Browse Source

acme: Fix loading credentials

Move loading credential function before cert renewal call as credentials might be needed for some renewal operations ( ex: DNS )

Signed-off-by: Adrien DAURIAT <16813527+dauriata@users.noreply.github.com>
[toke@toke.dk: Port to master branch]
Signed-off-by: Toke Høiland-Jørgensen <toke@toke.dk>
lilik-openwrt-22.03
Adrien DAURIAT 6 years ago
committed by Toke Høiland-Jørgensen
parent
commit
3439c008e5
1 changed files with 6 additions and 6 deletions
  1. +6
    -6
      net/acme/files/run.sh

+ 6
- 6
net/acme/files/run.sh View File

@ -204,6 +204,12 @@ issue_cert()
[ -n "$webroot" ] || [ -n "$dns" ] || pre_checks "$main_domain" || return 1
log "Running ACME for $main_domain"
handle_credentials() {
local credential="$1"
eval export $credential
}
config_list_foreach "$section" credentials handle_credentials
if [ -e "$STATE_DIR/$main_domain" ]; then
if [ "$use_staging" -eq "0" ] && is_staging "$main_domain"; then
@ -240,12 +246,6 @@ issue_cert()
acme_args="$acme_args --webroot $webroot"
fi
handle_credentials() {
local credential="$1"
eval export $credential
}
config_list_foreach "$section" credentials handle_credentials
if ! $ACME --home "$STATE_DIR" --issue $acme_args; then
failed_dir="$STATE_DIR/${main_domain}.failed-$(date +%s)"
err "Issuing cert for $main_domain failed. Moving state to $failed_dir"


Loading…
Cancel
Save