cfg: Drop the default configuration file

- The configuration module defaults to values in the production configuration
file.

- If the file is found, it is read and the read values overwrite the defaults.
If the file is not found, no error is raised. This allows us to not ship the
configuration file. User may create the configuration if they want to change the
defaults. This eases upgrades when configuration is edited. This also make
FreedomBox robust to deployments where /etc/ is not populated by default such as
OSTree. It is also a good practice for daemons as followed by the likes of
systemd.

- If the file partly populated only the values read override the defaults and
the remaining values don't change. This allows the user to write simpler
configuration file.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Sunil Mohan Adapa authored and James Valleroy committed 2020-06-28 21:01:15 -04:00
1 parent 64b1c21fe0
commit 4263f9e2c8
7 files changed
+67 -103

No files matched your search

+1 -1
View File
@@ -55,7 +55,7 @@ def fixture_load_cfg():
cfg_file = test_data_dir / 'etc' / 'plinth' / 'plinth.config'
cfg.read(str(cfg_file), str(root_dir))
yield cfg
cfg.read()
cfg.read(str(cfg_file), str(root_dir))
@pytest.fixture(name='develop_mode')