vpn integration

This commit is contained in:
2026-04-11 21:51:30 +02:00
parent 4671e5da63
commit c4d27e9842
26 changed files with 2566 additions and 899 deletions
+39
View File
@@ -0,0 +1,39 @@
import os
import uvicorn
def build_config() -> dict:
debug = os.getenv("DEBUG", "true").lower() == "true"
config = {
"host": os.getenv("UVICORN_HOST", "0.0.0.0"),
"port": int(os.getenv("UVICORN_PORT", "8000")),
"loop": "asyncio",
"ws": "websockets",
"proxy_headers": True,
"forwarded_allow_ips": "*",
"log_level": "debug" if debug else "info",
"access_log": True
}
if debug:
config.update(
{
"reload": True,
"reload_dirs": ["."],
"workers": 1,
}
)
else:
config.update(
{
"workers": int(os.getenv("UVICORN_WORKERS", "5")),
}
)
return config
if __name__ == "__main__":
uvicorn.run("app.asgi:application", **build_config())