diff --git a/radicale/__main__.py b/radicale/__main__.py index b510d18..fa8a88e 100644 --- a/radicale/__main__.py +++ b/radicale/__main__.py @@ -110,8 +110,7 @@ def run(): os.environ.get("RADICALE_CONFIG"), args.config)) if arguments_config: - configuration.update( - arguments_config, "arguments", internal=False) + configuration.update(arguments_config, "arguments") except Exception as e: logger.fatal("Invalid configuration: %s", e, exc_info=True) exit(1) diff --git a/radicale/config.py b/radicale/config.py index 318129e..e4623f6 100644 --- a/radicale/config.py +++ b/radicale/config.py @@ -274,7 +274,7 @@ def load(paths=()): except Exception as e: raise RuntimeError( "Failed to load %s: %s" % (config_source, e)) from e - configuration.update(config, config_source, internal=False) + configuration.update(config, config_source) return configuration @@ -298,9 +298,9 @@ class Configuration: if option.startswith("_"): continue values[section][option] = schema[section][option]["value"] - self.update(values, "default config") + self.update(values, "default config", internal=True) - def update(self, config, source, internal=True): + def update(self, config, source, internal=False): """Update the configuration. ``config`` a dict of the format {SECTION: {OPTION: VALUE, ...}, ...}. diff --git a/radicale/server.py b/radicale/server.py index 37f97a0..9417551 100644 --- a/radicale/server.py +++ b/radicale/server.py @@ -247,7 +247,8 @@ def serve(configuration, shutdown_socket=None): logger.info("Starting Radicale") # Copy configuration before modifying configuration = configuration.copy() - configuration.update({"internal": {"internal_server": "True"}}, "server") + configuration.update({"internal": {"internal_server": "True"}}, "server", + internal=True) # Create collection servers servers = {} diff --git a/radicale/tests/test_auth.py b/radicale/tests/test_auth.py index ae7af4e..884b3a2 100644 --- a/radicale/tests/test_auth.py +++ b/radicale/tests/test_auth.py @@ -47,7 +47,7 @@ class TestBaseAuthRequests(BaseTest): # Disable syncing to disk for better performance "internal": {"filesystem_fsync": "False"}, # Set incorrect authentication delay to a very low value - "auth": {"delay": "0.002"}}, "test") + "auth": {"delay": "0.002"}}, "test", internal=True) def teardown(self): shutil.rmtree(self.colpath) diff --git a/radicale/tests/test_base.py b/radicale/tests/test_base.py index 7bf5f1b..f202242 100644 --- a/radicale/tests/test_base.py +++ b/radicale/tests/test_base.py @@ -1476,7 +1476,7 @@ permissions: RrWw""") # Disable syncing to disk for better performance "internal": {"filesystem_fsync": "False"}, "rights": {"file": rights_file_path, - "type": "from_file"}}, "test") + "type": "from_file"}}, "test", internal=True) self.application = Application(self.configuration) def teardown(self): @@ -1490,7 +1490,7 @@ class TestMultiFileSystem(BaseFileSystemTest, BaseRequestsMixIn): def test_fsync(self): """Create a directory and file with syncing enabled.""" self.configuration.update({ - "internal": {"filesystem_fsync": "True"}}, "test") + "internal": {"filesystem_fsync": "True"}}, "test", internal=True) self.application = Application(self.configuration) status, _, _ = self.request("MKCALENDAR", "/calendar.ics/") assert status == 201 diff --git a/radicale/tests/test_config.py b/radicale/tests/test_config.py index 59bbabd..2e0b05e 100644 --- a/radicale/tests/test_config.py +++ b/radicale/tests/test_config.py @@ -134,10 +134,11 @@ class TestConfig: def test_internal(self): configuration = config.load() - configuration.update({"internal": {"internal_server": "True"}}, "test") + configuration.update({"internal": {"internal_server": "True"}}, "test", + internal=True) with pytest.raises(Exception) as exc_info: - configuration.update({"internal": {"internal_server": "True"}}, - "test", internal=False) + configuration.update( + {"internal": {"internal_server": "True"}}, "test") e = exc_info.value assert "Invalid section 'internal'" in str(e) diff --git a/radicale/tests/test_rights.py b/radicale/tests/test_rights.py index 4576b82..67ed812 100644 --- a/radicale/tests/test_rights.py +++ b/radicale/tests/test_rights.py @@ -38,7 +38,7 @@ class TestBaseRightsRequests(BaseTest): self.configuration.update({ "storage": {"filesystem_folder": self.colpath}, # Disable syncing to disk for better performance - "internal": {"filesystem_fsync": "False"}}, "test") + "internal": {"filesystem_fsync": "False"}}, "test", internal=True) def teardown(self): shutil.rmtree(self.colpath) diff --git a/radicale/tests/test_server.py b/radicale/tests/test_server.py index 476cf71..52d9f93 100644 --- a/radicale/tests/test_server.py +++ b/radicale/tests/test_server.py @@ -68,7 +68,7 @@ class TestBaseServerRequests: # Enable debugging for new processes "logging": {"level": "debug"}, # Disable syncing to disk for better performance - "internal": {"filesystem_fsync": "False"}}, "test") + "internal": {"filesystem_fsync": "False"}}, "test", internal=True) self.thread = threading.Thread(target=server.serve, args=( self.configuration, shutdown_socket_out)) ssl_context = ssl.create_default_context() diff --git a/radicale/tests/test_web.py b/radicale/tests/test_web.py index 31f727c..db1bcad 100644 --- a/radicale/tests/test_web.py +++ b/radicale/tests/test_web.py @@ -36,7 +36,7 @@ class TestBaseWebRequests(BaseTest): self.configuration.update({ "storage": {"filesystem_folder": self.colpath}, # Disable syncing to disk for better performance - "internal": {"filesystem_fsync": "False"}}, "test") + "internal": {"filesystem_fsync": "False"}}, "test", internal=True) self.application = Application(self.configuration) def teardown(self):