aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJannis Pinter <1999743+jannispinter@users.noreply.github.com>2020-10-16 20:59:08 +0200
committerJannis Pinter <jannis+openwrt@pinterjann.is>2020-10-16 21:47:42 +0200
commit3f7d03eda64b81fd5e68fee77eaf22bcacbacd52 (patch)
tree197dba8c8d5d60006eb3277381d5653f865faa51
parent28c075d2c870004f5c4fbf40d6835aeee6771d21 (diff)
acme: Allow custom ACME server directory URL
The underlying `acme.sh` allows custom ACME server URLs (using `--server`). Adding the necessary field to specify a custom ACME server URL from UCI. Signed-off-by: Jannis Pinter <jannis+openwrt@pinterjann.is>
-rw-r--r--net/acme/Makefile2
-rw-r--r--net/acme/files/run.sh7
2 files changed, 8 insertions, 1 deletions
diff --git a/net/acme/Makefile b/net/acme/Makefile
index 61935fb1c..de1baf473 100644
--- a/net/acme/Makefile
+++ b/net/acme/Makefile
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=acme
PKG_VERSION:=2.8.7
-PKG_RELEASE:=1
+PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/acmesh-official/acme.sh/tar.gz/$(PKG_VERSION)?
diff --git a/net/acme/files/run.sh b/net/acme/files/run.sh
index 5c9361f4f..e167b7043 100644
--- a/net/acme/files/run.sh
+++ b/net/acme/files/run.sh
@@ -210,6 +210,7 @@ issue_cert()
local user_cleanup
local ret
local domain_dir
+ local acme_server
config_get_bool enabled "$section" enabled 0
config_get_bool use_staging "$section" use_staging
@@ -223,6 +224,7 @@ issue_cert()
config_get dns "$section" dns
config_get user_setup "$section" user_setup
config_get user_cleanup "$section" user_cleanup
+ config_get acme_server "$section" acme_server
UPDATE_NGINX=$update_nginx
UPDATE_UHTTPD=$update_uhttpd
@@ -277,6 +279,11 @@ issue_cert()
[ -n "$ACCOUNT_EMAIL" ] && acme_args="$acme_args --accountemail $ACCOUNT_EMAIL"
[ "$use_staging" -eq "1" ] && acme_args="$acme_args --staging"
+ if [ -n $acme_server ]; then
+ log "Using custom ACME server URL"
+ acme_args="$acme_args --server $acme_server"
+ fi
+
if [ -n "$dns" ]; then
log "Using dns mode"
acme_args="$acme_args --dns $dns"