Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) by nld3-dev1.alpinelinux.org (Postfix) with ESMTPS id B25A4782BC5 for ; Wed, 18 Aug 2021 07:23:59 +0000 (UTC) Received: by mail-wm1-f46.google.com with SMTP id f13-20020a1c6a0d000000b002e6fd0b0b3fso2044462wmc.3 for ; Wed, 18 Aug 2021 00:23:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=9DXvtkCY0xyeiMndYr67UmxLI+fYPy6aqb03lWOUY54=; b=h+D+5sAnviHGsmLkMVV+3wEd4O+1Mps8tt2UuTo4H2Ytrt5cBS1WvTaJVzRJowzME6 33XZjtHZkZtIzpSU8gAWwrjc5Bq9qy03VQWFgY7n5H3vSyMv3T6p2A5Nd49ZMFUEjUC+ N8BPJr1NRt8vaA9QOpyXrWMZ7fC8VAF7c8z/l3lF3+O2GrKgOKfum2MRdftVU1/Jr4F6 f5RtS67HPJpyN2J8xmKH1yHpjlE3XVe5yu9rrNRgmmKnMO5nP08c6OKpJht9bDXookzB R6zEhEYvDZ7VY8qDOZupcGbtLTJ3Z7dN4HJ9e8vSNMHeHrMGXF2vn7ihYsVHfNB5Kzjt 2RZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; bh=9DXvtkCY0xyeiMndYr67UmxLI+fYPy6aqb03lWOUY54=; b=DxgMLFGn0FUsnuKNud4Qhx6k+Yt6oXLZoV/cgLvHvpPLdGuidboB6OHyAVEhdHVJk1 W5gp/m/w8ZliW089Z/RjYRPZGkz2XKOCeweNkUTWCNRm/527NMR0ieEBAj6Ey0thBJkk X0r3l8paUFmRdUBHvi8wuLw672iyGFWzM3eNtVtOyZYc+lKtcYDW1eLynOZN/qxoPRrG YMCfKcSrG7KU1d+t/AnTnunXsEnuVVsM/qfP0dCrwIwU4hTDR7Z+39dQf0X7EwY3885Z LJkDwNAQ5KmxhdGfxSthfn731bGJK5TsFnFh/h5RusBGY9KjQiWipggB+DFWWdWhW9Kg UKUA== X-Gm-Message-State: AOAM533EBufR/ukoCSYllIsgCkLdJIogj/tP7rau6UNpvIL1p9O+yqrc sM5+wA+ljGH+yTSDdSTJyYIRxRPlfg4= X-Google-Smtp-Source: ABdhPJxBgeAx0LM5p5beKS9l056hBkJ6TI0mGgrmF0tvyulXCpPXpgNNawTzyBem6sDwSthTIv9+DQ== X-Received: by 2002:a1c:7dd0:: with SMTP id y199mr6947025wmc.23.1629271439026; Wed, 18 Aug 2021 00:23:59 -0700 (PDT) Received: from troy.wobcom.de ([94.31.100.46]) by smtp.gmail.com with ESMTPSA id e3sm5115156wrv.65.2021.08.18.00.23.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Aug 2021 00:23:58 -0700 (PDT) Sender: Marvin Preuss From: Marvin Preuss To: alpine-aports@lists.alpinelinux.org Cc: Marvin Preuss Subject: [PATCH] testing/tlsrouter: new aport Date: Wed, 18 Aug 2021 09:23:26 +0200 Message-Id: <20210818072326.109373-1-marvin@xsteadfastx.org> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit --- testing/tlsrouter/APKBUILD | 43 +++++++++++++++++++++++++ testing/tlsrouter/tlsrouter.confd | 3 ++ testing/tlsrouter/tlsrouter.initd | 14 ++++++++ testing/tlsrouter/tlsrouter.pre-install | 8 +++++ 4 files changed, 68 insertions(+) create mode 100644 testing/tlsrouter/APKBUILD create mode 100644 testing/tlsrouter/tlsrouter.confd create mode 100644 testing/tlsrouter/tlsrouter.initd create mode 100644 testing/tlsrouter/tlsrouter.pre-install diff --git a/testing/tlsrouter/APKBUILD b/testing/tlsrouter/APKBUILD new file mode 100644 index 0000000000..1374ccf5df --- /dev/null +++ b/testing/tlsrouter/APKBUILD @@ -0,0 +1,43 @@ +# Contributor: Marvin Preuss +# Maintainer: Marvin Preuss +pkgname=tlsrouter +pkgver=0_git20210817 +pkgrel=0 +_short_commit=b6bb9b5 +pkgdesc="tlsouter is a tls proxy that routes connections to backends based on the tls sni" +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 + " +builddir="$srcdir/inetaf-tcpproxy-$_short_commit" + +export GOFLAGS="$GOFLAGS -modcacherw" +export GO111MODULE=off + +build() { + go build ./cmd/tlsrouter +} + +package() { + install -Dm755 "$srcdir/inetaf-tcpproxy-$_short_commit/$pkgname" "$pkgdir/usr/bin/$pkgname" + + install -Dm755 "$srcdir/$pkgname.initd" \ + "$pkgdir/etc/init.d/$pkgname" + + install -Dm644 "$srcdir/$pkgname.confd" \ + "$pkgdir/etc/conf.d/$pkgname" + + setcap cap_net_bind_service=+ep "$pkgdir/usr/bin/$pkgname" +} +sha512sums=" +668dff16cdd7078b2fa1e363743ff642ef5e4bff20a7f320d855b6db8e69fd70b940875251950ec332ada8d1d4eb79649c30729fdf8a501e4fb5d8abc456de10 tlsrouter-0_git20210817.tar.gz +495b26eaba88b57f4e363b7e89e302ba73c89a38f69c3c299ba4dd3531e5a2231c92b90c11d79a0199fbe602059c43ad52ae3d6cdfe532b350a884a90b21983e tlsrouter.initd +7dde09a46fa706fc7ef511c034bd8e1cb58a29d55320cc5fae9fdd6a5dc053948cb28ef76f1f8893edd656a3b99dd222a54f660b12a220011fcb949c1f64874c tlsrouter.confd +" diff --git a/testing/tlsrouter/tlsrouter.confd b/testing/tlsrouter/tlsrouter.confd new file mode 100644 index 0000000000..3332390b62 --- /dev/null +++ b/testing/tlsrouter/tlsrouter.confd @@ -0,0 +1,3 @@ +# tlsrouter options + +tlsrouter_opts="-conf /etc/tlsrouter/tlsrouter.conf -listen :443" diff --git a/testing/tlsrouter/tlsrouter.initd b/testing/tlsrouter/tlsrouter.initd new file mode 100644 index 0000000000..3f2bfa3388 --- /dev/null +++ b/testing/tlsrouter/tlsrouter.initd @@ -0,0 +1,14 @@ +#!/sbin/openrc-run + +supervisor=supervise-daemon + +name=tlsrouter +command="/usr/bin/tlsrouter" +command_args="$tlsrouter_opts" +command_user="tlsrouter" +start_stop_daemon_args="--quiet" + +depend() { + need net + after firewall +} diff --git a/testing/tlsrouter/tlsrouter.pre-install b/testing/tlsrouter/tlsrouter.pre-install new file mode 100644 index 0000000000..e8bec36487 --- /dev/null +++ b/testing/tlsrouter/tlsrouter.pre-install @@ -0,0 +1,8 @@ +#!/bin/sh + +addgroup -S tlsrouter 2>/dev/null +adduser -S -D -h /var/lib/tlsrouter -s /sbin/nologin -G tlsrouter -g tlsrouter tlsrouter 2>/dev/null +mkdir -p /etc/tlsrouter 2>/dev/null +chown tlsrouter:tlsrouter /etc/tlsrouter 2>/dev/null + +exit 0 -- 2.32.0