-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Add support for file-based environment variables in environment-to-ini (v1.16 backport) #19858
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 support for file-based environment variables in environment-to-ini (v1.16 backport) #19858
Conversation
Hmm... isn't this just going to result in secrets being copied directly into the app.ini file - breaking the point of secrets... |
@zeripath It's true that the content of the files will be present as plain text inside the |
@zeripath Furthermore when storing secrets in let's say |
I'm not suggesting that the situation prior to this PR is correct. Just that I am concerned that the solution proposed by this PR may not be the best solution - I'm not certain that people would intend that the secrets would be copied into the containers directly. I have previously suggested two IMO very simple solutions :
These options would require that the secrets file be an ini - but I'm not certain that there's a great argument against this. Here are three more complex options:
|
In any case I don't think this should be backported to 1.16 |
@zeripath Thank you for your feedback
I will summarize the usability and security implications of the discussed solutions:
🟠 : Managing the whole overlaid ini file (dedicated for secrets) with I initially created a PR for the main branch #19857 so please consider that one instead. Since I was using v1.16 and since this feature was not implemented gitea-side I was tempted by integrating this feature in the v1.16. I'm going to edit the associated issue #19856 to describe this feature regardless of the implementation. |
Closed as 1.16 is end support. |
Improve
environment-to-ini
to allow for file content to be set as the value of an environment variable.Useful when using
docker secret
and were the secret is mounted as a file in/run/secrets/<SECRET_NAME>
.Any settings in
app.ini
can be set or overridden with the content of a file by defining an environment variable of the form:GITEA__section_name__KEY_NAME__FILE
that points to a file.Backports #19857
Fixes #19856