Repository navigation
System: OS-Version aus /etc/issue per MQTT bereitstellen - #4338
kevinwieland wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Hey - I've found 2 issues
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="packages/helpermodules/update_config.py" line_range="638" />
<code_context>
"^openWB/system/mac_address$",
"^openWB/system/mqtt/bridge/[0-9]+$",
"^openWB/system/mqtt/valid_partner_ids$",
+ "^openWB/system/os_version$",
"^openWB/system/pnp_ip$",
"^openWB/system/release_train$",
</code_context>
<issue_to_address>
**Existing installs cannot read OS version**
When an existing installation has user management enabled and its installed ACL version is 13, `update_acls()` compares the installed and template ACL versions and returns without syncing when they match. Because the default dynamic-security template keeps `openwb-version:13`, existing installations at version 13 never receive the new `os_version` read ACL, so the UI cannot read the published value.
Bump the ACL template version so existing installations run the ACL synchronization and receive the new permission.
</issue_to_address>
### Comment 2
<location path="packages/helpermodules/update_config.py" line_range="781" />
<code_context>
("openWB/system/ip_address", "unknown"),
("openWB/system/mqtt/valid_partner_ids", []),
("openWB/system/mac_address", "unknown"),
+ ("openWB/system/os_version", "unknown"),
("openWB/system/pnp_ip", {"address": "192.168.193.250", "prefix": 24}),
("openWB/system/release_train", "master"),
</code_context>
<issue_to_address>
**Actual version overwritten by default**
When the topic has no retained value and the default-publication flow overlaps the setup script’s retained publication, `UpdateConfig.update()` runs `__pub_missing_defaults()` while `setup_network.sh` publishes the detected version. If the update process has already classified the topic as missing, its later default publication replaces the retained actual version with `unknown`, so readers see an incorrect OS version until the next publish.
Ensure missing-default publication cannot overwrite a value published concurrently, for example by rechecking retained state immediately before publishing the default.
Also at `runs/setup_network.sh:195`.
</issue_to_address>| ("openWB/system/ip_address", "unknown"), | ||
| ("openWB/system/mqtt/valid_partner_ids", []), | ||
| ("openWB/system/mac_address", "unknown"), | ||
| ("openWB/system/os_version", "unknown"), |
There was a problem hiding this comment.
🟡 Medium · Actual version overwritten by default
When the topic has no retained value and the default-publication flow overlaps the setup script’s retained publication, UpdateConfig.update() runs __pub_missing_defaults() while setup_network.sh publishes the detected version. If the update process has already classified the topic as missing, its later default publication replaces the retained actual version with unknown, so readers see an incorrect OS version until the next publish.
Ensure missing-default publication cannot overwrite a value published concurrently, for example by rechecking retained state immediately before publishing the default.
Also at runs/setup_network.sh:195.
Prompt for AI agents
In `packages/helpermodules/update_config.py` at line 781:
**Actual version overwritten by default**
When the topic has no retained value and the default-publication flow overlaps the setup script’s retained publication, `UpdateConfig.update()` runs `__pub_missing_defaults()` while `setup_network.sh` publishes the detected version. If the update process has already classified the topic as missing, its later default publication replaces the retained actual version with `unknown`, so readers see an incorrect OS version until the next publish.
Ensure missing-default publication cannot overwrite a value published concurrently, for example by rechecking retained state immediately before publishing the default.
Also at `runs/setup_network.sh:195`.|
Ist bereits in #4251 enthalten. |
Zusammenfassung
runs/setup_network.shanalog zu IP-Adresse, MAC-Adresse und Hostname ermitteln./etc/issuelesen, Login-Platzhalter\nund\lsowie umgebende Leerzeichen entfernen; bei fehlender Informationunknownverwenden.openWB/system/os_versionretained veröffentlichen.Zugehörige UI
Anzeige unter „System → System → System Information“, direkt unter „Hostname“:
openWB/openwb-ui-settings#1174
Prüfung
bash -n runs/setup_network.shKeine PHP-Erweiterung.
Summary by Sourcery
Provide the operating system version through MQTT for system information display.
New Features:
/etc/issueas a retained JSON string onopenWB/system/os_version.