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:
+2
-6
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user