From 90b60b5044587535e792ed5410acbf10a76963e7 Mon Sep 17 00:00:00 2001 From: Wynn Wolf Arbor Date: Mon, 13 Jan 2020 15:59:49 +0100 Subject: Initial import --- www-servers/caddy-bin/Manifest | 5 +++ www-servers/caddy-bin/caddy-bin-1.0.4.ebuild | 38 ++++++++++++++++++++++ www-servers/caddy-bin/files/caddy.confd | 4 +++ www-servers/caddy-bin/files/caddy.initd | 48 ++++++++++++++++++++++++++++ www-servers/caddy-bin/metadata.xml | 7 ++++ 5 files changed, 102 insertions(+) create mode 100644 www-servers/caddy-bin/Manifest create mode 100644 www-servers/caddy-bin/caddy-bin-1.0.4.ebuild create mode 100644 www-servers/caddy-bin/files/caddy.confd create mode 100644 www-servers/caddy-bin/files/caddy.initd create mode 100644 www-servers/caddy-bin/metadata.xml (limited to 'www-servers/caddy-bin') diff --git a/www-servers/caddy-bin/Manifest b/www-servers/caddy-bin/Manifest new file mode 100644 index 0000000..4f31b40 --- /dev/null +++ b/www-servers/caddy-bin/Manifest @@ -0,0 +1,5 @@ +AUX caddy.confd 130 BLAKE2B d238ba2f7cb00b587377a0aba525a04929b2fee6d4c30dc4c96f89f09b930969946876c2fb6c505dfcd266ef7203e9d90d2883a6553754ce5aaab2de4054cb5f SHA512 dd8c1dee1d69ffe2dc516c6435b4efec12270b963df82fb703447590640dc1bf7d285821be7b25ebe0ec3d69969cb3e679b7b796237da1bcddfc6acf20dceae1 +AUX caddy.initd 1100 BLAKE2B 3ed5283b7e0da25388b05f922ade8a18ed8dd79afd1c2a3e1a6174a8f12a747c5428ed2e81231f8c03fa250132d91913444986f01b3e1dcb09837fe5ab415f68 SHA512 490de25a6e4e00dce5ec0d82be927204562a69e3b322cd643af2429e46c82696815f808da4035fa79ece17de9e66b860f739171ba8ee98b1c81b086b4d76717a +DIST caddy_v1.0.4_linux_amd64.tar.gz 11207935 BLAKE2B b8877bffb1fe72002336f45e7153cff5ff327ae17252efa62e77256b93906c987e182cc98586f694e56492314ba217c2eb8d1b5b3005e842aea1f764b92fa83d SHA512 c3e7ac2ad1cba15ef3184784a08c4f1dc3b867d551476a0902a9d04d08d975cb8786daebc3ae074f9026296cb3214a331b8bfbea909e7b1a3e51ade73382d42b +EBUILD caddy-bin-1.0.4.ebuild 774 BLAKE2B f40d0093869510eb5786ca2b04f95f0bdf9bc817dcf0a0af1158984e42b9bd74466c7c2e21637326974769cd228f59ef97c3ef9f6af7f5aff2e6852c31b63db5 SHA512 3bb9122c07ec0029465f2edf6afe7436b3a02243b212acfb301da4a4bdeafa400282fc723e59ab9a83e4b7206125460331a13cfd82883603d30214a9f29cd37f +MISC metadata.xml 223 BLAKE2B 2c1cd83f1f1d25a43ea978cd66b5c9f6020889613dfaed65d6745858a45d4bf50fda775305420e41c36cafd63d63746ed894411acbced66ab8ae04906dfb8592 SHA512 4f71eacfeb2b21a4ea746ce1663777937b920e942c94eef1fe93c3557e207c9fdb2569369d56637cba563dc50179d62195db6225123ecfedc303600b8a0bb49b diff --git a/www-servers/caddy-bin/caddy-bin-1.0.4.ebuild b/www-servers/caddy-bin/caddy-bin-1.0.4.ebuild new file mode 100644 index 0000000..158b331 --- /dev/null +++ b/www-servers/caddy-bin/caddy-bin-1.0.4.ebuild @@ -0,0 +1,38 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit user fcaps + +DESCRIPTION="Fast, cross-platform HTTP/2 web server with automatic HTTPS" +HOMEPAGE="https://github.com/mholt/caddy" + +SRC_URI="https://github.com/caddyserver/caddy/releases/download/v${PV}/caddy_v${PV}_linux_amd64.tar.gz" +KEYWORDS="amd64" + +LICENSE="Apache-2.0" +SLOT="0" +IUSE="" + +RDEPEND="!www-servers/caddy" + +FILECAPS=( cap_net_bind_service+ep /usr/bin/caddy ) + +RESTRICT="test mirror" + +S="${WORKDIR}" + +pkg_setup() { + enewgroup http + enewuser caddy -1 -1 /var/lib/caddy http +} + +src_install() { + dobin caddy + + newinitd "${FILESDIR}"/caddy.initd caddy + newconfd "${FILESDIR}"/caddy.confd caddy + + diropts -o caddy -g root -m 750 /var/lib/caddy +} diff --git a/www-servers/caddy-bin/files/caddy.confd b/www-servers/caddy-bin/files/caddy.confd new file mode 100644 index 0000000..ae77de2 --- /dev/null +++ b/www-servers/caddy-bin/files/caddy.confd @@ -0,0 +1,4 @@ +CADDYPATH="/var/lib/caddy" +CADDY_CONFIG="/etc/caddy/Caddyfile" +CADDY_OPTS="-agree=true -conf=${CADDY_CONFIG}" +rc_ulimit="-n 8192" diff --git a/www-servers/caddy-bin/files/caddy.initd b/www-servers/caddy-bin/files/caddy.initd new file mode 100644 index 0000000..c0112d3 --- /dev/null +++ b/www-servers/caddy-bin/files/caddy.initd @@ -0,0 +1,48 @@ +#!/sbin/openrc-run +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +name="${RC_SVCNAME}" +extra_commands="configtest" +extra_started_commands="reload" +description_configtest="Run Caddy's internal config check" +description_reload="Reload Caddy configuration" + +export CADDYPATH="${CADDYPATH}" +command="caddy" +command_args="${CADDY_OPTS}" +command_user="${command_user:-caddy:http}" +command_background=yes +pidfile="/run/${RC_SVCNAME}.pid" + +depend() { + use net + after dns +} + +start_pre() { + if [ "${RC_CMD}" != "restart" ]; then + configtest || return 1 + fi +} + +stop_pre() { + if [ "${RC_CMD}" = "restart" ]; then + configtest || return 1 + fi +} + +reload() { + configtest || return 1 + ebegin "Refreshing ${name}'s configuration" + start-stop-daemon --signal USR1 --pidfile "${pidfile}" + eend $? "Failed to reload ${name}" +} + +configtest() { + ebegin "Checking ${name} configuration" + if ! ${command} -validate -conf="${CADDY_CONFIG}" >/dev/null 2>&1; then + ${command} -validate -conf="${CADDY_CONFIG}" + fi + eend $? "Failed, please correct the errors above" +} diff --git a/www-servers/caddy-bin/metadata.xml b/www-servers/caddy-bin/metadata.xml new file mode 100644 index 0000000..c84abce --- /dev/null +++ b/www-servers/caddy-bin/metadata.xml @@ -0,0 +1,7 @@ + + + + + wolf@oriole.systems + + -- cgit v1.2.3-2-gb3c3