netbirdio / netbird

Connect your devices into a single secure private WireGuard®-based mesh network with SSO/MFA and simple access controls.
https://netbird.io
BSD 3-Clause "New" or "Revised" License
9.79k stars 424 forks source link

NB_{WIREGUARD_PORT,INTERFACE_NAME} is not supported by anything excepy `netbird up` #1562

Open nazarewk opened 4 months ago

nazarewk commented 4 months ago

Describe the problem

I am configuring wireguard interface/port using environment variables, but they do not get updated unless I run netbird up separately.

To Reproduce

Steps to reproduce the behavior:

  1. run netbird for the first time
  2. set Environment=NB_WIREGUARD_PORT=12345
  3. restart netbird.service
  4. netbird still runs on port 51820
  5. run netbird down
  6. run NB_WIREGUARD_PORT=12345 netbird up

Expected behavior

Netbrid starts on port 12345 with just systemd service change, not requiring separate down and up commands.

Are you using NetBird Cloud?

Yes

NetBird version

0.25.6

Additional context

Discovered while developing https://github.com/NixOS/nixpkgs/pull/287236

surik commented 4 months ago

The Current implementation doesn't cover service. We will need to extend this.

nazarewk commented 4 months ago

For more complete experience I think when netbird service run is configured with interface/port:

  1. it should have the highest priority
  2. should not be overridable by other tools at all
  3. should return errors/warning for other means of configuration netbird up / netbird-ui https://github.com/netbirdio/netbird/issues/1581