Skip to content

Commit

Permalink
acme-common: Create challenge directory on boot
Browse files Browse the repository at this point in the history
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 <toke@toke.dk>
  • Loading branch information
tohojo committed Dec 12, 2024
1 parent edf093f commit 76f17ab
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion net/acme-common/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 <toke@toke.dk>
PKG_LICENSE:=GPL-3.0-only
Expand Down
6 changes: 6 additions & 0 deletions net/acme-common/files/acme.init
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
}

0 comments on commit 76f17ab

Please sign in to comment.