chore: secure dashboard proxy endpoint and decouple lan checks
Deploy Dashboard / deploy (push) Successful in 1m48s

This commit is contained in:
Gan, Jimmy
2026-02-27 23:41:36 +08:00
parent 29a9e9d881
commit 3888a57642
5 changed files with 57 additions and 14 deletions
+14
View File
@@ -46,3 +46,17 @@ CHAT_SUMMARY_DB = os.environ.get("CHAT_SUMMARY_DB", "/app/data/chat-summarizer/c
# OpenClaw
OPENCLAW_GATEWAY_TOKEN = os.environ.get("OPENCLAW_GATEWAY_TOKEN", "")
# Networking configs
LAN_IP_RANGES = os.environ.get("LAN_IP_RANGES", "192.168.31.0/24,100.64.0.0/10").split(",")
def is_lan_ip(ip_str: str) -> bool:
import ipaddress
try:
ip_obj = ipaddress.ip_address(ip_str)
for subnet_str in LAN_IP_RANGES:
if ip_obj in ipaddress.ip_network(subnet_str.strip()):
return True
return False
except ValueError:
return False