@@ -380,7 +380,6 @@ class MachineConfig(BaseModel):
380380 """
381381 # Security-related keys
382382 global_configuration_path : Optional [Path ] = Field (
383- default = None ,
384383 description = (
385384 "Full file path to the YAML file containing the configurations for the "
386385 "Murfey server."
@@ -493,9 +492,7 @@ def machine_config_from_file(
493492
494493class GlobalConfig (BaseModel ):
495494 # Database connection settings
496- rabbitmq_credentials : str
497495 murfey_db_credentials : Optional [Path ] = Field (
498- default = None ,
499496 description = (
500497 "Full file path to where Murfey's SQL database credentials are stored. "
501498 "This is typically a YAML file."
@@ -518,6 +515,7 @@ class GlobalConfig(BaseModel):
518515 )
519516
520517 # RabbitMQ settings
518+ rabbitmq_credentials : Optional [Path ]
521519 feedback_queue : str = Field (
522520 default = "murfey_feedback" ,
523521 description = (
@@ -540,12 +538,13 @@ class GlobalConfig(BaseModel):
540538 auth_key : str = ""
541539 auth_algorithm : str = ""
542540 cookie_key : str = ""
543-
544541 session_validation : str = ""
545542 session_token_timeout : Optional [int ] = (
546543 None # seconds; typically the length of a microscope session plus a bit
547544 )
548545 allow_origins : list [str ] = ["*" ] # Restrict to only certain hostnames
546+
547+ # Graylog settings
549548 graylog_host : str = ""
550549 graylog_port : Optional [int ] = None
551550
@@ -595,10 +594,11 @@ def get_global_config() -> GlobalConfig:
595594 machine_config = get_machine_config (instrument_name = os .getenv ("BEAMLINE" ))[
596595 os .getenv ("BEAMLINE" , "" )
597596 ]
598- if machine_config .global_configuration_path :
599- return global_config_from_file (machine_config .global_configuration_path )
597+ if not machine_config .global_configuration_path :
598+ raise FileNotFoundError ("No global configuration file provided" )
599+ return global_config_from_file (machine_config .global_configuration_path )
600600 return GlobalConfig (
601- rabbitmq_credentials = "" ,
601+ rabbitmq_credentials = None ,
602602 session_validation = "" ,
603603 murfey_db_credentials = None ,
604604 crypto_key = "" ,
0 commit comments