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

Avoid overriding the config.js file with a user.config.js file #4841

Open
SirLouen opened this issue Feb 28, 2024 · 4 comments
Open

Avoid overriding the config.js file with a user.config.js file #4841

SirLouen opened this issue Feb 28, 2024 · 4 comments
Labels
Type: Feature Tickets that describe a desired feature or PRs that add them to the project.

Comments

@SirLouen
Copy link

SirLouen commented Feb 28, 2024

Feature Description

Every time I install the .deb package, it asks for a file override:
overriding

Ideally, all packages with an updating system should have a user config file to avoid this.

For example, PHP package has a /conf.d/ directory, any file like user.ini won't be overridden on update but will take over default variables.

So for example, if I only want to modify the max_execution_time I can create there a user.ini file and put there the max_execution_time = 900 or whatever. This user-defined variable will override the default behavior in php.ini

What are the advantages of this?

  1. If we have an automated update system (for example, via a Debian apt repository), the software will update automatically without user intervention (specially useful for security and bug fixes)
  2. It's way easier to maintain user changes. User could opt to edit the default config.js if they don't plan to update or they don't care about dev maintained packages/updates, or they can choose to edit user.config.js only with the variables they need (the rest will remain default. User can check the official config.js to see if there are new configurations (or some are deprecated or about to be deprecated), after updates without the hassle of having to check and implement diffs during the update (which is a massive waste of time for sysadmins)
  3. This is the default expected behavior for most modern software nowadays: anything that must be modified by users should never be overridden by updates.
@SirLouen SirLouen added the Type: Feature Tickets that describe a desired feature or PRs that add them to the project. label Feb 28, 2024
@brunnre8
Copy link
Member

a user config is the wrong solution.
The file in /etc is the user config as far as TL is concerned.

Drop in dir with fragments could be done but frankly we update so seldom that I don't think that this is really a problem.

@SirLouen
Copy link
Author

Drop in dir with fragments could be done but frankly we update so seldom that I don't think that this is really a problem.

With an unattended update system, this is a problem because the software never updates until the admin checks what's going on which ends in having to do all the manual procedure.

I think it's the most straightforward and easy implementation with a user.config.js: you get the array, and you replace the existing array with the new values. I think I could do a PR in a couple of minutes for this solution.

@brunnre8
Copy link
Member

if you actually want to work on it, merge the file in $THELOUNGE_HOME with the default config.
Again, the config file there is the user config.

There's no need for user.config.js as you keep suggesting.

I'll be happy to review your patch, feel free to scratch your own itch there

@SirLouen
Copy link
Author

Ok thanks, I will give it a go soon.

I find it very useful. It's true that there are not many updates, but when there are updates it's a little disturbing to do the whole switch (although probably most users just have the bare config params on the config file, they use docker, or they simply update from sources not overriding the default config file, so this is why it's not a hassle for almost anyone). But I've always liked the approach of having user-specific config files for any software. It's super clean and very easy to maintain.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Feature Tickets that describe a desired feature or PRs that add them to the project.
Projects
None yet
Development

No branches or pull requests

2 participants