[PR #674] [MERGED] Refactor Management and Admin URL config #12851

Closed
opened 2026-08-05 02:06:50 -04:00 by saavagebueno · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbirdio/netbird/pull/674
Author: @mlsmaycon
Created: 2/7/2023
Status: Merged
Merged: 2/7/2023
Merged by: @mlsmaycon

Base: mainHead: fix/service-url-overwrite


📝 Commits (1)

  • f5fadcb Refactor Management and Admin URL config

📊 Changes

9 files changed (+74 additions, -43 deletions)

View changed files

📝 client/cmd/login.go (+1 -1)
📝 client/cmd/root.go (+2 -2)
📝 client/cmd/service_controller.go (+1 -1)
📝 client/cmd/testutil.go (+2 -1)
📝 client/cmd/up.go (+1 -0)
📝 client/internal/config.go (+39 -25)
📝 client/internal/config_test.go (+20 -8)
📝 client/internal/connect.go (+6 -1)
📝 client/server/server.go (+2 -4)

📄 Description

Describe your changes

We had an issue where the daemon service was overwriting the admin URL every time it was restarted. With the changes, we are making the default admin URL a concern of the config logic.

I've also reduced the number of input parameters for the New function in the daemon logic as it is only called after the service is installed, which kind brake the need for it to receive such inputs.

Other changes:

  • Avoid sending admin or management URLs on service start as it doesn't have an input
  • Parse management and admin URL when needed
  • Pass empty admin URL on commands to prevent default overwrite

Checklist

  • Is it a bug fix
  • Is a typo/documentation fix
  • Is a feature enhancement
  • It is a refactor
  • Created tests that fail without the change (if possible)
  • Extended the README / documentation, if necessary

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netbirdio/netbird/pull/674 **Author:** [@mlsmaycon](https://github.com/mlsmaycon) **Created:** 2/7/2023 **Status:** ✅ Merged **Merged:** 2/7/2023 **Merged by:** [@mlsmaycon](https://github.com/mlsmaycon) **Base:** `main` ← **Head:** `fix/service-url-overwrite` --- ### 📝 Commits (1) - [`f5fadcb`](https://github.com/netbirdio/netbird/commit/f5fadcb763b4d1f20a777cae9141d505d6db8cc9) Refactor Management and Admin URL config ### 📊 Changes **9 files changed** (+74 additions, -43 deletions) <details> <summary>View changed files</summary> 📝 `client/cmd/login.go` (+1 -1) 📝 `client/cmd/root.go` (+2 -2) 📝 `client/cmd/service_controller.go` (+1 -1) 📝 `client/cmd/testutil.go` (+2 -1) 📝 `client/cmd/up.go` (+1 -0) 📝 `client/internal/config.go` (+39 -25) 📝 `client/internal/config_test.go` (+20 -8) 📝 `client/internal/connect.go` (+6 -1) 📝 `client/server/server.go` (+2 -4) </details> ### 📄 Description ## Describe your changes We had an issue where the daemon service was overwriting the admin URL every time it was restarted. With the changes, we are making the default admin URL a concern of the config logic. I've also reduced the number of input parameters for the New function in the daemon logic as it is only called after the service is installed, which kind brake the need for it to receive such inputs. Other changes: - Avoid sending admin or management URLs on service start as it doesn't have an input - Parse management and admin URL when needed - Pass empty admin URL on commands to prevent default overwrite ## Issue ticket number and link ### Checklist - [x] Is it a bug fix - [ ] Is a typo/documentation fix - [ ] Is a feature enhancement - [ ] It is a refactor - [ ] Created tests that fail without the change (if possible) - [ ] Extended the README / documentation, if necessary --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
saavagebueno added the pull-request label 2026-08-05 02:06:50 -04:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DYNR/netbird#12851