Commit e27d7a41 authored by Michał Polański's avatar Michał Polański Committed by Leo

community/caddy1: new aport

This aport is the latest version of Caddy 1.
Code was largely moved from community/caddy,
which is now upgraded to Caddy 2.
parent a73ff199
# Contributor: Carlo Landmeter <clandmeter@gmail.com> # Contributor: Carlo Landmeter <clandmeter@gmail.com>
# Maintainer: Chloe Kudryavtsev <toast@toastin.space> # Contributor: Chloe Kudryavtsev <toast@toastin.space>
pkgname=caddy # Maintainer: Michał Polański <michal@polanski.me>
pkgver=1.0.4 pkgname=caddy1
pkgrel=3 _pkgname=caddy
pkgver=1.0.5
pkgrel=0
pkgdesc="Fast, cross-platform HTTP/2 web server with automatic HTTPS" pkgdesc="Fast, cross-platform HTTP/2 web server with automatic HTTPS"
url="https://caddyserver.com/" url="https://caddyserver.com/"
arch="all !s390x" arch="all !s390x"
...@@ -17,20 +19,20 @@ depends="ca-certificates" ...@@ -17,20 +19,20 @@ depends="ca-certificates"
makedepends="go libcap bash" makedepends="go libcap bash"
subpackages="$pkgname-openrc" subpackages="$pkgname-openrc"
install="$pkgname.pre-install" install="$pkgname.pre-install"
pkgusers="$pkgname" pkgusers="$_pkgname"
pkggroups="$pkgname" pkggroups="$_pkgname"
source="$pkgname-$pkgver.tar.gz::https://github.com/caddyserver/caddy/archive/v$pkgver.tar.gz source="$_pkgname-$pkgver.tar.gz::https://github.com/caddyserver/caddy/archive/v$pkgver.tar.gz
$pkgname.initd $pkgname.initd
$pkgname.confd $pkgname.confd
$pkgname.conf $_pkgname.conf
" "
builddir="$srcdir/src/github.com/mholt/$pkgname" builddir="$srcdir/src/github.com/mholt/$_pkgname"
export GOPATH="$srcdir" export GOPATH="$srcdir"
prepare() { prepare() {
mkdir -p ${builddir%/*} mkdir -p ${builddir%/*}
mv "$srcdir"/$pkgname-$pkgver "$builddir"/ mv "$srcdir"/$_pkgname-$pkgver "$builddir"/
default_prepare default_prepare
} }
...@@ -45,25 +47,25 @@ check() { ...@@ -45,25 +47,25 @@ check() {
} }
package() { package() {
install -Dm755 bin/caddy "$pkgdir"/usr/sbin/caddy install -Dm755 bin/caddy "$pkgdir"/usr/sbin/$pkgname
# caddy currently does not support dropping privileges so we # caddy currently does not support dropping privileges so we
# change attributes with setcat to allow access to priv ports # change attributes with setcat to allow access to priv ports
# https://caddyserver.com/docs/faq # https://caddyserver.com/docs/faq
setcap cap_net_bind_service=+ep \ setcap cap_net_bind_service=+ep \
"$pkgdir"/usr/sbin/caddy "$pkgdir"/usr/sbin/$pkgname
install -d -o caddy -g caddy \ install -d -o caddy -g caddy \
"$pkgdir"/var/lib/caddy \ "$pkgdir"/var/lib/$pkgname \
"$pkgdir"/etc/caddy \ "$pkgdir"/etc/$pkgname \
"$pkgdir"/var/www "$pkgdir"/var/www
install -Dm755 "$srcdir"/$pkgname.initd \ install -Dm755 "$srcdir"/$pkgname.initd \
"$pkgdir"/etc/init.d/$pkgname "$pkgdir"/etc/init.d/$pkgname
install -Dm644 "$srcdir"/$pkgname.confd \ install -Dm644 "$srcdir"/$pkgname.confd \
"$pkgdir"/etc/conf.d/$pkgname "$pkgdir"/etc/conf.d/$pkgname
install -Dm644 "$srcdir"/$pkgname.conf \ install -Dm644 "$srcdir"/$_pkgname.conf \
"$pkgdir"/etc/$pkgname/$pkgname.conf "$pkgdir"/etc/$pkgname/$_pkgname.conf
} }
cleanup_srcdir() { cleanup_srcdir() {
...@@ -71,7 +73,7 @@ cleanup_srcdir() { ...@@ -71,7 +73,7 @@ cleanup_srcdir() {
default_cleanup_srcdir default_cleanup_srcdir
} }
sha512sums="49dae9c0965000ba1cf36a6148ff78718383a511d671fb73edc3b08e4219db0a9902fc70e40bcbb13ffa7afaa520fd1e6303ea3776059de04085896c018d9c02 caddy-1.0.4.tar.gz sha512sums="6f6df0b5bfc60cb6d67e6e65ddee7f16d12ae4c80f0168383807490f4d519e04cfdc754acf8b68d7996d52a764d4b13b5ce710cd391f8287a9907e0bec317ce1 caddy-1.0.5.tar.gz
1fbab66fbc913f194a94eee6e60e218fcc762b9467258ff22eed43dc98664692f2f2525226068fe3ca101cfe5b6727f16774c2a49c575abb83782416680f399a caddy.initd e009740cf7a5c4195d410ba26a703b808bf573a6b0fbd37f7a5a8aab918ccae572b9b0b1374475058a9a6f70cc6f7b025c3eb8b3a379dd78b1f3d6c6806eb5b1 caddy1.initd
7808688e92ab9950403a9b8ad29777f5bd0f75aa8cccc1d49958bb1e5af1b972dfba0c6d31931354f702a3a13933d0a1b8f28b82eed263773d71b79ec95cc15c caddy.confd 5f3421986f37b1569c7cc4a47627510ac253aec7f2658903aca93c04c2e3f78288803085892de885c7d0e3753a4b29effabf3d4025366ff36ab0c030e314cd8d caddy1.confd
c24805d17234e6cf40fe1dd102c03f05cf6129d43f58f5567d540a0e4400ce89994820bb0e317f611c65459ae26bcf7110e23a8fecaae11ca78a561892b45d75 caddy.conf" c24805d17234e6cf40fe1dd102c03f05cf6129d43f58f5567d540a0e4400ce89994820bb0e317f611c65459ae26bcf7110e23a8fecaae11ca78a561892b45d75 caddy.conf"
# caddy options file # caddy options file
CADDY_OPTS="-conf /etc/caddy/caddy.conf -agree" CADDY_OPTS="-conf /etc/caddy1/caddy.conf -agree"
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
supervisor=supervise-daemon supervisor=supervise-daemon
name="Caddy webserver" name="Caddy webserver"
command=/usr/sbin/caddy command=/usr/sbin/caddy1
command_args="$CADDY_OPTS" command_args="$CADDY_OPTS"
command_user=caddy:caddy command_user=caddy:caddy
extra_commands="checkconfig" extra_commands="checkconfig"
......
#!/bin/sh #!/bin/sh
addgroup -S -g 82 www-data 2>/dev/null
addgroup -S caddy 2>/dev/null addgroup -S caddy 2>/dev/null
adduser -S -D -h /var/lib/caddy -s /sbin/nologin -G caddy -g caddy caddy 2>/dev/null
adduser -S -D -h /var/lib/caddy1 -s /sbin/nologin -G caddy -g caddy caddy 2>/dev/null
adduser caddy www-data 2>/dev/null adduser caddy www-data 2>/dev/null
exit 0 exit 0
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment