From f237c6930750f1a65ae90b9cdf4801a8f4c41228 Mon Sep 17 00:00:00 2001 From: Matthew Grotke Date: Wed, 27 May 2026 00:42:54 -0400 Subject: [PATCH] Development --- docker/routlin-dash/app/action_networklayout.py | 16 ++++++++++++++++ docker/routlin-dash/app/view_page.py | 3 +++ docker/routlin-dash/data/page_content.json | 9 +++++++++ 3 files changed, 28 insertions(+) diff --git a/docker/routlin-dash/app/action_networklayout.py b/docker/routlin-dash/app/action_networklayout.py index 82499d7..fd9cb30 100644 --- a/docker/routlin-dash/app/action_networklayout.py +++ b/docker/routlin-dash/app/action_networklayout.py @@ -118,6 +118,14 @@ def networklayout_tablevlans_edit(): request.form.getlist('use_blocklists'), {b.get('name') for b in load_config().get('dns_blocking', {}).get('blocklists', [])}, ) + identity_ips_raw = [line.strip() for line in request.form.get('server_identity_ips', '').splitlines() if line.strip()] + identity_ips = [] + for raw_ip in identity_ips_raw: + clean = sanitize.ip(raw_ip) + if not clean: + flash(f"'{raw_ip}' is not a valid IP address.", 'error') + return redirect(VIEW) + identity_ips.append(clean) subnet_mask_raw = request.form.get('subnet_mask') if subnet_mask_raw is not None: @@ -168,6 +176,13 @@ def networklayout_tablevlans_edit(): flash('Only one VLAN can be the RADIUS default.', 'error') return redirect(VIEW) + old_identities = existing.get('server_identities', []) + new_identities = [] + for i, ip in enumerate(identity_ips): + entry = dict(old_identities[i]) if i < len(old_identities) else {} + entry['ip'] = ip + new_identities.append(entry) + before = {k: existing.get(k) for k in _VLAN_FIELDS} existing.update({ 'name': name, @@ -178,6 +193,7 @@ def networklayout_tablevlans_edit(): 'radius_default': radius_default, 'mdns_reflection': mdns_reflection, 'use_blocklists': use_blocklists, + 'server_identities': new_identities, }) errors = validate.validate_config(cfg) if errors: diff --git a/docker/routlin-dash/app/view_page.py b/docker/routlin-dash/app/view_page.py index 2d8cd62..e314fdc 100644 --- a/docker/routlin-dash/app/view_page.py +++ b/docker/routlin-dash/app/view_page.py @@ -305,6 +305,9 @@ def _config_datasource(name): row['use_blocklists'] = json.dumps([ {'n': bl, 'd': bl_desc.get(bl, bl)} for bl in v.get('use_blocklists', []) ]) + row['server_identity_ips'] = json.dumps([ + s.get('ip', '') for s in v.get('server_identities', []) if s.get('ip') + ]) rows.append(row) return rows diff --git a/docker/routlin-dash/data/page_content.json b/docker/routlin-dash/data/page_content.json index 87c0231..174f231 100644 --- a/docker/routlin-dash/data/page_content.json +++ b/docker/routlin-dash/data/page_content.json @@ -1521,6 +1521,11 @@ "field": "subnet_mask", "class": "col-mono col-narrow" }, + { + "label": "Self Ident(s)", + "field": "server_identity_ips", + "render": "tag_list" + }, { "label": "Blocklists", "field": "use_blocklists", @@ -1572,6 +1577,10 @@ "min": 1, "max": 30 }, + { + "col": "server_identity_ips", + "input_type": "textarea" + }, { "col": "radius_default", "input_type": "checkbox",