-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use currently-maintained Hurricane Electric certbot plugin #3856
base: master
Are you sure you want to change the base?
Use currently-maintained Hurricane Electric certbot plugin #3856
Conversation
The old plugin hasn't been updated since 2019. A newer plugin has been much more recently maintained and should be used instead, as this fixes several bugs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems you haven't yet signed a CLA. Please do so here.
Once you do that we will be able to review and accept this pull request.
Thanks!
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
📝 Walkthrough📝 WalkthroughWalkthroughThe changes include updates to the Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your PR!
You also have to adjust the DNS provider name: Currently dns-he
is used, this would need to change to dns-hurricane_electric
looking at the readme at https://github.com/studioeng/certbot-dns-hurricane-electric. I'd suggest to just set DNS_PROVIDER=dns-hurricane_electric
on line 247, so the current settings remain backwards compatible.
It seems that the new library uses different keys in the configuration files (dns_hurricane_electric_user
instead of dns_he_user
and dns_hurricane_electric_pass
instead of dns_he_pass
).
We currently use he_user
and he_pass
in the add-on config, for backwards compatibility we should leave those as is.
Uses new provider name, cleans up whitespace
Appreciate the feedback! I believe I've incorporated the required changes - let me know if there's anything else amiss. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Outside diff range and nitpick comments (1)
letsencrypt/rootfs/etc/services.d/lets-encrypt/run (1)
248-251
: LGTM! Consider adding a deprecation notice.The changes correctly implement the new Hurricane Electric DNS provider while maintaining backwards compatibility. The implementation follows the same pattern as other DNS providers in the file.
Consider adding a comment indicating that the
dns.he_*
configuration keys are deprecated in favor ofdns.hurricane_electric_*
to help users transition to the new naming scheme in the future.# Hurricane Electric elif [ "${CHALLENGE}" == "dns" ] && [ "${DNS_PROVIDER}" == "dns-hurricane_electric" ]; then + # TODO: The dns.he_* config keys are deprecated and will be replaced with dns.hurricane_electric_* in a future release bashio::config.require 'dns.he_user' bashio::config.require 'dns.he_pass'
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
letsencrypt/CHANGELOG.md
(1 hunks)letsencrypt/build.yaml
(1 hunks)letsencrypt/config.yaml
(2 hunks)letsencrypt/rootfs/etc/cont-init.d/file-structure.sh
(1 hunks)letsencrypt/rootfs/etc/services.d/lets-encrypt/run
(3 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
- letsencrypt/build.yaml
- letsencrypt/CHANGELOG.md
- letsencrypt/config.yaml
🔇 Additional comments (1)
letsencrypt/rootfs/etc/cont-init.d/file-structure.sh (1)
77-78
: LGTM! Well-handled backwards compatibility.
The changes correctly map the old configuration keys (dns.he_user
and dns.he_pass
) to the new variable names (dns_hurricane_electric_user
and dns_hurricane_electric_pass
) required by the updated plugin, ensuring a smooth transition for existing users.
@@ -310,7 +310,7 @@ if bashio::config.exists 'key_type'; then | |||
fi | |||
else | |||
bashio::log.info "Detecting existing certificate type for ${DOMAIN_ARR[1]}" | |||
readarray -t CBCERTS < <(certbot certificates --non-interactive --cert-name "${DOMAIN_ARR[1]}" --config-dir "$CERT_DIR" --work-dir "$WORK_DIR") | |||
readarray -t CBCERTS < <(certbot certificates --non-interactive --cert-name "${DOMAIN_ARR[1]}" --config-dir "$CERT_DIR" --work-dir "$WORK_DIR") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a safety check for empty domains array.
The command uses ${DOMAIN_ARR[1]}
without verifying that the array contains elements, which could lead to an error if no domains are configured.
+ if [ ${#DOMAIN_ARR[@]} -eq 0 ]; then
+ bashio::log.error "No domains configured"
+ exit 1
+ fi
readarray -t CBCERTS < <(certbot certificates --non-interactive --cert-name "${DOMAIN_ARR[1]}" --config-dir "$CERT_DIR" --work-dir "$WORK_DIR")
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
readarray -t CBCERTS < <(certbot certificates --non-interactive --cert-name "${DOMAIN_ARR[1]}" --config-dir "$CERT_DIR" --work-dir "$WORK_DIR") | |
if [ ${#DOMAIN_ARR[@]} -eq 0 ]; then | |
bashio::log.error "No domains configured" | |
exit 1 | |
fi | |
readarray -t CBCERTS < <(certbot certificates --non-interactive --cert-name "${DOMAIN_ARR[1]}" --config-dir "$CERT_DIR" --work-dir "$WORK_DIR") |
The currently used Hurricane Electric Certbot plugin hasn't been updated since 2019 and has a bug preventing it from validating subdomains from Hurricane Electric.
This updates the Letsencrypt addon to use a currently-updated Hurricane Electric certbot plugin.
Summary by CodeRabbit
New Features
Bug Fixes
Chores