summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app-crypt/dehydrated/Manifest1
-rw-r--r--app-crypt/dehydrated/dehydrated-0.7.0.ebuild50
-rw-r--r--app-crypt/dehydrated/files/dehydrated-0.7.0-fix-CN-extraction-for-older-openssl-versions.patch30
3 files changed, 81 insertions, 0 deletions
diff --git a/app-crypt/dehydrated/Manifest b/app-crypt/dehydrated/Manifest
index e13b79053a90..0feddd582c27 100644
--- a/app-crypt/dehydrated/Manifest
+++ b/app-crypt/dehydrated/Manifest
@@ -1 +1,2 @@
DIST dehydrated-0.6.5.tar.gz 82274 BLAKE2B 3c8138bafdaab9c60db1463860d6c16dd0fb8e686f368e55a4fa010d004f350d03cdd161dde38361411506959f896a25ef802b76432c0fcd89a69d75fe1be9c9 SHA512 da8ff3ecb7ddeb25356469fa272aef4e7c3705049caf88d09656dbc4baf29e0efa135e6f154c78cec82da17a27a78f2145ee3b7bd71521a080e10550d09b8a53
+DIST dehydrated-0.7.0.tar.gz 86574 BLAKE2B 35a3b0b7592126ca65003a6c9eb8934a76584710d028057e5add7f77bb2fa3799e89a060306da3b98a62d291229a2a78f23e0f95f19e033796aee31e97b94488 SHA512 47740d2d31ca73482a4fc5ed0dfce986af907dd5449cb3a5230bf9683845686c8122fc32e6219a4439574ef11d6fb104ee09591c5ff667927a2c9c13ba005511
diff --git a/app-crypt/dehydrated/dehydrated-0.7.0.ebuild b/app-crypt/dehydrated/dehydrated-0.7.0.ebuild
new file mode 100644
index 000000000000..a0b9dd29497c
--- /dev/null
+++ b/app-crypt/dehydrated/dehydrated-0.7.0.ebuild
@@ -0,0 +1,50 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="7"
+
+DESCRIPTION="a client for signing certificates with an ACME-server"
+HOMEPAGE="https://github.com/lukas2511/dehydrated"
+SRC_URI="https://github.com/lukas2511/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~x86"
+IUSE="+cron"
+
+RDEPEND="acct-group/dehydrated
+ acct-user/dehydrated
+ app-shells/bash
+ net-misc/curl
+ cron? ( virtual/cron )"
+
+PATCHES=( "${FILESDIR}"/${P}-fix-CN-extraction-for-older-openssl-versions.patch )
+
+src_configure() {
+ default
+ sed -i 's,^#CONFIG_D=.*,CONFIG_D="/etc/dehydrated/config.d",' docs/examples/config || die "could not set config (CONFIG_D)"
+}
+
+src_install() {
+ dobin ${PN}
+ insinto /etc/${PN}
+ doins docs/examples/{config,domains.txt,hook.sh}
+ fperms u+x /etc/${PN}/hook.sh
+ dodoc docs/*.md
+
+ insinto /etc/${PN}/config.d
+ doins "${FILESDIR}"/00_gentoo.sh
+
+ if use cron ; then
+ insinto /etc/cron.d
+ newins "${FILESDIR}"/cron ${PN}
+ fi
+}
+
+pkg_postinst() {
+ if [[ -z "${REPLACING_VERSIONS}" ]] ; then
+ einfo "See /etc/dehydrated/config for configuration."
+
+ use cron && einfo "After finishing setup you should enable the cronjob in /etc/cron.d/dehydrated."
+ fi
+}
diff --git a/app-crypt/dehydrated/files/dehydrated-0.7.0-fix-CN-extraction-for-older-openssl-versions.patch b/app-crypt/dehydrated/files/dehydrated-0.7.0-fix-CN-extraction-for-older-openssl-versions.patch
new file mode 100644
index 000000000000..91188fbe3587
--- /dev/null
+++ b/app-crypt/dehydrated/files/dehydrated-0.7.0-fix-CN-extraction-for-older-openssl-versions.patch
@@ -0,0 +1,30 @@
+From 29b67962ac07d5d2b24f69c863a9ef31e8ac53ee Mon Sep 17 00:00:00 2001
+From: Lukas Schauer <lukas@schauer.so>
+Date: Fri, 11 Dec 2020 18:02:51 +0100
+Subject: [PATCH] fix CN extraction for older openssl versions
+
+---
+ dehydrated | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/dehydrated b/dehydrated
+index 622165e..37e0ab6 100755
+--- a/dehydrated
++++ b/dehydrated
+@@ -926,14 +926,14 @@ extract_altnames() {
+ printf "%s" "${altnames}" | tr '\n' ' '
+ else
+ # No SANs, extract CN
+- altnames="$( <<<"${reqtext}" grep '^[[:space:]]*Subject:' | _sed -e 's/.* CN ?= ?([^ /,]*).*/\1/' )"
++ altnames="$( <<<"${reqtext}" grep '^[[:space:]]*Subject:' | _sed -e 's/.*[ /]CN ?= ?([^ /,]*).*/\1/' )"
+ printf "%s" "${altnames}"
+ fi
+ }
+
+ # Get last issuer CN in certificate chain
+ get_last_cn() {
+- <<<"${1}" _sed 'H;/-----BEGIN CERTIFICATE-----/h;$!d;x' | "${OPENSSL}" x509 -noout -issuer | head -n1 | _sed -e 's/.* CN ?= ?([^/,]*).*/\1/'
++ <<<"${1}" _sed 'H;/-----BEGIN CERTIFICATE-----/h;$!d;x' | "${OPENSSL}" x509 -noout -issuer | head -n1 | _sed -e 's/.*[ /]CN ?= ?([^/,]*).*/\1/'
+ }
+
+ # Create certificate for domain(s) and outputs it FD 3