Subject: [PATCH] testing/tlsrouter: upgrade to 0_git20220202

From: Marvin Preuss <[email-masked]>
Date: Wed, 2 Feb 2022 11:58:16 +0100

Since the upgrade we can drop the own go.mod and go.sum files. I also
removed the config dir ownership. Also check is enabled because testing
works.

---
 testing/tlsrouter/APKBUILD              | 21 ++++++++-------------
 testing/tlsrouter/go.mod                |  5 -----
 testing/tlsrouter/go.sum                |  2 --
 testing/tlsrouter/tlsrouter.pre-install |  5 ++++-
 4 files changed, 12 insertions(+), 21 deletions(-)
 delete mode 100644 testing/tlsrouter/go.mod
 delete mode 100644 testing/tlsrouter/go.sum

diff --git a/testing/tlsrouter/APKBUILD b/testing/tlsrouter/APKBUILD
index f4f6d4b121..b6573a5db9 100644
--- a/testing/tlsrouter/APKBUILD
+++ b/testing/tlsrouter/APKBUILD
@@ -1,24 +1,21 @@
 # Contributor: Marvin Preuss <[email-masked]>
 # Maintainer: Marvin Preuss <[email-masked]>
 pkgname=tlsrouter
-pkgver=0_git20210817
-pkgrel=1
-_short_commit=b6bb9b5
+pkgver=0_git20220202
+pkgrel=0
+_short_commit=2e577fe
 pkgdesc="tls proxy that routes connections to backends based on tls sni"
 pkgusers="tlsrouter"
 pkggroups="tlsrouter"
 url="https://github.com/inetaf/tcpproxy/tree/master/cmd/tlsrouter"
 arch="all"
 license="Apache-2.0"
-options="!check" # some tests are failing
 makedepends="go libcap"
 subpackages="$pkgname-openrc"
 install="$pkgname.pre-install"
 source="tlsrouter-$pkgver.tar.gz::https://github.com/inetaf/tcpproxy/tarball/$_short_commit
 	$pkgname.initd
 	$pkgname.confd
-	go.mod
-	go.sum
 	"
 builddir="$srcdir/inetaf-tcpproxy-$_short_commit/cmd/tlsrouter"
 
@@ -26,14 +23,16 @@ export GOFLAGS="$GOFLAGS -modcacherw"
 
 prepare() {
 	default_prepare
-	cp "$srcdir/go.mod" "$builddir"
-	cp "$srcdir/go.sum" "$builddir"
 }
 
 build() {
 	go build .
 }
 
+check() {
+	go test ./...
+}
+
 package() {
 	install -Dm755 "$builddir/$pkgname" "$pkgdir/usr/bin/$pkgname"
 
@@ -43,14 +42,10 @@ package() {
 	install -Dm644 "$srcdir/$pkgname.confd" \
 		"$pkgdir/etc/conf.d/$pkgname"
 
-	install -d -m644 -o tlsrouter -g tlsrouter "$pkgdir"/etc/"$pkgname"
-
 	setcap cap_net_bind_service=+ep "$pkgdir/usr/bin/$pkgname"
 }
 sha512sums="
-668dff16cdd7078b2fa1e363743ff642ef5e4bff20a7f320d855b6db8e69fd70b940875251950ec332ada8d1d4eb79649c30729fdf8a501e4fb5d8abc456de10  tlsrouter-0_git20210817.tar.gz
+5cecd7e8cf65d1aac29cf720ab6879df2a724b46b6ff8e042d79541b66d8ae415702a6c69670ea746883cf28a9ec51a8f67be15098a3d71654d9fdd3ba0a5150  tlsrouter-0_git20220202.tar.gz
 495b26eaba88b57f4e363b7e89e302ba73c89a38f69c3c299ba4dd3531e5a2231c92b90c11d79a0199fbe602059c43ad52ae3d6cdfe532b350a884a90b21983e  tlsrouter.initd
 7dde09a46fa706fc7ef511c034bd8e1cb58a29d55320cc5fae9fdd6a5dc053948cb28ef76f1f8893edd656a3b99dd222a54f660b12a220011fcb949c1f64874c  tlsrouter.confd
-aa271f389bb13defd50234623e03ae4246db5a3c5fc81fa40f02f277b9cec1b463e61bd44151ffbfae5f579087d89da9d91cf2e54db8a011c0e3c6bb46933aae  go.mod
-c9c7f86b7810aa098cc8dd5137502ec7683dc8141db07bc1dc0977b55f56adc2205219b76af96805a2d4ab7817a32f09f85df117e0179460a22a268f11f0e68c  go.sum
 "
diff --git a/testing/tlsrouter/go.mod b/testing/tlsrouter/go.mod
deleted file mode 100644
index 1aac78ca5b..0000000000
--- a/testing/tlsrouter/go.mod
+++ /dev/null
@@ -1,5 +0,0 @@
-module tlsrouter
-
-go 1.16
-
-require github.com/armon/go-proxyproto v0.0.0-20210323213023-7e956b284f0a
diff --git a/testing/tlsrouter/go.sum b/testing/tlsrouter/go.sum
deleted file mode 100644
index de51fb1c3d..0000000000
--- a/testing/tlsrouter/go.sum
+++ /dev/null
@@ -1,2 +0,0 @@
-github.com/armon/go-proxyproto v0.0.0-20210323213023-7e956b284f0a h1:AP/vsCIvJZ129pdm9Ek7bH7yutN3hByqsMoNrWAxRQc=
-github.com/armon/go-proxyproto v0.0.0-20210323213023-7e956b284f0a/go.mod h1:QmP9hvJ91BbJmGVGSbutW19IC0Q9phDCLGaomwTJbgU=
diff --git a/testing/tlsrouter/tlsrouter.pre-install b/testing/tlsrouter/tlsrouter.pre-install
index f1821892ca..ba0f6eb29b 100644
--- a/testing/tlsrouter/tlsrouter.pre-install
+++ b/testing/tlsrouter/tlsrouter.pre-install
@@ -1,6 +1,9 @@
 #!/bin/sh
 
+user=tlsrouter
+group=tlsrouter
+
 addgroup -S tlsrouter 2>/dev/null
-adduser -S -D -h /var/lib/tlsrouter -s /sbin/nologin -G tlsrouter -g tlsrouter tlsrouter 2>/dev/null
+adduser -S -D -h /var/lib/$user -s /sbin/nologin -G $group -g $user $user 2>/dev/null
 
 exit 0
-- 
2.35.1