Skip to content

fix: renew standalone certificates with nginx running - #163

Open
ermolaev-bst wants to merge 1 commit into
eGamesAPI:mainfrom
ermolaev-bst:fix/certbot-standalone-renewal
Open

fix: renew standalone certificates with nginx running#163
ermolaev-bst wants to merge 1 commit into
eGamesAPI:mainfrom
ermolaev-bst:fix/certbot-standalone-renewal

Conversation

@ermolaev-bst

@ermolaev-bst ermolaev-bst commented Aug 20, 2026

Copy link
Copy Markdown

🔀 Description of Change

  • Improvement in Certificate Renewal Process
    The installation script has been made more robust by incorporating checks to ensure other running processes are not interrupted during the certificate renewal using ACME HTTP-01 challenge. These changes streamline the certificate renewal process, improve error messages in case the renewal fails, and allow better management when working with different certificate configurations.

  • Enhancements in English Language Messaging
    Added a clearer and more user-friendly error message in English for situations when the certificate renewal fails. This new addition will improve user understanding and troubleshooting attempts.

  • Additions to Russian Language Messaging
    To maintain relevance with the updated English messaging, a new error message has also been added in Russian. This ensures an equal level of clarity and usability for Russian speaking users during certificate renewal issues.

Fixes Certbot renewal for HTTP-01 standalone certificates when remnawave-nginx already owns port 80.

What was wrong

  • standalone renewal attempted to bind port 80 without stopping nginx;
  • generated renewal hooks used a hard-coded /opt/remnawave path, which is invalid for node-only installations under /opt/remnanode;
  • docker compose down remnawave-nginx is not a valid service-scoped Compose command;
  • every Certbot failure was reported as a Let's Encrypt rate-limit error;
  • the temporary UFW rule was not reliably removed after a failed cron renewal.

Changes

  • configure pre/post hooks for standalone certificates to stop and start remnawave-nginx;
  • configure a deploy hook for DNS-01 certificates;
  • stop and restore nginx when issuing an additional standalone certificate;
  • detect the authenticator from existing renewal configurations;
  • preserve the Certbot exit status while always cleaning up the temporary UFW rule;
  • replace the misleading rate-limit message with a pointer to the Certbot log;
  • remove hard-coded Compose paths from renewal hooks.

Verification

  • bash -n install_remnawave.sh src/lang/en.sh src/lang/ru.sh
  • git diff --check
  • standalone and DNS renewal-hook generation smoke tests
  • successful live renewal of two expired standalone certificates
  • successful certbot renew --dry-run --no-random-sleep-on-renew

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant