acme: Make sure we don't handle the same listener twice
authorToke Høiland-Jørgensen <redacted>
Tue, 8 Sep 2020 09:59:38 +0000 (11:59 +0200)
committerToke Høiland-Jørgensen <redacted>
Wed, 9 Sep 2020 10:49:53 +0000 (12:49 +0200)
If a daemon listens on multiple addresses at once, it'll show up multiple
times in get_listeners() which will clobber the config for uhttpd. Fix this
by skipping subsequent handlings of the same daemon binary.

Fixes #13325.

Signed-off-by: Toke Høiland-Jørgensen <redacted>
net/acme/Makefile
net/acme/files/run.sh

index 158037e9e578f0ff398ac6e6023c558ffa38477b..d62cce0c930156bc9def7e3c597726b2ba900a37 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=acme
 PKG_VERSION:=2.8.6
-PKG_RELEASE:=4
+PKG_RELEASE:=5
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://github.com/acmesh-official/acme.sh/archive/$(PKG_VERSION).tar.gz
index eccd3cb1810455f3ca3b59780f862c48e70ad110..5c9361f4f620ad892a75b56d6fe47ab306bb52f2 100644 (file)
@@ -77,6 +77,11 @@ pre_checks()
 
                case "$cmd" in
                        uhttpd)
+                               if [ -n "$UHTTPD_LISTEN_HTTP" ]; then
+                                       debug "Already handled uhttpd; skipping"
+                                       continue
+                               fi
+
                                debug "Found uhttpd listening on port 80; trying to disable."
 
                                UHTTPD_LISTEN_HTTP=$(uci get uhttpd.main.listen_http)
@@ -96,6 +101,11 @@ pre_checks()
                                fi
                                ;;
                        nginx*)
+                               if [ "$NGINX_WEBSERVER" -eq "1" ]; then
+                                       debug "Already handled nginx; skipping"
+                                       continue
+                               fi
+
                                debug "Found nginx listening on port 80; trying to disable."
                                NGINX_WEBSERVER=1
                                local tries=0
git clone https://git.99rst.org/PROJECT