[Close #1077] fix!: protect secrets and enforce config precedence
Bash / bash-unittest (push) Successful in 19s
Bash / shellcheck (push) Successful in 26s
changelog / changelog (push) Successful in 12s
Helm / helm-lint (push) Successful in 16s
Helm / helm-unittest (push) Successful in 16s
Markdown linter / markdown-lint (push) Successful in 15s
Markdown linter / markdown-link-checker (push) Successful in 53s

Equivalent environment variable encodings could overwrite existing
secrets or make configuration precedence depend on environment order.

BREAKING CHANGE: Duplicate preset environment variables targeting the
same setting now cause initialization to fail. Remove duplicates.

Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
volker.raschekandCopilot committed 2026-12-04 22:37:36 +01:00
1 parent ccb53fca3f
commit a5579c167e
3 files changed
+163 -11

No files matched your search

+14 -2
View File
@@ -10,6 +10,7 @@
- [Limit resources](#limit-resources)
- [Configuration](#configuration)
- [Default Configuration](#default-configuration)
- [Rebuilding app.ini](#rebuilding-appini)
- [Database defaults](#database-defaults)
- [Server defaults](#server-defaults)
- [Metrics defaults](#metrics-defaults)
@@ -56,8 +57,8 @@
- [LivenessProbe](#livenessprobe)
- [ReadinessProbe](#readinessprobe)
- [StartupProbe](#startupprobe)
- [valkey](#valkey)
- [CloudNativePG](#cloudnativepg)
- [valkey](#valkey)
- [Advanced](#advanced)
- [Contributing](#contributing)
- [Upgrading](#upgrading)
@@ -481,9 +482,20 @@ gitea:
Priority (highest to lowest) for defining app.ini variables:
1. Environment variables prefixed with `GITEA`
1. Environment variables prefixed with `GITEA__`
1. Additional config sources
1. Values defined in `gitea.config`
1. Automatically generated initial secrets
Setting names are case-sensitive. Encode `.` as `_0X2E_` and `-` as `_0X2D_` in environment variable names.
Append `__FILE` to read a setting value from a file, as supported by Gitea.
Section names are case-insensitive, and differently encoded names can refer to the same setting.
If multiple predefined environment variables refer to the same setting, the init container fails with a conflict error;
remove the duplicate variables before restarting it.
When `app.ini` already exists, the chart preserves `security.SECRET_KEY`, `security.INTERNAL_TOKEN`,
`oauth2.JWT_SECRET`, and `server.LFS_JWT_SECRET` instead of overwriting them from any configuration source.
This also applies to environment variables using `__FILE` or encoded names.
### External Database