Skip to content
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

Migrate configuration to github.com/spf13/viper #9299

Closed
sapk opened this issue Dec 9, 2019 · 10 comments
Closed

Migrate configuration to github.com/spf13/viper #9299

sapk opened this issue Dec 9, 2019 · 10 comments
Labels
type/proposal The new feature has not been accepted yet but needs to be discussed first.

Comments

@sapk
Copy link
Member

sapk commented Dec 9, 2019

Since https://github.com/spf13/viper/releases/tag/v1.6.0, viper support INI file config.

What do you think of migrating to this library to store config in various format (INI, Toml, Env variable, etcd, consul, ...) ?

I think this would remove a lot of code logic from gitea and help readability of the config code.
This would also ease the compatibility with container environnement via env variable or distributed config manager support (etcd, consul)
This would also ease the compatibility with FHS linux distribution by looking at multiple standard path for configuration.
Another point, this would allow support for live reloading of some configuration (and maybe could be used by UI) but this would not be the primary goal.

Somewhat related issues/change that could be replaced: #7287 #6923

@sapk sapk added the type/proposal The new feature has not been accepted yet but needs to be discussed first. label Dec 9, 2019
@lunny
Copy link
Member

lunny commented Dec 9, 2019

I think we can try and PRs are welcome.

@davidsvantesson
Copy link
Contributor

Shouldn't we try to make more admin configuration available in the UI? Would that be possible with this or would that require moving settings to database?

@techknowlogick
Copy link
Member

I think a migration to this would be useful, as it can also allow configuration changes to be made without a binary restart, as well as non-ini config formats.

I am a bit biased as I was the one who created the PR to viper to get INI support added.

As this is a non-breaking change, I prefer we do this before evaluating moving to a UI based approach.

@guillep2k
Copy link
Member

Is it possible to select from code which values can be "hot-loaded" and which should remain freezed? I didn't check our code in depth, but I believe there are groups of settings that need to be consistent as a whole; allowing changes to some of the values without a group revalidation could produce invalid results.

Maybe we should make a list of the settings that we expect to be automatically reloaded (e.g. log level?) and which don't (install dir?).

@renothing
Copy link
Contributor

#5070
part1: readonly variables with startup
part2: changeable variables write to db with hot reload.

@wxiaoguang
Copy link
Contributor

Gitea's config system has too many quirks, and has too much specialized code.

I guess it's impossible to do the migration at the moment.

@wxiaoguang wxiaoguang added the issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail label May 9, 2023
@lunny
Copy link
Member

lunny commented May 9, 2023

I can have a try. If it's impossible then we can close this one.

@wxiaoguang
Copy link
Contributor

What's the plan? Feasible or not?

@GiteaBot
Copy link
Contributor

GiteaBot commented Sep 8, 2023

We close issues that need feedback from the author if there were no new comments for a month. 🍵

@GiteaBot GiteaBot closed this as completed Sep 8, 2023
@jolheiser jolheiser removed the issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail label Sep 8, 2023
@jolheiser jolheiser reopened this Sep 8, 2023
@wxiaoguang
Copy link
Contributor

wxiaoguang commented Sep 8, 2023

I do not see it is feasible, so I think it could be closed.

Feel free to reopen with a feasible plan.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type/proposal The new feature has not been accepted yet but needs to be discussed first.
Projects
None yet
Development

No branches or pull requests

9 participants