From 137ad9f52ebfb1ffabe973915314510d97936c84 Mon Sep 17 00:00:00 2001 From: aptalca <541623+aptalca@users.noreply.github.com> Date: Mon, 4 Mar 2024 18:10:49 -0500 Subject: [PATCH 1/5] Run package installer as part of SWAG init to prevent init fail due to missing dns plugin --- root/etc/s6-overlay/s6-rc.d/init-certbot-config/run | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/root/etc/s6-overlay/s6-rc.d/init-certbot-config/run b/root/etc/s6-overlay/s6-rc.d/init-certbot-config/run index 800a806a..4559db41 100755 --- a/root/etc/s6-overlay/s6-rc.d/init-certbot-config/run +++ b/root/etc/s6-overlay/s6-rc.d/init-certbot-config/run @@ -23,6 +23,13 @@ for i in "${SANED_VARS[@]}"; do export echo "${i}"="$(echo "${!i}" | tr '[:upper:]' '[:lower:]')" done +# Check for and install requested DNS plugins +if echo ${DOCKER_MODS} | grep -q "universal-package-install" && echo ${INSTALL_PIP_PACKAGES} | grep -q "dns"; then + echo "**** Installing requested dns plugins ****" + exec /etc/s6-overlay/s6-rc.d/init-mod-universal-package-install-add-package/run + exec /etc/s6-overlay/s6-rc.d/init-mods-package-install/run +fi + # check to make sure DNSPLUGIN is selected if dns validation is used CERTBOT_DNS_AUTHENTICATORS=$(certbot plugins --authenticators 2>/dev/null | sed -e 's/^Entry point: EntryPoint(name='\''cpanel'\''/Entry point: EntryPoint(name='\''dns-cpanel'\''/' -e '/EntryPoint(name='\''dns-/!d' -e 's/^Entry point: EntryPoint(name='\''dns-\([^ ]*\)'\'',/\1/' | sort) if [[ "${VALIDATION}" = "dns" ]] && ! echo "${CERTBOT_DNS_AUTHENTICATORS}" | grep -q "${DNSPLUGIN}"; then From 970fa75e871f6c98d13c165debe7114a88628b92 Mon Sep 17 00:00:00 2001 From: aptalca <541623+aptalca@users.noreply.github.com> Date: Mon, 4 Mar 2024 18:23:04 -0500 Subject: [PATCH 2/5] run scripts direct --- root/etc/s6-overlay/s6-rc.d/init-certbot-config/run | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/root/etc/s6-overlay/s6-rc.d/init-certbot-config/run b/root/etc/s6-overlay/s6-rc.d/init-certbot-config/run index 4559db41..15505bd0 100755 --- a/root/etc/s6-overlay/s6-rc.d/init-certbot-config/run +++ b/root/etc/s6-overlay/s6-rc.d/init-certbot-config/run @@ -26,8 +26,8 @@ done # Check for and install requested DNS plugins if echo ${DOCKER_MODS} | grep -q "universal-package-install" && echo ${INSTALL_PIP_PACKAGES} | grep -q "dns"; then echo "**** Installing requested dns plugins ****" - exec /etc/s6-overlay/s6-rc.d/init-mod-universal-package-install-add-package/run - exec /etc/s6-overlay/s6-rc.d/init-mods-package-install/run + /etc/s6-overlay/s6-rc.d/init-mod-universal-package-install-add-package/run + /etc/s6-overlay/s6-rc.d/init-mods-package-install/run fi # check to make sure DNSPLUGIN is selected if dns validation is used From 32f72ac0b4b3b72b5b76eebe432a74f57a768228 Mon Sep 17 00:00:00 2001 From: aptalca <541623+aptalca@users.noreply.github.com> Date: Mon, 4 Mar 2024 18:33:13 -0500 Subject: [PATCH 3/5] make it pretty, grep `certbot-dns` --- root/etc/s6-overlay/s6-rc.d/init-certbot-config/run | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/root/etc/s6-overlay/s6-rc.d/init-certbot-config/run b/root/etc/s6-overlay/s6-rc.d/init-certbot-config/run index 15505bd0..f3ad0aaf 100755 --- a/root/etc/s6-overlay/s6-rc.d/init-certbot-config/run +++ b/root/etc/s6-overlay/s6-rc.d/init-certbot-config/run @@ -24,7 +24,7 @@ for i in "${SANED_VARS[@]}"; do done # Check for and install requested DNS plugins -if echo ${DOCKER_MODS} | grep -q "universal-package-install" && echo ${INSTALL_PIP_PACKAGES} | grep -q "dns"; then +if grep -q "universal-package-install" <<< "${DOCKER_MODS}" && grep -q "certbot-dns" <<< "${INSTALL_PIP_PACKAGES}"; then echo "**** Installing requested dns plugins ****" /etc/s6-overlay/s6-rc.d/init-mod-universal-package-install-add-package/run /etc/s6-overlay/s6-rc.d/init-mods-package-install/run From bf21a51e1079d762b6817e855463c74c1a843aaf Mon Sep 17 00:00:00 2001 From: aptalca <541623+aptalca@users.noreply.github.com> Date: Mon, 4 Mar 2024 19:33:01 -0500 Subject: [PATCH 4/5] Update root/etc/s6-overlay/s6-rc.d/init-certbot-config/run Co-authored-by: Eric Nemchik --- root/etc/s6-overlay/s6-rc.d/init-certbot-config/run | 2 ++ 1 file changed, 2 insertions(+) diff --git a/root/etc/s6-overlay/s6-rc.d/init-certbot-config/run b/root/etc/s6-overlay/s6-rc.d/init-certbot-config/run index f3ad0aaf..b2f1053a 100755 --- a/root/etc/s6-overlay/s6-rc.d/init-certbot-config/run +++ b/root/etc/s6-overlay/s6-rc.d/init-certbot-config/run @@ -28,6 +28,8 @@ if grep -q "universal-package-install" <<< "${DOCKER_MODS}" && grep -q "certbot- echo "**** Installing requested dns plugins ****" /etc/s6-overlay/s6-rc.d/init-mod-universal-package-install-add-package/run /etc/s6-overlay/s6-rc.d/init-mods-package-install/run + echo "#!/usr/bin/with-contenv bash" >/etc/s6-overlay/s6-rc.d/init-mod-universal-package-install-add-package/run + echo "#!/usr/bin/with-contenv bash" >/etc/s6-overlay/s6-rc.d/init-mods-package-install/run fi # check to make sure DNSPLUGIN is selected if dns validation is used From 907dfc8c039427dc1cfe9b5ea449450b456e8ebd Mon Sep 17 00:00:00 2001 From: aptalca <541623+aptalca@users.noreply.github.com> Date: Mon, 4 Mar 2024 20:19:53 -0500 Subject: [PATCH 5/5] Revert "Update root/etc/s6-overlay/s6-rc.d/init-certbot-config/run" This reverts commit bf21a51e1079d762b6817e855463c74c1a843aaf. --- root/etc/s6-overlay/s6-rc.d/init-certbot-config/run | 2 -- 1 file changed, 2 deletions(-) diff --git a/root/etc/s6-overlay/s6-rc.d/init-certbot-config/run b/root/etc/s6-overlay/s6-rc.d/init-certbot-config/run index b2f1053a..f3ad0aaf 100755 --- a/root/etc/s6-overlay/s6-rc.d/init-certbot-config/run +++ b/root/etc/s6-overlay/s6-rc.d/init-certbot-config/run @@ -28,8 +28,6 @@ if grep -q "universal-package-install" <<< "${DOCKER_MODS}" && grep -q "certbot- echo "**** Installing requested dns plugins ****" /etc/s6-overlay/s6-rc.d/init-mod-universal-package-install-add-package/run /etc/s6-overlay/s6-rc.d/init-mods-package-install/run - echo "#!/usr/bin/with-contenv bash" >/etc/s6-overlay/s6-rc.d/init-mod-universal-package-install-add-package/run - echo "#!/usr/bin/with-contenv bash" >/etc/s6-overlay/s6-rc.d/init-mods-package-install/run fi # check to make sure DNSPLUGIN is selected if dns validation is used