Skip to content

Add a Rule Sets tab to the Blocking page - #414

Merged
drudge merged 2 commits into
mainfrom
claude/per-device-blocking-0lzpfb
Oct 9, 2026
Merged

drudge merged 2 commits into
mainfrom
claude/per-device-blocking-0lzpfb

Conversation

@drudge

@drudge drudge commented Oct 9, 2026 •

Copy link
Copy Markdown
Owner

Before: rule sets (#240) worked only from the config file. The Blocking page had three tabs, and nothing in the console showed which devices used which block lists.

After: the Blocking page has a fourth tab, Rule Sets. It lists a Default row (the block lists for every device without a rule set) and one row per rule set, with its lists, its own blocked and allowed domain counts, and the devices in it by name. Add, Edit and Delete open the usual dialog. Edit Default chooses between Every Block List and Only These Lists.

Renaming a rule set moves its devices to the new name, and deleting one moves its devices back to Default, in the same change. Removing a block list now also drops it from every rule set and from the Default lists, and refuses when it is the Default's only list, so a list removal can no longer leave the config invalid.

Picking a device's rule set comes in the next PR (the device panel in Insights), so this tab's help text points there.

Screenshots

View Before (main) After
Tab strip (Block Lists tab)
Rule Sets tab New
Edit a rule set New
Add Rule Set New
Edit Default, every list New
Edit Default, only these lists New
Laptop dark
View Before (main) After
Tab strip (Block Lists tab)
Rule Sets tab New
Edit a rule set New
Add Rule Set New
Edit Default, every list New
Edit Default, only these lists New
Phone
View Before (main) After
Tab strip (Block Lists tab)
Rule Sets tab New
Edit a rule set New
Add Rule Set New
Edit Default, every list New
Edit Default, only these lists New
Phone dark
View Before (main) After
Tab strip (Block Lists tab)
Rule Sets tab New
Edit a rule set New
Add Rule Set New
Edit Default, every list New
Edit Default, only these lists New

How

  • config.SaveRuleSet, DeleteRuleSet and Blocking.RemoveList in internal/config/rule_sets.go do the edits, so the console, the MCP remove_block_list tool and the old block list delete all share them.
  • ruleSetService in internal/web/rule_set_service.go applies them through the settings editor like the other policy changes, and needs blocking.write.
  • The tab and dialogs are in internal/web/pages/blocking_rule_sets.templ, built from the shared Dialog, Field, Button and EmptyState components. The tab strip now has four columns.
  • Device names come from the client's name in config, else the name Insights or UniFi gave it, else its address.
  • The Vandelay demo now has three rule sets (Guests, IoT, Warehouse) so the tab has something to show.
  • It also moves the build to Go 1.27.2 and golang.org/x/net 0.60.0. govulncheck started failing on ten new advisories in Go 1.27.1 and x/net 0.59.0 (on main too), and these versions fix them.
  • mage verify passes. New tests cover save, rename, delete, the default lists, and removing a list that rule sets use.

Part of #240.

Rule sets were config-only. The Blocking page now lists them beside a
Default row, with dialogs to add, edit, rename and delete a rule set and
to pick the block lists for devices without one. Renaming or deleting a
rule set carries its devices along in the same change, and removing a
block list also drops it from every rule set and the default lists.
drudge added a commit that referenced this pull request Oct 9, 2026
govulncheck reports ten advisories (GO-2026-6603, 6605, 6607 to 6613,
6617) in net/http, its http2 code, net/textproto and crypto/tls in Go
1.27.1, and the matching http2 ones in x/net 0.59.0. Go 1.27.2 and x/net
0.60.0 fix all of them.

drudge commented Oct 9, 2026

Copy link
Copy Markdown
Owner Author

Quality failed in govulncheck, not because of anything in this PR. Ten new Go advisories (GO-2026-6603, 6605, 6607 to 6613 and 6617) cover net/http, http2, net/textproto and crypto/tls in Go 1.27.1, and golang.org/x/net 0.59.0. Main has the same versions, so it fails this check too.

8b88ef6 moves the toolchain to Go 1.27.2 and x/net to 0.60.0, which fix all ten. mage verify passes on 1.27.2. Once this merges, main is fixed as well.


Generated by Claude Code

@drudge
drudge merged commit 0a35db9 into main Oct 9, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant