Files
simplefileupload-server/src/start.py

20 lines
464 B
Python
Raw Normal View History

import os
import subprocess
cert = os.getenv("SSL_CERT", "cert.pem")
key = os.getenv("SSL_KEY", "key.pem")
use_ssl = os.path.exists(cert) and os.path.exists(key)
base_cmd = [
2025-04-16 21:40:35 -04:00
"gunicorn", "wsgi:app", "--bind", "0.0.0.0:7777", "--workers", "4", "--timeout", "300",
]
if use_ssl:
print("🟢 Starting with HTTPS")
base_cmd += ["--certfile", cert, "--keyfile", key]
else:
print("🟡 Starting with HTTP (no certs found)")
subprocess.run(base_cmd)