aboutsummaryrefslogtreecommitdiffstats
path: root/modules/setting/config_env.go
Commit message (Collapse)AuthorAgeFilesLines
* Fix `environment-to-ini` inherited key bug (#27543)wxiaoguang2023-10-101-1/+2
| | | | | | | Fix #27541 The INI package has a quirk: by default, the keys are inherited. When maintaining the keys, the newly added sub key should not be affected by the parent key.
* Remove last newline from config file (#26468)wxiaoguang2023-08-121-0/+6
| | | | | | | | | When users put the secrets into a file (GITEA__sec__KEY__FILE), the newline sometimes is different to avoid (eg: echo/vim/...) So the last newline could be removed when reading, it makes the users easier to maintain the secret files. Co-authored-by: Giteabot <teabot@gitea.io>
* Fix env config parsing for "GITEA____APP_NAME" (#26001)wxiaoguang2023-07-201-1/+1
| | | | | | | Regression of #24832 Fix the bug and add a test for it Co-authored-by: Giteabot <teabot@gitea.io>
* Make "install page" respect environment config (#25648)wxiaoguang2023-07-091-2/+23
| | | | | | | | | | | | | | | | | | | | | | | | | Replace #25580 Fix #19453 The problem was: when users set "GITEA__XXX__YYY" , the "install page" doesn't respect it. So, to make the result consistent and avoid surprising end users, now the "install page" also writes the environment variables to the config file. And, to make things clear, there are enough messages on the UI to tell users what will happen. There are some necessary/related changes to `environment-to-ini.go`: * The "--clear" flag is removed and it was incorrectly written there. The "clear" operation should be done if INSTALL_LOCK=true * The "--prefix" flag is removed because it's never used, never documented and it only causes inconsistent behavior. ![image](https://github.com/go-gitea/gitea/assets/2114189/12778ee4-3fb5-4664-a73a-41ebbd77cd5b)
* Refactor INI package (first step) (#25024)wxiaoguang2023-06-021-3/+1
| | | | | | | | | The INI package has many bugs and quirks, and in fact it is unmaintained. This PR is the first step for the INI package refactoring: * Use Gitea's "config_provider" to provide INI access * Deprecate the INI package by golangci.yml rule
* Make environment-to-ini support loading key value from file (#24832)wxiaoguang2023-05-241-0/+142
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