aboutsummaryrefslogtreecommitdiffstats
path: root/community/caddy
diff options
context:
space:
mode:
authorCarlo Landmeter <clandmeter@gmail.com>2016-03-24 14:40:56 +0100
committerCarlo Landmeter <clandmeter@gmail.com>2016-03-24 14:41:08 +0100
commita63f5879b8bbe18ba7d317c79d8bc2d015f73297 (patch)
tree7a05f23ce02b7d9e2962dd021aa152c4d517f8b8 /community/caddy
parentc749890cee25c59d44c799c76790acb5ef60c974 (diff)
downloadaports-a63f5879b8bbe18ba7d317c79d8bc2d015f73297.tar.bz2
aports-a63f5879b8bbe18ba7d317c79d8bc2d015f73297.tar.xz
community/caddy: add ca-certificates to deps and move to community
Diffstat (limited to 'community/caddy')
-rw-r--r--community/caddy/APKBUILD90
-rw-r--r--community/caddy/caddy.conf2
-rw-r--r--community/caddy/caddy.confd2
-rw-r--r--community/caddy/caddy.initd13
-rw-r--r--community/caddy/caddy.pre-install4
5 files changed, 111 insertions, 0 deletions
diff --git a/community/caddy/APKBUILD b/community/caddy/APKBUILD
new file mode 100644
index 0000000000..7ad5309740
--- /dev/null
+++ b/community/caddy/APKBUILD
@@ -0,0 +1,90 @@
+# Contributor: Carlo Landmeter <clandmeter@gmail.com>
+# Maintainer: Carlo Landmeter <clandmeter@gmail.com>
+pkgname=caddy
+pkgver=0.8.2
+pkgrel=3
+pkgdesc="Fast, cross-platform HTTP/2 web server with automatic HTTPS"
+url="https://caddyserver.com/"
+arch="all"
+license="ASL 2.0"
+depends="ca-certificates"
+depends_dev=""
+makedepends="$depends_dev go libcap"
+install="$pkgname.pre-install"
+subpackages=""
+pkgusers="$pkgname"
+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/"
+_gourl="github.com/mholt/caddy"
+_builddir="$srcdir"/src/$_gourl
+
+prepare() {
+ local i
+ cd "$_builddir"
+ for i in $source; do
+ case $i in
+ *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
+ esac
+ done
+}
+
+snapshot() {
+ abuild clean && abuild deps
+ export GOPATH="$srcdir"
+ msg "Checking out v${pkgver} tag"
+ # go get will not checkout a specific tag
+ # so we run our own git checkout branch
+ git clone --quiet --branch v${pkgver} \
+ https://$_gourl $_builddir || return 1
+ cd $_builddir
+ # fetch deps
+ go get -v -d || return 1
+ cd "$srcdir"
+ tar zcf $pkgname-$pkgver.tar.gz src || return 1
+ rsync --progress -La $pkgname-$pkgver.tar.gz \
+ $_disturl || return 1
+ cd $startdir && abuild undeps
+}
+
+build() {
+ cd "$_builddir" || return 1
+ export GOPATH="$srcdir"
+ go build -v -o ecaddy || return 1
+}
+
+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
+8217cae6d4621dc942b15dad6a364e6a caddy.initd
+b5f1f62ac7d59b722bdebdcc9d2a6af5 caddy.confd
+82217943769d0761c24e333e9fd51f1f caddy.conf"
+sha256sums="a298af1e38ba37d5812d4733029e7bc7d3b79557094c61f450947fcae2045e96 caddy-0.8.2.tar.gz
+c9070cce0b57cef69894f05841b1eb7eca33cf9b50af71c15e57ebf17a40af2c caddy.initd
+61a23e879e2aa9743f631fc54a62b9c23a1944606194b9dbbbcf3f563a8998c1 caddy.confd
+08065486d87a9922464b3ae033343db27eca86d790cc0233dbb9b6666641db98 caddy.conf"
+sha512sums="a59e6556b6e65d74a7da53d265a47fe052f3e6ef9be68c6d44933040a84ba75ba26e783a71b9e13eeee5e5a0904b700cb4459d6ae802603dbafe811115f3d276 caddy-0.8.2.tar.gz
+00fe095efd8d801f0c2c69832c7240858080407ea3696ca07f6b53d3304f7e2784566d8a6b447cb83d7dc4542db551f1b4fa48ff031da7e4a1d4a26e59fc05c5 caddy.initd
+7808688e92ab9950403a9b8ad29777f5bd0f75aa8cccc1d49958bb1e5af1b972dfba0c6d31931354f702a3a13933d0a1b8f28b82eed263773d71b79ec95cc15c caddy.confd
+c24805d17234e6cf40fe1dd102c03f05cf6129d43f58f5567d540a0e4400ce89994820bb0e317f611c65459ae26bcf7110e23a8fecaae11ca78a561892b45d75 caddy.conf"
diff --git a/community/caddy/caddy.conf b/community/caddy/caddy.conf
new file mode 100644
index 0000000000..7de2f90e09
--- /dev/null
+++ b/community/caddy/caddy.conf
@@ -0,0 +1,2 @@
+# Caddy config file
+# See: https://caddyserver.com/docs/caddyfile
diff --git a/community/caddy/caddy.confd b/community/caddy/caddy.confd
new file mode 100644
index 0000000000..1c17719c61
--- /dev/null
+++ b/community/caddy/caddy.confd
@@ -0,0 +1,2 @@
+# caddy options file
+CADDY_OPTS="-conf /etc/caddy/caddy.conf -agree"
diff --git a/community/caddy/caddy.initd b/community/caddy/caddy.initd
new file mode 100644
index 0000000000..4dae7edfa9
--- /dev/null
+++ b/community/caddy/caddy.initd
@@ -0,0 +1,13 @@
+#!/sbin/openrc-run
+
+name="Caddy webserver"
+command="/usr/sbin/caddy"
+command_args="$CADDY_OPTS"
+pidfile="/var/run/caddy.pid"
+command_background=yes
+start_stop_daemon_args="--user caddy --group caddy"
+
+depend() {
+ need net localmount
+ after firewall
+}
diff --git a/community/caddy/caddy.pre-install b/community/caddy/caddy.pre-install
new file mode 100644
index 0000000000..16d74a36d2
--- /dev/null
+++ b/community/caddy/caddy.pre-install
@@ -0,0 +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