mirror of
https://github.com/mattintech/simplefileupload-server.git
synced 2026-07-11 15:11:54 +00:00
added logic to support self signed certs
This commit is contained in:
19
src/start.py
Normal file
19
src/start.py
Normal 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)
|
||||
Reference in New Issue
Block a user