feat(dns): live delegation checks, registrar-aware setup, and record presets#106
Conversation
|
@codex review |
🦋 Changeset detectedLatest commit: 0c35033 The changes in this PR will be included in the next version bump. This PR includes changesets to release 6 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ab92a48b5e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const { value } = await prompts({ | ||
| type: "text", | ||
| name: "value", | ||
| message: param.optional | ||
| ? `${param.message} (blank to skip)` | ||
| : param.message, | ||
| initial: param.initial, | ||
| }); |
There was a problem hiding this comment.
Add flag equivalents for preset parameters
For named presets that need values, such as bluesky requiring a DID, this always reads the value with prompts and the command builder exposes no way to pass it as a flag. In non-interactive shells a fully specified invocation like bunny dns records preset bluesky example.com still blocks/fails before writing records, so add a scriptable parameter mechanism before falling back to prompts.
Useful? React with 👍 / 👎.
| if (detected) { | ||
| logger.success( | ||
| `Nameservers detected and pointing to Bunny DNS for ${zoneDomain}.`, | ||
| ); | ||
| return; |
There was a problem hiding this comment.
Keep nameserver output formats structured
For delegated zones, bunny dns zones ns example.com -o csv|table|markdown now emits a success sentence and returns, instead of honoring the requested non-JSON format with structured zone/nameserver data as this command did before. Any scripts consuming CSV/Markdown lose machine-readable output; keep the prose for text mode and render formatted rows for the other output formats.
Useful? React with 👍 / 👎.
Greptile SummaryThis PR replaces bunny's
Confidence Score: 5/5Safe to merge; the new DNS delegation logic and preset catalog are well-tested and the two findings are defensive robustness improvements rather than present-defect blockers. The hand-rolled DNS parser in decodeName lacks a guard against compression-pointer cycles, which could block the event loop on a crafted malformed packet — but in practice all queries go to TLD authoritative servers and the data is not attacker-controlled in normal CLI use. The non-interactive preset param strictness is a usability friction, not a data-loss issue. Both are straightforward to address. The previously-flagged issues (bidirectional NS set check, partial-write error reporting) are fully resolved. packages/cli/src/core/dns-nameservers.ts (decodeName pointer-loop guard) and packages/cli/src/commands/dns/record/preset.ts (initial-value handling in non-interactive mode) Important Files Changed
Sequence Diagram%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
participant CLI
participant BunnyAPI
participant SystemDNS
participant TLD_NS as TLD Nameserver (UDP)
participant RDAP as rdap.org
Note over CLI: dns zones add / dns zones ns / dns zones list
CLI->>BunnyAPI: GET /dnszone (fetch zones)
BunnyAPI-->>CLI: zones[]
CLI->>SystemDNS: resolveNs(parent zone)
SystemDNS-->>CLI: parent NS hosts
CLI->>SystemDNS: resolve4(ns host)
SystemDNS-->>CLI: IP addresses
CLI->>TLD_NS: UDP NS query (non-recursive, EDNS0)
TLD_NS-->>CLI: NS referral (authority section)
alt referral readable
CLI->>CLI: compare resolved vs expected (bidirectional)
else referral unreadable
CLI->>SystemDNS: resolveNs(domain) fallback
SystemDNS-->>CLI: recursive NS answer
end
alt not yet delegated
CLI->>RDAP: "GET /domain/{domain} (4s timeout)"
RDAP-->>CLI: registrar name (or null)
CLI->>CLI: print registrar-aware guidance
else already delegated
CLI->>CLI: print confirmation
end
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
participant CLI
participant BunnyAPI
participant SystemDNS
participant TLD_NS as TLD Nameserver (UDP)
participant RDAP as rdap.org
Note over CLI: dns zones add / dns zones ns / dns zones list
CLI->>BunnyAPI: GET /dnszone (fetch zones)
BunnyAPI-->>CLI: zones[]
CLI->>SystemDNS: resolveNs(parent zone)
SystemDNS-->>CLI: parent NS hosts
CLI->>SystemDNS: resolve4(ns host)
SystemDNS-->>CLI: IP addresses
CLI->>TLD_NS: UDP NS query (non-recursive, EDNS0)
TLD_NS-->>CLI: NS referral (authority section)
alt referral readable
CLI->>CLI: compare resolved vs expected (bidirectional)
else referral unreadable
CLI->>SystemDNS: resolveNs(domain) fallback
SystemDNS-->>CLI: recursive NS answer
end
alt not yet delegated
CLI->>RDAP: "GET /domain/{domain} (4s timeout)"
RDAP-->>CLI: registrar name (or null)
CLI->>CLI: print registrar-aware guidance
else already delegated
CLI->>CLI: print confirmation
end
Reviews (2): Last reviewed commit: "updates" | Re-trigger Greptile |
feat(dns): live delegation checks, registrar-aware setup, and record presets