aboutsummaryrefslogtreecommitdiff
path: root/net/haproxy
diff options
context:
space:
mode:
authorGlen Huang <heyhgl@gmail.com>2022-01-29 20:54:35 +0800
committerToke Høiland-Jørgensen <toke@toke.dk>2022-08-16 00:32:04 +0200
commite84f6514538f0638507ce8066f801374db6f4150 (patch)
tree9274e85ce94512361980aade53f6b0864b819574 /net/haproxy
parentb02fea131b7fe0de5bf5132e2e3104eb343aa06f (diff)
acme: use the hotplug system
Signed-off-by: Glen Huang <heyhgl@gmail.com>
Diffstat (limited to 'net/haproxy')
-rw-r--r--net/haproxy/Makefile2
-rw-r--r--net/haproxy/files/acme.hotplug12
2 files changed, 14 insertions, 0 deletions
diff --git a/net/haproxy/Makefile b/net/haproxy/Makefile
index 3b882d954..bd47c15bb 100644
--- a/net/haproxy/Makefile
+++ b/net/haproxy/Makefile
@@ -122,6 +122,8 @@ define Package/haproxy/install
$(INSTALL_CONF) ./files/haproxy.cfg $(1)/etc/
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/haproxy.init $(1)/etc/init.d/haproxy
+ $(INSTALL_DIR) $(1)/etc/hotplug.d/acme
+ $(INSTALL_DATA) ./files/acme.hotplug $(1)/etc/hotplug.d/acme/00-haproxy
endef
Package/haproxy-nossl/install = $(Package/haproxy/install)
diff --git a/net/haproxy/files/acme.hotplug b/net/haproxy/files/acme.hotplug
new file mode 100644
index 000000000..5a4dc5cdd
--- /dev/null
+++ b/net/haproxy/files/acme.hotplug
@@ -0,0 +1,12 @@
+case $ACTION in
+issued|renewed)
+ cat \
+ "/etc/ssl/acme/$main_domain.fullchain.cer" \
+ "/etc/ssl/acme/$main_domain.key" \
+ >"/etc/ssl/acme/$main_domain.combined.cer"
+ ;;
+esac
+
+if [ "$ACTION" = renewed ]; then
+ /etc/init.d/haproxy reload
+fi