diff options
author | V3n3RiX <venerix@koprulu.sector> | 2024-03-17 00:48:59 +0000 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2024-03-17 00:48:59 +0000 |
commit | cd356b722fd8d162f02a5059fae1a66e00be52e3 (patch) | |
tree | 504d62c3aeab09148b029f019e77ba15b10cf8e6 /www-servers/caddy | |
parent | f265f17242b04ae036b4dc174fa95401d895dbc5 (diff) |
gentoo auto-resync : 17:03:2024 - 00:48:58
Diffstat (limited to 'www-servers/caddy')
-rw-r--r-- | www-servers/caddy/Manifest | 6 | ||||
-rw-r--r-- | www-servers/caddy/caddy-2.7.6-r2.ebuild | 131 | ||||
-rw-r--r-- | www-servers/caddy/caddy-9999.ebuild | 44 | ||||
-rw-r--r-- | www-servers/caddy/metadata.xml | 5 |
4 files changed, 163 insertions, 23 deletions
diff --git a/www-servers/caddy/Manifest b/www-servers/caddy/Manifest index 70ed81cbbd7a..124cf76aa3d4 100644 --- a/www-servers/caddy/Manifest +++ b/www-servers/caddy/Manifest @@ -5,8 +5,10 @@ AUX remove-binary-altering-commands-2.7.5.patch 2269 BLAKE2B a87a3f7fc6dcb4754f8 DIST caddy-2.7.6-deps.tar.xz 128958740 BLAKE2B ffbe682df64a88dac9f50e9712f1d6697e58f2d9854c270321f7a0325f0b5ead7f93316756136a4435b70c5e08742c7130ce507ee4aa4696f4fb906f4eba8754 SHA512 f467144e235e09a7718cffe5ed3c40ec2d63038a6a948fe4f85d34717877af8a9959ef7e2c3ac32fd0cce522d693ccac883877f061f5cefc9512f7eed556b336 DIST caddy-2.7.6-docs.tar.gz 24583 BLAKE2B d3dbbb701d86cbfaf538f10911fdd3613b8c3c0f49ef9e229487d2a4fcef9eff79b56e9852d5c1ccd5a8d1d1898861fc8183c343c129901562b03a9092af9e61 SHA512 62e534d41e714b47265fd8089ad9e03a1a89903460976d8af27fa5f71173e076bab8574282213595e495be701b769e1a70ff9e7ec9576fbf8e821e672207faa5 DIST caddy-2.7.6-r1-deps.tar.xz 129331604 BLAKE2B 50b83c012c70637936c83ec765758cdcd80014ca224d76a746de8640a6b36ae15ce11ec57d9fdb20a5f7b3add946209c6dde7bb4e4bd4a47ffe3ffc8971725db SHA512 a4bc56de4f7ec8e9967dde3d7ca4cbb74cba9ce0b8906ffe16f8dae3f52fff1164827942df8154eadbae80cce3ee603535b9135cf8a5126d84a9017e8aece078 +DIST caddy-2.7.6-r2-deps.tar.xz 8511804 BLAKE2B ad3c78ee483474754ad83284fabf249c376423217c2929740cd171446d0e755f121e380130c80f291422d39ca69ea7e6ac52f5ce5cdec740616099b665cef5af SHA512 c48d299d9a0b27ebe467f64dc433625de26293674d8153122ad6798a6b95ed4fe55f764a18d3e9211a8e2f966724d20996f1789e2e84dbb0181cfcf5340303fb DIST caddy-2.7.6.tar.gz 606077 BLAKE2B 1237edc164ec6095c9dff27c332925c4ce9d91a60e629770463bbffb1503b8b11e36033e852df3eb5bb69ffa448833b6ee2891dc0ba6dc9b43b6cce27d492179 SHA512 ef0cb6fd7f6f2a296290b4bb520300e043ad31cc612e734632ffa25cdaa23fd7d601ac4ceaa1c76285d54a07ee773360f795103ef3c2ec79516a4f18a5e844b5 EBUILD caddy-2.7.6-r1.ebuild 3452 BLAKE2B 6834808498445fc62ccd707e59e3c7124ca17ae27233dd15e4ad46c958d31ae562f16dd7e35c460c0fb9a9e2f8159bc1e72bef8c7cbe56643059d400b8d33179 SHA512 ee135d4f0087c6510af3036652ffbfd717989d6264766f0890a94773fc40038bbda19d5e8e47927ef69bbe0c230ac03a09af0aafd665ba54fadf5d1a6444167f +EBUILD caddy-2.7.6-r2.ebuild 3266 BLAKE2B f1c6f904d7078b4a6287a0fd63effe2b6cb24fc351c8fc4a7ddd0ab06111f48fbdb937ed8c6b5e5c7fbf10cd7fe6b8bcb07350dd8646fc237e76c3fe370d86fc SHA512 4e7f47cb41b2b70956ccb3b6dcd667caaa941dbc35116e33a8e8329f1fad5705fcc4bee9aaf7ae858ae980f3a4cfc7b374c5a37a011f6b878fb457acefc947dc EBUILD caddy-2.7.6.ebuild 2425 BLAKE2B daa4f27f63e1de4bf4489856622c9a641ede71cc7aee0e6e9c9c15b8f7383b23935fc8456f7dfde5f163819317bed05b391b65b4f61346fd46928c0776403aa7 SHA512 3dc0ce07d782590c0a71a78de89d82489a6c9923912c676ac0985999f13a4e1313104386250a6a50eb94908bb0ddece6200b9a8772098c81a3ae6254a1e48fa2 -EBUILD caddy-9999.ebuild 3502 BLAKE2B 82addf6fa72d3ba99c2582e3b0537940733b840b980490817241eb976342f4f44d40571845e6beb5d2cae0a5ff7ead1a09eca2efa27c086e3ba9536edea69eef SHA512 0376742cfca41e29afc3f87df49d931b2933220b66acef837f8117b89d2a2d37f17b24a8ebb6cad9512f2ee0f141e453cceaa01fba5f861fcc2f44ff6c70444a -MISC metadata.xml 980 BLAKE2B 2ee3b469fa4243c0bff38b31d2c10f82c04b740b265cb1ffe5e5d36745bb828e91ee6d02dd599232c2be657807533ed2c1a3f32d4393e876dca224fb0faac46e SHA512 9eb633a87a3c68c96ad457684f60d751122e91bfecbede4cf3e7b642a61ddc165f0ce862e65d707c1c00d3ecf605f66c813d80d918e3080dc7fc1e6745ce7115 +EBUILD caddy-9999.ebuild 3314 BLAKE2B 590bb030a9fd575a4bbe3c5cef9ac6f3603612746878ca46c3f3979478d1fdd66110a4eee8287a1dd57c080a371be7c466f696c3b0fa3b3a9928226429a855d1 SHA512 dd3eaaf24d70ebbb7f63d4d9050d37163aca5b4f3f65733505f45bffee81a79cd3acd3b85c8ef9e40579761abc731fdd7563de46531280c4632a411d6e36fea1 +MISC metadata.xml 1212 BLAKE2B d5395939287c1f47d7c6e6590492ead98297a229620056bfe220c5b19b5d980f51c3ace25415e5c8f2c30cf65ff6690861b20871cf7088763f7509c799e94242 SHA512 947fba49f76b506cdf9889fd120acf0eaa6b82243c649944319d37232dc8cdf7c4ab1b3c418761c99ff0404e92f7957a61e5be8e44ca2635f93b9c2161e36dc5 diff --git a/www-servers/caddy/caddy-2.7.6-r2.ebuild b/www-servers/caddy/caddy-2.7.6-r2.ebuild new file mode 100644 index 000000000000..00c08cad4d9f --- /dev/null +++ b/www-servers/caddy/caddy-2.7.6-r2.ebuild @@ -0,0 +1,131 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit fcaps go-module systemd shell-completion + +DESCRIPTION="Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HTTPS" +HOMEPAGE="https://caddyserver.com" + +if [[ "${PV}" == 9999* ]]; then + inherit git-r3 + EGIT_REPO_URI="https://github.com/caddyserver/caddy.git" +else + SRC_URI=" + https://github.com/caddyserver/caddy/archive/v${PV}.tar.gz -> ${P}.tar.gz + https://dev.gentoo.org/~zmedico/dist/${PF}-deps.tar.xz + https://github.com/caddyserver/dist/archive/refs/tags/v${PV}.tar.gz -> ${P}-docs.tar.gz +" + KEYWORDS="~amd64 ~arm64 ~loong ~riscv" +fi + +# MAIN +LICENSE="Apache-2.0" +# deps +LICENSE+=" BSD ECL-2.0 MIT CC0-1.0" +SLOT="0" + +IUSE='events-handlers-exec security' +RESTRICT="test" + +RDEPEND=" + acct-user/http + acct-group/http" +DEPEND="${RDEPEND}" + +FILECAPS=( + -m 755 'cap_net_bind_service=+ep' usr/bin/"${PN}" +) + +PATCHES=( + "${FILESDIR}"/remove-binary-altering-commands-2.7.5.patch +) + +# takes a module as an only arg +add_custom_module() { + local LINE_NO=$(grep -n 'plug in Caddy modules here' cmd/caddy/main.go | awk -F: '{print $1;}' || die) + sed -i -e "${LINE_NO:?}a \ _ \"$1\"" cmd/caddy/main.go || die +} + +src_unpack() { + declare -A MOOMODULES || die + + use events-handlers-exec && { MOOMODULES[exec]="github.com/mholt/caddy-events-exec" || die ; } + use security && { MOOMODULES[sec]="github.com/greenpau/caddy-security" || die ; } + + export MY_MODULES="${MOOMODULES[@]}" || die + + if [[ "${PV}" == 9999* ]]; then + # clone main git repo + git-r3_src_unpack + + # get extra modules + pushd "${P}" || die + for moo in ${MY_MODULES}; do + add_custom_module "${moo}" + ego get "${moo}" + done + popd || die + + # clone dist repo (docs and misc) + EGIT_REPO_URI="https://github.com/caddyserver/dist.git" + EGIT_CHECKOUT_DIR="${WORKDIR}/dist-${PV}" + git-r3_src_unpack + + go-module_live_vendor + else + default + fi +} + +src_prepare() { + default + sed -i -e "s|User=caddy|User=http|g;s|Group=caddy|Group=http|g;" ../dist-"${PV}"/init/*service || die + + if [[ "${PV}" != 9999* ]]; then + mv ../vendor ./ || die + eapply ../go-mod-sum.patch + + for moo in ${MY_MODULES}; do + add_custom_module "${moo}" + done + fi +} + +src_compile() { + # https://github.com/caddyserver/caddy/blob/master/caddy.go#L843 + if [[ ${PV} == 9999* ]]; then + local CUSTOM_VER="git-$(git rev-parse --short HEAD)" + else + local CUSTOM_VER="${PV}" + fi + + ego build -ldflags "-X github.com/caddyserver/caddy/v2.CustomVersion=${CUSTOM_VER}" ./cmd/caddy + local sh + for sh in bash fish zsh; do + ./caddy completion "${sh}" > completion."${sh}" || die + done + ./caddy manpage -o manpages || die +} + +src_install() { + default + + dobin "${PN}" + insinto /etc/"${PN}" + doins ../dist-"${PV}"/config/Caddyfile + systemd_dounit ../dist-"${PV}"/init/*.service + newinitd "${FILESDIR}"/initd-2.7.5 "${PN}" + newconfd "${FILESDIR}"/confd-2.7.5 "${PN}" + insinto /etc/logrotate.d + newins "${FILESDIR}/logrotated" "${PN}" + insinto /usr/share/"${PN}" + doins ../dist-"${PV}"/welcome/index.html + + newbashcomp completion.bash "${PN}" + newfishcomp completion.fish "${PN}".fish + newzshcomp completion.zsh _"${PN}" + newdoc ../dist-"${PV}"/init/README.md systemd-services-README.md + doman manpages/* +} diff --git a/www-servers/caddy/caddy-9999.ebuild b/www-servers/caddy/caddy-9999.ebuild index daa4e4571bd8..86a00c5d6ef9 100644 --- a/www-servers/caddy/caddy-9999.ebuild +++ b/www-servers/caddy/caddy-9999.ebuild @@ -26,7 +26,7 @@ LICENSE="Apache-2.0" LICENSE+=" BSD ECL-2.0 MIT CC0-1.0" SLOT="0" -IUSE='events-handlers-exec' +IUSE='events-handlers-exec security' RESTRICT="test" RDEPEND=" @@ -44,22 +44,29 @@ PATCHES=( # takes a module as an only arg add_custom_module() { - local LINE_NO=$(grep -n 'plug in Caddy modules here' cmd/caddy/main.go | awk -F: '{print $1;}') + local LINE_NO=$(grep -n 'plug in Caddy modules here' cmd/caddy/main.go | awk -F: '{print $1;}' || die) sed -i -e "${LINE_NO:?}a \ _ \"$1\"" cmd/caddy/main.go || die } src_unpack() { + declare -A MOOMODULES || die + + use events-handlers-exec && { MOOMODULES[exec]="github.com/mholt/caddy-events-exec" || die ; } + use security && { MOOMODULES[sec]="github.com/greenpau/caddy-security" || die ; } + + export MY_MODULES="${MOOMODULES[@]}" || die + if [[ "${PV}" == 9999* ]]; then # clone main git repo git-r3_src_unpack # get extra modules - if use events-handlers-exec; then - pushd "${P}" - add_custom_module 'github.com/mholt/caddy-events-exec' || die - ego get github.com/mholt/caddy-events-exec - popd - fi + pushd "${P}" || die + for moo in ${MY_MODULES}; do + add_custom_module "${moo}" + ego get "${moo}" + done + popd || die # clone dist repo (docs and misc) EGIT_REPO_URI="https://github.com/caddyserver/dist.git" @@ -68,7 +75,7 @@ src_unpack() { go-module_live_vendor else - go-module_src_unpack + default fi } @@ -76,18 +83,13 @@ src_prepare() { default sed -i -e "s|User=caddy|User=http|g;s|Group=caddy|Group=http|g;" ../dist-"${PV}"/init/*service || die - if use events-handlers-exec && [[ "${PV}" != 9999* ]]; then - add_custom_module 'github.com/mholt/caddy-events-exec' || die - cat <<-EOF >> go.sum || die - github.com/mholt/caddy-events-exec v0.0.0-20231121214933-055bfd2e8b82 h1:uRsPaFNQJRDrYcSsgnH0hFhCWFXfgB8QVH8yjX+u154= - github.com/mholt/caddy-events-exec v0.0.0-20231121214933-055bfd2e8b82/go.mod h1:Y9JjT8YLxpmk7PeUkvsWAhzzRdC6rXP7QjAHiwmvjD0= - EOF - - cat <<-EOF >> go.mod || die - require ( - github.com/mholt/caddy-events-exec v0.0.0-20231121214933-055bfd2e8b82 // indirect - ) - EOF + if [[ "${PV}" != 9999* ]]; then + mv ../vendor ./ || die + eapply ../go-mod-sum.patch + + for moo in ${MY_MODULES}; do + add_custom_module "${moo}" + done fi } diff --git a/www-servers/caddy/metadata.xml b/www-servers/caddy/metadata.xml index ede41c6d550d..caee265575b1 100644 --- a/www-servers/caddy/metadata.xml +++ b/www-servers/caddy/metadata.xml @@ -19,6 +19,11 @@ https://caddyserver.com/docs/modules/events.handlers.exec https://caddyserver.com/docs/caddyfile/options#event-options </flag> + <flag name="security"> + Authentication, Authorization, and Accounting. LDAP, OAuth, SAML, MFA, 2FA, JWT etc.. + https://caddyserver.com/docs/modules/security + https://github.com/greenpau/caddy-security + </flag> </use> <upstream> <remote-id type="github">caddyserver/caddy</remote-id> |