Souhaits #1822
closedRemove non user related files from cofiguration folder
100%
Description
The
config
folder of galette, seems to contain a mix of user application configuration and developer / release application configurationconfig.inc.php
, behavior.inc.php
and maybe also exports.yaml
are user configurable.
- Users may want to keep their special configurations between installations. Not knowing which files to keep, they keep all files from the config folder, to the detriment of application upgrades that update default configurations, for example paths and versions in
paths.inc.php
andversions.inc.php
- For container setups or setups where you simply want to symlink user configurations, you need to mount or symlink the specific files containing your personal configuration, leading to the problem "which files to link to". You can also mount / symlink the whole config folder, but then you have to copy the developer / release application configuration files over from the original archives.
Problem solution suggestion:
Create a user_config
folder, which may be empty from the start. Any file placed here, overrides the corresponding file in the config
folder, but only the ones that should be overridable.
I would suggest that the database info in config.inc.php
would always be created here (and you can place your unattended install file here if #1821 is solved). And the installer can either copy or move behavior.inc.php
and exports.yaml
? to the user_config
folder if they don't already exist.
Allowing the folder to be empty from the archives of galette, is important for solutions where you want to symlink or mount the whole folder.
Updated by Chris Christiansen 6 months ago
Extra comment.
I discovered that when you run galette for the first time, the config.inc.php
is created in the config
folder. This folder already contains files that comes with galette. So when you run galette in docker you have a problem:
mounts / volumes in docker are assumed to be directories, unless you mount an existing file on the host filesystem. So you have to create config.inc.php
before you run the container for the first time. This leads to the #1821 feature request.
If you forget to create the file and you want to use docker, you will get an error, since docker will create a directory called config.inc.php
instead of a file. Of course galette can't read this directory as a file and will fail.
To keep everything proof to errors, I suggest this user_config
or local_config
folder, where database data (config.inc.php
) and advanced configuration (behavior.inc.php
) and perhaps also export info (exports.yaml
) are created / copied during installation, such that your can mount / symlink this user_config
or local_config
folder and keep your config between installations by keeping the whole config folder.
There are ways past this problem, but galette does actually create this file for you, if you don't have it and that's a nice feature. To keep it even if you want to mount (inside or outside docker) or symlink your configuration. You just need an empty configuration folder for your personal / system configuration. This
Updated by Chris Christiansen 6 months ago
Ignore this last line, it was supposed to be deleted, it is just another way I started describing what should happen when you don't have the file and you start for the first time. :)
There are ways past this problem, but galette does actually create this file for you, if you don't have it and that's a nice feature. To keep it even if you want to mount (inside or outside docker) or symlink your configuration. You just need an empty configuration folder for your personal / system configuration. This
Updated by Johan Cwiklinski 5 months ago
- Category set to Core
- Status changed from Nouveau to In Progress
- Assignee set to Johan Cwiklinski
I think about that, and I guess we should keep actual config
directory to store "user" data (config.inc.php
, exports.yaml
, local_*
files and so on. That way, user will not have to move their files or configuration, documentation is still accurate - everything will keep working.
I made a PR:
https://github.com/galette/galette/pull/500
All system configuration files has been moved. galette/config
directory contains only dist files.
Let me know if that seems good to you.
Updated by Chris Christiansen 5 months ago
Hey. Sounds great.
Question related to #1821
What happens if `config` folder (now only for user/local) is empty?
- I guess `config.inc.php` will be auto-generated during installation
- What about other files that is specific to local installation?
Updated by Johan Cwiklinski 5 months ago
Chris Christiansen a écrit (#note-4):
Hey. Sounds great.
:-)
Question related to #1821
What happens if `config` folder (now only for user/local) is empty?
- I guess `config.inc.php` will be auto-generated during installation
Yes
- What about other files that is specific to local installation?
The only required file in this directory is the database configuration one. All other possible files are user specific (local override files, exports configuration, behavior file, etc.) and completely optional.
Updated by Johan Cwiklinski 5 months ago
- Status changed from In Progress to Résolu
- % Done changed from 0 to 100
Appliqué par commit 850588d11a2445b73ffe2ec35f7e079f9bf9c204.
Updated by Johan Cwiklinski 5 months ago
- Subject changed from Move user config to separate config folder + auto generate default config file to Remove non user related files from cofiguration folder
- Status changed from Résolu to Fermé