feat(admin): add Danger Zone to delete a Fider site#1565
Open
mattwoberts wants to merge 4 commits into
Open
Conversation
Only site owners (the oldest admin on the account) can do this Once confirmed, the board goes into a queue. You can during this time cancel the delete When processed, we just remove everything. We also cancel any stripe subscription
…tities Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a Danger Zone to admin Site Settings with one action: permanently delete the entire site (tenant) and everything in it. Hosted multi-tenant only; owner-only (the original signup user — lowest-id active admin).
resource_missing) → blob storage wipe (S3/fs/sql) → DB hard delete (FK-RESTRICT ordered across 20 tenant-scoped tables +reactionsvia subquery) → completed email.Auth model
A request to schedule deletion must pass all of: global CSRF (POST/PUT/DELETE requires JSON Accept/Content-Type, blocking cross-origin forms),
IsAuthenticated,IsAuthorized(RoleAdministrator), theenv.IsSingleHostMode()check (route isn't even registered in single-host), the owner identity check, and the subdomain match. Only one writer to the schedule column (scheduleTenantDeletion), only one dispatcher (RequestTenantDeletion).Test plan
make buildsucceedsmake test— all Go + Jest pass (incl. 3 new sqlstore tests + 6 new handler tests)make lint— 0 issuesmake watch): owner schedules deletion → email arrives in MailHog with cancel link → click link → schedule clearedscheduled_deletion_atto past, wait for cron → tenant + blobs gone, Stripe sub cancelled (test sub), completed email arrives🤖 Generated with Claude Code