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

Add back support for Env vars #1472

Closed
Nutomic opened this issue Mar 1, 2021 · 4 comments
Closed

Add back support for Env vars #1472

Nutomic opened this issue Mar 1, 2021 · 4 comments
Labels
enhancement New feature or request

Comments

@Nutomic
Copy link
Member

Nutomic commented Mar 1, 2021

Was broken by #1433. We should be able to support env vars again with the same behaviour as before, by following the example in softprops/envy#55 (comment).

Edit: The solution is not going to work, because of another Envy issue: softprops/envy#26

$ LEMMY_CAPTCHA__ENABLED=false LEMMY_CAPTCHA__DIFFICULTY=easy cargo run
Finished dev [unoptimized] target(s) in 0.15s
Running `target/debug/lemmy_server`
thread 'main' panicked at 'invalid type: string "false", expected a boolean'

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@Nutomic Nutomic added the bug Something isn't working label Mar 1, 2021
@dessalines dessalines added this to the 0.10.0 milestone Mar 2, 2021
@dessalines dessalines removed the v0.10.0 label Mar 2, 2021
@Nutomic Nutomic removed this from the 0.10.0 milestone Mar 10, 2021
@Nutomic
Copy link
Member Author

Nutomic commented Mar 10, 2021

I tried another crate, envconfig to implement this, but its missing many required features. All other related libraries I found are really small and unmaintained. So it looks like we would have to reimplement this functionality from scratch, which we dont have time for. This means configuration with env vars will not be supported in the next version, and probably not for a long time (except for a few specific vars which we can handle manually).

@Nutomic Nutomic added enhancement New feature or request and removed bug Something isn't working labels Apr 22, 2022
@Nutomic Nutomic closed this as completed Jan 15, 2023
@gabe565
Copy link

gabe565 commented Jun 13, 2023

I'm creating a Helm chart for Lemmy Kubernetes deployments, and envs would be useful for setting default chart values. Would you consider reopening this issue?

@dessalines
Copy link
Member

I think it'd be too much work. Is there any reason you can't use a lemmy.hjson file?

@gabe565
Copy link

gabe565 commented Jun 14, 2023

Got it! Essentially, I would like to generate some of the config values, but using hjson might make it a bit more challenging. I can still generate the file, though, since regular JSON is valid hjson, it will just introduce some additional complexity and make things less dynamic.

For instance, if the user configures my Helm chart to deploy Pictrs, I could automatically generate an API key and store it as a Secret. Then, both pictrs and lemmy could use that secret to set the env. When using a config file, I'll need to generate and set the value explicitly in JSON. It makes the configuration less dynamic, but it's not a major issue.

I'll see if there's an elegant way for me to generate the hjson file. Thank you! 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants