Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow overriding smtp_password with the LEMMY_SMTP_PASSWORD env var #3154

Merged
merged 2 commits into from Jun 21, 2023

Conversation

n3oney
Copy link
Contributor

@n3oney n3oney commented Jun 16, 2023

Closes #3151

crates/utils/src/email.rs Outdated Show resolved Hide resolved
@Nutomic
Copy link
Member

Nutomic commented Jun 20, 2023

The env vars need to be documented, this page seems like the best place. Would you also make a pull request there?

@n3oney
Copy link
Contributor Author

n3oney commented Jun 20, 2023

Sure, I've done that.

@dessalines
Copy link
Member

Needs a run of cargo +nightly fmt

@n3oney
Copy link
Contributor Author

n3oney commented Jun 20, 2023

Needs a run of cargo +nightly fmt

Sorry about that, I tried to do it before but couldn't figure it out (the +nightly part didn't work).

Formatted now.

@Nutomic
Copy link
Member

Nutomic commented Jun 21, 2023

Formatting still not passing, try running cargo +nightly fmt --all

@n3oney
Copy link
Contributor Author

n3oney commented Jun 21, 2023

Seems like the CI is using some outdated code?
Looking at the cargo_fmt action, it says this:

+ cargo +nightly fmt -- --check
Diff in /woodpecker/src/github.com/LemmyNet/lemmy/crates/utils/src/email.rs at line 78:
   };
 
   // Set the creds if they exist
-  let smtp_password = std::env::var("LEMMY_SMTP_PASSWORD").ok().or(email_config.smtp_password);
+  let smtp_password = std::env::var("LEMMY_SMTP_PASSWORD")
+    .ok()
+    .or(email_config.smtp_password);

However, the code is already in that format in the actual code as you can check.

Formatting locally (on a different machine) returns no changes.

@dessalines dessalines enabled auto-merge (squash) June 21, 2023 17:12
@dessalines dessalines merged commit 4cdb958 into LemmyNet:main Jun 21, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow overriding smtp_password with an environment variable
3 participants