Repository navigation
settings: add firewall configuration page under network - #4197
DaniCatGames wants to merge 7 commits into
Conversation
|
Really nice feature. I hope it gets merged, I would integrate it into #3727 too (if that ever gets in). |
|
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.
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. |
@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. |
|
/claude review |
Claude reviewSolid backend design; two small QML issues to fix.
|
|
|
||
| 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 === "" |
There was a problem hiding this comment.
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:
| 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"), |
There was a problem hiding this comment.
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").
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
Related issues
None
Screenshots / video
Checklist
I18n.tr()with translator context, reusing existing terms where possiblemake fmt, added/updated tests,make testpasses, andgo mod tidyis cleanmake lint-qmlwith no new warnings