From a53fed80c4d17d248c3f069fbb9be66e519f3150 Mon Sep 17 00:00:00 2001 From: Sky Brewer Date: Fri, 20 Mar 2026 13:33:38 +0100 Subject: [PATCH] Add an env_owner_variable This allows to use specific env variable name for the owner in channelfinder. --- server/demo.conf | 6 ++++++ server/recceiver/cfstore.py | 3 ++- server/recceiver_full.conf | 6 ++++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/server/demo.conf b/server/demo.conf index c850ec5c..67eac4c4 100644 --- a/server/demo.conf +++ b/server/demo.conf @@ -102,3 +102,9 @@ # Specify the timezone in the time output #timezone = True + +# The username to use when creating channels in channelfinder +#username = cfstore + +# The env variable to use for the owner field when creating channels in channelfinder +#env_owner_variable = ENGINEER diff --git a/server/recceiver/cfstore.py b/server/recceiver/cfstore.py index 99de9a62..1587359f 100755 --- a/server/recceiver/cfstore.py +++ b/server/recceiver/cfstore.py @@ -50,6 +50,7 @@ class CFConfig: clean_on_start: bool = True clean_on_stop: bool = True username: str = "cfstore" + env_owner_variable: str = "ENGINEER" recceiver_id: str = RECCEIVERID_DEFAULT timezone: Optional[str] = None cf_query_limit: int = DEFAULT_QUERY_LIMIT @@ -552,7 +553,7 @@ def _commit_with_thread(self, transaction: CommitTransaction): ioc_name=transaction.client_infos.get("IOCNAME") or str(transaction.source_address.port), ioc_IP=transaction.source_address.host, owner=( - transaction.client_infos.get("ENGINEER") + transaction.client_infos.get(self.cf_config.env_owner_variable) or transaction.client_infos.get("CF_USERNAME") or self.cf_config.username ), diff --git a/server/recceiver_full.conf b/server/recceiver_full.conf index 68d2f49e..6f73a014 100644 --- a/server/recceiver_full.conf +++ b/server/recceiver_full.conf @@ -98,6 +98,12 @@ environment_vars=ENGINEER:Engineer,EPICS_BASE:EpicsVersion,PWD:WorkingDirectory # Specify the timezone in the time output timezone = True +# The username to use when creating channels in channelfinder +username = cfstore + +# The env variable to use for the owner field when creating channels in channelfinder +env_owner_variable = ENGINEER + # The channelFinder client is configuration information is # stored in /etc/channelfinderapi.conf as described in the client # Can be configured to be this file, like so: