acme-acmesh: use validation_method option instead of guessing
The new validation_method option can be: dns, webroot or standalone. Previously we guessed the challenge type: 1. if the DNS provider is specified then it's dns 2. if standalone=1 3. fallback to webroot The logic is preserved and if the validation_method wasn't set explicitly we'll guess it in old manner. Signed-off-by: Sergey Ponomarev <stokito@gmail.com>
This commit is contained in:
parent
7d07c75154
commit
4bec28b4d1
|
@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=acme-acmesh
|
PKG_NAME:=acme-acmesh
|
||||||
PKG_VERSION:=3.0.7
|
PKG_VERSION:=3.0.7
|
||||||
PKG_RELEASE:=1
|
PKG_RELEASE:=2
|
||||||
|
|
||||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||||
PKG_SOURCE_URL:=https://codeload.github.com/acmesh-official/acme.sh/tar.gz/$(PKG_VERSION)?
|
PKG_SOURCE_URL:=https://codeload.github.com/acmesh-official/acme.sh/tar.gz/$(PKG_VERSION)?
|
||||||
|
|
|
@ -56,12 +56,12 @@ get)
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
log info "Running ACME for $main_domain"
|
log info "Running ACME for $main_domain with validation_method $validation_method"
|
||||||
|
|
||||||
if [ -e "$domain_dir" ]; then
|
if [ -e "$domain_dir" ]; then
|
||||||
if [ "$staging" = 0 ] && grep -q "acme-staging" "$domain_dir/$main_domain.conf"; then
|
if [ "$staging" = 0 ] && grep -q "acme-staging" "$domain_dir/$main_domain.conf"; then
|
||||||
mv "$domain_dir" "$domain_dir.staging"
|
mv "$domain_dir" "$domain_dir.staging"
|
||||||
log info "Certificates are previously issued from a staging server, but staging option is diabled, moved to $domain_dir.staging."
|
log info "Certificates are previously issued from a staging server, but staging option is disabled, moved to $domain_dir.staging."
|
||||||
staging_moved=1
|
staging_moved=1
|
||||||
else
|
else
|
||||||
set -- "$@" --renew --home "$state_dir" -d "$main_domain"
|
set -- "$@" --renew --home "$state_dir" -d "$main_domain"
|
||||||
|
@ -107,7 +107,8 @@ get)
|
||||||
set -- "$@" --days "$days"
|
set -- "$@" --days "$days"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$dns" ]; then
|
case "$validation_method" in
|
||||||
|
"dns")
|
||||||
set -- "$@" --dns "$dns"
|
set -- "$@" --dns "$dns"
|
||||||
if [ "$dalias" ]; then
|
if [ "$dalias" ]; then
|
||||||
set -- "$@" --domain-alias "$dalias"
|
set -- "$@" --domain-alias "$dalias"
|
||||||
|
@ -120,12 +121,18 @@ get)
|
||||||
if [ "$dns_wait" ]; then
|
if [ "$dns_wait" ]; then
|
||||||
set -- "$@" --dnssleep "$dns_wait"
|
set -- "$@" --dnssleep "$dns_wait"
|
||||||
fi
|
fi
|
||||||
elif [ "$standalone" = 1 ]; then
|
;;
|
||||||
|
"standalone")
|
||||||
set -- "$@" --standalone --listen-v6
|
set -- "$@" --standalone --listen-v6
|
||||||
else
|
;;
|
||||||
|
"webroot")
|
||||||
mkdir -p "$CHALLENGE_DIR"
|
mkdir -p "$CHALLENGE_DIR"
|
||||||
set -- "$@" --webroot "$CHALLENGE_DIR"
|
set -- "$@" --webroot "$CHALLENGE_DIR"
|
||||||
fi
|
;;
|
||||||
|
*)
|
||||||
|
log err "Unsupported validation_method $validation_method"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
set -- "$@" --issue --home "$state_dir"
|
set -- "$@" --issue --home "$state_dir"
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue