feature/ssh-server #1
@@ -7,14 +7,15 @@ file_path="/etc/app/config.yaml"
|
||||
config=None
|
||||
|
||||
def config_exits():
|
||||
global config
|
||||
return config is not None
|
||||
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():
|
||||
@@ -22,4 +23,6 @@ def load_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)
|
||||
|
||||
|
||||
@@ -14,8 +14,6 @@ def main():
|
||||
else:
|
||||
print("👉 starting setup")
|
||||
|
||||
|
||||
globals.load_config()
|
||||
setup_container()
|
||||
|
||||
if globals.is_debugging():
|
||||
|
||||
@@ -116,5 +116,4 @@ def start_server():
|
||||
subprocess.run(["/usr/sbin/sshd", "-D", "-e"])
|
||||
|
||||
if __name__ == "__main__":
|
||||
globals.load_config()
|
||||
load()
|
||||
@@ -86,5 +86,4 @@ def load():
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
globals.load_config()
|
||||
load()
|
||||
|
||||
Reference in New Issue
Block a user