]> git.openstreetmap.org Git - chef.git/commitdiff
letsencrypt: ensure request script runs as correct user
authorGrant Slater <github@firefishy.com>
Wed, 26 Feb 2025 19:46:28 +0000 (19:46 +0000)
committerGrant Slater <github@firefishy.com>
Wed, 26 Feb 2025 19:46:28 +0000 (19:46 +0000)
cookbooks/letsencrypt/templates/default/request.erb

index ccdc25fedf7894f98297dd6d0ed85afc19982798..8bb2847cae8016fa30b976d857961935469279b4 100644 (file)
@@ -2,6 +2,11 @@
 
 # DO NOT EDIT - This file is being maintained by Chef
 
+if [ "$(id -un)" != "letsencrypt" ]; then
+    echo "Error: This script must be run as user letsencrypt" >&2
+    exit 1
+fi
+
 /usr/bin/certbot certonly \
     --non-interactive \
     --config-dir /srv/acme.openstreetmap.org/config \