Commit Graph
3603 Commits
Author SHA1 Message Date
Theodor S. Midtlien 748bcb072e Fix session holder logic for profiles without owner. 2026-10-27 13:21:59 +01:00
Theodor S. Midtlien 4ab791ba23 Merge branch 'main' into profile-ownership 2026-10-26 11:08:28 +01:00
Pascal Fischer fdc51d6f95 [management] shift network map data store onto the read replica (#8302) 2026-10-25 22:34:44 +01:00
Misha Bragin dd38fabc82 [client] Add --table output to netbird status (#8305) 2026-10-24 14:01:45 -04:00
Viktor Liu 9dd51ca42e [client] Drop SSH privileges through libc in PKCS#11 package builds (#8323) 2026-10-24 10:49:51 +02:00
Maycon Santos c051ca8f87 [client,proxy,management,signal,relay] Distrust compromised eMudhra CA keys (#8326)
* [client,proxy,management,signal,relay] Distrust compromised eMudhra CA keys

Eight eMudhra intermediate CA private keys were compromised and browsers
blocked them on 2026-10-17. Our binaries were built with go1.26.7, which
accepts chains through those intermediates whenever the trust store still
holds emSign ECC Root CA - G3. go1.26.10 rejects them in crypto/x509 on
every platform, regardless of the trust store.

The UBI base still ships the root and Red Hat has no fixed package yet, so
the UBI images blocklist it with p11-kit. The ingest image, the UI server
image and the pinned Chainguard digests also carried the root and move to
bases that no longer do.

* [client,proxy,management,signal,relay] Use the fixed UBI base instead of a blocklist

Red Hat shipped ca-certificates 2026.2.92_v9.0.319-90.3 on 2026-10-22,
which drops emSign ECC Root CA - G3 and AAA Certificate Services. The
current ubi9-minimal image carries it, so pin that digest and remove the
p11-kit blocklist step.

* [misc] Pin upload-server images by digest only and restore go.mod comment
2026-10-24 01:07:20 +02:00
Bethuel Mmbaga 69f13e3733 [management] Move reverse proxy access logs to a dedicated database (#8303) 2026-10-23 16:04:09 +03:00
Theodor S. Midtlien df6c55f1a4 Merge branch 'main' into profile-ownership 2026-10-23 11:42:29 +02:00
Theodor Midtlien e13dbe8cb4 [client] Improve error surfacing for restricted daemon sockets (#7704)
* Add probe for daemon restriction and improve error surfacing
2026-10-23 11:38:26 +02:00
Maycon Santos 8397bed4af [management] Push network maps when background validation changes (#8299)
An integrated validator can approve or revoke peers outside a login or
sync, for example during a periodic EDR sync. Only revocations of SSO
peers reached anyone; a newly approved peer kept its empty map, and its
peers did not see it, until an unrelated update or a reconnect.

Add SetPeerValidationChangeListener to the IntegratedValidator interface.
The account manager registers a handler that resolves the affected peers
and calls OnPeersUpdated, the same path a login-time approval takes. The
OSS validator and the mock implement it as a no-op.
2026-10-22 22:57:47 +02:00
dmitri-netbird f548a74c7c [management] Compensate for a possible nil peer when returning "empty" network map (#8285)
* we somehow can get a nil peer when returning empty components; this fix compensates for the issue, but doesn't fix the root cause (which is unknown atm)

Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io>

* fix test

Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io>

---------

Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io>
2026-10-22 20:27:53 +02:00
Pascal Fischer 48ecdfbcfc [management] remove account id check from inner groups query to use index (#8297) 2026-10-22 19:13:55 +02:00
Pascal Fischer 431e201355 [management] reduce calls to update last usage for users and pats (#8290) 2026-10-22 19:13:11 +02:00
Pascal Fischer c476196653 [management] Add additional indexes for groups, events, pats and access logs (#8289) 2026-10-22 19:12:17 +02:00
Maycon Santos 0fc596e2e1 [management] Skip inactivity expiration rescan on connect when a job is scheduled (#8287)
* [management] Skip inactivity expiration rescan when a job is scheduled

Every SSO peer connect and disconnect cancelled the account's inactivity
expiration job and re-armed it, loading every inactivity-enabled peer of
the account each time. During a management deploy, when all peers
reconnect, that is a full account scan per peer.

A connecting peer cannot expire, and a disconnecting peer expires after
every peer that was already disconnected, so neither can move the next
run earlier. Connect and disconnect now leave an already scheduled job in
place, as login expiration already does. Settings and per-peer toggle
changes still cancel and reschedule, since they can move the run earlier.

* [management] Keep inactivity rescan on disconnect

A disconnect that lands while the inactivity job is finishing its last
run saw the job as scheduled and skipped arming a new one; the scheduler
then removed the job, leaving the disconnected peer without an inactivity
timer. Only connect, where the peer cannot expire, now skips a scheduled
job; disconnect cancels and re-arms as before.

The test asserts on the synchronous Cancel call instead of sleeping.
2026-10-22 14:32:52 +02:00
Viktor Liu abf50e3ad4 [client] Remove the replace directives from the embedded client (#8280) 2026-10-22 17:39:22 +09:00
Theodor Midtlien f886f4b06c Bump wasm build size to 70MB (#8281) 2026-10-22 09:47:39 +02:00
Bruno Mercier Costa b03d1c7d07 [client] Stop the service and UI before the NSIS installer extracts files (#8255) 2026-10-21 20:37:48 +02:00
Mohammadreza Razavian 73829c8d96 [management] Give the /api/setup owner account the single account mode domain (#8147) 2026-10-21 20:46:33 +03:00
Bethuel Mmbaga 4ca20f0c7a [management] Make EDR sync interval configurable (#8273) 2026-10-21 18:38:08 +03:00
Bethuel Mmbaga 11799f6b94 [management] Use account owner as inviter for service user invites (#8276) 2026-10-21 18:33:31 +03:00
Eduard Gert 031a4bd70d [client] Migrate the desktop UI to Tailwind CSS 4 and fix frontend npm audit findings (#8277)
* [proxy] Fix npm audit findings in the web UI

npm audit reported 10 vulnerabilities (7 high), all in build tooling:
Vite/launch-editor, PostCSS, Babel, browserslist, js-yaml, nanoid,
brace-expansion and source-map-js. All are resolved by the lockfile
update; Vite is pinned exactly, so it is bumped from 7.3.2 to 7.3.7.

* [client] Migrate the desktop UI to Tailwind CSS 4 and fix npm audit findings

pnpm audit reported 36 vulnerabilities in the desktop UI. All but two
(braces and postcss-selector-parser, both pulled in by Tailwind 3 with
no patched version in range) are fixed by updating within the existing
ranges; react-router moves to 7.18.4, which also fixes an open redirect
and an XSS in its error handler.

The remaining two go away by moving to Tailwind CSS 4, which the proxy
web UI already uses:

- The config moves into an @theme block in globals.css; the official
  upgrade tool applied the v4 utility renames across the components.
- @tailwindcss/vite replaces the PostCSS plugin and autoprefixer.
- tw-animate-css replaces tailwindcss-animate with the same classes.
- The Prettier plugin reads the theme from the stylesheet.

A screenshot comparison of every screen against the Tailwind 3 build
found three regressions caused by v4's changed utility and variant
ordering, fixed here so the UI renders as before:

- Label combined inline-block and flex; v4 let inline-block win, which
  made every settings row taller. The dead inline-block is removed.
- The active settings tab lost its highlight in dark mode because
  dark: now outranks group-data-[state=active]:. The active color is
  set for dark mode explicitly.
- v4 rebuilt its default palette in OKLCH, shifting colors the theme
  does not override such as sky-400. The Tailwind 3 values for the
  neutral, zinc, sky, orange and amber families are pinned in @theme.

The only remaining visible difference is 2px less height per row in
the profiles list, because v4's preflight resets the browser's default
table-cell padding.
2026-10-21 15:53:05 +02:00
Zoltan Papp 1e63b68c4d [relay] Negotiate the protocol version on the server side (#8231) 2026-10-21 12:27:44 +02:00
Theodor S. Midtlien c75f272252 Fix rename profile regression 2026-10-20 22:48:11 +02:00
Theodor S. Midtlien 71732da68e Fix server merge regression bug 2026-10-20 22:30:08 +02:00
Theodor S. Midtlien 8f952fda06 Fix ipcauth tests after merge 2026-10-20 22:19:15 +02:00
Theodor S. Midtlien 0e5eaaa829 Merge branch 'main' into profile-ownership 2026-10-20 21:52:17 +02:00
Bethuel Mmbaga aa0f569677 [management] Remove the MySQL store engine (#7914) 2026-10-20 18:50:32 +03:00
Maycon Santos 569b9aa169 [misc] Let suites outside the module reach the e2e harness network (#8260)
The harness hands peers the management address netbird.local:8080, which
only resolves on the deployment's own Docker network, and keeps that
network, the client image and the client container private. A suite that
runs agents somewhere else, such as the Kubernetes operator's Kind
cluster, has no way to attach to the deployment, run the same client
build, or check routed access from a harness peer.

Expose the network name, resolve the client image on its own, and let a
caller exec into a client container.
2026-10-20 14:21:05 +02:00
Maycon Santos b866d1584c [client] Drop the non-functional admin URL (#8267)
* [client] Drop the non-functional admin URL

#4218 deprecated --admin-url, but #3980 merged right after it and restored the flag and its wiring. The value has been stored and echoed back ever since, without anything reading it.

Stop sending it from the CLI, ignore it in the daemon and drop it from the profile config, the UI settings service and the debug bundle. The proto fields stay for older clients, and the mobile getters and setters keep their signatures as deprecated stubs.

* [client] Drop adminUrl from the Wails API reference
2026-10-20 14:07:00 +02:00
Riccardo Manfrin 7420c97930 [client] Keep the resolv.conf watch armed while repairing DNS in file mode (#8207)
* [client] Split resolv.conf parsing from file reading

Pure refactor, no behavior change. parseResolvConf parses content that
was already read, so a caller can compare and parse the same snapshot
of the file instead of reading it twice.

* [client] Return the written content from the resolv.conf update function

Pure refactor, no behavior change. The repair watcher needs to know what
NetBird wrote so it can tell its own write apart from a third party's.
Callers ignore the content for now.

* [client] Keep the resolv.conf watch armed while repairing

In file mode the repair watcher removed its inotify watch, rewrote
resolv.conf and re-added the watch, without looking at the file again.
A second third-party write landing in that window raised no event, so
the file stayed on the upstream resolver until something else touched
it. systemd-resolved with the stub listener off, the Amazon Linux 2023
default, writes the file twice in a row on restart and does not rewrite
it on an unchanged DHCP renewal, so the host stayed off NetBird DNS
while the client reported connected.

The watch now stays armed during the repair. NetBird's own write is
recognized by comparing the file with the content it wrote, which also
covers a write whose search list was truncated to the resolv.conf
limits and would otherwise fail the parameter check forever. The
watcher checks the file once when it is armed, since a change made
before that produced no event.

* [client] Consume inotify errors in the resolv.conf watcher

fsnotify blocks its reader until an error is received. The watcher
never read the Errors channel, so a single error, such as an event
queue overflow, stopped all further events and silently disabled the
repair. The watcher now consumes errors and checks the file, since an
overflow means events were dropped.

* [client] Parse resolv.conf one line at a time

Pure refactor, no behavior change. The per-line handling moves into
parseResolvConfLine, which keeps parseResolvConf under the cognitive
complexity limit.

* [client] Drop the comment restating parseResolvConfLine
2026-10-20 13:35:15 +02:00
Bethuel Mmbaga 1f70970792 [management] Mask credentials in logged URLs (#8250) 2026-10-20 13:33:46 +03:00
Alireza Heydari 30ea8270d6 [client] Fix grammatical error in post-install message (#8242) 2026-10-20 11:18:41 +02:00
Riccardo Manfrin 6989d689cf [misc] Announce tag-pushed releases on the forum (#8265)
* [misc] Announce tag-pushed releases on the forum

Since 0.77 a release is cut by pushing a tag, and goreleaser creates the
GitHub release with GITHUB_TOKEN. Events raised by that token start no
workflow, so the release:published trigger never fires for them and
0.78.0, 0.79.0, 0.80.0, 0.81.0 and 0.81.3 got no forum topic, while
releases published from the UI still did.

Post from the completion of the Release workflow instead, for tag runs
that succeeded and whose release was created by the bot. Release
candidates stay off the forum, and an existing topic with the same title
is left alone so re-running a green Release run does not post twice.

* [misc] Point an empty forum post at the release notes

goreleaser creates the release with an empty body and the notes are
written on the release page afterwards, so the topic would otherwise
hold only its title link. Say where the notes and downloads are.

* [misc] Fail closed in the forum post lookups

Announce stable tags only: every pre-release tag carries a hyphen, so
canaries and release candidates pushed as tags stay off the forum.

A failed release lookup now fails the step instead of passing as "no
release"; only a 404 skips. The duplicate check searches by title rather
than reading the first page of the category, and a failed search stops
the step instead of falling through to a post. Discourse requests
refuse any non-HTTPS redirect and retry transient errors.
2026-10-20 10:42:34 +02:00
dmitri-netbird 8fef487e42 [management] Add support for pagination in GetAllPeers call (#8190)
* use libopenapi OpenAPI generator

Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io>

* added a handler for v1alpha1/peers

Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io>

* wire up request validator

Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io>

* wired up spec-based validation

Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io>

* use sync validation; set base url to v1alpha1

Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io>

* moved stuff around, extracted runtime libopenapu deps into runtime_tooling

Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io>

* testing /peers path params

Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io>

* fixed tests

Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io>

* added user schemas and paths

Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io>

* use api validation in tests

Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io>

* post-merge fixes

Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io>

* deleted tmp command used to test validator integration

Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io>

* require request body in post/put requests in order to force validation

Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io>

* making linter happy

Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io>

* switch to api/v1alpha1

Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io>

* go mod tidy

Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io>

* keep the original order of middleware: metrics, cors, then auth

Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io>

* return 422 on validation errors

Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io>

* cleanups

Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io>

* more cleanups

Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io>

* v1alpha1 spec cleanups

Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io>

* no need for a double-pointer

Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io>

* more linter fixes

Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io>

* removed more double pointers

Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io>

* use di to inject api_v0 and api_v1 http routers

Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io>

* do not re-add middleware on repeated call to ApiHandler

Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io>

* support for pagination and filtering in /peers call

Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io>

* calling ApiRouter() now also calls ApiV1Router()

Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io>

* adding peer filters

Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io>

* introduced paginated GetAllPeers call

Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io>

* wire up pagination

Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io>

* convert pagination state to query scope

Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io>

* peer filter wip

Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io>

* implemented peer filter

Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io>

* test for filtering by os

Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io>

* support for sorting of peers

Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io>

* support for ordering + tests

Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io>

* more tests

Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io>

* wire up total number of records in paginated GetAllPeers call

Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io>

* cleaned up GetAllPeers response

Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io>

* pacify linter

Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io>

* cleanups and fixes

Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io>

* moar cleanups

Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io>

* pacify linter

Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io>

* remove duplicated test

Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io>

* make linter happy

Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io>

* moving GetAllPeersPaginated to peer manager, p. 1

Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io>

* moving GetAllPeersPaginated to peer manager, p. 2

Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io>

* added peer manager tests for GetPeersPaginated

Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io>

* order peers in GetAccountPeersPaginated by their ids by default

Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io>

* always order by peer_id, filter out proxies

Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io>

* fixed broken tests

Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io>

* support for filtering of peers by peer_id in GetAllPeers()

Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io>

* filtering by peer_ids

Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io>

* use lowercase in 'like' queries, drop ordering by ip

Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io>

* drop sort_by ip key

Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io>

* drop forced_approve filter

Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io>

* replace mac with darwin in peer os filter

Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io>

* fix peers query parameter: use peer_ids

Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io>

* fixed broken peer_test

Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io>

* responded to feedback

Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io>

---------

Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io>
2026-10-19 22:19:39 +02:00
Maycon Santos 36fe467aba [client] Avoid Signal reconnect listener shutdown deadlock (#8257)
* [client] Reproduce Signal reconnect listener shutdown deadlock

* [client] Invoke Signal reconnect listeners outside the client mutex

Capture the listener with the registration state, then release the mutex before calling it. Watcher shutdown can now unregister a listener while an in-flight callback waits for the watcher lock.

Keep callback invocation synchronous and document that unregistration does not drain an already captured callback. Record callback completion inside the regression test's external lock.
2026-10-19 18:47:25 +02:00
Edward 0bb9854704 [client] Add Hebrew to the language picker (#8102)
The Hebrew translation is complete and synced from Crowdin, and RTL
layout support is in, so list it in _index.json.
2026-10-19 16:39:17 +02:00
6e1065882a New Crowdin updates (#8101)
* New translations common.json (French)

[ci skip]

* New translations common.json (Spanish)

[ci skip]

* New translations common.json (German)

[ci skip]

* New translations common.json (Hebrew)

[ci skip]

* New translations common.json (Hungarian)

[ci skip]

* New translations common.json (Italian)

[ci skip]

* New translations common.json (Japanese)

[ci skip]

* New translations common.json (Russian)

[ci skip]

* New translations common.json (Ukrainian)

[ci skip]

* New translations common.json (Chinese Simplified)

[ci skip]

* New translations common.json (Portuguese, Brazilian)

[ci skip]

* New translations common.json (Galician)

[ci skip]

* Update client/ui/i18n/locales/he/common.json

Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>

* New translations common.json (French)

[ci skip]

* New translations common.json (Spanish)

[ci skip]

* New translations common.json (German)

[ci skip]

* New translations common.json (Hebrew)

[ci skip]

* New translations common.json (Hungarian)

[ci skip]

* New translations common.json (Italian)

[ci skip]

* New translations common.json (Japanese)

[ci skip]

* New translations common.json (Russian)

[ci skip]

* New translations common.json (Ukrainian)

[ci skip]

* New translations common.json (Chinese Simplified)

[ci skip]

* New translations common.json (Portuguese, Brazilian)

[ci skip]

* New translations common.json (Galician)

[ci skip]

---------

Co-authored-by: Edward <43848523+thomashacker@users.noreply.github.com>
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
2026-10-19 16:24:07 +02:00
Viktor Liu b1f4efb160 [client] Fix errcheck findings from the latest golangci-lint (#8251) 2026-10-19 22:16:59 +09:00
Riccardo Manfrin f8f335720d [client,relay] Bump quic-go to v0.64.0 (#8249) 2026-10-19 14:08:15 +02:00
EdwardandDevBot NetBird 279adb8fdd [management] Return the reason when custom domain validation fails (#8122)
* [management] Return the reason when custom domain validation fails

The validate endpoint returned an empty 202 and ran the check in a
goroutine, so a failed verification only reached the management log.
Run the check in the request and return 204 or 412 with a classified
reason. Resolver errors are not forwarded.

* [management] Address review feedback on custom domain validation

Pass the request context to the lookup and store calls now that the
check runs in the request, compare the self-resolved name
case-insensitively, document the 412 like the other entries, and
check the returned error in the existing tests.

* [management] Match custom domain CNAME targets case-insensitively

DNS names are case-insensitive, so a CNAME pointing at the cluster in
different casing should validate instead of failing as a mismatch.

* [management] Add validation timeout

---------

Co-authored-by: DevBot NetBird <91386968+netbirddev@users.noreply.github.com>
2026-10-19 13:58:14 +02:00
Zoltan Papp cf01711971 [client] Bump wireguard-go to bd0cb75a3df0 (#8229)
StdNetBind.Send reused pooled *net.UDPAddr objects and copied the
destination into ua.IP before resizing the slice. After an IPv4 send the
slice was 4 bytes long, so the next IPv6 send copied only 4 bytes and
extended the slice with stale data, misdirecting datagrams to a truncated
or foreign IPv6 address. Userspace clients with both IPv4 and IPv6 P2P
peers saw intermittent loss and restarting handshakes.

The fork now carries the upstream fix (WireGuard/wireguard-go#135,
netbirdio/wireguard-go#24). Pick it up.
2026-10-16 20:52:43 +02:00
Theodor S. Midtlien 69ecec2161 Fix ui merge bug 2026-10-16 18:39:47 +02:00
Theodor S. Midtlien 1bca20bed5 Fix merge bug 2026-10-16 18:24:14 +02:00
Theodor S. Midtlien 9f5f118a32 Merge branch 'main' into profile-ownership 2026-10-16 17:51:02 +02:00
Theodor S. Midtlien 62fbca147b Merge branch 'main' into profile-ownership 2026-10-16 05:04:49 +02:00
Zoltan Papp 28657607c1 [client] Keep interface discovery out of the bind open path (#8226)
* [client] Keep interface discovery out of the bind open path

Since 0.81.0 a userspace-mode agent whose interface name is not covered
by the interface blacklist deadlocks while bringing the device up, and
the daemon, the GUI and the service stop all hang. wireguard-go holds
the device net lock across bind.Open, our bind builds the UDP mux there,
the mux enumerated interfaces in its constructor, and the interface
filter probed every unlisted name through wgctrl. For the agent's own
interface that probe connected to the daemon's own UAPI endpoint and
waited, with no deadline, for a reply the handler could only give after
taking the same lock. #7346 moved the first enumeration from the stdnet
constructor, which ran before the device existed, to this call site.

The mux no longer discovers interfaces when it is constructed. It
records whether its socket is bound to an unspecified address and
GetConn uses that instead of the length of the discovered list, while
GetListenAddresses keeps refreshing on demand, which pion calls during
candidate gathering outside the device locks. The WireGuard detector
also answers for the agent's own interface without probing, so no
filter asks the daemon about itself.

* [client] Take the agent's own interface name in the detector constructor

Every device implementation reports the configured name, so there is no
later name to follow and the setter was state without a reader that
needed it. The detector takes the name once and compares without a lock.

* [client] Create the default mux Net in the constructor

With discovery moved to GetListenAddresses, the nil Net fallback ran
there as well, and the first concurrent callers raced on writing it.
stdnet.NewNet does no discovery, so the constructor can create it before
the mux is shared and the address refresh only reads it.

* [client] Follow the created interface name in the detector

Android ignores the configured interface name and keeps the TUN name
returned by CreateUnmonitoredTUNFromFD, so the detector built from the
configuration would still probe the agent's real interface. The engine
updates the detector with wgInterface.Name() once the interface exists.

* [client] Keep the detector's own interface name immutable

On Android the kernel names the TUN and the name can change again on
renew, while the UAPI socket cannot be opened there at all, so neither
the probe nor a name set after creation can identify the agent's own
interface reliably. Excluding that interface on Android belongs to the
interface discovery the app provides. Everywhere else the configured
name is the created name, so the constructor argument is enough and the
detector needs no setter and no lock on the hot path.
v0.81.1
2026-10-16 02:16:45 +02:00
Pascal Fischer afd5c6df6a [management] fix proxy conn lifecycle during acks (#8220) 2026-10-15 16:27:36 +02:00
Pascal Fischer dd830f0890 [management] clean nul byte strings in peer meta (#8219) 2026-10-15 16:26:04 +02:00
Pascal Fischer 89c1b47e9c [management] cancel peer expiration for account if account is gone (#8218) 2026-10-15 16:23:29 +02:00