Files
ssh/docker/ssh-server/app/globals.py
Márcio Fernandes 90336bbbe5
All checks were successful
/ ssh-client-container (push) Successful in 10s
/ ssh-server-container (push) Successful in 21s
.
2025-09-07 00:38:58 +00:00

29 lines
595 B
Python

import os
import yaml
def is_debugging(): return os.getenv("CONFIGURATION") == "Debug"
file_path="/etc/app/config.yaml"
config=None
def config_exits():
return get_config() is not None
def sshserver_enabled():
return not is_debugging() or os.getenv("SSH_SERVER_ENABLED") == "true"
def get_config():
global config
if config == None:
load_config()
return config
def load_config():
global config
if os.path.exists(file_path):
with open(file_path, 'r') as f:
config = yaml.safe_load(f)
else:
print(f"⚠️ missing " + file_path)