Pelican/pterodactyl deploy support: run.py, requirements.txt, SERVER_PORT, ready marker
This commit is contained in:
@@ -0,0 +1,4 @@
|
|||||||
|
starlette>=1.0
|
||||||
|
uvicorn>=0.35
|
||||||
|
websockets>=14
|
||||||
|
segno>=1.6
|
||||||
@@ -16,7 +16,8 @@ def lan_ip():
|
|||||||
|
|
||||||
def main():
|
def main():
|
||||||
scheme = "https" if config.TLS_CERT else "http"
|
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:
|
if config.PUBLIC_URL:
|
||||||
print(f"QR codes encode {config.PUBLIC_URL}")
|
print(f"QR codes encode {config.PUBLIC_URL}")
|
||||||
elif scheme == "http":
|
elif scheme == "http":
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
import os
|
import os
|
||||||
|
|
||||||
HOST = os.environ.get("HOST", "0.0.0.0")
|
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
|
# url encoded in the QR codes, eg https://vote.example.org
|
||||||
# when empty the projector's own origin is used
|
# when empty the projector's own origin is used
|
||||||
PUBLIC_URL = os.environ.get("PUBLIC_URL", "").rstrip("/")
|
PUBLIC_URL = os.environ.get("PUBLIC_URL", "").rstrip("/")
|
||||||
|
|||||||
Reference in New Issue
Block a user