Просмотр исходного кода

Implement LE Pre- and Post Hooks. (#4925)

* Implement LE Pre- and Post Hooks.

* Improve if validatin checks and add arguments, thx @sahsanu!

* Run Formatting

---------

Co-authored-by: Jaap Marcus <9754650+jaapmarcus@users.noreply.github.com>
Raphael 11 месяцев назад
Родитель
Сommit
0d7e6c37ea
1 измененных файлов с 10 добавлено и 0 удалено
  1. 10 0
      bin/v-add-letsencrypt-domain

+ 10 - 0
bin/v-add-letsencrypt-domain

@@ -34,6 +34,11 @@ if [[ "$LE_STAGING" = 'yes' ]]; then
 	LE_API='https://acme-staging-v02.api.letsencrypt.org'
 fi
 
+# LE Pre-Hook
+if [ -x "/etc/hestiacp/hooks/le_pre.sh" ]; then
+	/etc/hestiacp/hooks/le_pre.sh "$user" "$domain" "$aliases" "$mail"
+fi
+
 # encode base64
 encode_base64() {
 	cat | base64 | tr '+/' '-_' | tr -d '\r\n='
@@ -611,6 +616,11 @@ else
 	update_object_value 'mail' 'DOMAIN' "$root_domain" '$LETSENCRYPT_FAIL_COUNT' "0"
 fi
 
+# LE Post-Hook
+if [ -x "/etc/hestiacp/hooks/le_post.sh" ]; then
+	/etc/hestiacp/hooks/le_post.sh "$user" "$domain" "$aliases" "$mail"
+fi
+
 # Remove challenge folder if exist
 if [ -n "$well_known" ]; then
 	rm -fr $well_known