mirror of
https://github.com/novatiq/packages.git
synced 2026-04-30 15:38:40 +01:00
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>
This commit is contained in:
committed by
Toke Høiland-Jørgensen
parent
fc42664a18
commit
cc8439566f
+1
-1
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
|
|||||||
|
|
||||||
PKG_NAME:=acme
|
PKG_NAME:=acme
|
||||||
PKG_VERSION:=2.7.8
|
PKG_VERSION:=2.7.8
|
||||||
PKG_RELEASE:=3
|
PKG_RELEASE:=4
|
||||||
PKG_LICENSE:=GPLv3
|
PKG_LICENSE:=GPLv3
|
||||||
|
|
||||||
PKG_SOURCE_PROTO:=git
|
PKG_SOURCE_PROTO:=git
|
||||||
|
|||||||
@@ -163,6 +163,12 @@ issue_cert()
|
|||||||
[ -n "$webroot" ] || [ -n "$dns" ] || pre_checks "$main_domain" || return 1
|
[ -n "$webroot" ] || [ -n "$dns" ] || pre_checks "$main_domain" || return 1
|
||||||
|
|
||||||
log "Running ACME for $main_domain"
|
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 [ -e "$STATE_DIR/$main_domain" ]; then
|
||||||
if [ "$use_staging" -eq "0" ] && is_staging "$main_domain"; then
|
if [ "$use_staging" -eq "0" ] && is_staging "$main_domain"; then
|
||||||
@@ -197,12 +203,6 @@ issue_cert()
|
|||||||
acme_args="$acme_args --webroot $webroot"
|
acme_args="$acme_args --webroot $webroot"
|
||||||
fi
|
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
|
if ! $ACME --home "$STATE_DIR" --issue $acme_args; then
|
||||||
failed_dir="$STATE_DIR/${main_domain}.failed-$(date +%s)"
|
failed_dir="$STATE_DIR/${main_domain}.failed-$(date +%s)"
|
||||||
err "Issuing cert for $main_domain failed. Moving state to $failed_dir"
|
err "Issuing cert for $main_domain failed. Moving state to $failed_dir"
|
||||||
|
|||||||
Reference in New Issue
Block a user