lemmy icon indicating copy to clipboard operation
lemmy copied to clipboard

Allow overriding smtp_password with an environment variable

Open n3oney opened this issue 2 years ago • 0 comments

Requirements

  • [X] Is this a feature request? For questions or discussions use https://lemmy.ml/c/lemmy_support
  • [X] Did you check to see if this issue already exists?
  • [X] Is this only a feature request? Do not put multiple feature requests in one issue.
  • [ ] Is this a UI / front end issue? Use the lemmy-ui repo.

Is your proposal related to a problem?

I'm using NixOS to host my lemmy instance, and my configuration is public on GitHub. Because of that, I don't really want my smtp_password visible in the config.

Describe the solution you'd like.

One of the most common solution to using secrets on NixOS is https://github.com/ryantm/agenix, which lets you encrypt a file using age. However, you can't encrypt a part of the file or use some string interpolation. You can only encrypt a full file.
This is fine if the program you're using allows reading from a file or something similar, but I can't use this here.
With the environment variable support, I could use the EnvironmentFile directive in my systemd service to load the env variable only from a file, while keeping the rest of the configuration nicely visible.

Describe alternatives you've considered.

I could technically age-encrypt the entire .rjson file, but that makes it much harder to modify some settings.

Additional context

No response

n3oney avatar Jun 16 '23 18:06 n3oney