You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Environment variables are not recognized, unless environment-to-ini is loaded, which currently only runs for docker deployments.
There are two places to define a default value and it causes bugs, as seen in this PR.
There is ambiguity between casing, e.g. Enabled in the config struct, vs ENABLED in the .Key definition.
I would propose treating environment variables as first-class, so the following steps could be taken:
Move environment-to-ini into the main code base so environment variables are recognized at all times.
Use https://github.com/kelseyhightower/envconfig to parse the environment to config structs. The structs should have original case and format of the variables, so a config variable remains greppable, so it should be config.APP_NAME instead of config.AppName.
Have a separate mechanism that parses the ini and map values to the already initialized config struct, but not overwrite existing values because environment variables must have precedence over ini values.
The text was updated successfully, but these errors were encountered:
silverwind
added
type/proposal
The new feature has not been accepted yet but needs to be discussed first.
type/feature
Completely new functionality. Can only be merged if feature freeze is not active.
labels
May 19, 2023
I think at minimum, we want to merge environment-to-ini into the codebase. It's just not acceptable to require a config file in this day and age.
It should be possible to start gitea in systemd with a bunch of variables in the gitea.service file only. See the gitpod config which had to specifically work around this silly requirement for a app.ini.
There are two places to define a default value and it causes bugs, as seen in this PR.
That's also related to the ini package's bug / quirk behavior. Sooner or later, the ini package should be written first before other config related refactoring.
Feature Description
Gitea's config system has various issues:
Enabled
in the config struct, vsENABLED
in the.Key
definition.I would propose treating environment variables as first-class, so the following steps could be taken:
config.APP_NAME
instead ofconfig.AppName
.The text was updated successfully, but these errors were encountered: