Server: Simplify IP filtering - only blacklist

- Remove whitelist (not needed for public launcher)
- Only BLOCKED_IPS env var supported now
This commit is contained in:
SashegDev
2026-05-07 17:14:47 +00:00
parent 04f97c3c80
commit 513c07666b
2 changed files with 15 additions and 38 deletions
+2 -6
View File
@@ -33,17 +33,13 @@ BUILDS_DIR = Path("builds")
import os
import middleware as mw
# Configure allowed IPs (empty = allow all, set IPs = only these allowed)
ALLOWED_IPS = set(os.environ.get("ALLOWED_IPS", "").split(",")) - {""}
# Configure blocked IPs
# Configure blocked IPs only
BLOCKED_IPS = set(os.environ.get("BLOCKED_IPS", "").split(",")) - {""}
if ALLOWED_IPS:
logger.info(f"IP whitelist enabled: {len(ALLOWED_IPS)} IPs allowed")
if BLOCKED_IPS:
logger.info(f"IP blacklist enabled: {len(BLOCKED_IPS)} IPs blocked")
mw.set_ip_config(allowed=ALLOWED_IPS, blocked=BLOCKED_IPS)
mw.set_ip_config(blocked=BLOCKED_IPS)
@asynccontextmanager