added logic to support self signed certs

This commit is contained in:
2025-04-15 19:23:42 -04:00
parent 21a6734300
commit 10983b9410
7 changed files with 33 additions and 59 deletions

19
src/start.py Normal file
View File

@@ -0,0 +1,19 @@
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 = [
"gunicorn", "wsgi:app", "--bind", "0.0.0.0:7777"
]
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)