Port to Plasma 6 and switch to the local zerotier-one API - #5
Open
Hafikan wants to merge 2 commits into
Open
Conversation
Zerotier Central's API needs an account token that is not available on the free plan, so the widget now talks to the local zerotier-one service on localhost:9993 instead. That trades the full membership roster of a network for what this machine actually sees: the networks it joined and the peers it is talking to, with latency and direct/relayed state. A peer's address on the virtual network -- the one you connect to -- is not in the local API, since it is the controller that hands it out. It is recovered instead by deriving each peer's MAC from the network id and node id, then looking that up in the interface's neighbour table. The port itself: metadata.json, PlasmoidItem, Kirigami units and theme, PlasmaExtras.Representation with a PlasmoidHeading, and KCM.SimpleKCM config pages. Emoji status markers became theme-coloured dots, the panel icon is now a symbolic SVG that follows the panel colour, and the separate network selector window is gone -- networks are picked inline in the settings. Fixes carried over from the old Central code: - Stale replies landing after a clear() duplicated the list; requests now carry a generation and late ones are dropped. - With no token configured, a retry timer restarted itself every 5s forever. Reloads are driven by configuration changes instead. - The online count summed the server's onlineMemberCount on every reply, so it grew without bound and disagreed with the list next to it. - ConfigGeneral declared cfg_zerotierToken twice and used string literals as ids, and its network selector window was parented to an undefined id. - Removing a network from the selection used a regex over the comma separated list and could leave stray commas behind. Note for anyone debugging this: Qt 6 blocks local file reads over XMLHttpRequest unless QML_XHR_ALLOW_FILE_READ=1 is set, and it fails silently -- the request never completes and no error is raised. The auth token is read through the executable data engine because of it.
The plugin id is what Plasma installs a package under, so reusing the original one would overwrite the upstream widget on anyone who already has it. Take a distinct id, credit both authors in the metadata, and point the links at this fork. The original copyright notice stays in LICENSE as MIT requires.
Owner
|
Port to plasma 6 and other things okay but for the zerotier api there is no change needed zerotier still gives us the "API Access Tokens" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Zerotier Central's API needs an account token that is not available on the free plan, so the widget now talks to the local zerotier-one service on localhost:9993 instead. That trades the full membership roster of a network for what this machine actually sees: the networks it joined and the peers it is talking to, with latency and direct/relayed state.
A peer's address on the virtual network -- the one you connect to -- is not in the local API, since it is the controller that hands it out. It is recovered instead by deriving each peer's MAC from the network id and node id, then looking that up in the interface's neighbour table.
The port itself: metadata.json, PlasmoidItem, Kirigami units and theme, PlasmaExtras.Representation with a PlasmoidHeading, and KCM.SimpleKCM config pages. Emoji status markers became theme-coloured dots, the panel icon is now a symbolic SVG that follows the panel colour, and the separate network selector window is gone -- networks are picked inline in the settings.
Fixes carried over from the old Central code:
Note for anyone debugging this: Qt 6 blocks local file reads over XMLHttpRequest unless QML_XHR_ALLOW_FILE_READ=1 is set, and it fails silently -- the request never completes and no error is raised. The auth token is read through the executable data engine because of it.