main.py aktualisiert

This commit is contained in:
2026-03-03 22:55:38 +00:00
parent 332aded4ce
commit 47730521bc

View File

@@ -100,6 +100,14 @@ async def remove_node(node_id: int):
conn.close()
return RedirectResponse(url="/", status_code=303)
async def check_docker_installed(ip, user):
# Prüft via SSH, ob der Befehl 'docker' existiert
cmd = "command -v docker >/dev/null 2>&1 && echo 'yes' || echo 'no'"
ssh_cmd = f"ssh -o StrictHostKeyChecking=no {user}@{ip} '{cmd}'"
process = subprocess.Popen(ssh_cmd, shell=True, stdout=subprocess.PIPE, text=True)
output = process.stdout.read().strip()
return output == "yes"
# --- Chat & KI Logik ---
@app.websocket("/ws/chat")