-
-
Notifications
You must be signed in to change notification settings - Fork 940
[management] check and log on new management version #4029
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
run the check every 30 minutes and logs on new NetBird version
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
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
httpAgentstring to set the User-Agent header. fetchVersionbuilds a custom HTTP request (instead ofhttp.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
httpAgentconstant.
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| version/update.go | Added httpAgent field, updated NewUpdate signature, set header in fetchVersion. |
| version/update_test.go | Introduced httpAgent constant and passed it to NewUpdate in tests. |
| management/cmd/management.go | Passed "nb/management" agent and set update listener. |
| client/ui/client_ui.go | Passed "nb/client-ui" agent when creating the update checker. |
Comments suppressed due to low confidence (2)
version/update.go:37
- Update the comment to describe the new
httpAgentparameter, e.g.,// NewUpdate instantiates Update with a custom User-Agent and starts the fetcher.
// NewUpdate instantiate Update and start to fetch the new version information
version/update_test.go:16
- Add an assertion in the test handler to verify
r.Header.Get("User-Agent") == httpAgentso the custom header behavior is covered by tests.
svr := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
…false_enginerestarts * upstream/main: (228 commits) [management] add breakdown of network map calculation metrics (netbirdio#4020) [client] Don't open cmd.exe during MSI actions (netbirdio#4041) [misc] Specify netbird binary location in Dockerfiles (netbirdio#4024) [management] check and log on new management version (netbirdio#4029) [misc] add additional metrics (netbirdio#4028) [client] close windows when process needs to exit (netbirdio#4027) [client] Refactor showLoginURL to improve error handling and connection status checks (netbirdio#4026) [client] Handle lazy routing peers that are part of HA groups (netbirdio#3943) [management] add transaction for integrated validator groups update and primary account update (netbirdio#4014) [management] export ephemeral peer flag on api (netbirdio#4004) [management] Add backward compatibility for older clients without firewall rules port range support (netbirdio#4003) [client] Fix port range squashing (netbirdio#4007) [client] Add more Android advanced settings (netbirdio#4001) Fix route notification [management] Refactor routes to use store methods (netbirdio#2928) [client] fix connection state handling (netbirdio#3995) [client] Fix logic in updateStatus to correctly handle connection state (netbirdio#3994) [management] Avoid recalculating next peer expiration (netbirdio#3991) [client] Fix DNS Interceptor Build Error (netbirdio#3993) [client] Tighten allowed domains for dns forwarder (netbirdio#3978) ...
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



Describe your changes
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.
httpAgentstring to set the User-Agent header.fetchVersionbuilds a custom HTTP request (instead ofhttp.Get) and sets the User-Agent."nb/management"and"nb/client-ui"respectively to NewUpdate.httpAgentconstant.Issue ticket number and link
Stack
Checklist