17 lines
491 B
Python
17 lines
491 B
Python
"""
|
|
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", []))
|