Skip to content

[feature request] read environment variables when loading app.ini #10123

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

Closed
andrewzah opened this issue Feb 3, 2020 · 6 comments · Fixed by #24832
Closed

[feature request] read environment variables when loading app.ini #10123

andrewzah opened this issue Feb 3, 2020 · 6 comments · Fixed by #24832
Labels
type/feature Completely new functionality. Can only be merged if feature freeze is not active. type/proposal The new feature has not been accepted yet but needs to be discussed first.

Comments

@andrewzah
Copy link

I can take a stab at a PR if one could give me some pointers on where to start looking at.

This PR would allow checking in app.ini to version control and use it in setting up a dockerized gitea instance. Right now app.ini can't be stored in version control due to saving passwords in plaintext.

@guillep2k
Copy link
Member

I can't find the reference, but I believe another .ini parser was considered and/or implemented that directly supported carrying settings from env variables. It was a couple of months ago. Perhaps another maintainer remembers.

@techknowlogick
Copy link
Member

ini support was added to viper so we could switch to it and potentially use alternative formats (yaml), but also utilize env variables as well.

@techknowlogick techknowlogick added type/feature Completely new functionality. Can only be merged if feature freeze is not active. type/proposal The new feature has not been accepted yet but needs to be discussed first. labels Feb 3, 2020
@zeripath
Copy link
Contributor

zeripath commented Feb 3, 2020

In the meantime there is contrib/environment-to-ini

@andrewzah
Copy link
Author

Thanks for the input! If I get time I'll take a look at viper.

@anbraten
Copy link
Contributor

anbraten commented Sep 3, 2022

Maybe #19857 will solve this issue as well

@wxiaoguang
Copy link
Contributor

wxiaoguang commented May 21, 2023

Dup of #19856 (will be resolved by it)

Will be fixed by Make environment-to-ini support loading key value from file #24832

lunny pushed a commit that referenced this issue May 24, 2023
Replace #19857

Close #19856
Close #10311
Close #10123

Major changes:

1. Move a lot of code from `environment-to-ini.go` to `config_env.go` to
make them testable.
2. Add `__FILE` support
3. Update documents
4. Add tests
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type/feature Completely new functionality. Can only be merged if feature freeze is not active. type/proposal The new feature has not been accepted yet but needs to be discussed first.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants