lemmy icon indicating copy to clipboard operation
lemmy copied to clipboard

allow overriding smtp_password with the LEMMY_SMTP_PASSWORD env var

Open n3oney opened this issue 2 years ago • 4 comments

Closes #3151

n3oney avatar Jun 16 '23 19:06 n3oney

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

Nutomic avatar Jun 20 '23 14:06 Nutomic

Sure, I've done that.

n3oney avatar Jun 20 '23 14:06 n3oney

Needs a run of cargo +nightly fmt

dessalines avatar Jun 20 '23 17:06 dessalines

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.

n3oney avatar Jun 20 '23 22:06 n3oney

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

Nutomic avatar Jun 21 '23 08:06 Nutomic

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.

n3oney avatar Jun 21 '23 16:06 n3oney