aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarlo Landmeter <clandmeter@gmail.com>2016-02-29 11:01:22 +0100
committerCarlo Landmeter <clandmeter@gmail.com>2016-02-29 11:01:44 +0100
commit569c7b9cf59ca30a67f0de79a9947cd84765574a (patch)
treef76f7d6befa062786b2cd0c9d65bd813ab36ba4e
parent3587c46af038e4bf558f3535da36eb73025eebe3 (diff)
downloadaports-569c7b9cf59ca30a67f0de79a9947cd84765574a.tar.bz2
aports-569c7b9cf59ca30a67f0de79a9947cd84765574a.tar.xz
testing/caddy: setcap at build time and install config
-rw-r--r--testing/caddy/APKBUILD29
-rw-r--r--testing/caddy/caddy.conf2
-rw-r--r--testing/caddy/caddy.confd2
-rw-r--r--testing/caddy/caddy.initd4
-rw-r--r--testing/caddy/caddy.pre-install1
5 files changed, 24 insertions, 14 deletions
diff --git a/testing/caddy/APKBUILD b/testing/caddy/APKBUILD
index dc693bc583..dc1fa369ad 100644
--- a/testing/caddy/APKBUILD
+++ b/testing/caddy/APKBUILD
@@ -2,14 +2,14 @@
# Maintainer:
pkgname=caddy
pkgver=0.8.2
-pkgrel=1
+pkgrel=2
pkgdesc="Fast, cross-platform HTTP/2 web server with automatic HTTPS"
url="https://caddyserver.com/"
arch="all"
license="ASL 2.0"
-depends="libcap"
+depends=""
depends_dev=""
-makedepends="$depends_dev go"
+makedepends="$depends_dev go libcap"
install="$pkgname.pre-install"
subpackages=""
pkgusers="$pkgname"
@@ -17,6 +17,7 @@ pkggroups="$pkgname"
source="http://dev.alpinelinux.org/archive/$pkgname/$pkgname-$pkgver.tar.gz
$pkgname.initd
$pkgname.confd
+ $pkgname.conf
"
_disturl="dev.alpinelinux.org:/archive/$pkgname/"
@@ -60,20 +61,30 @@ build() {
package() {
cd "$_builddir"
install -Dm755 ecaddy "$pkgdir"/usr/sbin/caddy || return 1
+ # caddy currently does not support dropping privileges so we
+ # change attributes with setcat to allow access to priv ports
+ # https://caddyserver.com/docs/faq
+ setcap cap_net_bind_service=+ep \
+ "$pkgdir"/usr/sbin/caddy || return 1
install -d -o caddy -g caddy $pkgdir/var/lib/caddy \
$pkgdir/etc/caddy $pkgdir/var/www || return 1
install -Dm755 $srcdir/$pkgname.initd \
$pkgdir/etc/init.d/$pkgname || return 1
install -Dm644 $srcdir/$pkgname.confd \
$pkgdir/etc/conf.d/$pkgname || return 1
+ install -Dm644 $srcdir/$pkgname.conf \
+ $pkgdir/etc/$pkgname/$pkgname.conf || return 1
}
md5sums="fbac857f44eb017a8ec3cc5a232ac492 caddy-0.8.2.tar.gz
-be960e64588cb71a443ba67cf48ef761 caddy.initd
-a01dc274da3cfbe554fae94ac805d00d caddy.confd"
+8217cae6d4621dc942b15dad6a364e6a caddy.initd
+b5f1f62ac7d59b722bdebdcc9d2a6af5 caddy.confd
+82217943769d0761c24e333e9fd51f1f caddy.conf"
sha256sums="a298af1e38ba37d5812d4733029e7bc7d3b79557094c61f450947fcae2045e96 caddy-0.8.2.tar.gz
-5bd21633fd6425f1f795b69f258e22bde3f248da7c83367f538a7cdf50a453a7 caddy.initd
-fbb6f12241ee5096e58d4fd9e05c4a5e402cf413279d5765c857e7487eb2d88a caddy.confd"
+c9070cce0b57cef69894f05841b1eb7eca33cf9b50af71c15e57ebf17a40af2c caddy.initd
+61a23e879e2aa9743f631fc54a62b9c23a1944606194b9dbbbcf3f563a8998c1 caddy.confd
+08065486d87a9922464b3ae033343db27eca86d790cc0233dbb9b6666641db98 caddy.conf"
sha512sums="a59e6556b6e65d74a7da53d265a47fe052f3e6ef9be68c6d44933040a84ba75ba26e783a71b9e13eeee5e5a0904b700cb4459d6ae802603dbafe811115f3d276 caddy-0.8.2.tar.gz
-26297fd26f3f2bb362da73255b122089afe4c3859e1510a789535df52c7621db7ead2ae235c43d5c0b0737b3b621bc4d31d83466b538488b36ec6b940e2b4825 caddy.initd
-5b1df94190c5570da0ef4dbc0aa5dc1ede91f440e1b194f5ee949c1a1a0b4e3fd47d6bef66cbc4d73daa00569a7eb7b1813f014af4eb8f239905e8e67f3811f1 caddy.confd"
+00fe095efd8d801f0c2c69832c7240858080407ea3696ca07f6b53d3304f7e2784566d8a6b447cb83d7dc4542db551f1b4fa48ff031da7e4a1d4a26e59fc05c5 caddy.initd
+7808688e92ab9950403a9b8ad29777f5bd0f75aa8cccc1d49958bb1e5af1b972dfba0c6d31931354f702a3a13933d0a1b8f28b82eed263773d71b79ec95cc15c caddy.confd
+c24805d17234e6cf40fe1dd102c03f05cf6129d43f58f5567d540a0e4400ce89994820bb0e317f611c65459ae26bcf7110e23a8fecaae11ca78a561892b45d75 caddy.conf"
diff --git a/testing/caddy/caddy.conf b/testing/caddy/caddy.conf
new file mode 100644
index 0000000000..7de2f90e09
--- /dev/null
+++ b/testing/caddy/caddy.conf
@@ -0,0 +1,2 @@
+# Caddy config file
+# See: https://caddyserver.com/docs/caddyfile
diff --git a/testing/caddy/caddy.confd b/testing/caddy/caddy.confd
index 6e51cae151..1c17719c61 100644
--- a/testing/caddy/caddy.confd
+++ b/testing/caddy/caddy.confd
@@ -1,2 +1,2 @@
# caddy options file
-CADDY_OPTS="-conf /etc/caddy/conf -agree"
+CADDY_OPTS="-conf /etc/caddy/caddy.conf -agree"
diff --git a/testing/caddy/caddy.initd b/testing/caddy/caddy.initd
index 877e7cff28..4dae7edfa9 100644
--- a/testing/caddy/caddy.initd
+++ b/testing/caddy/caddy.initd
@@ -11,7 +11,3 @@ depend() {
need net localmount
after firewall
}
-
-start_pre() {
- setcap cap_net_bind_service=+ep $command
-}
diff --git a/testing/caddy/caddy.pre-install b/testing/caddy/caddy.pre-install
index c44f60cd45..16d74a36d2 100644
--- a/testing/caddy/caddy.pre-install
+++ b/testing/caddy/caddy.pre-install
@@ -1,3 +1,4 @@
#!/bin/sh
adduser -h /var/lib/caddy -D -s /sbin/nologin caddy 2>/dev/null
+adduser caddy www-data 2>/dev/null
exit 0