Skip to content

Remove retired custom deployment target from Caddy rollout - #119

Merged
adriaandotcom merged 1 commit into
caddyfrom
fix/caddy-deploy-targets
Oct 15, 2026
Merged

adriaandotcom merged 1 commit into
caddyfrom
fix/caddy-deploy-targets

Conversation

@simple-analytics-ai

@simple-analytics-ai simple-analytics-ai Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Closes #118

Removes the retired custom deployment destination (the nginx server at app@external.simpleanalytics.com) from the deployment CLI, leaving cdn and caddy as the only targets. The Destination union, remoteTarget/RemoteTarget, uploadCustomFile, and the custom-server inspection and verification branches are deleted; readCustomFiles becomes readCaddyFiles against CADDY_HOST/CADDY_ROOT. addServerPair collapses into addCaddyPair, which always applies the caddy-ssi transform.

The destination prompt now offers CDN and Caddy with both selected by default, the proxy variant is offered when Caddy is selected, --caddy-only is unchanged, and the obsolete nginx reminder is replaced by a plain SRI documentation reminder. Caddy keeps consuming the existing dist/**/custom/ artifacts, so no generated script or SRI bytes change.

This targets PR #95 (caddy): merge this cleanup into #95 first, then merge #95 into main.

Changes:

  • Remove retired custom deployment target

Security implications

Has security impact - described as: changes production deployment routing by removing a retired destination and making Caddy a default target. Remote-path validation, shell quoting, Go-template escaping of proxy query values, --ignore-existing protection for immutable SRI artifacts, and post-upload content verification are all preserved.

Testing

  • node --test test/deploy.test.mts — 17/17 pass.
  • tsc (project tsconfig.json, --noEmit) — clean, no errors.
  • No production deployment performed.

Checklist

  • Linked to an issue
  • Tested
  • Asked for a review

@github-actions github-actions 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.

README.md:41 still documents the deleted target: "Custom-domain reads and writes require SSH access to app@external.simpleanalytics.com", which no longer exists after this PR, so a deployer provisions access to the wrong host. Update that sentence to the remaining SSH target (user@esapp05.simpleanalytics.com, the CADDY_HOST in deploy.mts).

@github-actions

Copy link
Copy Markdown
Contributor
Claude review checkpoint

Reviewed commit bd186eec2f73957d378471a76b6729021c74a60a. This is used to keep later automated reviews focused on changes Claude has not checked yet.

@github-actions github-actions Bot added the change: needs review Changes affecting security, data protection, or system stability. label Oct 15, 2026
@github-actions

Copy link
Copy Markdown
Contributor

SDLC label: change: needs review because Changes production deployment routing by deleting a deployment destination and its upload/verification paths, and makes Caddy a default-selected target for customer-facing script releases

@adriaandotcom
adriaandotcom merged commit e82ef66 into caddy Oct 15, 2026
3 of 4 checks passed
@adriaandotcom
adriaandotcom deleted the fix/caddy-deploy-targets branch October 15, 2026 21:52
adriaandotcom added a commit that referenced this pull request Oct 21, 2026
* Add Caddy custom-domains deploy destination

Add a "caddy" destination alongside "custom" for the new Caddy-based
custom-domains setup (elastic-infra ansible/vars/apps/custom-domains.yml).
It uploads the same files as the old external nginx server, but rewrites
the nginx SSI directives to Caddy template placeholders on upload, since
Caddy's templates directive injects the request hostname and the
proxy-product query parameters at serve time.

The caddy-ssi transform fails the deploy if a build contains stray Go
template delimiters or an SSI directive without a known replacement, so
a bad build cannot turn into per-request 500s. Uploads go via a temporary
file so the transformed bytes are what lands on the server, and the
post-upload verification compares against the transformed content.

A --caddy-only flag deploys exclusively to the new setup, leaving the CDN
and the old external server untouched during the migration.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ApznmYeffWY6YojKXhEJDW

* Escape Caddy proxy template values

* Remove retired custom deployment target (#119)

Co-authored-by: Simple Analytics Codex <codex@simpleanalytics.invalid>

---------

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
Co-authored-by: Simple Analytics Codex <codex@simpleanalytics.invalid>
Co-authored-by: simple-analytics-ai[bot] <313929673+simple-analytics-ai[bot]@users.noreply.github.com>
Co-authored-by: Adriaan <1079135+adriaandotcom@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

change: needs review Changes affecting security, data protection, or system stability.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant