Self-hosted personal gallery application with online photo management and albums, supporting Live/Motion Photos, EXIF parsing, geolocation recognition, and an explore map.
TypeScript albumsexif-extractiongeocodinglive-photomotion-photophoto-galleryphoto-sharingwebgl-viewer
feat(cloud): enforce moderation and custom domain lifecycle
Timothy Yin77207157bc3b
diff --git a/apps/cloud/app/assets/cloud.css b/apps/cloud/app/assets/cloud.cssindex ac71e613..2ecb86fa 100644--- a/apps/cloud/app/assets/cloud.css+++ b/apps/cloud/app/assets/cloud.css@@ -2778,3 +2778,17 @@ a.cf-domain-address:hover {flex-shrink: 0;}}++.cf-site-row[data-disabled] {+ cursor: default;+ background: var(--muted);+ color: var(--muted-foreground);+}+.cf-suspension-reason {+ display: block;+ font-size: 11px;+ font-weight: 400;+ color: var(--muted-foreground);+ white-space: normal;+ margin-top: 4px;+}diff --git a/apps/cloud/app/components/CloudDomainCard.vue b/apps/cloud/app/components/CloudDomainCard.vueindex 0c42b646..ab4bb3d8 100644--- a/apps/cloud/app/components/CloudDomainCard.vue+++ b/apps/cloud/app/components/CloudDomainCard.vue@@ -99,6 +99,26 @@ const guidance = computed(() =>class="cf-domain-card":id="'domain-' + domain.generation">+ <p+ v-if="domain.holdReason && domain.holdReason !== 'manual'"+ class="cf-notice"+ >+ {{+ t(+ 'cloud.enforcement.' ++ { plan: 'holdPlan', site: 'holdSite', account: 'holdAccount' }[+ domain.holdReason+ ],+ )+ }}+ </p>+ <p+ v-if="domain.cleanupPending"+ class="cf-field-hint"+ role="status"+ >+ {{ t('cloud.enforcement.cleanup') }}+ </p><div class="cf-domain-card-header"><Globe:size="18"@@ -155,7 +175,11 @@ const guidance = computed(() =></template><DropdownMenuItemv-if="!['deleting', 'expired'].includes(domain.status)"- :disabled="domain.status === 'paused' && !enabled"+ :disabled="+ domain.status === 'paused' &&+ (!enabled ||+ (!!domain.holdReason && domain.holdReason !== 'manual'))+ "@select="emit('action',diff --git a/apps/cloud/app/components/CloudPortalShell.vue b/apps/cloud/app/components/CloudPortalShell.vueindex aa911d71..7acad1a9 100644--- a/apps/cloud/app/components/CloudPortalShell.vue+++ b/apps/cloud/app/components/CloudPortalShell.vue@@ -19,6 +19,32 @@ watch(},)useCloudSiteSubscription()+const content = ref<HTMLElement>()+const reduced = usePreferredReducedMotion()+let entrance: Animation | undefined,+ lastPath = ''+function animatePage() {+ if (!content.value || route.path === lastPath) return+ lastPath = route.path+ entrance?.cancel()+ if (reduced.value !== 'reduce')+ entrance = content.value.animate(+ [+ { opacity: 0, transform: 'translateY(8px)' },+ { opacity: 1, transform: 'translateY(0)' },+ ],+ { duration: 220, easing: 'cubic-bezier(.2,.7,.2,1)' },+ )+}+const removeEntranceHook = useNuxtApp().hook('page:finish', animatePage)+onMounted(animatePage)+watch(reduced, () => {+ if (reduced.value === 'reduce') entrance?.cancel()+})+onBeforeUnmount(() => {+ removeEntranceHook()+ entrance?.cancel()+})</script><template><div class="cf-portal">@@ -77,7 +103,10 @@ useCloudSiteSubscription()class="cf-portal-main"tabindex="-1">- <div class="cf-portal-content">+ <div+ ref="content"+ class="cf-portal-content"+ ><slot /></div></main>diff --git a/apps/cloud/app/pages/signin.vue b/apps/cloud/app/pages/signin.vueindex 1741084a..3163888f 100644--- a/apps/cloud/app/pages/signin.vue+++ b/apps/cloud/app/pages/signin.vue@@ -94,8 +94,8 @@ async function passkeySignIn() {const result = await useCloudAccount().signIn.passkey()if (result.error) throw result.errorawait navigateTo('/sites', { external: true })- } catch {- error.value = t('cloud.messages.passkeySignInWasNotCompletedTryAgainOr')+ } catch (cause) {+ error.value = accountError(cause, t)} finally {busy.value = false}diff --git a/apps/cloud/app/pages/sites/index.vue b/apps/cloud/app/pages/sites/index.vueindex 091490ba..ac19b851 100644--- a/apps/cloud/app/pages/sites/index.vue+++ b/apps/cloud/app/pages/sites/index.vue@@ -1,9 +1,8 @@<script setup lang="ts">const { t } = useI18n()-import { motion } from 'motion-v'import { ArrowUpRight, Images, ShieldCheck } from 'lucide-vue-next'-const entrance = useCloudMotion()+const siteLink = resolveComponent('NuxtLink')definePageMeta({ layout: 'portal' })const workspace = ref<{ name: string } | null>(null)const workspaceError = ref(false)@@ -37,7 +36,7 @@ const sites = ref()</script><template>- <motion.div v-bind="entrance">+ <div><div class="cf-page-heading"><div><h1 class="cf-page-title">{{ $t('cloud.messages.yourSites') }}</h1>@@ -83,8 +82,11 @@ const sites = ref(v-for="site in sites":key="site.siteId">- <NuxtLink- :to="`/sites/${site.siteId}/overview`"+ <component+ :is="site.suspended ? 'div' : siteLink"+ :to="site.suspended ? undefined : `/sites/${site.siteId}/overview`"+ :aria-disabled="site.suspended || undefined"+ :data-disabled="site.suspended || undefined":aria-label="site.name":aria-describedby="`site-status-${site.siteId} site-role-${site.siteId}`"class="cf-site-row"@@ -94,15 +96,31 @@ const sites = ref(><spanclass="cf-site-name":title="site.name"- >{{ site.name }}</span+ >{{ site.name+ }}<small+ v-if="site.suspended && site.suspensionReason"+ class="cf-suspension-reason"+ >{{ site.suspensionReason }}</small+ ></span></span><span :id="`site-status-${site.siteId}`"- ><CloudBadge :tone="site.published ? 'success' : 'neutral'">{{- site.published- ? $t('cloud.messages.published')- : $t('cloud.messages.draft')- }}</CloudBadge></span+ ><CloudBadge+ :tone="+ site.suspended+ ? 'neutral'+ : site.published+ ? 'success'+ : 'neutral'+ "+ >{{+ site.suspended+ ? $t('cloud.enforcement.siteSuspended')+ : site.published+ ? $t('cloud.messages.published')+ : $t('cloud.messages.draft')+ }}</CloudBadge+ ></span><span:id="`site-role-${site.siteId}`"@@ -111,11 +129,12 @@ const sites = ref($t(site.role === 'admin' ? 'cloud.ui.admin' : 'cloud.ui.member')}}</span><ArrowUpRight+ v-if="!site.suspended":size="15"class="cf-row-arrow"aria-hidden="true"/>- </NuxtLink>+ </component></li></ul></div>@@ -135,5 +154,5 @@ const sites = ref(>{{ $t('cloud.messages.viewDocumentation') }}<ArrowUpRight :size="12"/></a></p>- </motion.div>+ </div></template>diff --git a/apps/cloud/app/utils/account-error.ts b/apps/cloud/app/utils/account-error.tsindex 6de670c8..b91d44be 100644--- a/apps/cloud/app/utils/account-error.ts+++ b/apps/cloud/app/utils/account-error.ts@@ -6,7 +6,13 @@ export function accountError(cause: unknown, t: (key: string) => string) {}if (error.statusCode === 429)return t('cloud.messages.tooManyAttemptsPleaseWaitBeforeTryingAgain')- const code = error.data?.code ?? ''+ const code = error.data?.code ?? (cause as { code?: string }).code ?? ''+ if (code === 'ACCOUNT_SUSPENDED')+ return (+ t('cloud.enforcement.accountSuspended') ++ ' ' ++ (error.data?.message ?? (cause as { message?: string }).message ?? '')+ )if (code === 'AUTHENTICATOR_REQUIRED')return t('cloud.messages.useYourAuthenticatorOrAnUnusedRecoveryCodeTo')if (code.includes('PASSWORD_TOO_SHORT'))diff --git a/apps/cloud/i18n/locales/en.json b/apps/cloud/i18n/locales/en.jsonindex 3487f025..2754f76a 100644--- a/apps/cloud/i18n/locales/en.json+++ b/apps/cloud/i18n/locales/en.json@@ -576,6 +576,14 @@"noCustomDomains": "Your plan does not include custom domains. Your default site address remains available.","unavailable": "Platform uploads are temporarily unavailable. Your site remains published; no custom storage setup is required.","managedHelp": "Your plan includes platform storage. No bucket setup is needed."+ },+ "enforcement": {+ "accountSuspended": "Your account has been suspended.",+ "siteSuspended": "Suspended",+ "holdPlan": "Your plan does not include this domain. Its hosted domain service is being removed or has been removed; it will be restored automatically when your plan allows it.",+ "holdSite": "This site is suspended. Its hosted domain service will be removed.",+ "holdAccount": "Workspace account access is suspended. Its hosted domain service will be removed.",+ "cleanup": "Domain resources are being removed. This record remains until cleanup completes and will retry automatically."}}}diff --git a/apps/cloud/i18n/locales/zh-Hans.json b/apps/cloud/i18n/locales/zh-Hans.jsonindex 879a880e..b136e255 100644--- a/apps/cloud/i18n/locales/zh-Hans.json+++ b/apps/cloud/i18n/locales/zh-Hans.json@@ -576,6 +576,14 @@"noCustomDomains": "当前套餐不包含自定义域名,你仍可使用站点的默认地址。","unavailable": "平台上传暂不可用。你的站点仍已发布,无需配置自定义存储。","managedHelp": "套餐已包含平台存储,无需自行配置存储桶。"+ },+ "enforcement": {+ "accountSuspended": "账号已被暂停访问。",+ "siteSuspended": "已暂停",+ "holdPlan": "当前套餐不包含此域名。平台正在回收或已回收对应的域服务;套餐恢复后将自动重新启用。",+ "holdSite": "站点访问已暂停,域服务将停用。",+ "holdAccount": "工作空间账号已暂停,域服务将停用。",+ "cleanup": "正在清理域服务;完成前将保留此记录并自动重试。"}}}diff --git a/apps/cloud/server/api/sites/[siteId]/domains.post.ts b/apps/cloud/server/api/sites/[siteId]/domains.post.tsindex 467ea6ac..08d6d435 100644--- a/apps/cloud/server/api/sites/[siteId]/domains.post.ts+++ b/apps/cloud/server/api/sites/[siteId]/domains.post.ts@@ -56,7 +56,7 @@ export default definePlatformHandler(async (event) => {| 'redirects',body.value === true,)- if (['check', 'resume', 'delete'].includes(String(body.action)))+ if (['check', 'resume', 'delete', 'pause'].includes(String(body.action)))await manager.reconcile(body.hostname)return result})diff --git a/apps/cloud/server/utils/account-auth.ts b/apps/cloud/server/utils/account-auth.tsindex 64a28348..f36039db 100644--- a/apps/cloud/server/utils/account-auth.ts+++ b/apps/cloud/server/utils/account-auth.ts@@ -1,3 +1,4 @@+import type { PlatformD1 } from '@chronoframe/platform'import 'reflect-metadata'import { betterAuth, type BetterAuthOptions } from 'better-auth'import { APIError } from 'better-auth/api'@@ -25,6 +26,28 @@ export function accountAuthOptions(}return {appName: 'ChronoFrame Cloud',+ databaseHooks: {+ session: {+ create: {+ before: async (session) => {+ const control = await (database as unknown as PlatformD1)+ .prepare(+ 'SELECT suspended,public_reason FROM platform_account_controls WHERE user_id=?',+ )+ .bind(Number(session.userId))+ .first<{ suspended: number; public_reason: string }>()+ if (control?.suspended)+ throw new APIError('FORBIDDEN', {+ code: 'ACCOUNT_SUSPENDED',+ message:+ control.public_reason ||+ 'Account access has been suspended. Contact support.',+ })+ return { data: session }+ },+ },+ },+ },baseURL: origin.origin,basePath: '/api/auth',secret: config.secret,diff --git a/apps/shared/platform/context.ts b/apps/shared/platform/context.tsindex 78c7a448..4f383a83 100644--- a/apps/shared/platform/context.ts+++ b/apps/shared/platform/context.ts@@ -1,3 +1,4 @@+import { domainEligibility } from '../../../packages/platform/src/domain-policy'import {defaultSiteHost,validSiteSlug,@@ -74,7 +75,11 @@ export async function siteContextDTO(.bind(candidate, context.site.id).first(): null- const host = primary?.hostname ?? (owned ? candidate! : context.host)+ const primaryHost =+ primary && (await domainEligibility(db, primary.hostname)).allowed+ ? primary.hostname+ : null+ const host = primaryHost ?? (owned ? candidate! : context.host)canonicalOrigin = 'https://' + host}return {diff --git a/apps/site/server/middleware/00-domain-routing.ts b/apps/site/server/middleware/00-domain-routing.tsindex e75e9332..0bac8a20 100644--- a/apps/site/server/middleware/00-domain-routing.ts+++ b/apps/site/server/middleware/00-domain-routing.ts@@ -1,3 +1,4 @@+import { domainEligibility } from '../../../../packages/platform/src/domain-policy'import { createError, getRequestURL, sendRedirect, setResponseHeader } from 'h3'import { validSiteSlug } from '@chronoframe/contracts/domains'import {@@ -83,7 +84,11 @@ export default defineEventHandler(async (event) => {).bind(context.site.id, Date.now() - 3600000).first<{ hostname: string }>()- if (primary && primary.hostname !== host)+ if (+ primary &&+ primary.hostname !== host &&+ (await domainEligibility(db, primary.hostname)).allowed+ )return sendRedirect(event,'https://' + primary.hostname + url.pathname + url.search,diff --git a/packages/contracts/src/domains.ts b/packages/contracts/src/domains.tsindex 4e5bda62..2df1422d 100644--- a/packages/contracts/src/domains.ts+++ b/packages/contracts/src/domains.ts@@ -87,6 +87,8 @@ export type DomainStatus =| 'deleted'| 'expired'export interface CustomDomain {+ holdReason?: 'plan' | 'site' | 'account' | 'manual' | null+ cleanupPending?: booleanhostname: stringsiteId: numbergeneration: stringdiff --git a/packages/contracts/src/entry.ts b/packages/contracts/src/entry.tsindex 693efcb1..fecfb81b 100644--- a/packages/contracts/src/entry.ts+++ b/packages/contracts/src/entry.ts@@ -69,6 +69,8 @@ export function entryRequestPath(}export interface EntrySiteSummary {+ suspended?: boolean+ suspensionReason?: stringsiteId: numberworkspaceId: numbername: stringdiff --git a/packages/platform/migrations/0015_lifecycle.sql b/packages/platform/migrations/0015_lifecycle.sqlnew file mode 100644index 00000000..83318de0--- /dev/null+++ b/packages/platform/migrations/0015_lifecycle.sql@@ -0,0 +1,11 @@+ALTER TABLE platform_account_controls ADD COLUMN public_reason TEXT NOT NULL DEFAULT '';+ALTER TABLE platform_sites ADD COLUMN suspension_reason TEXT NOT NULL DEFAULT '';+ALTER TABLE platform_custom_domains ADD COLUMN user_paused INTEGER NOT NULL DEFAULT 0 CHECK(user_paused IN(0,1));+ALTER TABLE platform_custom_domains ADD COLUMN hold_reason TEXT;+ALTER TABLE platform_custom_domains ADD COLUMN purge_requested INTEGER NOT NULL DEFAULT 0 CHECK(purge_requested IN(0,1));+ALTER TABLE platform_custom_domains ADD COLUMN restore_primary INTEGER NOT NULL DEFAULT 0 CHECK(restore_primary IN(0,1));+UPDATE platform_custom_domains SET user_paused=1 WHERE state='paused';+CREATE TABLE platform_policy_epoch (id INTEGER PRIMARY KEY CHECK(id=1),revision INTEGER NOT NULL DEFAULT 1);+INSERT INTO platform_policy_epoch(id) VALUES(1);+-- Recheck existing domains, including bindings created before plan enforcement.+UPDATE platform_custom_domains SET next_check_at=0 WHERE state<>'deleted';diff --git a/packages/platform/src/domain-policy.ts b/packages/platform/src/domain-policy.tsnew file mode 100644index 00000000..e95c968c--- /dev/null+++ b/packages/platform/src/domain-policy.ts@@ -0,0 +1,27 @@+import type { PlatformD1 } from './index.ts'+import { workspaceEntitlements } from './entitlements.ts'+export type DomainHold = 'plan' | 'site' | 'account' | 'manual'+export async function domainEligibility(db: PlatformD1, hostname: string) {+ const row = await db+ .prepare(`SELECT d.site_id,s.workspace_id,s.suspended,COALESCE(c.suspended,0) AS owner_suspended,+ (SELECT COUNT(*) FROM platform_custom_domains other JOIN platform_sites os ON os.id=other.site_id+ WHERE os.workspace_id=s.workspace_id AND other.state NOT IN('deleted','deleting') AND (other.created_at<d.created_at OR (other.created_at=d.created_at AND other.hostname<=d.hostname))) AS rank+ FROM platform_custom_domains d JOIN platform_sites s ON s.id=d.site_id JOIN platform_workspaces w ON w.id=s.workspace_id+ LEFT JOIN platform_account_controls c ON c.user_id=w.owner_user_id WHERE d.hostname=?`)+ .bind(hostname)+ .first<{+ site_id: number+ workspace_id: number+ suspended: number+ owner_suspended: number+ rank: number+ }>()+ if (!row) return { allowed: false, reason: 'plan' as DomainHold }+ if (row.suspended) return { allowed: false, reason: 'site' as DomainHold }+ if (row.owner_suspended)+ return { allowed: false, reason: 'account' as DomainHold }+ const plan = await workspaceEntitlements(db, row.workspace_id)+ return row.rank > 0 && row.rank <= plan.limits.customDomains+ ? { allowed: true, reason: null }+ : { allowed: false, reason: 'plan' as DomainHold }+}diff --git a/packages/platform/src/domains.ts b/packages/platform/src/domains.tsindex c3443802..b9cb159b 100644--- a/packages/platform/src/domains.ts+++ b/packages/platform/src/domains.ts@@ -1,3 +1,4 @@+import { domainEligibility } from './domain-policy.ts'import { workspaceEntitlements } from './entitlements.ts'import {DEFAULT_CNAME_TARGET,@@ -70,6 +71,10 @@ interface Row {retry_requested: numberlease_until: number | nullverified_at: number | null+ user_paused: number+ hold_reason: string | null+ purge_requested: number+ restore_primary: number}export function domainDTO(row: Row,@@ -92,6 +97,15 @@ export function domainDTO(checkedAt: row.checked_at,expiresAt: row.expires_at,nextCheckAt: row.next_check_at,+ holdReason: row.hold_reason as CustomDomain['holdReason'],+ cleanupPending:+ !!(+ row.provider_id ||+ row.route_id ||+ row.provider_attempted ||+ row.route_attempted+ ) &&+ (row.state === 'paused' || row.state === 'deleting'),}}/** Domain transitions retain their generation and database lease through external retries. */@@ -146,11 +160,30 @@ export function createDomainManager(async function list(userId: number, siteId: number) {await authorize(userId, siteId, false)const rows = await stmt(- `SELECT json_group_array(json_object('hostname',hostname,'site_id',site_id,'generation',generation,'revision',revision,'state',state,'dns_status',dns_status,'hostname_status',hostname_status,'ssl_status',ssl_status,'error',error,'is_primary',is_primary,'redirects',redirects,'created_at',created_at,'checked_at',checked_at,'expires_at',expires_at,'next_check_at',next_check_at)) AS items FROM (SELECT * FROM platform_custom_domains WHERE site_id=? AND state<>'deleted' ORDER BY created_at)`,+ `SELECT json_group_array(json_object('hostname',hostname,'site_id',site_id,'generation',generation,'revision',revision,'state',state,'dns_status',dns_status,'hostname_status',hostname_status,'ssl_status',ssl_status,'error',error,'is_primary',is_primary,'redirects',redirects,'created_at',created_at,'checked_at',checked_at,'expires_at',expires_at,'next_check_at',next_check_at,'user_paused',user_paused,'hold_reason',hold_reason,'provider_attempted',provider_attempted,'route_attempted',route_attempted,'provider_id',provider_id,'route_id',route_id)) AS items FROM (SELECT * FROM platform_custom_domains WHERE site_id=? AND state<>'deleted' ORDER BY created_at)`,siteId,).first<{ items: string }>()- return (JSON.parse(rows?.items ?? '[]') as Row[]).map((row) =>- domainDTO(row, target),+ return Promise.all(+ (JSON.parse(rows?.items ?? '[]') as Row[]).map(async (row) => {+ const eligibility = await domainEligibility(db, row.hostname)+ const dto = domainDTO(row, target)+ if (!['deleting', 'expired'].includes(row.state)) {+ dto.holdReason = row.user_paused ? 'manual' : eligibility.reason+ if (!eligibility.allowed || row.user_paused) {+ dto.status = 'paused'+ dto.cleanupPending = !!(+ row.provider_id ||+ row.route_id ||+ row.provider_attempted ||+ row.route_attempted+ )+ } else if (row.state === 'paused') {+ dto.status = 'pending'+ dto.holdReason = null+ }+ }+ return dto+ }),)}async function request(userId: number, siteId: number, input: unknown) {@@ -200,10 +233,10 @@ export function createDomainManager(const insertion = stmt(`INSERT INTO platform_custom_domains(hostname,site_id,generation,created_at,expires_at,next_check_at,dns_status)SELECT ?,?,?,?,?,?,? WHERE ${memberGuard}- AND (SELECT COUNT(*) FROM platform_custom_domains WHERE state<>'deleted' AND NOT ${HAS_PROVIDER})<?- AND (SELECT COUNT(*) FROM platform_custom_domains WHERE state<>'deleted')<?+ AND (SELECT COUNT(*) FROM platform_custom_domains WHERE state NOT IN('deleted','paused') AND NOT ${HAS_PROVIDER})<?+ AND (SELECT COUNT(*) FROM platform_custom_domains WHERE state<>'deleted' AND (state<>'paused' OR ${HAS_PROVIDER}))<?AND (SELECT COUNT(*) FROM platform_custom_domains c JOIN platform_sites s ON s.id=c.site_id WHERE s.workspace_id=(SELECT workspace_id FROM platform_sites WHERE id=?) AND c.state<>'deleted')<?- ON CONFLICT(hostname) DO UPDATE SET site_id=excluded.site_id,generation=excluded.generation,revision=platform_custom_domains.revision+1,state='pending',created_at=excluded.created_at,expires_at=excluded.expires_at,next_check_at=excluded.next_check_at,dns_status=excluded.dns_status,provider_attempted=0,route_attempted=0,retry_requested=0,attempts=0,checked_at=NULL,verified_at=NULL,hostname_status='unknown',ssl_status='unknown',error=NULL,is_primary=0,redirects=0,lease_token=NULL,lease_until=NULL+ ON CONFLICT(hostname) DO UPDATE SET site_id=excluded.site_id,generation=excluded.generation,revision=platform_custom_domains.revision+1,state='pending',created_at=excluded.created_at,expires_at=excluded.expires_at,next_check_at=excluded.next_check_at,dns_status=excluded.dns_status,provider_attempted=0,route_attempted=0,retry_requested=0,attempts=0,checked_at=NULL,verified_at=NULL,hostname_status='unknown',ssl_status='unknown',error=NULL,is_primary=0,redirects=0,lease_token=NULL,lease_until=NULL,user_paused=0,hold_reason=NULL,purge_requested=0,restore_primary=0WHERE platform_custom_domains.state='deleted' AND platform_custom_domains.provider_id IS NULL AND platform_custom_domains.route_id IS NULL`,host,siteId,@@ -287,6 +320,11 @@ export function createDomainManager(throw new DomainError(409, 'domain_not_ready')if (row.state === 'deleting' && action !== 'delete')throw new DomainError(409, 'domain_cleanup_pending')+ if (+ ['resume', 'primary', 'redirects'].includes(action) &&+ !(await domainEligibility(db, host)).allowed+ )+ throw new DomainError(403, 'domain_limit')if (action === 'resume' && row.state !== 'paused')throw new DomainError(409, 'domain_changed')if (action === 'check' && row.next_check_at > now() + 30000)@@ -299,7 +337,7 @@ export function createDomainManager(if (action === 'primary')statements.push(stmt(- `UPDATE platform_custom_domains SET is_primary=0 WHERE site_id=? AND hostname<>? AND EXISTS(SELECT 1 FROM platform_custom_domains WHERE ${guard})`,+ `UPDATE platform_custom_domains SET is_primary=0,restore_primary=0 WHERE site_id=? AND hostname<>? AND EXISTS(SELECT 1 FROM platform_custom_domains WHERE ${guard})`,siteId,host,...args,@@ -307,13 +345,13 @@ export function createDomainManager()let set =action === 'pause'- ? "state='paused',is_primary=0"+ ? "state='paused',is_primary=0,user_paused=1,hold_reason='manual',restore_primary=0": action === 'delete'- ? "state='deleting',is_primary=0"+ ? "state='deleting',is_primary=0,restore_primary=0": action === 'resume'- ? "state='pending',is_primary=0"+ ? "state='pending',is_primary=0,user_paused=0,hold_reason=NULL": action === 'primary'- ? 'is_primary=1'+ ? 'is_primary=1,restore_primary=0': action === 'redirects'? `redirects=${value ? 1 : 0}`: 'error=NULL,retry_requested=1'@@ -342,7 +380,7 @@ export function createDomainManager(async function reconcile(onlyHost?: string, batchSize = 5) {if (!config.enabled) return { checked: 0 }const rows = await stmt(- `SELECT json_group_array(hostname) AS items FROM (SELECT hostname FROM platform_custom_domains WHERE (state IN ('pending','active','deleting','expired') OR (state='paused' AND verified_at IS NULL AND expires_at<=?)) AND next_check_at<=? AND (lease_until IS NULL OR lease_until<?) ${onlyHost ? 'AND hostname=?' : ''} ORDER BY next_check_at LIMIT ?)`,+ `SELECT json_group_array(hostname) AS items FROM (SELECT hostname FROM platform_custom_domains WHERE (state IN ('pending','active','deleting','expired') OR (state='paused' AND ((hold_reason IS NOT NULL AND hold_reason<>'manual') OR provider_attempted=1 OR route_attempted=1 OR (verified_at IS NULL AND expires_at<=?)))) AND next_check_at<=? AND (lease_until IS NULL OR lease_until<?) ${onlyHost ? 'AND hostname=?' : ''} ORDER BY CASE WHEN ${HAS_PROVIDER} THEN 0 WHEN next_check_at=0 THEN 1 WHEN state='pending' THEN 2 ELSE 3 END,next_check_at,hostname LIMIT ?)`,now(),now(),now(),@@ -354,7 +392,7 @@ export function createDomainManager(const token = dependencies.id(),time = now()const row = await stmt(- `UPDATE platform_custom_domains SET lease_token=?,lease_until=? WHERE hostname=? AND (lease_until IS NULL OR lease_until<?) AND next_check_at<=? AND (state IN ('pending','active','deleting','expired') OR (state='paused' AND verified_at IS NULL AND expires_at<=?)) RETURNING *`,+ `UPDATE platform_custom_domains SET lease_token=?,lease_until=? WHERE hostname=? AND (lease_until IS NULL OR lease_until<?) AND next_check_at<=? AND (state IN ('pending','active','deleting','expired') OR (state='paused' AND ((hold_reason IS NOT NULL AND hold_reason<>'manual') OR provider_attempted=1 OR route_attempted=1 OR (verified_at IS NULL AND expires_at<=?)))) RETURNING *`,token,time + 300000,host,@@ -363,9 +401,19 @@ export function createDomainManager(time,).first<Row>()if (!row) continue+ const epoch = await stmt(+ 'SELECT revision FROM platform_policy_epoch WHERE id=1',+ ).first<{ revision: number }>()const guard =- 'hostname=? AND generation=? AND lease_token=? AND revision=? AND state=?'- const args = [host, row.generation, token, row.revision, row.state]+ 'hostname=? AND generation=? AND lease_token=? AND revision=? AND state=? AND (SELECT revision FROM platform_policy_epoch WHERE id=1)=?'+ const args = [+ host,+ row.generation,+ token,+ row.revision,+ row.state,+ epoch!.revision,+ ]const fenced = async (sql: string,...values: (string | number | null)[]@@ -399,14 +447,16 @@ export function createDomainManager(throw new DomainError(409, 'domain_changed')}try {- if (- row.state === 'deleting' ||- row.state === 'expired' ||- ((row.state === 'pending' || row.state === 'paused') &&- time >= row.expires_at &&- !row.verified_at)- ) {- // Resource identity is never inferred unless this generation previously attempted creation.+ const eligibility = await domainEligibility(db, host)+ const expired =+ (row.state === 'pending' || row.state === 'paused') &&+ time >= row.expires_at &&+ !row.verified_at+ const deleting =+ row.state === 'deleting' || row.state === 'expired' || expired+ const hold = row.user_paused ? 'manual' : eligibility.reason+ if (deleting || hold) {+ // Delete only resources owned by this claim, recovering IDs after uncertain writes.let providerId = row.provider_id,routeId = row.route_idif (!providerId && row.provider_attempted)@@ -428,17 +478,27 @@ export function createDomainManager(...args,),stmt(- `UPDATE platform_custom_domains SET revision=revision+1,state='deleted',is_primary=0,provider_id=NULL,route_id=NULL,error=NULL,checked_at=?,next_check_at=?,lease_token=NULL,lease_until=NULL WHERE ${guard}`,- time,+ `UPDATE platform_custom_domains SET revision=revision+1,state=?,restore_primary=CASE WHEN ?=0 AND user_paused=0 THEN MAX(restore_primary,is_primary) ELSE 0 END,is_primary=0,provider_id=NULL,route_id=NULL,provider_attempted=0,route_attempted=0,hold_reason=?,hostname_status='removed',ssl_status='removed',error=NULL,checked_at=?,next_check_at=?,lease_token=NULL,lease_until=NULL WHERE ${guard}`,+ deleting ? 'deleted' : 'paused',+ deleting ? 1 : 0,+ deleting ? null : hold,time,+ time + 86400000,...args,),],- 'removed',+ deleting ? 'removed' : 'suspended',)+ if (deleting && row.purge_requested)+ await stmt(+ "DELETE FROM platform_custom_domains WHERE hostname=? AND generation=? AND state='deleted' AND provider_id IS NULL AND route_id IS NULL AND provider_attempted=0 AND route_attempted=0",+ host,+ row.generation,+ ).run()checked++continue}+ if (row.state === 'deleted') continueconst dns = await dependencies.dns(host,domainClaimTarget(row.generation, target),@@ -469,8 +529,14 @@ export function createDomainManager(: await dependencies.provider.find(host)if (!row.provider_id && provider && !row.provider_attempted)throw new DomainError(409, 'domain_provider_conflict')- if (row.provider_id && !provider)- throw new DomainError(409, 'domain_provider_missing')+ if (row.provider_id && !provider) {+ if (row.route_id)+ await dependencies.provider.removeRoute(row.route_id, host)+ await fenced('provider_id=NULL,route_id=NULL,route_attempted=0')+ row.route_id = null+ row.route_attempted = 0+ row.provider_id = null+ }if (!provider) {const allocationToken = dependencies.id()const allocation = await stmt(@@ -547,7 +613,7 @@ export function createDomainManager(...args,),stmt(- `UPDATE platform_custom_domains SET revision=revision+1,state=?,is_primary=CASE WHEN ?=1 THEN is_primary ELSE 0 END,error=?,attempts=CASE WHEN state='active' THEN 0 ELSE attempts+1 END,checked_at=?,verified_at=CASE WHEN ?=1 THEN ? ELSE verified_at END,next_check_at=?,lease_token=NULL,lease_until=NULL WHERE ${guard}`,+ `UPDATE platform_custom_domains SET revision=revision+1,state=?,is_primary=CASE WHEN ?=1 THEN CASE WHEN restore_primary=1 AND NOT EXISTS(SELECT 1 FROM platform_custom_domains other WHERE other.site_id=platform_custom_domains.site_id AND other.hostname<>platform_custom_domains.hostname AND other.is_primary=1) THEN 1 ELSE is_primary END ELSE 0 END,hold_reason=NULL,error=?,attempts=CASE WHEN state='active' THEN 0 ELSE attempts+1 END,checked_at=?,verified_at=CASE WHEN ?=1 THEN ? ELSE verified_at END,next_check_at=?,lease_token=NULL,lease_until=NULL WHERE ${guard}`,active ? 'active' : 'pending',active ? 1 : 0,config.routingReady ? null : 'domain_routing_unavailable',@@ -556,7 +622,7 @@ export function createDomainManager(time,time +(active- ? 900000+ ? 1800000: Math.min(1800000, 60000 * 2 ** Math.min(row.attempts, 5))),...args,),@@ -585,7 +651,7 @@ export function createDomainManager(time - DOMAIN_HEALTH_TTL,),stmt(- `UPDATE platform_custom_domains SET revision=revision+1,state=CASE WHEN state IN ('deleting','expired') THEN state WHEN ?=1 OR verified_at IS NULL OR verified_at<? THEN 'pending' ELSE state END,is_primary=CASE WHEN ?=1 OR verified_at IS NULL OR verified_at<? THEN 0 ELSE is_primary END,error=?,attempts=attempts+1,checked_at=?,next_check_at=?,lease_token=NULL,lease_until=NULL WHERE ${guard}`,+ `UPDATE platform_custom_domains SET revision=revision+1,state=CASE WHEN state IN ('deleting','expired','paused') THEN state WHEN ?=1 OR verified_at IS NULL OR verified_at<? THEN 'pending' ELSE state END,is_primary=CASE WHEN ?=1 OR verified_at IS NULL OR verified_at<? THEN 0 ELSE is_primary END,error=?,attempts=attempts+1,checked_at=?,next_check_at=?,lease_token=NULL,lease_until=NULL WHERE ${guard}`,terminal ? 1 : 0,time - DOMAIN_HEALTH_TTL,terminal ? 1 : 0,@@ -604,7 +670,7 @@ export function createDomainManager(const site = await authorize(userId, siteId)await db.batch([stmt(- `UPDATE platform_custom_domains SET is_primary=0,redirects=0,revision=revision+1 WHERE site_id=? AND ${memberGuard}`,+ `UPDATE platform_custom_domains SET is_primary=0,restore_primary=0,redirects=0,revision=revision+1 WHERE site_id=? AND ${memberGuard}`,siteId,siteId,userId,diff --git a/packages/platform/src/index.ts b/packages/platform/src/index.tsindex 6a4e9f95..d448a79d 100644--- a/packages/platform/src/index.ts+++ b/packages/platform/src/index.ts@@ -1,3 +1,4 @@+import { domainEligibility } from './domain-policy.ts'import { DOMAIN_HEALTH_TTL } from './domains.ts'import type { EmailCodeStore } from '@chronoframe/core'import type { PlatformDirectory, PlatformSession } from '@chronoframe/core'@@ -37,11 +38,22 @@ export function createD1Directory(async getPublishedSiteByHost(host) {const row = await db.prepare(- `SELECT s.id, s.workspace_id AS workspaceId, s.published FROM platform_domains d JOIN platform_sites s ON s.id=d.site_id LEFT JOIN platform_custom_domains cd ON cd.hostname=d.hostname WHERE d.hostname=? AND d.verified=1 AND d.active=1 AND s.published=1 AND s.suspended=0 AND (d.kind<>'custom' OR (cd.site_id=d.site_id AND cd.state='active' AND cd.verified_at>=?)) AND (d.kind<>'alias' OR d.redirect_until>?)`,+ `SELECT s.id, s.workspace_id AS workspaceId, s.published, d.kind FROM platform_domains d JOIN platform_sites s ON s.id=d.site_id LEFT JOIN platform_custom_domains cd ON cd.hostname=d.hostname WHERE d.hostname=? AND d.verified=1 AND d.active=1 AND s.published=1 AND s.suspended=0 AND NOT EXISTS(SELECT 1 FROM platform_workspaces w JOIN platform_account_controls ac ON ac.user_id=w.owner_user_id WHERE w.id=s.workspace_id AND ac.suspended=1) AND (d.kind<>'custom' OR (cd.site_id=d.site_id AND cd.state='active' AND cd.verified_at>=?)) AND (d.kind<>'alias' OR d.redirect_until>?)`,).bind(host, now() - DOMAIN_HEALTH_TTL, now())- .first<{ id: number; workspaceId: number; published: number }>()- return row ? { ...row, published: row.published === 1 } : null+ .first<{+ id: number+ workspaceId: number+ published: number+ kind: string+ }>()+ if (+ !row ||+ (row.kind === 'custom' && !(await domainEligibility(db, host)).allowed)+ )+ return null+ const { kind: _kind, ...site } = row+ return { ...site, published: row.published === 1 }},}}@@ -145,6 +157,8 @@ export function createD1Sessions(db: PlatformD1) {}export interface PlatformSiteSummary {+ suspended: boolean+ suspensionReason: stringsiteId: numberworkspaceId: numbername: string@@ -160,8 +174,8 @@ export function createD1SiteCatalog(db: PlatformD1) {const row = await db.prepare(`SELECT json_group_array(json_object('siteId', id, 'workspaceId', workspace_id, 'name', name,- 'published', published, 'role', role)) AS items FROM (- SELECT s.id, s.workspace_id, s.name, s.published, m.role+ 'published', published, 'role', role,'suspended',suspended,'suspensionReason',suspension_reason)) AS items FROM (+ SELECT s.id, s.workspace_id, s.name, s.published, m.role,s.suspended,s.suspension_reasonFROM platform_sites s JOIN platform_memberships m ON m.workspace_id = s.workspace_idWHERE m.user_id = ? AND m.role IN ('admin', 'member') ORDER BY s.id)`)@@ -170,9 +184,13 @@ export function createD1SiteCatalog(db: PlatformD1) {return (JSON.parse(row?.items ?? '[]') as (Omit<PlatformSiteSummary,- 'published'- > & { published: number })[]- ).map((site) => ({ ...site, published: site.published === 1 }))+ 'published' | 'suspended'+ > & { published: number; suspended: number })[]+ ).map((site) => ({+ ...site,+ suspended: site.suspended === 1,+ published: site.published === 1,+ }))},/** Read a name after the caller has independently authorized or resolved the Site. */async name(siteId: number): Promise<string> {diff --git a/tests/cloud-account-security.test.ts b/tests/cloud-account-security.test.tsindex a1cd5b0c..2abc1904 100644--- a/tests/cloud-account-security.test.ts+++ b/tests/cloud-account-security.test.ts@@ -46,6 +46,11 @@ test('Cloud account migration preserves identities and enforces verified registr.run()await migration('0002_visitor_access.sql')await migration('0003_account_security.sql')+ await db+ .prepare(+ "CREATE TABLE platform_account_controls(user_id INTEGER PRIMARY KEY,suspended INTEGER NOT NULL DEFAULT 0,public_reason TEXT NOT NULL DEFAULT '')",+ )+ .run()assert.equal((await db.prepare('SELECT user_id FROM platform_memberships').first()).user_id,@@ -443,6 +448,40 @@ test('Cloud account migration preserves identities and enforces verified registr'setting a first password does not replace a migrated identity',)await call('/sign-out', {})+ await db+ .prepare(+ "INSERT INTO platform_account_controls(user_id,suspended,public_reason) VALUES(42,1,'Account suspended for review. Contact support.')",+ )+ .run()+ const wrong = await call('/sign-in/email', {+ email: '[email protected]',+ password: 'wrong-password',+ })+ assert.ok(wrong.response.status >= 400)+ assert.ok(!JSON.stringify(wrong.data).includes('suspended for review'))+ const banned = await call('/sign-in/email', {+ email: '[email protected]',+ password: existingPassword,+ })+ assert.equal(banned.response.status, 403)+ assert.equal(banned.data.code, 'ACCOUNT_SUSPENDED')+ assert.match(banned.data.message, /suspended for review/)+ await call('/email-otp/send-verification-otp', {+ email: '[email protected]',+ type: 'sign-in',+ })+ const bannedCode = messages.at(-1)!.text.match(/\b[0-9]{6}\b/)![0]+ const bannedOtp = await call('/sign-in/email-otp', {+ email: '[email protected]',+ otp: bannedCode,+ })+ assert.equal(bannedOtp.response.status, 403)+ assert.equal((await call('/get-session')).data, null)+ await db+ .prepare(+ 'UPDATE platform_account_controls SET suspended=0 WHERE user_id=42',+ )+ .run()const before = messages.lengthawait call('/email-otp/send-verification-otp', {email: '[email protected]',diff --git a/tests/cloud-domains.test.ts b/tests/cloud-domains.test.tsindex 11aa69ff..6660d685 100644--- a/tests/cloud-domains.test.ts+++ b/tests/cloud-domains.test.ts@@ -5,6 +5,7 @@ import { createRequire } from 'node:module'import {createD1Provisioning,createD1Directory,+ createD1SiteCatalog,} from '../packages/platform/src/index.ts'import {createDomainManager,@@ -242,6 +243,71 @@ test('Real D1 custom domains fence claims, CNAME ownership transitions, provider)domain = (await manager.list(1, one.siteId))[0]!assert.equal(domain.primary, true)+ // Downgrades block traffic before the next provider reconciliation.+ const claimGeneration = domain.generation,+ claimTarget = domain.cnameTarget+ await db+ .prepare(+ "UPDATE platform_plans SET policy_json=json_set(policy_json,'$.limits.customDomains',0) WHERE id='free'",+ )+ .run()+ assert.equal(await directory.getPublishedSiteByHost(domain.hostname), null)+ let held = (await manager.list(1, one.siteId))[0]!+ assert.equal(held.holdReason, 'plan')+ assert.equal(held.status, 'paused')+ assert.equal(held.cleanupPending, true)+ failDelete = true+ time += 1800001+ await manager.reconcile(domain.hostname)+ assert.equal(+ hosts.size,+ 1,+ 'failed cleanup retains the upstream reference for retry',+ )+ assert.equal(await directory.getPublishedSiteByHost(domain.hostname), null)+ time += 1800001+ await manager.reconcile(domain.hostname)+ held = (await manager.list(1, one.siteId))[0]!+ assert.equal(held.cleanupPending, false)+ assert.equal(hosts.size, 0)+ assert.equal(routes.size, 0)+ assert.equal(held.generation, claimGeneration)+ await db+ .prepare(+ "UPDATE platform_plans SET policy_json=json_set(policy_json,'$.limits.customDomains',4) WHERE id='free'",+ )+ .run()+ await db.prepare('UPDATE platform_custom_domains SET next_check_at=0').run()+ await manager.reconcile(domain.hostname)+ domain = (await manager.list(1, one.siteId))[0]!+ assert.equal(domain.status, 'active')+ assert.equal(domain.primary, true)+ assert.equal(domain.cnameTarget, claimTarget)+ // Owner and site moderation block all public routes immediately.+ await db+ .prepare(+ "INSERT INTO platform_account_controls(user_id,suspended,public_reason) VALUES(1,1,'Account under review')",+ )+ .run()+ assert.equal(+ await directory.getPublishedSiteByHost('timo.chronoframe.art'),+ null,+ )+ assert.equal(await directory.getPublishedSiteByHost(domain.hostname), null)+ await db.prepare('UPDATE platform_account_controls SET suspended=0').run()+ await db+ .prepare(+ "UPDATE platform_sites SET suspended=1,suspension_reason='Site under review' WHERE id=?",+ )+ .bind(one.siteId)+ .run()+ const catalog = await createD1SiteCatalog(db).list(1)+ assert.equal(catalog[0]?.suspended, true)+ assert.equal(catalog[0]?.suspensionReason, 'Site under review')+ await db+ .prepare('UPDATE platform_sites SET suspended=0 WHERE id=?')+ .bind(one.siteId)+ .run()await manager.mutate(1,one.siteId,@@ -303,7 +369,7 @@ test('Real D1 custom domains fence claims, CNAME ownership transitions, providerawait manager.reconcile()assert.equal(creates,- 1,+ 2,'a prior generation CNAME must not establish account ownership',)dns.set(rebound.hostname, 'cname.chronoframe.art')@@ -311,7 +377,7 @@ test('Real D1 custom domains fence claims, CNAME ownership transitions, providerawait manager.reconcile()assert.equal(creates,- 1,+ 2,'a shared CNAME does not authorize the new generation',)dns.set(rebound.hostname, rebound.cnameTarget)@@ -413,6 +479,84 @@ test('Real D1 custom domains fence claims, CNAME ownership transitions, providerawait manager.reconcile(leased.hostname)assert.equal(hosts.has(leased.hostname), false)provider.create = originalCreate+ let releasePolicy!: () => void, enteredPolicy!: () => void+ const policyGate = new Promise<void>((r) => (releasePolicy = r)),+ policyStarted = new Promise<void>((r) => (enteredPolicy = r))+ provider.create = async (host) => {+ const result = await originalCreate(host)+ if (host === 'policy-race.example.com') {+ enteredPolicy()+ await policyGate+ }+ return result+ }+ const racing = await manager.request(+ 1,+ one.siteId,+ 'policy-race.example.com',+ )+ dns.set(racing.hostname, racing.cnameTarget)+ const work = manager.reconcile(racing.hostname)+ await policyStarted+ await db.batch([+ db.prepare(+ "UPDATE platform_plans SET policy_json=json_set(policy_json,'$.limits.customDomains',0) WHERE id='free'",+ ),+ db.prepare(+ 'UPDATE platform_policy_epoch SET revision=revision+1 WHERE id=1',+ ),+ ])+ releasePolicy()+ await work+ assert.equal(await directory.getPublishedSiteByHost(racing.hostname), null)+ assert.equal(+ routes.has(racing.hostname),+ false,+ 'old policy cannot finish publishing a route',+ )+ time += 300001+ await manager.reconcile(racing.hostname)+ assert.equal(+ hosts.has(racing.hostname),+ false,+ 'uncertain provider create is recovered and reclaimed',+ )+ await db+ .prepare(+ "UPDATE platform_plans SET policy_json=json_set(policy_json,'$.limits.customDomains',4) WHERE id='free'",+ )+ .run()+ // A queued permanent removal is not finalized until upstream deletion succeeds.+ await db+ .prepare(+ "UPDATE platform_custom_domains SET state='deleting',purge_requested=1,next_check_at=0 WHERE hostname=?",+ )+ .bind(lost.hostname)+ .run()+ failDelete = true+ await manager.reconcile(lost.hostname)+ assert.ok(+ await db+ .prepare(+ 'SELECT hostname FROM platform_custom_domains WHERE hostname=?',+ )+ .bind(lost.hostname)+ .first(),+ )+ time += 1800001+ await manager.reconcile(lost.hostname)+ assert.equal(hosts.has(lost.hostname), false)+ assert.equal(+ await db+ .prepare(+ 'SELECT hostname FROM platform_custom_domains WHERE hostname=?',+ )+ .bind(lost.hostname)+ .first(),+ null,+ )+ provider.create = originalCreate+await renameDefaultDomain(db,1,diff --git a/tests/platform-email-d1.test.ts b/tests/platform-email-d1.test.tsindex 0d79c8e8..61857179 100644--- a/tests/platform-email-d1.test.ts+++ b/tests/platform-email-d1.test.ts@@ -211,6 +211,9 @@ test('D1 directory never maps unverified/inactive domains or unrelated Workspacesqlite.exec('ALTER TABLE platform_sites ADD COLUMN suspended INTEGER NOT NULL DEFAULT 0',)+ sqlite.exec(+ 'CREATE TABLE platform_account_controls(user_id INTEGER,suspended INTEGER)',+ )const access = createPlatformAccess(createD1Directory(db), () => 100)const session = { userId: 1, expiresAt: 200 }assert.equal((await access.authorizeSite(session, 1, 'manage')).site.id, 1)@@ -380,6 +383,9 @@ test('D1 Site catalog lists only current memberships, including unpublished owneINSERT INTO platform_workspaces VALUES(1,'one'),(2,'two');INSERT INTO platform_sites VALUES(1,1,'one-public',1),(2,2,'two-private',0),(3,1,'one-draft',0);INSERT INTO platform_memberships VALUES(1,1,'admin'),(2,2,'member');`)+ sqlite.exec(+ "ALTER TABLE platform_sites ADD COLUMN suspended INTEGER NOT NULL DEFAULT 0;ALTER TABLE platform_sites ADD COLUMN suspension_reason TEXT NOT NULL DEFAULT '';",+ )assert.deepEqual((await createD1SiteCatalog(db).list(1)).map((s) => s.siteId),[1, 3],diff --git a/tests/platform-provisioning.test.ts b/tests/platform-provisioning.test.tsindex 898ad27a..b35770e9 100644--- a/tests/platform-provisioning.test.ts+++ b/tests/platform-provisioning.test.ts@@ -87,6 +87,7 @@ test('Real D1 provisioning preserves old tenants, serializes defaults and enforc'0007_cloud_storage.sql','0009_cloud_usage_events.sql','0014_entitlements.sql',+ '0015_lifecycle.sql',])await migrate(migration)await dbdiff --git a/tests/site-domain-error.test.ts b/tests/site-domain-error.test.tsindex 4d78742a..83c5f3ea 100644--- a/tests/site-domain-error.test.ts+++ b/tests/site-domain-error.test.ts@@ -19,6 +19,8 @@ test('Site domain middleware leaves Nuxt error rendering independent of unavailadefineEventHandler: (fn: unknown) => fn,useRuntimeConfig: () => ({ public: { siteBaseDomain: 'chronoframe.art' } }),require: (name: string) => {+ if (name.endsWith('/domain-policy'))+ return { domainEligibility: async () => ({ allowed: true }) }if (name === 'h3')return {getRequestURL: (e: any) => new URL(e.url),