use script-dependencies.nix
as a nix shell environment instead of specifying dependencies in shebangs of each individual script file
This commit is contained in:
parent
d82fe7048a
commit
ef297345e1
4 changed files with 22 additions and 7 deletions
|
@ -30,10 +30,10 @@ def notify(
|
|||
|
||||
|
||||
def read_secret_file(secret: str) -> str:
|
||||
path = f"/run/secrets/{secret}"
|
||||
path = f"/var/secrets/{secret}"
|
||||
if not os.path.exists(path):
|
||||
raise FileNotFoundError(f"Secret file {path} does not exist.")
|
||||
with open(f"/run/secrets/{secret}", "r") as f:
|
||||
raise FileNotFoundError(f"Secret file {path} does not exist or cannot be read.")
|
||||
with open(f"/var/secrets/{secret}", "r") as f:
|
||||
secret = f.read().strip()
|
||||
if not secret:
|
||||
raise ValueError(f"Secret file {path} is empty.")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue