Fix crash running /app/force_renew
Some checks failed
Build and publish Docker image / Build and publish Docker image (push) Has been cancelled

This commit is contained in:
nicolas.dorier 2024-01-26 16:07:49 +09:00
parent 3badf7e255
commit 28590c301b
No known key found for this signature in database
GPG Key ID: 6618763EF09186FE
3 changed files with 21 additions and 15 deletions

View File

@ -6,21 +6,7 @@ set -u
# shellcheck source=functions.sh
source /app/functions.sh
if [[ "$ACME_CA_URI" == "https://acme-v01.api.letsencrypt.org/directory" ]] || \
[[ "$ACME_CA_URI" == "production" ]] || \
[[ "$ACME_CA_URI" == "prod" ]]; then
original_acme="$ACME_CA_URI"
export ACME_CA_URI="https://acme-v02.api.letsencrypt.org/directory"
echo "Info: Rewriting ACME_CA_URI from $original_acme to $ACME_CA_URI"
fi
if [[ "$ACME_CA_URI" == "https://acme-staging.api.letsencrypt.org/directory" ]] || \
[[ "$ACME_CA_URI" == "staging" ]] || \
[[ "$ACME_CA_URI" == "test" ]]; then
original_acme="$ACME_CA_URI"
export ACME_CA_URI="https://acme-staging-v02.api.letsencrypt.org/directory"
echo "Info: Rewriting ACME_CA_URI from $original_acme to $ACME_CA_URI"
fi
load_acme_ca_uri
function print_version {
if [[ -n "${COMPANION_VERSION:-}" ]]; then

View File

@ -429,3 +429,21 @@ function set_ownership_and_permissions {
return 1
fi
}
function load_acme_ca_uri {
if [[ "$ACME_CA_URI" == "https://acme-v01.api.letsencrypt.org/directory" ]] || \
[[ "$ACME_CA_URI" == "production" ]] || \
[[ "$ACME_CA_URI" == "prod" ]]; then
original_acme="$ACME_CA_URI"
export ACME_CA_URI="https://acme-v02.api.letsencrypt.org/directory"
echo "Info: Rewriting ACME_CA_URI from $original_acme to $ACME_CA_URI"
fi
if [[ "$ACME_CA_URI" == "https://acme-staging.api.letsencrypt.org/directory" ]] || \
[[ "$ACME_CA_URI" == "staging" ]] || \
[[ "$ACME_CA_URI" == "test" ]]; then
original_acme="$ACME_CA_URI"
export ACME_CA_URI="https://acme-staging-v02.api.letsencrypt.org/directory"
echo "Info: Rewriting ACME_CA_URI from $original_acme to $ACME_CA_URI"
fi
}

View File

@ -3,6 +3,8 @@
# shellcheck source=functions.sh
source /app/functions.sh
load_acme_ca_uri
CERTS_UPDATE_INTERVAL="${CERTS_UPDATE_INTERVAL:-3600}"
ACME_CA_URI="${ACME_CA_URI:-"https://acme-v02.api.letsencrypt.org/directory"}"
ACME_CA_TEST_URI="https://acme-staging-v02.api.letsencrypt.org/directory"