maloja
maloja copied to clipboard
Don't overwrite config file
Maloja tries to write it's config in /etc/maloja/settings.ini
, which is pretty unexpected behavior. It would be good if maloja would not write to config files. If it needs to store some state, it should instead use the state directory.
On NixOS for example the config file lives in a read-only file system, which makes Maloja crash. It also leads to unexpected behavior when versioning the config file with git or another version control system.
This is kind of necessary as the configuration can be changed from other sources (web interface). I'll see if I can implement a read-only mode for this, but it could take a while as I'm still in the middle of the rework. As a workaround, you can put the configuration directory somewhere else with MALOJA_DIRECTORY_CONFIG
.
How does NixOS handle initial creation of the config file? Can the application create the file initially, but then never write to it again?
The initial (and subsequent) creation is done by the package manager/operating system. The application can't write to /etc at any time.
13.04.2022 05:03:27 krateng @.***>:
How does NixOS handle initial creation of the config file? Can the application create the file initially, but then never write to it again?
— Reply to this email directly, view it on GitHub[https://github.com/krateng/maloja/issues/103#issuecomment-1097502308], or unsubscribe[https://github.com/notifications/unsubscribe-auth/AAQOVZ3POAEMXIP6ZFYMM2DVEY2PLANCNFSM5RUPGIMQ]. You are receiving this because you authored the thread.[Verfolgungsbild][https://github.com/notifications/beacon/AAQOVZ5ILRJMEXRI3NCSAY3VEY2PLA5CNFSM5RUPGIM2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOIFVI4ZA.gif]
@krateng Tangentially related, but what would be the current best way to declaratively configure Maloja? I'm working on getting Maloja to run on NixOS, and I've run into the same issue. A few potential solutions for getting this done on the Nix side:
- Overwrite the .ini file every time the system is rebuilt.
- Have configuration be applied via ENV and have a mutable .ini file in order to have Maloja run (though this might be jank and is also not reccomended).