Repository navigation
Update the network page for the current NetworkMgr net_api - #19
Conversation
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.
Reviewer's GuideUpdates 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 rescansequenceDiagram
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
Sequence diagram for WiFi authentication and connectionsequenceDiagram
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())
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
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
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.
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:
Bug Fixes:
Enhancements:
Build:
Chores: