Development
This commit is contained in:
parent
8303eb5397
commit
a4eb431f22
11 changed files with 744 additions and 1 deletions
17
routlin/mod_captive.py
Normal file
17
routlin/mod_captive.py
Normal 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", []))
|
||||
Loading…
Add table
Add a link
Reference in a new issue