Development

This commit is contained in:
Matthew Grotke 2026-06-06 00:51:30 -04:00
parent 6cfb070b7f
commit 286930423f
7 changed files with 44 additions and 11 deletions

View file

@ -103,7 +103,7 @@
"label": "Source",
"name": "src_ip_or_subnet",
"input_type": "text",
"validate": "VALIDATION_IPV4_CIDR",
"validate": "VALIDATION_IPV4_CIDRFLEX",
"placeholder": "e.g. 192.168.20.100 or 192.168.20.0/24",
"hint": "You may allow either a single device IP or an entire subnet to contact dest."
},
@ -112,7 +112,7 @@
"label": "Destination",
"name": "dst_ip_or_subnet",
"input_type": "text",
"validate": "VALIDATION_IPV4_CIDR",
"validate": "VALIDATION_IPV4_CIDRFLEX",
"placeholder": "e.g. 192.168.10.200 or 192.168.10.0/24",
"hint": "You may allow either a single device IP or an entire subnet to be reached by source."
}

View file

@ -66,9 +66,17 @@ def auth_mode_save():
flash('This authentication mode requires a Routlin Pro license.', 'error')
return redirect(f'/{_PAGE}')
eap_protocol = request.form.get('eap_protocol', 'eap_peap')
if eap_protocol not in ('eap_peap', 'eap_ttls', 'eap_md5'):
eap_protocol = 'eap_peap'
cfg = load_config()
before = copy.deepcopy(cfg.get('radius', {}).get('options', {}))
after = {**before, 'auth_mode': auth_mode}
if auth_mode == 'eap_password':
after['eap_protocol'] = eap_protocol
else:
after.pop('eap_protocol', None)
cfg.setdefault('radius', {})['options'] = after
changes = diff_fields(before, after)

View file

@ -201,7 +201,7 @@
},
{
"type": "card",
"label": "Extensible Authentication Protocol (EAP)",
"label": "Authentication Mode",
"client_requirement": "client_is_administrator+",
"items": [
{
@ -225,6 +225,23 @@
"options": "%RADIUS_AUTH_MODE_OPTIONS%",
"hint": "_"
},
{
"type": "raw_html",
"html": "<div id=\"eap-protocol-row\">"
},
{
"type": "field",
"label": "Username/Password Protocol",
"name": "eap_protocol",
"input_type": "select",
"value": "%RADIUS_EAP_PROTOCOL%",
"options": "%RADIUS_EAP_PROTOCOL_OPTIONS%",
"hint": "_"
},
{
"type": "raw_html",
"html": "</div>"
},
{
"type": "button_row",
"items": [

View file

@ -68,7 +68,13 @@ def collect_tokens(cfg):
fr_opts = fr.get('options', {})
fr_gen = fr.get('general', {})
tokens['RADIUS_MAC_FORMAT'] = fr_opts.get('mac_format', 'aabbccddeeff')
tokens['RADIUS_AUTH_MODE'] = fr_opts.get('auth_mode', 'mab')
tokens['RADIUS_AUTH_MODE'] = fr_opts.get('auth_mode', 'mab')
tokens['RADIUS_EAP_PROTOCOL'] = fr_opts.get('eap_protocol', 'eap_peap')
tokens['RADIUS_EAP_PROTOCOL_OPTIONS'] = json.dumps([
{'value': 'eap_peap', 'label': 'EAP-PEAP'},
{'value': 'eap_ttls', 'label': 'EAP-TTLS'},
{'value': 'eap_md5', 'label': 'EAP-MD5'},
])
pro_suffix = '' if PRO_LICENSE else ' (PRO REQUIRED)'
pro_disabled = not PRO_LICENSE
tokens['RADIUS_AUTH_MODE_OPTIONS'] = json.dumps([

View file

@ -208,7 +208,7 @@
"label": "Server Endpoint",
"name": "vpn_server_endpoint",
"input_type": "text",
"validate": "VALIDATION_ENDPOINT",
"validate": "VALIDATION_IP_OR_DOMAIN_NAME",
"value": "%VPN_SERVER_ENDPOINT%",
"placeholder": "e.g. vpn.example.com",
"hint": "Publicly reachable hostname or IP of this server, embedded in client config files."