Github messages for voidlinux
 help / color / mirror / Atom feed
From: Skirmisher <Skirmisher@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: [PR PATCH] [Updated] yggdrasil: add service changes from upstream systemd unit
Date: Mon, 27 Apr 2020 23:43:06 +0200	[thread overview]
Message-ID: <20200427214306.d1tQvBpzoC8GG1okMPcSxueq5UkJ158hjy1M1I-jLhU@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-19767@inbox.vuxu.org>

[-- Attachment #1: Type: text/plain, Size: 765 bytes --]

There is an updated pull request by Skirmisher against master on the void-packages repository

https://github.com/Skirmisher/void-packages upstream-master
https://github.com/void-linux/void-packages/pull/19767

yggdrasil: add service changes from upstream systemd unit
yggdrasil will fail to start if the `tun` kernel module is not loaded. Upstream modified their [service file](https://github.com/yggdrasil-network/yggdrasil-go/blob/4b16c325a3d90d97df208457bc35d499249f8146/contrib/systemd/yggdrasil.service) to first attempt to load the module before starting the service. They also opted to drop capabilities to CAP_NET_ADMIN and CAP_NET_RAW, which I saw fit to include.

A patch file from https://github.com/void-linux/void-packages/pull/19767.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-upstream-master-19767.patch --]
[-- Type: text/x-diff, Size: 4281 bytes --]

From 452e8396a06d99bce91fa1929b89ad9a3ba75cf5 Mon Sep 17 00:00:00 2001
From: Will Springer <skirmisher@protonmail.com>
Date: Wed, 4 Mar 2020 17:18:23 -0800
Subject: [PATCH 1/5] yggdrasil: attempt to load tun module in service

---
 srcpkgs/yggdrasil/files/yggdrasil/run | 1 +
 1 file changed, 1 insertion(+)

diff --git a/srcpkgs/yggdrasil/files/yggdrasil/run b/srcpkgs/yggdrasil/files/yggdrasil/run
index c383bafca9d..a6216cecf5b 100755
--- a/srcpkgs/yggdrasil/files/yggdrasil/run
+++ b/srcpkgs/yggdrasil/files/yggdrasil/run
@@ -1,4 +1,5 @@
 #!/bin/sh
+/usr/bin/modprobe tun
 if [ -f /etc/yggdrasil.conf ]; then
 	exec /usr/bin/yggdrasil --useconffile /etc/yggdrasil.conf 1>/dev/null
 else

From 4d82a011683b03b1f19b0f230f9637635b4e539e Mon Sep 17 00:00:00 2001
From: Will Springer <skirmisher@protonmail.com>
Date: Wed, 4 Mar 2020 17:21:25 -0800
Subject: [PATCH 2/5] yggdrasil: drop unnecessary caps when running service

---
 srcpkgs/yggdrasil/files/yggdrasil/run | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/yggdrasil/files/yggdrasil/run b/srcpkgs/yggdrasil/files/yggdrasil/run
index a6216cecf5b..3fad5399e95 100755
--- a/srcpkgs/yggdrasil/files/yggdrasil/run
+++ b/srcpkgs/yggdrasil/files/yggdrasil/run
@@ -1,7 +1,9 @@
 #!/bin/sh
 /usr/bin/modprobe tun
+caps='-all,+NET_ADMIN,+NET_RAW'
+drop_caps="/usr/bin/setpriv --inh-caps $caps --bounding-set $caps"
 if [ -f /etc/yggdrasil.conf ]; then
-	exec /usr/bin/yggdrasil --useconffile /etc/yggdrasil.conf 1>/dev/null
+	exec $drop_caps /usr/bin/yggdrasil --useconffile /etc/yggdrasil.conf 1>/dev/null
 else
-	exec /usr/bin/yggdrasil --autoconf 1>/dev/null
+	exec $drop_caps /usr/bin/yggdrasil --autoconf 1>/dev/null
 fi

From d55243cdf972f65a18bc1971036c7a81a601fa0c Mon Sep 17 00:00:00 2001
From: Will Springer <skirmisher@protonmail.com>
Date: Wed, 4 Mar 2020 23:23:18 -0800
Subject: [PATCH 3/5] yggdrasil: revbump for service changes

---
 srcpkgs/yggdrasil/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/yggdrasil/template b/srcpkgs/yggdrasil/template
index 955fbb0368b..865baefdd59 100644
--- a/srcpkgs/yggdrasil/template
+++ b/srcpkgs/yggdrasil/template
@@ -1,7 +1,7 @@
 # Template file for 'yggdrasil'
 pkgname=yggdrasil
 version=0.3.14
-revision=1
+revision=2
 wrksrc="yggdrasil-go-${version}"
 build_style=go
 go_import_path=github.com/yggdrasil-network/yggdrasil-go

From 3c34718bbaec7c34eacbfd5790079db339f1e217 Mon Sep 17 00:00:00 2001
From: Will Springer <skirmisher@protonmail.com>
Date: Mon, 27 Apr 2020 14:21:09 -0700
Subject: [PATCH 4/5] yggdrasil: remove absolute paths

---
 srcpkgs/yggdrasil/files/yggdrasil/run | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/yggdrasil/files/yggdrasil/run b/srcpkgs/yggdrasil/files/yggdrasil/run
index 3fad5399e95..4ee19bbaf77 100755
--- a/srcpkgs/yggdrasil/files/yggdrasil/run
+++ b/srcpkgs/yggdrasil/files/yggdrasil/run
@@ -1,9 +1,9 @@
 #!/bin/sh
-/usr/bin/modprobe tun
+modprobe tun
 caps='-all,+NET_ADMIN,+NET_RAW'
-drop_caps="/usr/bin/setpriv --inh-caps $caps --bounding-set $caps"
+drop_caps="setpriv --inh-caps $caps --bounding-set $caps"
 if [ -f /etc/yggdrasil.conf ]; then
-	exec $drop_caps /usr/bin/yggdrasil --useconffile /etc/yggdrasil.conf 1>/dev/null
+	exec $drop_caps yggdrasil --useconffile /etc/yggdrasil.conf 1>/dev/null
 else
-	exec $drop_caps /usr/bin/yggdrasil --autoconf 1>/dev/null
+	exec $drop_caps yggdrasil --autoconf 1>/dev/null
 fi

From 82c9eb0510508a78febd124e0c4c812c247d6a87 Mon Sep 17 00:00:00 2001
From: Will Springer <skirmisher@protonmail.com>
Date: Mon, 27 Apr 2020 14:41:05 -0700
Subject: [PATCH 5/5] yggdrasil: add util-linux dependency

---
 srcpkgs/yggdrasil/template | 1 +
 1 file changed, 1 insertion(+)

diff --git a/srcpkgs/yggdrasil/template b/srcpkgs/yggdrasil/template
index 865baefdd59..a2ba2ddc78e 100644
--- a/srcpkgs/yggdrasil/template
+++ b/srcpkgs/yggdrasil/template
@@ -6,6 +6,7 @@ wrksrc="yggdrasil-go-${version}"
 build_style=go
 go_import_path=github.com/yggdrasil-network/yggdrasil-go
 hostmakedepends="go git"
+depends=util-linux
 short_desc="Experiment in scalable routing as an encrypted IPv6 overlay network"
 maintainer="Jan Christian Gruenhage <jan.christian@gruenhage.xyz>"
 license="LGPL-3.0-only"

  parent reply	other threads:[~2020-04-27 21:43 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-19767@inbox.vuxu.org>
2020-03-05  7:21 ` Skirmisher
2020-03-05  7:24 ` xtraeme
2020-03-05  7:24 ` xtraeme
2020-04-27 21:32 ` [PR PATCH] [Updated] " Skirmisher
2020-04-27 21:43 ` Skirmisher [this message]
2020-04-27 21:51 ` Vaelatern
2020-04-27 21:51 ` [PR PATCH] [Closed]: " Vaelatern

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200427214306.d1tQvBpzoC8GG1okMPcSxueq5UkJ158hjy1M1I-jLhU@z \
    --to=skirmisher@users.noreply.github.com \
    --cc=ml@inbox.vuxu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).