[PR #1586] [MERGED] unify Config generation, loading and updating #13988

Open
opened 2026-08-05 02:09:18 -04:00 by saavagebueno · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbirdio/netbird/pull/1586
Author: @nazarewk
Created: 2/15/2024
Status: Merged
Merged: 5/8/2024
Merged by: @mlsmaycon

Base: mainHead: fixups


📝 Commits (4)

  • 62f6c77 config.go: pull unified Config.apply() out of createNewConfig() and update()
  • 41d0374 Merge branch 'main' into fixups
  • f215d1b add network monitor config update
  • 48a445a fix nat external IPs check

📊 Changes

1 file changed (+131 additions, -123 deletions)

View changed files

📝 client/internal/config.go (+131 -123)

📄 Description

Describe your changes

There are 2 primary changes:

  • (misc) allows passing custom system service name (helps https://github.com/NixOS/nixpkgs/pull/287236 )
  • unifies configuration loading and updating into a single Config.apply(ConfigInput):
    • has better logging (informs of everything it does)
    • accepts both empty Config{} and empty InputConfig{} filling in missing parts automatically
    • handling was slightly inconsistent between createNewConfig() and update()
    • added InterfaceBlacklist to the InputConfig

Basically when I tried to start the netbird service run with just WgIface and WgPort present in config.json it crashed, so I got to fixing stuff :)

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/1586 **Author:** [@nazarewk](https://github.com/nazarewk) **Created:** 2/15/2024 **Status:** ✅ Merged **Merged:** 5/8/2024 **Merged by:** [@mlsmaycon](https://github.com/mlsmaycon) **Base:** `main` ← **Head:** `fixups` --- ### 📝 Commits (4) - [`62f6c77`](https://github.com/netbirdio/netbird/commit/62f6c7706fb8e6417d5bd213bbe6966720dac7cb) config.go: pull unified Config.apply() out of createNewConfig() and update() - [`41d0374`](https://github.com/netbirdio/netbird/commit/41d03744653a2633949232d28c5135860d2b35e2) Merge branch 'main' into fixups - [`f215d1b`](https://github.com/netbirdio/netbird/commit/f215d1bad45b2b1b05d89e4747be14cc149cf0d1) add network monitor config update - [`48a445a`](https://github.com/netbirdio/netbird/commit/48a445a8866d93551954f7d589896529687ff03f) fix nat external IPs check ### 📊 Changes **1 file changed** (+131 additions, -123 deletions) <details> <summary>View changed files</summary> 📝 `client/internal/config.go` (+131 -123) </details> ### 📄 Description ## Describe your changes There are 2 primary changes: - (misc) allows passing custom system service name (helps https://github.com/NixOS/nixpkgs/pull/287236 ) - unifies configuration loading and updating into a single `Config.apply(ConfigInput)`: - has better logging (informs of everything it does) - accepts both empty `Config{}` and empty `InputConfig{}` filling in missing parts automatically - handling was slightly inconsistent between `createNewConfig()` and `update()` - added `InterfaceBlacklist` to the `InputConfig` Basically when I tried to start the `netbird service run` with just `WgIface` and `WgPort` present in `config.json` it crashed, so I got to fixing stuff :) ## Issue ticket number and link - partially addresses #1562 by making incomplete configs acceptable (currently it segfaults on missing pointers/values) - to be used in https://github.com/NixOS/nixpkgs/pull/287236 ### Checklist - [x] Is it a bug fix - [ ] Is a typo/documentation fix - [x] Is a feature enhancement - [x] 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:09:18 -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#13988