Skip to content

Update the network page for the current NetworkMgr net_api - #19

Merged
ericbsd merged 2 commits into
masterfrom
update-network-code
Oct 4, 2026
Merged

ericbsd merged 2 commits into
masterfrom
update-network-code

Conversation

@ericbsd

@ericbsd ericbsd commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

NetworkMgr's net_api now appends the full caps string, the security type and an enterprise flag to each access point entry. The page read ssid_info[-1] as the caps string, so it got the enterprise boolean and crashed on any WPA or WEP password. It now reads ssid_info[7].

Port the networkmgr connection handling. WPA-Enterprise networks open an EAP authentication dialog and are written with write_eap_config. Open networks get a quoted SSID in wpa_supplicant.conf, and every write to that file uses a 077 umask. Secured access points show the -secure signal icons.

Bring up any WiFi card that is down before the first scan, and add a Rescan button next to the wired status when a WiFi card is detected. The rescan runs in a thread and updates the status and access point list on the GTK main loop.

Connecting to a known SSID no longer blocks the UI, status updates after a connection go through GLib.idle_add, and the association wait matches networkmgr's 60 seconds.

Regenerate the translation template and catalogs. This adds the Rescan and enterprise authentication strings and picks up the reworded ZFS page strings that were not extracted yet.

Bump the version to 0.7.

Summary by Sourcery

Update network setup for the current NetworkMgr API and provide responsive support for open, secured, and WPA-Enterprise WiFi connections.

New Features:

  • Add WiFi rescanning with non-blocking status and access-point list updates.
  • Support WPA-Enterprise authentication with configurable EAP, certificate, identity, and password options.
  • Display security-aware WiFi signal icons and detect updated NetworkMgr access-point metadata.

Bug Fixes:

  • Correctly interpret the current NetworkMgr capability data to prevent authentication failures and crashes.
  • Quote open-network SSIDs and protect all wpa_supplicant configuration writes with a restrictive umask.
  • Wait up to 60 seconds for WiFi association while keeping connection handling responsive.

Enhancements:

  • Bring downed WiFi cards up before scanning and refresh connection status through the GTK main loop.

Build:

  • Bump the application version to 0.7.

Chores:

  • Regenerate translation templates and catalogs with the new network authentication and rescan messages.

NetworkMgr's net_api now appends the full caps string, the security
type and an enterprise flag to each access point entry. The page read
ssid_info[-1] as the caps string, so it got the enterprise boolean and
crashed on any WPA or WEP password. It now reads ssid_info[7].

Port the networkmgr connection handling. WPA-Enterprise networks open
an EAP authentication dialog and are written with write_eap_config.
Open networks get a quoted SSID in wpa_supplicant.conf, and every write
to that file uses a 077 umask. Secured access points show the -secure
signal icons.

Bring up any WiFi card that is down before the first scan, and add a
Rescan button next to the wired status when a WiFi card is detected.
The rescan runs in a thread and updates the status and access point
list on the GTK main loop.

Connecting to a known SSID no longer blocks the UI, status updates
after a connection go through GLib.idle_add, and the association wait
matches networkmgr's 60 seconds.

Regenerate the translation template and catalogs. This adds the Rescan
and enterprise authentication strings and picks up the reworded ZFS
page strings that were not extracted yet.

Bump the version to 0.7.
@ericbsd
ericbsd requested review from a team as code owners October 3, 2026 17:38
@sourcery-ai

sourcery-ai Bot commented Oct 3, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

Updates the network setup page for the current NetworkMgr API, adding robust AP metadata handling, secure and enterprise WiFi configuration, non-blocking scans and connections, refreshed translations, and a 0.7 release version.

Sequence diagram for non-blocking WiFi rescan

sequenceDiagram
    participant User
    participant NetworkSetup
    participant ScanThread
    participant NetworkMgr
    participant GTK

    User->>NetworkSetup: rescan
    NetworkSetup->>ScanThread: start_new_thread(scan_networks)
    ScanThread->>NetworkMgr: enableWifi(wlan_card)
    ScanThread->>NetworkMgr: networkdictionary()
    ScanThread->>GTK: GLib.idle_add(refresh_networks)
    GTK->>NetworkSetup: refresh_networks(network_info)
    NetworkSetup->>NetworkMgr: nic_status(card)
    NetworkSetup->>NetworkSetup: populate_ssid_list
Loading

Sequence diagram for WiFi authentication and connection

sequenceDiagram
    participant User
    participant NetworkSetup
    participant WPAConfig
    participant ConnectionThread
    participant NetworkMgr
    participant GTK

    User->>NetworkSetup: wifi_setup(selection)
    alt Known SSID
        NetworkSetup->>ConnectionThread: start_new_thread(try_to_connect_to_ssid)
    else WPA-Enterprise SSID
        NetworkSetup->>NetworkSetup: enterprise_authentication(ssid_info, card, false)
        User->>NetworkSetup: add_enterprise_to_wpa_supplicant
        NetworkSetup->>WPAConfig: write_eap_config(ssid, eap_config)
        NetworkSetup->>ConnectionThread: start_new_thread(try_to_connect_to_ssid)
    else Secured PSK or WEP SSID
        NetworkSetup->>NetworkSetup: authentication(ssid_info, card, false)
        User->>NetworkSetup: add_to_wpa_supplicant
        NetworkSetup->>WPAConfig: setup_wpa_supplicant(ssid, ssid_info, password)
    else Open SSID
        NetworkSetup->>WPAConfig: open_wpa_supplicant(ssid)
        NetworkSetup->>ConnectionThread: start_new_thread(try_to_connect_to_ssid)
    end
    loop Up to 60 seconds
        ConnectionThread->>NetworkMgr: nic_status(card)
    end
    ConnectionThread->>GTK: GLib.idle_add(refresh_networks, networkdictionary())
Loading

File-Level Changes

Change Details Files
Adapt WiFi discovery and access-point rendering to the current NetworkMgr metadata format.
  • Read capabilities, security type, and enterprise flag from their new positions.
  • Display secure signal icons and populate the AP list from scan results.
  • Bring downed WLAN interfaces up before initialization and add threaded rescanning with GTK-main-loop refreshes.
install_station/network_setup.py
Port WiFi connection and credential handling to NetworkMgr behavior, including enterprise authentication.
  • Connect to configured SSIDs asynchronously and wait up to 60 seconds for association.
  • Add WPA-Enterprise EAP/802.1X form support with method, phase-2, identity, certificate, and key inputs.
  • Write enterprise, open, WPA/WPA2, and WEP configurations through a root-only umask and quote open-network SSIDs.
install_station/network_setup.py
Regenerate internationalization resources for the new network UI and related extracted strings.
  • Update the translation template and locale catalogs with rescan and enterprise-authentication messages plus newly extracted ZFS wording.
po/install-station.pot
po/ar_SA.po
po/bg_BG.po
po/ca_ES.po
po/cs_CZ.po
po/da_DK.po
po/de_DE.po
po/el_GR.po
po/en_GB.po
po/en_US.po
po/es_ES.po
po/et_EE.po
po/fi_FI.po
po/fr_CA.po
po/fr_FR.po
po/hr_HR.po
po/hu_HU.po
po/it_IT.po
po/ja_JP.po
po/ko_KR.po
po/lt_LT.po
po/lv_LV.po
po/nl_NL.po
po/no_NO.po
po/pl_PL.po
po/pt_BR.po
po/pt_PT.po
po/ro_RO.po
po/ru_RU.po
po/sk_SK.po
po/sl_SI.po
po/sv_SE.po
po/th_TH.po
po/tr_TR.po
po/vi_VN.po
po/zh_CN.po
po/zh_TW.po
Bump the application release version.
  • Set the package version to 0.7.
setup.py

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey - I've found 1 issue

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="install_station/network_setup.py" line_range="286-293" />
<code_context>
+            _widget: Button widget that triggered the action (unused)
+        """
+        cls.rescan_button.set_sensitive(False)
+        _thread.start_new_thread(cls.scan_networks, ())
+
+    @classmethod
+    def scan_networks(cls) -> None:
</code_context>
<issue_to_address>
**issue (bug_risk):** If `enableWifi` or `networkdictionary` raises in the rescan thread, `refresh_networks` is never scheduled and `rescan_button` remains insensitive permanently, leaving the page unable to rescan again.

**Triggers:** When a WiFi scan fails or the interface disappears during scanning.

**Suggested fix:** Wrap the worker body in `try`/`finally` and schedule an idle callback that restores the button's sensitivity and reports the failure.
</issue_to_address>

Sourcery assessment

Needs a human reviewer. 1 finding to address first, and this changes authentication flows and writes user passwords, certificates, and private-key settings into /etc/wpa_supplicant.conf, while also changing how Wi-Fi access is enabled and configured. If the EAP mapping or generated configuration is wrong, users can lose connectivity or have credentials misapplied, and reverting the code does not remove configuration blocks already appended to the system file.

Blocking findings: install_station/network_setup.py:293


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

Comment thread install_station/network_setup.py
A failure in networkdictionary() inside the rescan thread, or the
WiFi card vanishing from the new scan, left the Rescan button greyed
out for good. Restore it in a finally block and skip the access point
list update when the card is gone.
@ericbsd
ericbsd merged commit ff16d7c into master Oct 4, 2026
1 check passed
@ericbsd
ericbsd deleted the update-network-code branch October 4, 2026 21:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants