Supports using the original Granian define environment variables, cleans up references to gunicorn

This commit is contained in:
Trenton H
2025-02-24 13:32:29 -08:00
parent 1e9b3d0f4a
commit ba5a4554c5
10 changed files with 18 additions and 310 deletions

View File

@@ -1,16 +1,15 @@
import os
if __name__ == "__main__":
import os
from granian import Granian
from granian.constants import Interfaces
Granian(
"paperless.asgi:application",
interface=Interfaces.ASGI,
address=os.getenv("PAPERLESS_BIND_ADDR", "::"),
port=int(os.getenv("PAPERLESS_PORT", 8000)),
workers=int(os.getenv("PAPERLESS_WEBSERVER_WORKERS", 1)),
address=os.getenv("GRANIAN_HOST") or os.getenv("PAPERLESS_BIND_ADDR", "::"),
port=int(os.getenv("GRANIAN_PORT") or os.getenv("PAPERLESS_PORT") or 8000),
workers=int(os.getenv("GRANIAN_WORKERS") or os.getenv("GRANIAN_WORKERS") or 1),
websockets=True,
# TODO, test this
url_path_prefix=os.getenv("PAPERLESS_FORCE_SCRIPT_NAME"),
).serve()