Skip to content

feat(pull-zone): Add 'Verknüpfung trennen' alongside delete#34

Merged
carhensi merged 2 commits into
mainfrom
feat/pull-zone-detach
May 19, 2026
Merged

feat(pull-zone): Add 'Verknüpfung trennen' alongside delete#34
carhensi merged 2 commits into
mainfrom
feat/pull-zone-detach

Conversation

@carhensi
Copy link
Copy Markdown
Contributor

Summary

Lets users choose between two outcomes when removing the CDN setup from the extension:

  • Komplett löschen (existing behaviour): destroys the bunny.net pull zone + DB state.
  • Verknüpfung trennen (new): drops the DB link only — the bunny.net zone stays so the user can keep managing it from the bunny.net dashboard.

Use case: uninstall the mStudio extension without losing a configured pull zone.

Bundled in this PR: bump nitro to ^3.0.260429-beta (separate commit) — patches two medium-severity advisories (GHSA-9phm-9p8f-hw5m, GHSA-5w89-w975-hf9q) in routeRules.

What changed

  • New detachPullZone domain function (src/domain/pull-zone.ts) — drops the DB row, leaves bunny.net + CNAME untouched.
  • New detachPullZoneFn server-fn (src/serverFunctions/pull-zone.ts) — same auth/scope path as deletePullZoneFn.
  • BunnyCdnGhost.detachPullZone() wired in src/ghosts.ts.
  • Confirm step in AccountTab reworked: two side-by-side options with hints (detachHint / deleteHint) + cancel.
  • DE + EN i18n strings (dangerZone.detachFinal, detachHint, detaching, restructured description).

Test plan

  • npm test — 224 / 224 (+3 new detach tests)
  • npm run typecheck — clean
  • npm run code-check — clean
  • npm run build — clean
  • npm audit --omit=dev — 0 vulnerabilities
  • Manual smoke (iframe): click 'CDN-Setup entfernen' → see two options → click 'Verknüpfung trennen' → verify pull zone still exists at bunny.net dashboard
  • Manual smoke (iframe): same flow → click 'Komplett löschen' → verify zone gone at bunny.net

New tests

  • detachPullZone deletes the DB row and does not call bunny.deletePullZone / bunny.removeHostname
  • detachPullZone throws NOT_FOUND when no pull zone is linked
  • detachPullZone works without an API key (no bunny interaction needed)

Follow-up

The webhook handler handleInstanceRemoved still does a best-effort bunny-delete on uninstall (src/server/webhooks/handler.ts:85-114). With detach available, the intended flow is: user clicks Detach in extension → DB row gone → user uninstalls extension via mStudio → webhook finds no pull zone → no-op. So no webhook change is needed for v1.

🤖 Generated with Claude Code

carhensi and others added 2 commits May 19, 2026 12:05
Patches two medium-severity advisories in `nitro` route-rules:
  - GHSA-9phm-9p8f-hw5m: Open Redirect via Protocol-Relative URL
  - GHSA-5w89-w975-hf9q: Proxy scope bypass via percent-encoded path

Lockfile + package.json bump only; no behavioural changes.
npm audit --omit=dev: 0 vulnerabilities.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Users can now choose between two outcomes when removing the CDN
setup: 'Komplett löschen' (destroys the bunny.net pull zone + DB
state, existing behaviour) or 'Verknüpfung trennen' (drops the
DB link only; the bunny.net zone stays so the user can keep
managing it from the bunny.net dashboard).

- New `detachPullZone` domain function + `detachPullZoneFn`
  server-fn; both leave bunny.net untouched.
- Confirm step in AccountTab now shows two side-by-side options
  with hints, plus cancel.
- 3 new unit tests for the detach path; total 224 / 224 green.

Use case: deinstall mStudio extension without losing the
configured pull zone.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@carhensi carhensi merged commit 3960325 into main May 19, 2026
5 checks passed
@carhensi carhensi deleted the feat/pull-zone-detach branch May 19, 2026 10:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant