From 0e6fbd3e784d2e9f2ee1f3a7839446c75e6399ca Mon Sep 17 00:00:00 2001 From: Franziska Kunsmann Date: Fri, 17 Dec 2021 11:28:10 +0100 Subject: [PATCH] add scripts/passwords-for and scripts/letsencrypt-wildcard --- scripts/letsencrypt-wildcard | 74 ++++++++++++++++++++++++++++++++++++ scripts/passwords-for | 32 ++++++++++++++++ 2 files changed, 106 insertions(+) create mode 100755 scripts/letsencrypt-wildcard create mode 100755 scripts/passwords-for diff --git a/scripts/letsencrypt-wildcard b/scripts/letsencrypt-wildcard new file mode 100755 index 0000000..98eca7a --- /dev/null +++ b/scripts/letsencrypt-wildcard @@ -0,0 +1,74 @@ +#!/usr/bin/env bash + +if [[ -z "$1" ]] || [[ "$1" == '--help' ]] +then + echo "Usage: $0 " + exit 1 +fi + +set -e + +domain=$1 +certalias="_.$1" + +tmpdir=$(mktemp -d) +trap 'cd /; rm -Rf "$tmpdir"' EXIT + +export BW_REPO_PATH="${BW_REPO_PATH:-$PWD}" + +cd -- "$tmpdir" +git clone https://github.com/dehydrated-io/dehydrated.git +cd dehydrated +git checkout "$(git describe --tags --abbrev=0)" + +cat >config <hook <<"EOF" +#!/usr/bin/env bash + +if [[ "$1" == 'deploy_challenge' ]] +then + domain=$2 + token_value=$4 + + echo + echo You must now provide this DNS record: + echo "$(tput bold)_acme-challenge.$domain. IN TXT $token_value$(tput sgr0)" + echo + echo "Hit ENTER once it's available." + read +fi +EOF +chmod +x hook + +cat <