Add andrewdems/vpn-manager - #632
Merged
Merged
Conversation
A NetworkManager VPN front end: connect, disconnect, import and delete VPN connections of any protocol, with optional auto-connect whenever the active network is not on a trusted list. Assisted-by: AI
Contributor
|
The description now contains the required template structure. |
ItsLemmy
marked this pull request as draft
September 5, 2026 07:09
Assisted-by: AI
AndrewDemsDS
marked this pull request as ready for review
September 5, 2026 07:14
Assisted-by: AI
Assisted-by: AI
Assisted-by: AI
Assisted-by: AI
Assisted-by: AI
Assisted-by: AI
AndrewDemsDS
marked this pull request as draft
September 5, 2026 09:21
Assisted-by: AI
Assisted-by: AI
Assisted-by: AI
Assisted-by: AI
AndrewDemsDS
marked this pull request as ready for review
September 5, 2026 10:11
AndrewDemsDS
marked this pull request as draft
September 5, 2026 10:15
…, false auto-disconnect failure, unguarded select index Assisted-by: AI
AndrewDemsDS
marked this pull request as ready for review
September 7, 2026 12:51
Assisted-by: AI
Contributor
Author
|
Added a launcher provider (`/vpn`): "Open VPN Manager" plus a connect or disconnect action for every configured connection, fuzzy-matched by name. It's read-only against `vpn.connections` and writes to the existing `vpn.cmd` channel `service.luau` already handles - no new dependencies, filesystem writes, or network calls. Documented in the README's Usage section and the Plugin table's Entries/Launcher Prefix rows. Tested end-to-end with real keystroke input: root query shows "Open VPN Manager", typing a connection's name surfaces the right connect/disconnect action, and activation dispatches through the existing command channel correctly. |
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.
Plugin
andrewdems/vpn-managerplugin.toml)What it does
A NetworkManager VPN front end: connect, disconnect, import, inspect, edit and
delete VPN connections of any protocol NetworkManager supports, plus optional
auto-connect whenever the active network is not on a trusted list.
The plugin implements no VPN protocol itself. It drives
nmcli, so it supportswhatever the installed NetworkManager VPN plugins support (OpenVPN, WireGuard,
IPsec/IKEv2, L2TP, PPTP, SSTP, OpenConnect, vpnc), and any connection created
with
nmtuiornm-connection-editorshows up automatically.In the panel:
expand a row for its live details, or delete it behind a confirmation.
connection, read from
nmcli, with Edit connection opening a full editor.should stay off.
Auto-connect is off by default. When enabled, it connects the starred VPN once
the active network has been off the trusted list for N consecutive polls
(default 3, to avoid flapping while roaming), and disconnects it again on a
trusted network - but only if this plugin was what started it, so a VPN brought
up by hand is left alone.
Three behaviours worth flagging for review, each written to match how the shell
actually behaves:
layer-shell grab and the picker renders but cannot be clicked.
udiskieandscreen-toolkitclose their panels for the same reason. The chosen fileimports on its own.
then, every failure is recorded; reopening the panel lands on the import form
with the reason and the offending path, and the protocol selector to retry.
NetworkManager reports
No valid secretswhen no secret agent is running,which is the normal state of a bare Wayland session. A manual connect is then
rerun as
nmcli --ask connection upin a terminal so the password can betyped; auto-connect never opens a terminal and reports the cause instead.
External dependencies
Every subprocess is spawned as an argv list rather than a shell string, except
the two noted below.
nmclivpn.service-type/ SSID lookupskdialogzenitykdialogis absentnm-connection-editornmtui-editNone of the last four is required: without a picker you can type a path or paste
the config, and without an editor the button reports that none was found. Both
are probed with
commandExistsfirst.The two shell strings. The picker is spawned detached (
cmd > tmp 2>/dev/null &)because it outlives the
runAsynccall, and thenmtui-editfallback goesthrough
runInTerminal. Both interpolate only a plugin-generated temp path or aUUID validated against
^[0-9a-fA-F-]+$; no user-supplied string reaches either.Filesystem writes. Trusted networks, the chosen default VPN, and which VPN
the plugin auto-started live as JSON under
noctalia.pluginDataDir()- runtimelists edited from the panel, so they do not belong in manifest settings. The
picker writes the chosen path to
pick.tmpin the same directory, consumed anddeleted on the next tick. Importing pasted text writes it to a temp file for
the duration of the
nmcli connection importcall and deletes it immediately onevery exit path, so a config's secrets do not linger outside NetworkManager's
own storage. Importing from a path writes nothing.
Network calls. None. All state comes from NetworkManager through
nmcli.Privileges. None beyond what
nmcliitself does; connecting or deleting asystem connection goes through NetworkManager's own polkit policy, the same one
nm-appletandnmtuiuse. The plugin never escalates.Secrets. Only UUIDs are passed to
nmcli; no password is ever placed on acommand line, and nothing sensitive is written to the log - the byte count of a
pasted config is logged, never its body.
Testing
Run on Arch with NetworkManager 1.58 against a WireGuard and an OpenVPN
connection. Exercised for this submission: the bar widget in both states, the
panel opened by clicking the widget and with
noctalia msg panel-toggle andrewdems/vpn-manager:panel, the connection listwith its per-connection controls, expanding a row for details, the file picker
opening and being cancelled (the browse button re-enables within seconds rather
than waiting out the timeout), a failed import surfacing its reason and path in
the panel, and the
No valid secretspath opening a terminal prompt.Parsers are additionally covered by offline tests against captured real output:
nmcli -tdetail lines including indexed keys (IP4.ADDRESS[1]) and IPv6values containing colons, and the secret-error matcher against the three
messages NetworkManager actually emits, checked not to swallow unrelated
failures.
noctalia plugins lintis clean.Screenshots / Videos
The panel, with the connection list, per-connection controls and the import
entry point (connection names are placeholders here):
Checklist
Ready-for-review requirement: Every box in this section must be checked. If any statement is not true, keep the
pull request as Draft. An explanation does not replace a required check.
idafter the/inplugin.tomlexactly.plugin.toml,README.md,thumbnail.webp, andtranslations/en.json.README.mdfollows theREADME template, documents
every entry id and dependency, and includes exact panel IPC commands and launcher prefixes where applicable.
thumbnail.webpis present and relevant; for a new plugin I created it with the thumbnail generator, and for an update I regenerated it with the generator if the visual identity or user-facing appearance changed.versionfollows semver and is bumped in this PR;plugin_apiis the oldest API level this plugin requires.understand that language well enough to review and maintain it (no unreviewed machine/LLM translations).
catalog.toml; CI generates it.Code review attestation
Plugins run as trusted, unsandboxed Luau in the user's session. Confirm:
Ready-for-review requirement: Every attestation below must be checked.
licensedeclared inplugin.toml.Every user-facing string goes through
noctalia.tr(), resolving againsttranslations/en.json; only product names in the import-type list (OpenVPN, WireGuard, Cisco) are left untranslated. This plugin was written with AI assistance, disclosed in an AI assistance section in itsREADME.md; every line is hand-reviewed, plain readable Luau.