makes the DNS forwarder port configurable in the management and client components, while changing the well-known port from 5454 to 22054. The change includes version-aware port assignment to ensure backward compatibility.
- Adds a configurable `ForwarderPort` field to the DNS configuration protocol
- Implements version-based port computation that returns the new port (22054) only when all peers support version 0.59.0 or newer
- Updates the client to dynamically restart the DNS forwarder when the port changes
* integrate api
integrate api with stream and implement some client side
* fix typo and fix validation
* use real daemon address
* redo the connect via address
* Refactor the debug bundle generator to be ready to use from engine (#4469)
* fix tests
* fix lint
* fix bug with stream
* try refactor status 1
* fix convert fullStatus to statusOutput & add logFile
* fix tests
* fix tests
* fix not enough arguments in call to nbstatus.ConvertToStatusOutputOverview
* fix status_test
* fix(engine): avoid deadlock when stopping engine during debug bundle
* use atomic for lock-free
* use new lock
---------
Co-authored-by: Zoltan Papp <zoltan.pmail@gmail.com>
This PR improves the NetBird client's status checking mechanism by implementing earlier detection of client state changes and better handling of connection lifecycle management. The key improvements focus on:
• Enhanced status detection - Added waitForReady option to StatusRequest for improved client status handling
• Better connection management - Improved context handling for signal and management gRPC connections• Reduced connection timeouts - Increased gRPC dial timeout from 3 to 10 seconds for better reliability
• Cleaner error handling - Enhanced error propagation and context cancellation in retry loops
Key Changes
Core Status Improvements:
- Added waitForReady optional field to StatusRequest proto (daemon.proto:190)
- Enhanced status checking logic to detect client state changes earlier in the connection process
- Improved handling of client permanent exit scenarios from retry loops
Connection & Context Management:
- Fixed context cancellation in management and signal client retry mechanisms
- Added proper context propagation for Login operations
- Enhanced gRPC connection handling with better timeout management
Error Handling & Cleanup:
- Moved feedback channels to upper layers for better separation of concerns
- Improved error handling patterns throughout the client server implementation
- Fixed synchronization issues and removed debug logging
- Move `util/grpc` and `util/net` to `client` so `internal` packages can be accessed
- Add methods to return the next best interface after the NetBird interface.
- Use `IP_UNICAST_IF` sock opt to force the outgoing interface for the NetBird `net.Dialer` and `net.ListenerConfig` to avoid routing loops. The interface is picked by the new route lookup method.
- Some refactoring to avoid import cycles
- Old behavior is available through `NB_USE_LEGACY_ROUTING=true` env var
This PR adds user approval functionality to the management system, allowing administrators to manually approve new users joining via domain matching. When enabled, users are blocked with pending approval status until explicitly approved by an admin.
Adds UserApprovalRequired setting to control manual user approval requirement
Introduces user approval and rejection endpoints with corresponding business logic
Prevents pending approval users from adding peers or logging in
fix lint
clean up
fix MarkPendingJobsAsFailed
apply feedbacks 1
fix typo
change api and apply new schema
fix lint
fix api object
clean switch case
apply feedback 2
fix error handle in create job
get rid of any/interface type in job database
fix sonar issue
use RawJson for both parameters and results
running go mod tidy
update package
fix 1
update codegen
fix code-gen
fix snyk
fix snyk hopefully
* new bi-directional stream for jobs
* create bidirectional job channel to send requests from the server and receive responses from the client
* fix tests
* fix lint and close bug
* fix lint
* clean up & fix close of closed channel
* add nolint:staticcheck
* remove some redundant code from the job channel PR since this one is a cleaner rewrite
* cleanup removes a pending job safely
* change proto
* rename to jobRequest
* apply feedback 1
* apply feedback 2
* fix typo
* apply feedback 3
* apply last feedback