Skip to content

duckDns: Revert renew each domain first#4122

Closed
Xebozone wants to merge 1 commit into
home-assistant:masterfrom
Xebozone:DuckDNS_RevertSingleTxt
Closed

duckDns: Revert renew each domain first#4122
Xebozone wants to merge 1 commit into
home-assistant:masterfrom
Xebozone:DuckDNS_RevertSingleTxt

Conversation

@Xebozone

@Xebozone Xebozone commented Aug 15, 2025

Copy link
Copy Markdown
Contributor
  • Revert behavior for renewing each domain separately
  • Dehydrated needs some fixes to support this first

Summary by CodeRabbit

  • Bug Fixes

    • Streamlined certificate renewal into a single bulk run, reducing redundant per-domain executions and improving stability.
    • Adjusted renewal behavior to align more closely with earlier versions while retaining wildcard support.
    • Reduced unnecessary log output during renewal.
  • Documentation

    • Added 1.26.0 changelog entry summarizing renewal updates and improvements.
  • Chores

    • Bumped version to 1.26.0.

- Dehydrated needs some fixes to support this first
@coderabbitai

coderabbitai Bot commented Aug 15, 2025

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

Version bumped to 1.26.0, changelog updated. Renewal script altered to disable per-domain dehydrated calls inside the loop and rely on a single bulk dehydrated invocation with aggregated domain arguments. A prior informational log line was commented out. No other behavioral or structural changes.

Changes

Cohort / File(s) Summary of Changes
Documentation
duckdns/CHANGELOG.md
Added 1.26.0 entry with notes on rate-limit workaround and fallback renewal behavior; no other entries modified.
Addon Manifest
duckdns/config.yaml
Bumped version from 1.25.0 to 1.26.0; no other keys changed.
Renewal Flow Script
duckdns/rootfs/etc/s6-overlay/s6-rc.d/duckdns/run
Commented out per-domain dehydrated invocations and an info log; retained single bulk dehydrated call using aggregated domain_args.

Sequence Diagram(s)

sequenceDiagram
    participant S6 as s6 service
    participant Script as duckdns/run
    participant Dehyd as dehydrated
    participant LE as Let's Encrypt

    S6->>Script: Start renewal
    Script->>Script: Collect domains/aliases into domain_args
    Note over Script: Per-domain dehydrated calls disabled
    Script->>Dehyd: Run once with aggregated domain_args
    Dehyd->>LE: ACME challenges/renewals
    LE-->>Dehyd: Certificates/response
    Dehyd-->>Script: Result
    Script-->>S6: Exit
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai or @coderabbitai title anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (4)
duckdns/CHANGELOG.md (1)

5-6: Tighten phrasing and style for consistency

Minor editorial nits: prefer “rate limit” (no hyphen) and US spelling “behavior” to match most existing entries.

-- Workaround for potential rate-limit for some people
-- Fallback to similar renewal behaviour to 1.19 while still supporting wildcards and other fixes
+- Workaround for potential rate limit for some people
+- Fallback to renewal behavior similar to 1.19 while still supporting wildcards and other fixes
duckdns/rootfs/etc/s6-overlay/s6-rc.d/duckdns/run (3)

54-57: Good rationale documented; add a tracking reference

The explanatory comments clarify the revert. Consider adding a TODO with an upstream issue/PR reference to dehydrated to aid future cleanup.

-        # Note, the below is commented out for now as dehydrated force-renews each domain when domain input is different from the previous run
-        # This is causing rate-limiting from Let's Encrypt
-        # Need to resolve issue with dehydrated first to properly support single TXT records
+        # Note, the below is commented out for now as dehydrated force-renews each domain when domain input is different from the previous run
+        # This is causing rate-limiting from Let's Encrypt
+        # TODO: Track upstream dehydrated fix to properly support single TXT records (add issue/PR reference)

59-60: Gate per-domain renew behind a feature flag instead of commenting out

Keeps the revert as default while enabling quick toggling for testing/triage without editing code.

-        #dehydrated --cron --algo "${ALGO}" --hook /root/hooks.sh --challenge dns-01 --domain "${domain}" --out "${CERT_DIR}" --config "${WORK_DIR}/config" || true
+        if [[ "${PER_DOMAIN_RENEW:-0}" == "1" ]]; then
+            # Caution: can trigger Let's Encrypt rate limits; enable only for testing or when dehydrated fix is available.
+            dehydrated --cron --algo "${ALGO}" --hook /root/hooks.sh --challenge dns-01 --domain "${domain}" --out "${CERT_DIR}" --config "${WORK_DIR}/config" || true
+        fi

63-63: Prefer debug-level logging over removing the message

This log helps diagnose renewal flow without spamming info logs.

-    #bashio::log.info "Final pass to combine individual certificates"
+    bashio::log.debug "Final pass to combine individual certificates"
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between b4c42bb and 217df0d.

📒 Files selected for processing (3)
  • duckdns/CHANGELOG.md (1 hunks)
  • duckdns/config.yaml (1 hunks)
  • duckdns/rootfs/etc/s6-overlay/s6-rc.d/duckdns/run (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
*/**(html|markdown|md)

⚙️ CodeRabbit Configuration File

*/**(html|markdown|md): - For instructional content in documentation, use a direct and authoritative tone. Avoid expressions of politeness such as 'may' or 'please', and ensure the goal of the instruction is fronted.

  • Apply the Microsoft Style Guide to ensure documentation maintains clarity and conciseness.
  • In step-by-step instructions, front the location phrase in the instructional sentence.
  • In step-by-step instructions, front the 'goal' in the instructional sentence.
  • In step-by-step instructions, if in doubt what to front, front the 'goal' before the location phrase in the instructional sentence.
  • do not hyphenate terms like 'top-right' or 'bottom-left' with 'corner'

*/**(html|markdown|md): - Use bold to mark UI strings.

  • If "" are used to mark UI strings, replace them by bold.

  • Be brief in your replies and don't add fluff like "thank you for..." and "Please let me know if"

  • Use sentence-style capitalization also in headings.

do not comment on HTML used for icons

Avoid flagging inline HTML for embedding videos in future reviews for this repository.

Files:

  • duckdns/CHANGELOG.md
  • duckdns/config.yaml
🔇 Additional comments (3)
duckdns/config.yaml (1)

2-2: Version bump aligns with CHANGELOG and revert scope

Manifest version update to 1.26.0 is consistent with the described behavior change.

duckdns/CHANGELOG.md (1)

3-3: Changelog entry added for 1.26.0

Entry accurately reflects the revert and rate-limit context.

duckdns/rootfs/etc/s6-overlay/s6-rc.d/duckdns/run (1)

54-60: Hooks implement the single-TXT record strategy via alias mapping
The deploy_challenge and clean_challenge functions in duckdns/rootfs/root/hooks.sh read the .aliases section from the Dehydrated config to consolidate all validations onto a single TXT record (using the ALIAS variable) and clear it appropriately. No further changes are required.

@Xebozone

Xebozone commented Aug 15, 2025

Copy link
Copy Markdown
Contributor Author

I'm reverting the one change I made earlier that renews each domain first due to the DuckDNS limitation of single TXT record.
Dehydrated is force-renewing the domains each run which can result in Let's Encrypt rate limits for people with multiple domains.
Dehydrated will need to provide better support for single TXT records. This is something to be tackled before enabling this again.

Comment thread duckdns/rootfs/etc/s6-overlay/s6-rc.d/duckdns/run
@Xebozone
Xebozone requested a review from agners August 16, 2025 10:46
@Xebozone
Xebozone marked this pull request as draft August 16, 2025 21:49
@Xebozone

Copy link
Copy Markdown
Contributor Author

Closing. Replaced with a proper fix: #4126

@Xebozone Xebozone closed this Aug 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants