feature/ssh-server #1

Merged
marcio.fernandes merged 21 commits from feature/ssh-server into main 2025-09-07 13:50:19 +00:00
4 changed files with 5 additions and 6 deletions
Showing only changes of commit 90336bbbe5 - Show all commits

View File

@@ -7,14 +7,15 @@ file_path="/etc/app/config.yaml"
config=None config=None
def config_exits(): def config_exits():
global config return get_config() is not None
return config is not None
def sshserver_enabled(): def sshserver_enabled():
return not is_debugging() or os.getenv("SSH_SERVER_ENABLED") == "true" return not is_debugging() or os.getenv("SSH_SERVER_ENABLED") == "true"
def get_config(): def get_config():
global config global config
if config == None:
load_config()
return config return config
def load_config(): def load_config():
@@ -22,4 +23,6 @@ def load_config():
if os.path.exists(file_path): if os.path.exists(file_path):
with open(file_path, 'r') as f: with open(file_path, 'r') as f:
config = yaml.safe_load(f) config = yaml.safe_load(f)
else:
print(f"⚠️ missing " + file_path)

View File

@@ -14,8 +14,6 @@ def main():
else: else:
print("👉 starting setup") print("👉 starting setup")
globals.load_config()
setup_container() setup_container()
if globals.is_debugging(): if globals.is_debugging():

View File

@@ -116,5 +116,4 @@ def start_server():
subprocess.run(["/usr/sbin/sshd", "-D", "-e"]) subprocess.run(["/usr/sbin/sshd", "-D", "-e"])
if __name__ == "__main__": if __name__ == "__main__":
globals.load_config()
load() load()

View File

@@ -86,5 +86,4 @@ def load():
if __name__ == "__main__": if __name__ == "__main__":
globals.load_config()
load() load()