Pelican/pterodactyl deploy support: run.py, requirements.txt, SERVER_PORT, ready marker

This commit is contained in:
2026-11-16 13:00:28 +01:00
parent e526edd75e
commit 9f54677e5d
4 changed files with 11 additions and 2 deletions
+4
View File
@@ -0,0 +1,4 @@
starlette>=1.0
uvicorn>=0.35
websockets>=14
segno>=1.6
+2 -1
View File
@@ -16,7 +16,8 @@ def lan_ip():
def main():
scheme = "https" if config.TLS_CERT else "http"
print(f"RotatyVote -> {scheme}://localhost:{config.PORT} (LAN: {scheme}://{lan_ip()}:{config.PORT})")
# "RUNNING" is the ready marker the pelican python egg waits for
print(f"RotatyVote RUNNING on {scheme}://localhost:{config.PORT} (LAN: {scheme}://{lan_ip()}:{config.PORT})", flush=True)
if config.PUBLIC_URL:
print(f"QR codes encode {config.PUBLIC_URL}")
elif scheme == "http":
+2 -1
View File
@@ -1,7 +1,8 @@
import os
HOST = os.environ.get("HOST", "0.0.0.0")
PORT = int(os.environ.get("PORT", "8000"))
# SERVER_PORT is what pterodactyl/pelican hands to the container
PORT = int(os.environ.get("PORT") or os.environ.get("SERVER_PORT") or "8000")
# url encoded in the QR codes, eg https://vote.example.org
# when empty the projector's own origin is used
PUBLIC_URL = os.environ.get("PUBLIC_URL", "").rstrip("/")
+3
View File
@@ -0,0 +1,3 @@
from rotatyvote.__main__ import main
main()