Skip to content

Comments

feat: add NetBird VPN support#759

Open
AndrewMoryakov wants to merge 1 commit intosipeed:mainfrom
AndrewMoryakov:feature/netbird-official
Open

feat: add NetBird VPN support#759
AndrewMoryakov wants to merge 1 commit intosipeed:mainfrom
AndrewMoryakov:feature/netbird-official

Conversation

@AndrewMoryakov
Copy link

Summary

  • Add NetBird as a second VPN option alongside Tailscale, using the official NetBird cloud server
  • VPN autostart mutual exclusion via /etc/kvm/vpn preference file — only one VPN runs at a time (NanoKVM Cube has 161MB RAM)
  • Autostart toggle added to both Tailscale and NetBird headers
  • Init script updates: swap setup, GOMEMLIMIT, OOM protection for NanoKVM-Server

Details

Backend:

  • server/service/extensions/netbird/ — CLI wrapper, bundled binary install, service handlers
  • server/service/extensions/vpn/ — VPN preference get/set with automatic stop-old/start-new
  • server/proto/netbird.go + vpn.go — request/response types
  • Routes: install, uninstall, status, login, down, start, stop, restart + VPN preference

Frontend:

  • NetBird settings tab mirroring Tailscale's state machine: Install → Run → Login → Device
  • Device flow login: Login button → URL opens in new tab → "I have logged in" confirmation
  • Device panel: enable/disable switch, device name, IP, version, disconnect button
  • Autostart switch on both Tailscale and NetBird headers with confirmation dialog

Init scripts:

  • S99netbird — TUN device setup, GOMEMLIMIT=30MiB, PID management
  • S95nanokvm — reads /etc/kvm/vpn, starts only selected VPN, swap setup, OOM protection

Test plan

  • Install NetBird from Settings → NetBird tab
  • Complete device flow login with official NetBird server
  • Verify device info (name, IP, version) displays correctly
  • Toggle enable/disable switch on device panel
  • Disconnect and reconnect
  • Toggle autostart between Tailscale and NetBird — verify only one runs
  • Reboot NanoKVM — verify correct VPN starts based on preference
  • Uninstall NetBird
  • Verify Tailscale still works normally with autostart toggle

Add NetBird as a second VPN option alongside Tailscale, using the
official NetBird cloud server. Only one VPN runs at a time due to
NanoKVM Cube's 161MB RAM constraint.

Backend:
- NetBird service with install/uninstall/start/stop/restart/login/down
- CLI wrapper with socket-based daemon communication and timeout handling
- Bundled binary installation with version tracking
- VPN preference service (/etc/kvm/vpn) for mutual exclusion

Frontend:
- NetBird settings tab mirroring Tailscale's state machine UI
- Autostart toggle on both Tailscale and NetBird headers
- Device flow login: Login button -> URL -> "I have logged in"
- Device panel with enable switch, info rows, disconnect button

Init scripts:
- S99netbird init script with TUN device setup and GOMEMLIMIT=30MiB
- S95nanokvm reads /etc/kvm/vpn preference, starts only selected VPN
- Swap setup and OOM protection for NanoKVM-Server process
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant