Skip to content

Commit 85d905d

Browse files
committed
'murfey_db_credentials' in GlobalConfig is now a Path
1 parent d43ab64 commit 85d905d

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

src/murfey/server/murfey_db.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313

1414
def url(global_config: GlobalConfig | None = None) -> str:
1515
global_config = global_config or get_global_config()
16+
if global_config.murfey_db_credentials is None:
17+
raise ValueError(
18+
"No database credentials file was provided for this instance of Murfey"
19+
)
1620
with open(global_config.murfey_db_credentials, "r") as stream:
1721
creds = yaml.safe_load(stream)
1822
f = Fernet(global_config.crypto_key.encode("ascii"))

src/murfey/util/config.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,13 @@ def machine_config_from_file(
493493

494494
class GlobalConfig(BaseModel):
495495
# Database connection settings
496-
murfey_db_credentials: str
496+
murfey_db_credentials: Optional[Path] = Field(
497+
default=None,
498+
description=(
499+
"Full file path to where Murfey's SQL database credentials are stored. "
500+
"This is typically a YAML file."
501+
),
502+
)
497503
sqlalchemy_pooling: bool = True
498504
crypto_key: str
499505

0 commit comments

Comments
 (0)