Skip to content

settings: add firewall configuration page under network - #4197

Draft
DaniCatGames wants to merge 7 commits into
duxlabs-dev:masterfrom
DaniCatGames:firewall-settings
Draft

DaniCatGames wants to merge 7 commits into
duxlabs-dev:masterfrom
DaniCatGames:firewall-settings

Conversation

@DaniCatGames

@DaniCatGames DaniCatGames commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Description

Add a firewall tab under Settings -> Network -> Firewall that allows basic configuration of both firewalld and ufw. Firewalld allows changing the zones of interfaces, and managing the rules of a zone. Ufw allows changing default incoming/outgoing and its rules are global instead of per zone. Raw/complicated zone/rule editing is not here on purpose to keep it usable and simple, while still providing 99% of the functionality most people will ever need.

Type of change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that changes existing behavior)
  • Refactor / internal cleanup
  • Documentation
  • Other

Related issues

None

Screenshots / video

Image

Checklist

  • My code follows the conventions in CONTRIBUTING.md
  • I have tested my changes locally
  • New user-facing strings are wrapped in I18n.tr() with translator context, reusing existing terms where possible
  • Go changes: ran make fmt, added/updated tests, make test passes, and go mod tidy is clean
  • QML changes: ran make lint-qml with no new warnings
  • I have opened a corresponding pull request in dux-docs to document any new behaviors: https://github.com/duxlabs-dev/dux-docs

@github-actions github-actions Bot added core Go daemon and CLI under core/ feature ui Quickshell UI under quickshell/ labels Nov 7, 2026
@Conava

Conava commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

Really nice feature. I hope it gets merged, I would integrate it into #3727 too (if that ever gets in).
But I think this needs a docs PR

@apollo79

apollo79 commented Nov 7, 2026

Copy link
Copy Markdown
Member

Design-wise I would like the status at the top to be a bit more prominent, color-wise maybe. Maybe also use the shield icon with checkmaek to indicate the secured status.

  • can one create new zones?
  • is it possible to edit rules? There is only a delete button visible.

Maybe expandable list items can also be used instead of the selector for zone: https://m3.material.io/components/lists/specs#5b4e7e40-f62b-4724-9d22-201672104ed5

The expandable items would be the zones in that case. Just an idea though and might not work out nicely.

Also the "Networks" section doesn't say what the dropdown on the right is. When you aren't familiar with firewalls you wouldn't understand what you are changing there.

@DaniCatGames

Copy link
Copy Markdown
Contributor Author

Really nice feature. I hope it gets merged, I would integrate it into #3727 too (if that ever gets in). But I think this needs a docs PR

@Conava What would you want to see in the docs? I was going to open a PR to add it to the optional features section with a quick explanation but would you like anything more?

@Conava

Conava commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

Really nice feature. I hope it gets merged, I would integrate it into #3727 too (if that ever gets in). But I think this needs a docs PR

@Conava What would you want to see in the docs? I was going to open a PR to add it to the optional features section with a quick explanation but would you like anything more?

No I think a small mention is enough. Just saw that it was missing here, nothing in particular I wanted to see in there.

@bbedward

bbedward commented Nov 8, 2026

Copy link
Copy Markdown
Member

/claude review

@github-actions

github-actions Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Claude review

Solid backend design; two small QML issues to fix.

  • Rules card and "Add rule" FAB show before the first firewall state arrives (or forever if the manager fails to init), quickshell/Modules/Settings/NetworkFirewallTab.qml:18
  • New user-facing strings missing translator context, quickshell/Common/SettingsTabs.qml:449
    Checked: firewall Go package (manager, firewalld D-Bus/polkit, ufw root helper, rule validation), server subscription refcount/grace close, router, doctor, FirewallService, settings tab and deprecated-shim usage. Model: claude-opus-5-5.


readonly property bool isFirewalld: FirewallService.backend === "firewalld"
readonly property bool canUnlock: FirewallService.locked && (!isFirewalld || FirewallService.active)
readonly property bool showRules: !FirewallService.locked && (!isFirewalld || FirewallService.active) && FirewallService.stateError === ""

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Until the first firewall event arrives, backend is "" and locked is false, so isFirewalld is false and showRules comes out true. The page then shows an empty, editable "Rules" card and the "Add rule" FAB. That happens every time the page opens, because the subscription re-dials and NewManager makes D-Bus calls first. If NewManager fails, no event is ever sent and the page stays in this state. It also happens after updateState({}) on close. Gate on a known backend:

Suggested change
readonly property bool showRules: !FirewallService.locked && (!isFirewalld || FirewallService.active) && FirewallService.stateError === ""
readonly property bool showRules: FirewallService.backend !== "" && !FirewallService.locked && (!isFirewalld || FirewallService.active) && FirewallService.stateError === ""

},
{
"id": "network_firewall",
"text": I18n.tr("Firewall"),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These new strings aren't in en.json yet and have no translator context, which CONTRIBUTING.md requires:

  • "Firewall" (here)
  • "Status, zones and rules" (line 453)
  • "Apply this to all incoming/outgoing traffic that no rule matches?" (NetworkFirewallTab.qml:218, :235)
  • "From anywhere" (NetworkFirewallTab.qml:445)

Add a context argument to each, e.g. I18n.tr("Firewall", "settings page title").

@DaniCatGames
DaniCatGames marked this pull request as draft November 9, 2026 19:39

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Go daemon and CLI under core/ feature ui Quickshell UI under quickshell/

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants