From 76f17ab15b49a7cb666fcdc9fd3602a3dd527c7c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Toke=20H=C3=B8iland-J=C3=B8rgensen?= Date: Tue, 19 Nov 2024 14:31:54 +0100 Subject: [PATCH] acme-common: Create challenge directory on boot MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The challenge directory (for webroot challenges) is on a tmpfs, which means it doesn't exist on boot. Some web servers (uhttpd in particular) don't like being configured to serve files from a non-existent directory. So add a boot() section to the ACME init script that just creates the challenge directory, and make sure it runs relatively early. That should take care of the non-existent directory issue, while still keeping the actual certificate renewal controlled by cron. Signed-off-by: Toke Høiland-Jørgensen --- net/acme-common/Makefile | 2 +- net/acme-common/files/acme.init | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/net/acme-common/Makefile b/net/acme-common/Makefile index 8e012dfb07..e87f681602 100644 --- a/net/acme-common/Makefile +++ b/net/acme-common/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=acme-common -PKG_VERSION:=1.4.0 +PKG_VERSION:=1.4.1 PKG_MAINTAINER:=Toke Høiland-Jørgensen PKG_LICENSE:=GPL-3.0-only diff --git a/net/acme-common/files/acme.init b/net/acme-common/files/acme.init index ba5d04165f..4f1a8f4d6d 100644 --- a/net/acme-common/files/acme.init +++ b/net/acme-common/files/acme.init @@ -1,5 +1,6 @@ #!/bin/sh /etc/rc.common +START=20 USE_PROCD=1 run_dir=/var/run/acme export CHALLENGE_DIR=$run_dir/challenge @@ -157,3 +158,8 @@ service_triggers() { procd_add_config_trigger config.change acme \ /etc/init.d/acme start } + +boot() { + mkdir -p "$CHALLENGE_DIR" + return 0 +} -- 2.30.2