acme: ensure symlinks for renewed certificates
authorGlen Huang <i@glenhuang.com>
Sat, 19 Nov 2022 17:26:44 +0000 (01:26 +0800)
committerGlen Huang <i@glenhuang.com>
Sun, 27 Nov 2022 16:48:27 +0000 (00:48 +0800)
Signed-off-by: Glen Huang <i@glenhuang.com>
net/acme-acmesh/Makefile
net/acme-acmesh/files/hook.sh

index fdcf1df24f87386f1a7f9baa752b9ee47e6aeb3c..0a198cc528b9829edd9995fd5a2e3b3b6b6c314d 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=acme-acmesh
 PKG_VERSION:=3.0.1
-PKG_RELEASE:=$(AUTORELEASE)
+PKG_RELEASE:=9
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://codeload.github.com/acmesh-official/acme.sh/tar.gz/$(PKG_VERSION)?
index 89c61a58ece0a6bfa4f9efad8035c17dd22e8c36..4df82643d4b83865ed972ed822ef75858b5b8b67 100644 (file)
@@ -45,6 +45,20 @@ get)
 
                        case $status in
                        0)
+                               mkdir -p /etc/ssl/acme
+                               if [ ! -e "/etc/ssl/acme/$main_domain.crt" ]; then
+                                       ln -s "$domain_dir/$main_domain.cer" "/etc/ssl/acme/$main_domain.crt"
+                               fi
+                               if [ ! -e "/etc/ssl/acme/$main_domain.key" ]; then
+                                       ln -s "$domain_dir/$main_domain.key" "/etc/ssl/acme/$main_domain.key"
+                               fi
+                               if [ ! -e "/etc/ssl/acme/$main_domain.fullchain.crt" ]; then
+                                       ln -s "$domain_dir/fullchain.cer" "/etc/ssl/acme/$main_domain.fullchain.crt"
+                               fi
+                               if [ ! -e "/etc/ssl/acme/$main_domain.chain.crt" ]; then
+                                       ln -s "$domain_dir/ca.cer" "/etc/ssl/acme/$main_domain.chain.crt"
+                               fi
+
                                $NOTIFY renewed
                                exit
                                ;;
@@ -111,7 +125,7 @@ get)
        case $status in
        0)
                ln -s "$domain_dir/$main_domain.cer" "/etc/ssl/acme/$main_domain.crt"
-               ln -s "$domain_dir/$main_domain.key" /etc/ssl/acme
+               ln -s "$domain_dir/$main_domain.key" "/etc/ssl/acme/$main_domain.key"
                ln -s "$domain_dir/fullchain.cer" "/etc/ssl/acme/$main_domain.fullchain.crt"
                ln -s "$domain_dir/ca.cer" "/etc/ssl/acme/$main_domain.chain.crt"
                $NOTIFY issued