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

Open
opened 2025-11-20 08:05:09 -05:00 by saavagebueno · 0 comments
Owner

Original Pull Request: https://github.com/netbirdio/netbird/pull/1586

State: closed
Merged: Yes


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
**Original Pull Request:** https://github.com/netbirdio/netbird/pull/1586 **State:** closed **Merged:** Yes --- ## 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
saavagebueno added the pull-request label 2025-11-20 08:05:09 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: SVI/netbird#3163