Skip to content

Commit b7848ec

Browse files
authored
Add the domain output in case of a failure while running... (hestiacp#1544)
* Add the domain output in case of a failure while running... ... v-update-letsencrypt, so the e-mail notification already includes the right domain name to validate and proceed with further debug. This commit fixes hestiacp#1542. * Update v-add-letsencrypt-domain
1 parent aeb07fe commit b7848ec

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

bin/v-add-letsencrypt-domain

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,8 @@ $BIN/v-add-letsencrypt-user $user
139139
if [ "$?" -ne 0 ]; then
140140
touch $HESTIA/data/queue/letsencrypt.pipe
141141
sed -i "/ $domain /d" $HESTIA/data/queue/letsencrypt.pipe
142-
send_notice "LETSENCRYPT" "Account registration failed"
143-
check_result $E_CONNECT "LE account registration" > /dev/null
142+
send_notice "LETSENCRYPT" "Account registration failed ($user)"
143+
check_result $E_CONNECT "LE account registration ($user)" > /dev/null
144144
fi
145145

146146
# Parsing LetsEncrypt account data
@@ -205,7 +205,7 @@ if [[ "$status" -ne 200 ]]; then
205205
fi
206206
fi
207207
fi
208-
check_result $E_CONNECT "Let's Encrypt nonce request status $status"
208+
check_result $E_CONNECT "Let's Encrypt nonce request status $status ($domain)"
209209
fi
210210

211211
# Placing new order / STEP 2
@@ -236,7 +236,7 @@ if [[ "$status" -ne 201 ]]; then
236236
fi
237237
fi
238238
fi
239-
check_result $E_CONNECT "Let's Encrypt new auth status $status"
239+
check_result $E_CONNECT "Let's Encrypt new auth status $status ($domain)"
240240
fi
241241

242242
# Requesting authorization token / STEP 3
@@ -262,7 +262,7 @@ for auth in $authz; do
262262
fi
263263
fi
264264
fi
265-
check_result $E_CONNECT "Let's Encrypt acme/authz bad status $status"
265+
check_result $E_CONNECT "Let's Encrypt acme/authz bad status $status ($domain)"
266266
fi
267267

268268
# Accepting challenge / STEP 4
@@ -275,7 +275,7 @@ for auth in $authz; do
275275
$BIN/v-delete-dns-record $user $domain $old_record
276276
done
277277
$BIN/v-add-dns-record $user $domain "_acme-challenge" "TXT" $record
278-
check_result $? "DNS _acme-challenge record wasn't created"
278+
check_result $? "DNS _acme-challenge record wasn't created ($domain)"
279279
else
280280
if [ -z "$mail" ]; then
281281
if [ "$WEB_SYSTEM" = 'nginx' ] || [ "$PROXY_SYSTEM" = 'nginx' ]; then
@@ -357,7 +357,7 @@ for auth in $authz; do
357357
fi
358358
fi
359359
debug_log "Abort Step 5" "=> Wrong status"
360-
check_result $E_CONNECT "Let's Encrypt validation status $status. Details: $details"
360+
check_result $E_CONNECT "Let's Encrypt validation status $status ($domain). Details: $details"
361361
fi
362362

363363
i=$((i + 1))
@@ -374,7 +374,7 @@ for auth in $authz; do
374374
fi
375375
fi
376376
debug_log "Abort Step 5" "=> Too many validation retries"
377-
check_result $E_CONNECT "Let's Encrypt domain validation timeout"
377+
check_result $E_CONNECT "Let's Encrypt domain validation timeout ($domain)"
378378
fi
379379
sleep $((i*2))
380380
done
@@ -390,7 +390,7 @@ for auth in $authz; do
390390
fi
391391
fi
392392
fi
393-
check_result $E_CONNECT "Let's Encrypt domain verification failed"
393+
check_result $E_CONNECT "Let's Encrypt domain verification failed ($domain)"
394394
fi
395395
done
396396

@@ -410,7 +410,7 @@ debug_log "Step 6" "- status: ${status}\n- nonce: ${nonce}\n- payload: ${payload
410410

411411
if [[ "$status" -ne 200 ]]; then
412412
[ -d "$ssl_dir" ] && rm -rf "$ssl_dir"
413-
check_result $E_CONNECT "Let's Encrypt finalize bad status $status"
413+
check_result $E_CONNECT "Let's Encrypt finalize bad status $status ($domain)"
414414
fi
415415

416416
# Downloading signed certificate / STEP 7
@@ -445,7 +445,7 @@ debug_log "CERT PEM" "$(cat "$ssl_dir/$domain.pem")"
445445

446446
if [[ "$status" -ne 200 ]]; then
447447
[ -d "$ssl_dir" ] && rm -rf "$ssl_dir"
448-
check_result $E_NOTEXIST "Let's Encrypt downloading signed cert failed status:$status"
448+
check_result $E_NOTEXIST "Let's Encrypt downloading signed cert failed status:$status ($domain)"
449449
fi
450450

451451
# Splitting up downloaded pem
@@ -492,7 +492,7 @@ if [ "$?" -ne '0' ]; then
492492
[ -d "$ssl_dir" ] && rm -rf "$ssl_dir"
493493
touch $HESTIA/data/queue/letsencrypt.pipe
494494
sed -i "/ $domain /d" $HESTIA/data/queue/letsencrypt.pipe
495-
send_notice 'LETSENCRYPT' "$domain certificate installation failed"
495+
send_notice 'LETSENCRYPT' "$domain certificate installation failed ($domain)"
496496
check_result $? "SSL install" > /dev/null
497497
fi
498498

0 commit comments

Comments
 (0)