Skip to content

cid.contact: order an advanced certificate before the nameserver change - #67

Merged
TakGN merged 2 commits into
mainfrom
cid-contact-advanced-certificate
Nov 19, 2026
Merged

TakGN merged 2 commits into
mainfrom
cid-contact-advanced-certificate

Conversation

@TakGN

@TakGN TakGN commented Nov 19, 2026 •

Copy link
Copy Markdown
Collaborator

What and why

Cloudflare only issues Universal SSL once a zone is active. After the nameserver change at Squarespace, the proxied hostnames on cid.contact (direct., fetch., web-ipni.) would have no edge certificate until it is issued, usually a few minutes. The new zone is on Enterprise, which includes advanced certificates (quota 100, none used). This orders one now, while the zone is pending:

DNS-only names aren't affected and need nothing: the apex (CloudFront), infra., sf*/chic1, status., prod..

Expected plan

cid.contact-public-utilities: 1 to add, 0 to change, 0 to destroy: cloudflare_certificate_pack.cid_contact. If cloudflare_pages_project.filecoin_redirect still shows an update, don't merge yet.

After the apply

  1. Read the TXT records from SSL/TLS → Edge Certificates on the new zone, or from the API. Not from Terraform: Cloudflare fills them in after the apply. There are usually two, both named _acme-challenge.cid.contact.
  2. Add them by hand to the cid.contact zone in Alex@ipfs.io's Account, which still answers for the domain. Do it within a few days, before the Let's Encrypt tokens expire.
  3. Wait for the certificate to be active (dashboard or API).
  4. Then change the nameservers at Squarespace, press "Check nameservers", and merge cid.contact: move direct. and fetch.cid.contact to ipni-filecoin-redirect (after the zone is active) #66 once the zone is Active.

If the certificate doesn't get past validation while the zone is pending, it is issued at activation like Universal SSL, and the cutover is as before.

Checklist

  • The plan comments show only the changes described above
  • Zone changes were tried on inbrowser.dev before inbrowser.link (n/a: a pending zone)
  • No private values in the code (origins, IPs, emails, tokens): they go in secrets
  • If this syncs a dashboard change: the dashboard and the code now match (n/a)

🤖 Generated with Claude Code

…hange

Universal SSL is only issued once a zone is active, so after the nameserver
change at Squarespace the proxied hostnames (direct., fetch., web-ipni.)
would have no edge certificate for the first minutes. The zone is on
Enterprise, which includes advanced certificates: this orders one for
cid.contact and *.cid.contact while the zone is pending, validated by TXT
records added by hand to the old zone, which still answers for the domain.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@TakGN
TakGN requested a review from nymd as a code owner November 19, 2026 13:57
@github-actions

github-actions Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Terraform plan: cid.contact-public-utilities: Plan: 1 to add, 0 to change, 0 to destroy.

Applied on merge if the plan is still the same.

Show plan

Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  + create

Terraform will perform the following actions:

  # cloudflare_certificate_pack.cid_contact will be created
  + resource "cloudflare_certificate_pack" "cid_contact" {
      + certificate_authority  = "lets_encrypt"
      + certificates           = (known after apply)
      + dcv_delegation_records = (known after apply)
      + hosts                  = [
          + "*.cid.contact",
          + "cid.contact",
        ]
      + id                     = (known after apply)
      + primary_certificate    = (known after apply)
      + status                 = (known after apply)
      + type                   = "advanced"
      + validation_errors      = (known after apply)
      + validation_method      = "txt"
      + validation_records     = (known after apply)
      + validity_days          = 90
      + zone_id                = "51b3ace740d2aa43892cc23443dc80d6"
    }

Plan: 1 to add, 0 to change, 0 to destroy.

Run · commit 3970734

@claude

claude Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Claude review

The change is small and follows the repo rules: no private values, no CI or gate changes, and the TXT validation values are public by design. I found no blocker. I couldn't run terraform validate or plan (no terraform binary here), so the provider 5.26.0 schema for cloudflare_certificate_pack and the coalesce typing in the output are unchecked by me. The Terraform plan check should confirm the expected "1 to add". The CI token docs already list SSL and Certificates: Edit for applies.

Findings, most severe first:

  1. Nit: cloudflare/cid.contact-public-utilities/outputs.tf:21. certificate_status and certificate_validation_records are only stored by an apply, and CI never runs a refresh-only apply. The values from the merge apply are likely initializing and an empty list, and they stay stale. The runbook's "read the TXT records from the apply's outputs" and "change the nameservers once it is active" shouldn't rely on them. The dashboard is the reliable source.
  2. Nit: cloudflare/cid.contact-public-utilities/certificates.tf:12. A later edit to the pack's identity attributes (hosts, CA, validity, validation method) likely replaces the live certificate, and nothing here guards or documents that.

claude-sonnet-5-5 at high effort · requested by TakGN · re-run with @claude review [sonnet|opus|fable] [low|medium|high|xhigh|max]

…lags

- Drop the certificate_status and certificate_validation_records outputs:
  Cloudflare fills them in after the apply and CI never applies a refresh,
  so they would stay stale. The comment points at the dashboard or API.
- Note that changing the pack's hosts, type, validation, validity or CA
  replaces the certificate.
- Ignore compatibility_flags on ipni-filecoin-redirect, which wrangler.toml
  owns like the compatibility date: the state keeps it null after #65's
  apply, so every plan (#66, #67) showed the same in-place update again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@TakGN

TakGN commented Nov 19, 2026

Copy link
Copy Markdown
Collaborator Author

Thanks for the review. Both nits are addressed in 3970734 (replies inline).

The first plan here also showed an unexpected update of cloudflare_pages_project.filecoin_redirect: compatibility_flags = [] again, plus the two computed source.config fields. #65's apply didn't settle it, because the state keeps compatibility_flags as null after a refresh, and #66's plan has the same update. wrangler.toml owns compatibility_flags, like the compatibility date, so it's now in ignore_changes. The new plan should show only the certificate (1 to add). If the project still shows an update, I'll look again before this merges.

@TakGN
TakGN enabled auto-merge (squash) November 19, 2026 14:04
@TakGN
TakGN merged commit d157822 into main Nov 19, 2026
5 checks passed
@TakGN
TakGN deleted the cid-contact-advanced-certificate branch November 19, 2026 14:04
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