Skip to content

Commit 176427e

Browse files
committed
Update
The update_current_certificates function to automatically open port 80 for ACME-based (HTTP-01 challenge) certificate renewals and close it afterward. The change ensures seamless certificate updates for domains using ACME, improving reliability and security by minimizing manual intervention. Error handling for port operations and detailed logging have been added to enhance robustness.
1 parent 9b4cfc8 commit 176427e

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

‎install_remnawave.sh‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3213,11 +3213,20 @@ EOL
32133213
fi
32143214

32153215
if [ "$days_left" -le "$renew_threshold" ]; then
3216+
if [ "$cert_method" == "2" ]; then
3217+
ufw allow 80/tcp && ufw reload >/dev/null 2>&1
3218+
fi
3219+
32163220
certbot renew --cert-name "$domain" --no-random-sleep-on-renew >> /var/log/letsencrypt/letsencrypt.log 2>&1 &
32173221
local cert_pid=$!
32183222
spinner $cert_pid "${LANG[WAITING]}"
32193223
wait $cert_pid
32203224
local certbot_exit_code=$?
3225+
3226+
if [ "$cert_method" == "2" ]; then
3227+
ufw delete allow 80/tcp && ufw reload >/dev/null 2>&1
3228+
fi
3229+
32213230
if [ "$certbot_exit_code" -ne 0 ]; then
32223231
cert_status["$cert_domain"]="${LANG[ERROR_UPDATE]}: ${LANG[RATE_LIMIT_EXCEEDED]}"
32233232
continue

0 commit comments

Comments
 (0)