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

Add PROGRAM_MAY_MODIFY_SETTINGS setting #26393

Open
delvh opened this issue Aug 8, 2023 · 2 comments
Open

Add PROGRAM_MAY_MODIFY_SETTINGS setting #26393

delvh opened this issue Aug 8, 2023 · 2 comments
Labels
type/proposal The new feature has not been accepted yet but needs to be discussed first.

Comments

@delvh
Copy link
Member

delvh commented Aug 8, 2023

Problem derivation

At the moment, we always need to delegate config changes to the admins of an instance, and refuse to start otherwise.
The reason for that is two-fold:

  1. A settings move might have unintended consequences, so it's better that an admin does it
  2. We don't know if we can write to the app.ini or not, i.e. Docker users and Kubernetes users like to use their app.ini read only once it is initialized.

But what if we would know if we can modify the config? Then we could automate a lot of things that are currently impossible.
So, what I'm proposing is the following:

Solution

As a first step to automating config changes, we can add a PROGRAM_MAY_MODIFY_SETTINGS setting (I guess in the default section) that is true by default (the docker image and helm chart would set it to false by default).
It has the following meaning:

  • false: No change to now
  • true:
    • When INSTALL_LOCK=false, no change to now, so treat it just like false above
    • When Gitea is installed already, Gitea can arbitrarily change the config and persist the changes

Advantages

@delvh delvh added the type/proposal The new feature has not been accepted yet but needs to be discussed first. label Aug 8, 2023
@silverwind
Copy link
Member

silverwind commented Aug 11, 2023

Ideally I would like to see a config override table (simple key-value) being written into SQL because writing into local config will not work properly in distributed setups unless all nodes do it which then presents the problem of coordinating the nodes. It's not something one wants to get into.

Said config override table could be shown on the admin ui and admins could be requested to persist the changed settings in their config. Then, once the config table and config are equal, delete the value from the config table.

@delvh
Copy link
Member Author

delvh commented Aug 11, 2023

Yep, additionally, we already have always write access to the database.
That's another benefit in this case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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

2 participants