-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Accept multiple config files #4860
Comments
I'd like to maybe get to work on this, although I'd definitely appreciate some guidance if anyone is willing to point me in the right direction. |
@clarcharr the ini library used is go-ini (docs: https://ini.unknwon.io/docs/intro/getting_started) and it allows multiple ini files to be loaded and appended (ex. Perhaps you could have the config flag for each cli cmd be overloaded to be called multiple times and then take each option and append them to one another (so you'd have |
@clarfon Did you end up working on this? Do you still have motivation? This would really help us simplify our packaging over at NixOS as right now we're forced to use less than ideal code to get secrets to work with our immutable configuration files. |
@aanderse I did not actually get to coding this, so I'm open to others working on it. Right now I don't really have the time for it. |
@clarfon Understandable. I thought I'd ping you just in case though 😄 Thanks for clarifying. |
Some information that may be useful for this issue: Something that the project is looking into is switching to use https://github.com/spf13/viper/ to handle configuration, this will allow us to move to another format as ini has some downsides (Note: INI support has a pending PR in viper). @aanderse some information re: secrets from a different area, right now internal secret supports inclusion of information from a different place, and could be extended to JWT secrets as well. |
@techknowlogick is there documentation or an example on this? Thanks for the info. |
@aanderse Turns out there isn't documentation on this, which is embarrassing since I was the one who created that PR. I'll sum it up here, but I'll also put a PR through to add this documentation. Under the security section instead of defining
Another PR could be added to extend this to support |
@techknowlogick fantastic! I only wish I knew |
For reference this functionality was added in #5812. |
Instead of configuration files, can't gitea be made to use environment variables instead (like a 12-factor application) ? |
@jpds environment variables are not nearly as versatile as config files. They are a potential option, but I feel that having some form of |
Is anyone still working on this? This feature would be handy in conjunction with config management. |
Use case, I'd like to be able to create a base
app.ini
file that I can mindlessly copy to servers while still having instance-specific configuration options like database passwords stored in a separateapp.ini
file.Alternatively, we could allow some form of
[include]
section which will load options from a separate app.ini file.Ideally, we'd have both. But accepting on the CLI is a good start.
The text was updated successfully, but these errors were encountered: