Development

This commit is contained in:
Matthew Grotke 2026-06-06 23:22:02 -04:00
parent 8303eb5397
commit a4eb431f22
11 changed files with 744 additions and 1 deletions

17
routlin/mod_captive.py Normal file
View file

@ -0,0 +1,17 @@
"""
mod_captive.py -- Captive portal state and path constants.
"""
import mod_shared as shared
CAPTIVE_QUEUE_FILE = shared.SCRIPT_DIR / ".captive-queue"
CAPTIVE_DB_FILE = shared.SCRIPT_DIR / ".client-credentials"
# nftables table and set that hold authenticated client IPs
CAPTIVE_NFT_FAMILY = "inet"
CAPTIVE_NFT_TABLE = "filter"
CAPTIVE_NFT_SET = "captive_allowed"
def captive_portal_enabled(data):
return any(v.get("restricted_vlan") == "c" for v in data.get("vlans", []))