Commit graph

7 commits

Author SHA1 Message Date
Earl Warren 24fed529fc
[BRANDING] parse FORGEJO__* in the container environment
(cherry picked from commit b075991747)
(cherry picked from commit da3f76228e)
(cherry picked from commit 20d196e74f)
(cherry picked from commit 0bf8b1824e)
(cherry picked from commit 655bb770a7)
(cherry picked from commit d69d5c2c46)
(cherry picked from commit 00b55e5a53)
(cherry picked from commit 456121fd8a)
(cherry picked from commit 9716a158e4)
(cherry picked from commit 7d60a6f511)
(cherry picked from commit d32a6d9437)
(cherry picked from commit ee1de38527)
(cherry picked from commit 54e7799d13)
(cherry picked from commit 4f04da7ab7)
(cherry picked from commit 3e001364eb)
(cherry picked from commit d2d5193b38)
(cherry picked from commit eb1f015c42)
(cherry picked from commit c4587aa893)
(cherry picked from commit 6e340be917)

Conflicts:
	contrib/environment-to-ini/environment-to-ini.go
	https://codeberg.org/forgejo/forgejo/pulls/1773
2023-11-13 14:00:15 +01:00
Giteabot 8c969cdf9c
Fix environment-to-ini inherited key bug (#27543) (#27546)
Backport #27543 by @wxiaoguang

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.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2023-10-09 17:46:58 +00:00
wxiaoguang bcccf4c0d6
Remove last newline from config file (#26468)
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>
2023-08-12 15:28:35 +00:00
wxiaoguang 28ecac8024
Fix env config parsing for "GITEA____APP_NAME" (#26001)
Regression of #24832 

Fix the bug and add a test for it

Co-authored-by: Giteabot <teabot@gitea.io>
2023-07-20 09:16:29 +00:00
wxiaoguang fa0b5b14c2
Make "install page" respect environment config (#25648)
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)
2023-07-09 22:43:37 +00:00
wxiaoguang de4a21fcb4
Refactor INI package (first step) (#25024)
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
2023-06-02 17:27:30 +08:00
wxiaoguang c21605951b
Make environment-to-ini support loading key value from file (#24832)
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
2023-05-24 11:37:22 +08:00