netbirdio / netbird

Connect your devices into a secure WireGuard®-based overlay network with SSO, MFA and granular access controls.
https://netbird.io
BSD 3-Clause "New" or "Revised" License
11.3k stars 518 forks source link

Packaging for more distros / inits? #363

Open endigma opened 2 years ago

endigma commented 2 years ago

Starting to build automated packages for more of the distros in the world would be great, perhaps starting with some of the popular non-debian ones?

Alpine Linux Artix/Arch Void Linux NixOS Solus

I'm sure given its Go there's a template pkgfile for each of these available if someone were to attempt automating it.

endigma commented 2 years ago

This could also involve writing rudimentary service files for openrc/runit/s6/etc

mlsmaycon commented 2 years ago

Hello @endigma, thanks for your suggestion. We will have a look at it, we consider building the package for Alpine and Arch already, we will need a repository to host them, this might be the only blocker.

If you already have any documentation or guides of the package managers of the distros you've proposed will be highly appreciated.

endigma commented 2 years ago

Official repositories should do for most distros. If you the first party are committed to maintaining the package and it doesn't have any dependencies I don't foresee you having much of a problem getting updates merged.

As an alternative with less upfront effort you could look into providing consistent versioned artifacts which would make 3rd party packages very simple. Scripts for other inits would also be fairly trivial to include in a doc/ folder or etc.

endigma commented 2 years ago

Void Linux

https://github.com/void-linux/void-packages/blob/master/Manual.md

Alpine Linux

https://wiki.alpinelinux.org/wiki/Creating_an_Alpine_package

Arch Linux

https://wiki.archlinux.org/title/creating_packages

NixOS

https://nixos.wiki/wiki/Go

Solus

https://getsol.us/articles/packaging/

endigma commented 2 years ago

If you're intent on hosting the repos yourself, I know for a fact void repos at least are trivial to self-host, but not really integrated into the package manager. Alpine should be similar. Not sure about Arch or Solus, NixOS shouldn't even require a repo.

mlsmaycon commented 2 years ago

Thank you @endigma we will have a look and get back to you soon.

hg commented 2 years ago

Consider using Open Build Service instead of reimplementing the wheel. (the code block is to avoid unnecessary linking)

https://github.com/tonarino/innernet/issues/203#issuecomment-1172847002
endigma commented 2 years ago

OBS is great until you realize in reality it only supports:

Which although technically covered by AppImage leaves off:

and a lot more, also any BSD

If you don't have the manpower to handle this, non-lock-in solutions like jordansissel/fpm exist, which is somewhat extensible to produce packages for "unsupported" distros.

mlsmaycon commented 2 years ago

hello @endigma and @hg, thanks for your suggestions.

I've checked all the guides and descriptions on how to create the packages. Unfortunately, the project only has 2 maintainers with an extensive roadmap, and we can't move this forward request without community help.

I've tested the binary installation and it worked well with 3/5 of the distros above:

For Void and NixOS, we had a few issues:

With that being said, as we progress with the project and onboard more people we will review this request again in the following quarters.

mlsmaycon commented 2 years ago

This is an example of init file for Void: Create a sv directory:

mkdir /etc/sv/netbird

Add a run file:

vi /etc/sv/netbird/run
# contents
#!/bin/sh
[ -r conf ] && . ./conf
exec netbird service run --log-level info 1>&2

link the file to /var/services

ln -s /etc/sv/netbird /var/service/
hg commented 2 years ago

@mlsmaycon personally I wouldn't expect you to support anything but a couple of the most popular distributions. Even major corporations rarely care about anything besides Ubuntu and RHEL.

OBS is great until you realize in reality it only supports …

… probably 99% of Linux installations out there. The remaining ones mostly cater to enthusiasts who can write their own packages. I really don't think it's reasonable to expect support for Void, Solus, and Clear Linux from a small startup. I don't believe I've ever seen anyone shipping packages for them now that I think of it (or binary packages for any of the BSDs for that matter — you're typically expected to use ports).

Alpine is pretty popular, but it's also frequently updated (and you can easily install 'backports' from the Edge repo, which is perfectly safe for statically linked binaries in my experience).

Note that OBS supports more than they officially claim, although quality may vary (it may not work on less popular architectures). For example, here are projects for cross-compilation onto Windows:

I'll throw together an OBS repo in the next few days, and we'll see how well it performs. If it works out badly, at least that's one dead end crossed out.

misuzu commented 2 years ago

I can help getting netbird to NixOS repository.

EDIT: see https://github.com/NixOS/nixpkgs/pull/186669

mlsmaycon commented 2 years ago

awesome, thanks @misuzu for your contribution.

Tennyleaz commented 2 years ago

Great if it also support BSD based firewall OS, like OPNSense? I would love to use it at an gateway.

FireMasterK commented 2 years ago

Created an issue in Alpine Linux's aports at https://gitlab.alpinelinux.org/alpine/aports/-/issues/14248

FReichelt commented 8 months ago

Is there any update on the BSD support?

xromansx commented 7 months ago

I agree BSD wuld be nice to have Opnsense, Pfsense would be perfect for this especially they all support wireguard now.

mimi0000oo commented 4 months ago

OPNSense support would be great!

nttranbao commented 3 months ago

Please support OpenSense/BSD. Thanks

yakaviuk commented 2 months ago

Hi, As for now it is any recommended solution how to install netbird client (not server) on ArchLinux (only CLI, without GUI; Linux archlinux 6.10.10-arch1-1 )? I tried yay and building using makepkg -si but got a lot of errors.

Thanks in advance

mimi0000oo commented 2 months ago

Hi, As for now it is any recommended solution how to install netbird client (not server) on ArchLinux (only CLI, without GUI; Linux archlinux 6.10.10-arch1-1 )? I tried yay and building using makepkg -si but got a lot of errors.

Thanks in advance

I have netbird installed on arch linux for some time now (cli and gui). I know pacman had an update a few days ago that broke yay stable, but i managed to install yay-git and the problem was fixed. Maybe that or some other pacman problem