From 2d7b7e99ff7f15ffc5b5e6815b371ecf89344a88 Mon Sep 17 00:00:00 2001 From: Sky Brewer Date: Fri, 20 Mar 2026 15:21:45 +0100 Subject: [PATCH] Allow passing cf client config Can set the baseurl, username, password and verify_ssl via the config --- server/pyproject.toml | 2 +- server/recceiver/cfstore.py | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/server/pyproject.toml b/server/pyproject.toml index 351b681..1e19cff 100644 --- a/server/pyproject.toml +++ b/server/pyproject.toml @@ -24,7 +24,7 @@ classifiers = [ "Programming Language :: Python :: 3.14", ] dependencies = [ - "channelfinder @ https://github.com/ChannelFinder/pyCFClient/archive/refs/tags/v3.0.0.zip", + "channelfinder @ https://github.com/ChannelFinder/pyCFClient/archive/refs/tags/v3.2.0.zip", "dataclasses; python_version<'3.7'", "requests", "twisted", diff --git a/server/recceiver/cfstore.py b/server/recceiver/cfstore.py index d184a28..08cf516 100755 --- a/server/recceiver/cfstore.py +++ b/server/recceiver/cfstore.py @@ -54,6 +54,10 @@ class CFConfig: recceiver_id: str = RECCEIVERID_DEFAULT timezone: Optional[str] = None cf_query_limit: int = DEFAULT_QUERY_LIMIT + base_url: Optional[str] = None + cf_username: Optional[str] = None + cf_password: Optional[str] = None + verify_ssl: Optional[bool] = None @classmethod def loads(cls, conf: ConfigAdapter) -> "CFConfig": @@ -75,6 +79,10 @@ def loads(cls, conf: ConfigAdapter) -> "CFConfig": recceiver_id=conf.get("recceiverId", RECCEIVERID_DEFAULT), timezone=conf.get("timezone", ""), cf_query_limit=conf.get("findSizeLimit", DEFAULT_QUERY_LIMIT), + base_url=conf.get("baseUrl"), + cf_username=conf.get("cfUsername"), + cf_password=conf.get("cfPassword"), + verify_ssl=conf.get("verifySSL"), ) @@ -286,7 +294,12 @@ def _start_service_with_lock(self): _log.info("CF_START with configuration: %s", self.cf_config) if self.client is None: # For setting up mock test client - self.client = ChannelFinderClient() + self.client = ChannelFinderClient( + BaseURL=self.cf_config.base_url, + username=self.cf_config.cf_username, + password=self.cf_config.cf_password, + verify_ssl=self.cf_config.verify_ssl, + ) try: cf_properties = {cf_property["name"] for cf_property in self.client.getAllProperties()} required_properties = {