Commit Graph

906 Commits

Author SHA1 Message Date
Viktor Liu
cdded8c22e Merge branch 'main' into ssh-rewrite 2025-07-11 22:05:12 +02:00
Viktor Liu
a7ea881900 [client] Add rotated logs flag for debug bundle generation (#4100) 2025-07-10 16:13:53 +02:00
Zoltan Papp
e3b40ba694 Update cli description of lazy connection (#4133) 2025-07-10 15:00:58 +02:00
Zoltan Papp
e59d75d56a Nil check in iface configurer (#4132) 2025-07-10 14:24:20 +02:00
Zoltan Papp
408f423adc [client] Disable pidfd check on Android 11 and below (#4127)
Disable pidfd check on Android 11 and below

On Android 11 (SDK <= 30) and earlier, pidfd-related system calls
are blocked by seccomp policies, causing SIGSYS crashes.

This change overrides `checkPidfdOnce` to return an error on
affected versions, preventing the use of unsupported pidfd features.
2025-07-09 22:16:08 +02:00
Zoltan Papp
8942c40fde [client] Fix nil pointer exception in lazy connection (#4109)
Remove unused variable
2025-07-06 15:13:14 +02:00
Zoltan Papp
fbb1b55beb [client] refactor lazy detection (#4050)
This PR introduces a new inactivity package responsible for monitoring peer activity and notifying when peers become inactive.
Introduces a new Signal message type to close the peer connection after the idle timeout is reached.
Periodically checks the last activity of registered peers via a Bind interface.
Notifies via a channel when peers exceed a configurable inactivity threshold.
Default settings
DefaultInactivityThreshold is set to 15 minutes, with a minimum allowed threshold of 1 minute.

Limitations
This inactivity check does not support kernel WireGuard integration. In kernel–user space communication, the user space side will always be responsible for closing the connection.
2025-07-04 19:52:27 +02:00
Viktor Liu
e4e0b8fff9 Remove empty file 2025-07-04 17:09:54 +02:00
Viktor Liu
a4b067553d Merge branch 'main' into ssh-rewrite 2025-07-04 16:53:54 +02:00
Viktor Liu
77ec32dd6f [client] Implement dns routes for Android (#3989) 2025-07-04 16:43:11 +02:00
Maycon Santos
c4ed11d447 [client] Avoid logging setup keys on error message (#3962) 2025-07-03 16:22:18 +02:00
Viktor Liu
088956645f Fix username validation and skip ci tests properly 2025-07-03 15:36:42 +02:00
Viktor Liu
aa30b7afe8 More windows tests 2025-07-03 14:11:20 +02:00
Viktor Liu
f1bb4d2ac3 Fix more Windows tests 2025-07-03 13:35:53 +02:00
Viktor Liu
982841e25b Test up tests users if none are available on CI 2025-07-03 12:33:31 +02:00
Viktor Liu
a476b8d12f Fix more windows tests 2025-07-03 11:26:04 +02:00
Viktor Liu
a21f924b26 Fix some windows tests 2025-07-03 10:20:16 +02:00
Viktor Liu
9e51d2e8fb Fix lint and sonar 2025-07-03 09:58:25 +02:00
Viktor Liu
9afbecb7ac [client] Use unique sequence numbers for bsd routes (#4081)
updates the route manager on Unix to use a unique, incrementing sequence number for each route message instead of a fixed value.

Replace the static Seq: 1 with a call to r.getSeq()
Add an atomic seq field and the getSeq method in SysOps
2025-07-03 09:02:53 +02:00
Viktor Liu
3e490d974c Remove duplicated code 2025-07-03 03:40:27 +02:00
Viktor Liu
04bb314426 Allow sftp same user switching on windows 2025-07-03 02:19:12 +02:00
Viktor Liu
6e15882c11 Fix tests and windows username validation 2025-07-03 01:58:15 +02:00
Viktor Liu
76f9e11b29 Fix tests 2025-07-03 01:07:58 +02:00
Viktor Liu
612de2c784 Remove socketfilter temporarily 2025-07-02 22:00:10 +02:00
Viktor Liu
1fdde66c31 More lint 2025-07-02 21:55:25 +02:00
Viktor Liu
5970591d24 Fix lint 2025-07-02 21:32:39 +02:00
Viktor Liu
0d5408baec Fix lint 2025-07-02 21:04:58 +02:00
Viktor Liu
96084e3a02 Reduce complexity 2025-07-02 20:43:17 +02:00
Viktor Liu
4bbca28eb6 Fix lint 2025-07-02 20:23:23 +02:00
Viktor Liu
9d1554f9f7 Complete overhaul 2025-07-02 19:35:19 +02:00
Viktor Liu
f56075ca15 Tidy mod 2025-07-02 19:34:36 +02:00
Viktor Liu
6ed846ae29 Refactor ssh server and client 2025-07-02 19:34:36 +02:00
Viktor Liu
520f2cfdb4 Remove implicit inbound ssh firewall rules and change default port 2025-07-02 19:34:32 +02:00
Viktor Liu
0f79a8942d Fix route notificaiton 2025-07-02 17:24:14 +02:00
Viktor Liu
5299e9fda3 Merge branch 'main' into android-dns-routes 2025-07-02 15:23:14 +02:00
Carlos Hernandez
6922826919 [client] Support fullstatus without probes (#4052) 2025-07-02 10:42:47 +02:00
Maycon Santos
56a1a75e3f [client] Support random wireguard port on client (#4085)
Adds support for using a random available WireGuard port when the user specifies port `0`.

- Updates `freePort` logic to bind to the requested port (including `0`) without falling back to the default.
- Removes default port assignment in the configuration path, allowing `0` to propagate.
- Adjusts tests to handle dynamically assigned ports when using `0`.
2025-07-02 09:01:02 +02:00
Ali Amer
d9402168ad [management] Add option to disable default all-to-all policy (#3970)
This PR introduces a new configuration option `DisableDefaultPolicy` that prevents the creation of the default all-to-all policy when new accounts are created. This is useful for automation scenarios where explicit policies are preferred.
### Key Changes:
- Added DisableDefaultPolicy flag to the management server config
- Modified account creation logic to respect this flag
- Updated all test cases to explicitly pass the flag (defaulting to false to maintain backward compatibility)
- Propagated the flag through the account manager initialization chain

### Testing:

- Verified default behavior remains unchanged when flag is false
- Confirmed no default policy is created when flag is true
- All existing tests pass with the new parameter
2025-07-02 02:41:59 +02:00
Maycon Santos
6ce8643368 [client] Run login popup on goroutine (#4080) 2025-07-01 13:45:55 +02:00
Krzysztof Nazarewski (kdn)
c1c71b6d39 [client] improve adding route log message (#4034)
from:
  Adding route to 1.2.3.4/32 via invalid IP @ 10 (wt0)
to:
  Adding route to 1.2.3.4/32 via no-ip @ 10 (wt0)
2025-06-30 11:57:42 +02:00
Viktor Liu
11bdf5b3a5 Use r 2025-06-26 15:41:56 +02:00
Viktor Liu
5fc95d4a0c Display domains properly 2025-06-26 15:36:14 +02:00
Viktor Liu
c7884039b8 Revert "Fix errorf"
This reverts commit 26fc32f1be.
2025-06-25 15:17:31 +02:00
Viktor Liu
26fc32f1be Fix errorf 2025-06-25 15:03:55 +02:00
Viktor Liu
d897365abc [client] Don't open cmd.exe during MSI actions (#4041) 2025-06-24 21:32:37 +02:00
Viktor Liu
f37aa2cc9d [misc] Specify netbird binary location in Dockerfiles (#4024) 2025-06-23 10:09:02 +02:00
Maycon Santos
5343bee7b2 [management] check and log on new management version (#4029)
This PR enhances the version checker to send a custom User-Agent header when polling for updates, and configures both the management CLI and client UI to use distinct agents. 

- NewUpdate now takes an `httpAgent` string to set the User-Agent header.
- `fetchVersion` builds a custom HTTP request (instead of `http.Get`) and sets the User-Agent.
- Management CLI and client UI now pass `"nb/management"` and `"nb/client-ui"` respectively to NewUpdate.
- Tests updated to supply an `httpAgent` constant.
- Logs if there is a new version available for management
2025-06-22 16:44:33 +02:00
Maycon Santos
08e9b05d51 [client] close windows when process needs to exit (#4027)
This PR fixes a bug by ensuring that the advanced settings and re-authentication windows are closed appropriately when the main GUI process exits.

- Updated runSelfCommand calls throughout the UI to pass a context parameter.
- Modified runSelfCommand’s signature and its internal command invocation to use exec.CommandContext for proper cancellation handling.
2025-06-22 10:33:04 +02:00
hakansa
3581648071 [client] Refactor showLoginURL to improve error handling and connection status checks (#4026)
This PR refactors showLoginURL to improve error handling and connection status checks by delaying the login fetch until user interaction and closing the pop-up if already connected.

- Moved s.login(false) call into the click handler to defer network I/O.
- Added a conn.Status check after opening the URL to skip reconnection if already connected.
- Enhanced error logs for missing verification URLs and service status failures.
2025-06-22 10:03:58 +02:00
Viktor Liu
2a51609436 [client] Handle lazy routing peers that are part of HA groups (#3943)
* Activate new lazy routing peers if the HA group is active
* Prevent lazy peers going to idle if HA group members are active (#3948)
2025-06-20 18:07:19 +02:00