A sr.ht/tlstunnel/APKBUILD => sr.ht/tlstunnel/APKBUILD +39 -0
@@ 0,0 1,39 @@
+# Maintainer: Drew DeVault <sir@cmpwn.com>
+pkgname=tlstunnel
+pkgver=0.1.1
+pkgrel=0
+pkgdesc="A TLS reverse proxy"
+url="https://git.sr.ht/~emersion/tlstunnel"
+arch="all"
+license="MIT"
+install="$pkgname.post-install"
+makedepends="go scdoc"
+source="
+ $pkgname-$pkgver.tar.gz::https://git.sr.ht/~emersion/tlstunnel/refs/download/v$pkgver/tlstunnel-$pkgver.tar.gz
+ tlstunnel.confd
+ tlstunnel.initd
+"
+subpackages="$pkgname-openrc $pkgname-doc"
+
+build() {
+ make PREFIX="/usr"
+}
+
+check() {
+ go test ./...
+}
+
+package() {
+ make install DESTDIR="$pkgdir" PREFIX="/usr"
+
+ install -Dm755 "$srcdir"/tlstunnel.initd \
+ "$pkgdir"/etc/init.d/tlstunnel
+ install -Dm644 "$srcdir"/tlstunnel.confd \
+ "$pkgdir"/etc/conf.d/tlstunnel
+}
+
+sha512sums="
+2b3b1dc5677bb4a5a1f093c9f07cb2051daddadbddd757be4239e3b2f06a0f907557c61e668459da3544bac643c458e72e62b44247350bedb208ba072d0c2417 tlstunnel-0.1.1.tar.gz
+a13dd2d351b3290f7b80fbd9197b39e41959219321f4f105f9deaad0ab5c1f0f4a893f336d1dc645e613e319be5fe79663058038aa7a35136a4882ef3c68bc97 tlstunnel.confd
+3cd75935df15a9d65081747d6be2bed5593957631a831dea19d8854c74773703624a045a52c7bd65d7e77907abd1355f4f131c782ecdc42e03d9b6f6ac41abd5 tlstunnel.initd
+"
A sr.ht/tlstunnel/tlstunnel.confd => sr.ht/tlstunnel/tlstunnel.confd +2 -0
@@ 0,0 1,2 @@
+output_log=/var/log/tlstunnel.log
+error_log=/var/log/tlstunnel.log
A sr.ht/tlstunnel/tlstunnel.initd => sr.ht/tlstunnel/tlstunnel.initd +15 -0
@@ 0,0 1,15 @@
+#!/sbin/openrc-run
+name="tlstunnel"
+description="TLS reverse proxy"
+supervisor=supervise-daemon
+CERTSTORE=/var/lib/tlstunnel
+command=/usr/bin/tlstunnel
+command_user="tlstunnel:tlstunnel"
+
+start_pre() {
+ [ -n "$output_log" ] && checkpath -f "$output_log" \
+ -m 644 -o $command_user
+ [ -n "$error_log" ] && checkpath -f "$error_log" \
+ -m 644 -o $command_user
+ checkpath -d "$CERTSTORE" -m 755 -o $command_user
+}
A sr.ht/tlstunnel/tlstunnel.post-install => sr.ht/tlstunnel/tlstunnel.post-install +5 -0
@@ 0,0 1,5 @@
+#!/bin/sh
+grep '^tlstunnel' /etc/group >/dev/null || addgroup -S tlstunnel 2>/dev/null
+grep '^tlstunnel' /etc/passwd >/dev/null || adduser -SDh/var/lib/tlstunnel \
+ -s/sbin/nologin -Gtlstunnel -gtlstunnel tlstunnel tlstunnel 2>/dev/null
+setcap 'cap_net_bind_service=+ep' /usr/bin/tlstunnel