@quickback-dev/cli 0.70.0 → 0.70.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/dist/skill/docs/api/query-params.md +6 -0
- package/dist/skill/docs/api/typescript.md +17 -5
- package/dist/skill/docs/configure/domains.md +17 -27
- package/dist/skill/docs/configure/index.md +9 -10
- package/dist/skill/docs/configure/security.md +1 -1
- package/dist/skill/docs/define/triggers.md +5 -1
- package/dist/skill/docs/platform/auth/plugins/index.md +1 -1
- package/dist/skill/docs/platform/database/d1.md +2 -2
- package/dist/skill/docs/platform/database/neon.md +2 -3
- package/dist/skill/docs/platform/database/planetscale-postgres.md +10 -4
- package/dist/skill/docs/ui/admin/index.md +1 -1
- package/package.json +1 -1
- package/src/skill/docs/api/query-params.md +6 -0
- package/src/skill/docs/api/typescript.md +17 -5
- package/src/skill/docs/configure/domains.md +17 -27
- package/src/skill/docs/configure/index.md +9 -10
- package/src/skill/docs/configure/security.md +1 -1
- package/src/skill/docs/define/triggers.md +5 -1
- package/src/skill/docs/platform/auth/plugins/index.md +1 -1
- package/src/skill/docs/platform/database/d1.md +2 -2
- package/src/skill/docs/platform/database/neon.md +2 -3
- package/src/skill/docs/platform/database/planetscale-postgres.md +10 -4
- package/src/skill/docs/ui/admin/index.md +1 -1
package/dist/index.js
CHANGED
|
@@ -45,6 +45,12 @@ It is never dropped:
|
|
|
45
45
|
| `?resolvedAt.gte=yesterday` on a Postgres timestamp column | `400` — `"yesterday" is not an ISO 8601 timestamp` |
|
|
46
46
|
| `?resolvedAt.like=2026` on a Postgres timestamp column | `400` — use `eq`, `ne`, `gt`, `gte`, `lt`, `lte` or `in` |
|
|
47
47
|
|
|
48
|
+
A column named like a list parameter (`sort`, `order`, `limit`, `offset`,
|
|
49
|
+
`search`, `fields`, `total`, `include`, `starting_after`, `ending_before`) is
|
|
50
|
+
not filterable: `?sort=` is always the sort control, and the OpenAPI spec omits
|
|
51
|
+
the column filter rather than declaring the parameter twice. Filter it through
|
|
52
|
+
a view or rename the column.
|
|
53
|
+
|
|
48
54
|
Silently dropping a predicate would return **every row the firewall allows**
|
|
49
55
|
while still reading as a scoped list — a typo'd or join-table field turns a
|
|
50
56
|
narrow query into a full dump. The same rule closes `?search=` and `?sort=`.
|
|
@@ -36,7 +36,7 @@ Each resource table exposes:
|
|
|
36
36
|
| `Insert` | Createable fields, with defaults and nullable fields optional |
|
|
37
37
|
| `Update` | Updatable fields, all optional |
|
|
38
38
|
| `ListResponse` | `Qb.Page<Row>` |
|
|
39
|
-
| `columns.<name>` | Type of one row column |
|
|
39
|
+
| `columns.<name>` | Type of one row column. A column named like a TypeScript keyword or built-in type (`number`, `string`, `delete`, …) is prefixed: `columns._number` |
|
|
40
40
|
| `views.<name>.Item` | A view's projected row |
|
|
41
41
|
| `views.<name>.Response` | Page plus typed aggregations where declared |
|
|
42
42
|
| `actions.<name>.Input` | The action's Zod input contract |
|
|
@@ -253,6 +253,15 @@ export default defineConfig({
|
|
|
253
253
|
`types` output, and the compile fails if `types` is `false`. It is off by
|
|
254
254
|
default.
|
|
255
255
|
|
|
256
|
+
> **TanStack Start denies `*.client.*` on the server**
|
|
257
|
+
>
|
|
258
|
+
> TanStack Start's import protection rejects any `**/*.client.*` module in the
|
|
259
|
+
> server environment, which includes the SPA prerender, so importing the default
|
|
260
|
+
> `quickback.client.ts` fails that build with `Import denied in server
|
|
261
|
+
> environment`. Give the client a name outside that pattern:
|
|
262
|
+
> `client: "src/lib/quickback-client.ts"`.
|
|
263
|
+
|
|
264
|
+
|
|
256
265
|
```typescript
|
|
257
266
|
import { createClient, QuickbackError } from "./quickback.client";
|
|
258
267
|
|
|
@@ -419,9 +428,12 @@ export default defineConfig({
|
|
|
419
428
|
});
|
|
420
429
|
```
|
|
421
430
|
|
|
422
|
-
Use a custom path, fan out identical copies to colocated apps
|
|
423
|
-
|
|
424
|
-
|
|
431
|
+
Use a custom path, fan out identical copies to colocated apps, disable
|
|
432
|
+
branding, or turn the artifact off. Paths resolve inside the project root:
|
|
433
|
+
`..` segments and absolute paths fail the compile (`Path traversal is not
|
|
434
|
+
allowed`). A sibling package consumes the file through a path alias
|
|
435
|
+
(`"@api/*": ["../api/client/*"]` in its `tsconfig.json`), not by emitting
|
|
436
|
+
into it:
|
|
425
437
|
|
|
426
438
|
```typescript
|
|
427
439
|
export default defineConfig({
|
|
@@ -440,7 +452,7 @@ export default defineConfig({
|
|
|
440
452
|
| `true` or omitted | Write `quickback.gen.ts` |
|
|
441
453
|
| `false` | Do not emit the first-party type tree |
|
|
442
454
|
| `"src/lib/quickback.gen.ts"` | Write to one custom path |
|
|
443
|
-
| `["quickback.gen.ts", "
|
|
455
|
+
| `["quickback.gen.ts", "apps/web/src/lib/quickback.gen.ts"]` | Fan out identical copies inside the project |
|
|
444
456
|
| `{ output, brandIds: false }` | Configure paths and use structural IDs |
|
|
445
457
|
|
|
446
458
|
`api-types.gen.ts` remains available through `openapi.types` for `openapi-fetch` and third-party OpenAPI tools. The two artifacts are independent: disabling OpenAPI types does not disable the first-party tree.
|
|
@@ -9,7 +9,7 @@ When you configure custom domains for CMS, Account, Admin, or `apps`, the compil
|
|
|
9
9
|
1. Adds `custom_domain` routes to `wrangler.toml`
|
|
10
10
|
2. Generates hostname-based middleware in the Worker
|
|
11
11
|
3. Auto-configures cross-subdomain cookies for shared authentication
|
|
12
|
-
4.
|
|
12
|
+
4. Requires an explicit `domain` — the all-in-one host — when only cms/api/auth hostnames are declared and the bundled CMS or Account SPA is enabled
|
|
13
13
|
|
|
14
14
|
All configured domains point to the **same Worker** — there's only one deployment.
|
|
15
15
|
|
|
@@ -22,7 +22,7 @@ All configured domains point to the **same Worker** — there's only one deploym
|
|
|
22
22
|
| `auth.example.com` | `account: { domain }` | Account SPA | Pass-through |
|
|
23
23
|
| `admin.example.com` | `account: { adminDomain }` | Account SPA | Pass-through |
|
|
24
24
|
| `www.example.com` | `apps: { <name>: { domain } }` | User-authored SPA | Pass-through |
|
|
25
|
-
| `
|
|
25
|
+
| `app.example.com` | `domain` | Everything | All |
|
|
26
26
|
|
|
27
27
|
### CMS Domain
|
|
28
28
|
|
|
@@ -64,9 +64,7 @@ The names `cms`, `account`, and `public` are reserved (they collide with compile
|
|
|
64
64
|
|
|
65
65
|
### Unified Domain
|
|
66
66
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
On this domain, **everything is available** on a single origin:
|
|
67
|
+
Set `domain` to the host where **everything is available** on a single origin:
|
|
70
68
|
|
|
71
69
|
| Path | Content |
|
|
72
70
|
|------|---------|
|
|
@@ -80,7 +78,12 @@ On this domain, **everything is available** on a single origin:
|
|
|
80
78
|
| `/health` | Health check |
|
|
81
79
|
| `/openapi.json` | OpenAPI spec |
|
|
82
80
|
|
|
83
|
-
|
|
81
|
+
`domain` is required when the project's only custom hostnames are `cms.domain`, `api.domain` or `auth.domain` and the CMS or Account SPA is enabled: each of those hosts blocks part of the surface the SPAs need, so without it they would call an origin that 404s. The compile fails with `config.domain: … Set \`domain\` to the all-in-one hostname`. A `providers.runtime.config.routes` entry, an `account.domain`/`adminDomain`, or an `apps.<name>.domain` already serves everything, so projects with one of those need no `domain`.
|
|
82
|
+
|
|
83
|
+
> **No longer inferred**
|
|
84
|
+
>
|
|
85
|
+
> Earlier compilers inferred this host as `quickback.{baseDomain}` from the first declared hostname, which emitted a `custom_domain` route in a zone the deploying account might not own and failed `wrangler deploy` after the upload. Only declared hostnames are emitted now.
|
|
86
|
+
|
|
84
87
|
|
|
85
88
|
## Configuration
|
|
86
89
|
|
|
@@ -122,7 +125,7 @@ routes = [
|
|
|
122
125
|
{ pattern = "admin.example.com", custom_domain = true },
|
|
123
126
|
{ pattern = "www.example.com", custom_domain = true },
|
|
124
127
|
{ pattern = "example.com", custom_domain = true },
|
|
125
|
-
{ pattern = "
|
|
128
|
+
{ pattern = "app.example.com", custom_domain = true }
|
|
126
129
|
]
|
|
127
130
|
```
|
|
128
131
|
|
|
@@ -209,7 +212,7 @@ Each `domains` key maps 1:1 to a top-level source:
|
|
|
209
212
|
|
|
210
213
|
| `domains` key | Claims |
|
|
211
214
|
|---------------|--------|
|
|
212
|
-
| `primary` | `domain` |
|
|
215
|
+
| `primary` | `domain`, or this target's own all-in-one host when there is no top-level `domain` |
|
|
213
216
|
| `api` | `api.domain` |
|
|
214
217
|
| `auth` | `auth.domain` |
|
|
215
218
|
| `cms` | `cms.domain` |
|
|
@@ -227,31 +230,18 @@ The compile fails, naming the config path to fix, when an environment leaves a g
|
|
|
227
230
|
|
|
228
231
|
### The unified hostname per target
|
|
229
232
|
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
| Target | Claims | Inferred unified host |
|
|
233
|
-
|--------|--------|-----------------------|
|
|
234
|
-
| `dev` | `api-dev.attend.vip` | `quickback-dev.attend.vip` |
|
|
235
|
-
| `prod` | `api.attend.vip` | `quickback-prod.attend.vip` |
|
|
236
|
-
|
|
237
|
-
The single-target name can't carry over verbatim: every environment would infer the same `quickback.attend.vip` from a shared base domain, and one custom domain cannot belong to two Workers. The environment key is the only thing that makes the name unique by construction.
|
|
238
|
-
|
|
239
|
-
It's a hyphen rather than a new label (`quickback-dev.attend.vip`, not `quickback.dev.attend.vip`) because Cloudflare's Universal SSL covers exactly one level of subdomain — the extra label would deploy without a certificate.
|
|
240
|
-
|
|
241
|
-
Set `domains.primary` to override the name on any target. That's how one environment keeps the bare hostname a single-target project would have inferred:
|
|
233
|
+
Each target names its own all-in-one host with `domains.primary` — the host where every surface coexists and `/` redirects to `/cms/`:
|
|
242
234
|
|
|
243
235
|
```typescript
|
|
244
|
-
|
|
236
|
+
dev: { domains: { api: "api-dev.attend.vip", primary: "app-dev.attend.vip" } },
|
|
237
|
+
prod: { domains: { api: "api.attend.vip", primary: "app.attend.vip" } },
|
|
245
238
|
```
|
|
246
239
|
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
> **These are real custom domains**
|
|
250
|
-
>
|
|
251
|
-
> Every inferred hostname is emitted as a `custom_domain` route, so Wrangler provisions the DNS record on deploy — same as the single-target `quickback.{baseDomain}` has always done. The zone has to be on the deploying Cloudflare account.
|
|
240
|
+
One custom domain cannot belong to two Workers, so a project with named environments has no shared top-level `domain`; `domains.primary` is how each target claims its own. Keep it one label deep (`app-dev.attend.vip`, not `app.dev.attend.vip`): Cloudflare's Universal SSL covers exactly one level of subdomain.
|
|
252
241
|
|
|
242
|
+
A target whose claimed hostnames are all cms/api/auth roles fails the compile without `domains.primary` when the CMS or Account SPA is enabled (`dev claims custom hostnames but no \`domains.primary\``); an account, admin, app or `routes[i]` claim already serves everything. A `domains: 'none'` target needs none. When the project declares a top-level `domain`, that becomes a real `primary` source each target claims by hand instead.
|
|
253
243
|
|
|
254
|
-
Each target's
|
|
244
|
+
Each target's `domains.primary` host joins `trustedOrigins` and the CSP origin list, but does **not** become the target's `BETTER_AUTH_URL` — that stays on the auth or API hostname, matching what a single-target project resolves.
|
|
255
245
|
|
|
256
246
|
### One bundle, several hostnames
|
|
257
247
|
|
|
@@ -34,7 +34,8 @@ export default defineConfig({
|
|
|
34
34
|
// [quickback:options-start]
|
|
35
35
|
// ── Project ──
|
|
36
36
|
//
|
|
37
|
-
// Primary custom domain
|
|
37
|
+
// Primary custom domain serving /cms, /account, /api and /auth together.
|
|
38
|
+
// Required when only cms/api/auth hostnames are declared and the CMS or Account SPA is enabled; never inferred.
|
|
38
39
|
// domain: "example.com",
|
|
39
40
|
//
|
|
40
41
|
// ── Embedded UIs (CMS / Account) ──
|
|
@@ -93,7 +94,7 @@ Every optional top-level key the config accepts is listed below. You never have
|
|
|
93
94
|
|
|
94
95
|
| Field | Type | Description |
|
|
95
96
|
|-------|------|-------------|
|
|
96
|
-
| `domain` | `string` | Primary custom domain
|
|
97
|
+
| `domain` | `string` | Primary custom domain serving every surface. Required when only cms/api/auth hostnames are declared and the CMS or Account SPA is enabled; never inferred — see [Domains](/configure/domains) |
|
|
97
98
|
| `contract` | `{ routes?: "v1" \| "v2" }` | `routes` selects the URL prefix and nothing else (default `"v1"`). See [API Contract](/platform/api-contract#one-axis-routes). |
|
|
98
99
|
| `api` | `object` | Dedicated hostname for the selected feature API contract (`/api/v1/*` or `/api/v2/*`); additive alias — see [Domains](/configure/domains) |
|
|
99
100
|
| `auth` | `object` | App-level auth settings (`roles`, `roleHierarchy`, `jwt`, delegated `principals`, `loginUrl`, `domain`) — see [Auth](/configure/auth), [Access](/define/access#role-hierarchy), and [Delegated principals](#delegated-principals) |
|
|
@@ -510,11 +511,11 @@ If `signature.required: true` and no key is available, compilation fails with a
|
|
|
510
511
|
|
|
511
512
|
## Hostname architecture
|
|
512
513
|
|
|
513
|
-
A modern Quickback project runs on **one Cloudflare Worker** that serves multiple URL surfaces.
|
|
514
|
+
A modern Quickback project runs on **one Cloudflare Worker** that serves multiple URL surfaces. Everything lives under a single unified backend hostname — `config.domain`, or the first `providers.runtime.config.routes` custom domain. For larger deployments, you can opt-in to **dedicated hostnames** for specific surfaces — they're additive aliases, never replacements.
|
|
514
515
|
|
|
515
516
|
### The unified backend contract
|
|
516
517
|
|
|
517
|
-
|
|
518
|
+
The unified backend host (`domain`) is where **every compiler-emitted backend route** is reachable:
|
|
518
519
|
|
|
519
520
|
- `/api/v1/*` and `/auth/v1/*` by default, or `/api/v2/*` and `/auth/v2/*`
|
|
520
521
|
when `contract.routes` is `"v2"` (the URL axis — the standard shape does
|
|
@@ -524,9 +525,7 @@ When any subdomain is configured (`account.domain`, `cms.domain`, `auth.domain`,
|
|
|
524
525
|
- `/account/*`, `/cms/*` — bundled SPAs (when enabled)
|
|
525
526
|
- `/broadcast/v1/*` (realtime; `/broadcast/v2/*` under `contract.routes: 'v2'`), `/mcp` (MCP), etc.
|
|
526
527
|
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
This contract is forward-pointing: it gives a stable URL pattern for future management tooling — `https://quickback.{baseDomain}/...` will always reach a Quickback backend regardless of how the operator splits their surfaces.
|
|
528
|
+
When the only configured hostnames are `cms.domain`, `auth.domain` or `api.domain` and the CMS or Account SPA is enabled, `domain` is required; the compile fails without it. An `account.domain`, `apps.<n>.domain` or runtime route already serves the whole surface. It is never inferred — an earlier `quickback.{baseDomain}` inference emitted a route in a zone the account might not own.
|
|
530
529
|
|
|
531
530
|
### Dedicated hostnames (optional, additive)
|
|
532
531
|
|
|
@@ -563,9 +562,9 @@ Dual-reach is preserved on the unified host:
|
|
|
563
562
|
|
|
564
563
|
| URL on unified host | Handler | Notes |
|
|
565
564
|
|---|---|---|
|
|
566
|
-
| `https://
|
|
567
|
-
| `https://
|
|
568
|
-
| `https://
|
|
565
|
+
| `https://app.example.com/api/{version}/users` | feature route | Works for the selected version whether `api.domain` is set or not |
|
|
566
|
+
| `https://app.example.com/auth/{version}/sign-in/email` | Better Auth | Works for the selected version whether `auth.domain` is set or not |
|
|
567
|
+
| `https://app.example.com/{version}/users` | **404** | Shortcut only applies on dedicated hostnames |
|
|
569
568
|
|
|
570
569
|
Each dedicated hostname also:
|
|
571
570
|
|
|
@@ -128,7 +128,7 @@ When you opt into a `csp` object, the compiler additively widens directives base
|
|
|
128
128
|
| `cms: true` OR `account: true` | `https://fonts.googleapis.com` | `styleSrc` | Bundled SPAs `<link>` to Google Fonts CSS |
|
|
129
129
|
| `cms: true` OR `account: true` | `https://fonts.gstatic.com` | `fontSrc` | The googleapis CSS loads `.woff2` from gstatic |
|
|
130
130
|
| `csp` set (always) | `@trustedOrigins` | `connectSrc` | XHR/fetch must reach the same allowlist `cors()` permits — covers cross-subdomain APIs without re-listing them |
|
|
131
|
-
| `cms: true` OR `account: true` | `https://${domain}` for each `cms.domain` / `account.domain` / `domain`
|
|
131
|
+
| `cms: true` OR `account: true` | `https://${domain}` for each `cms.domain` / `account.domain` / `domain` | `connectSrc` | The Vite bundle hardcodes `VITE_QUICKBACK_API_URL` at compile time, so the SPA fetches that exact URL even when the page is served from a different origin (e.g. localhost dev hitting prod-baked SPA). Emitted with the host's first letter capitalised (`https://Api.example.com`) so `wrangler dev`'s response-header rewrite can't mangle it — see [the `wrangler dev` note below](#why-the-spa-baked-origin-shows-up-capitalised-in-csp). |
|
|
132
132
|
| `cms: true` OR `account: true` | `'sha256-…'` (one exact hash per bundled SPA) | `scriptSrc` | The worker injects `<script>window.__QUICKBACK_RUNTIME={...}</script>` into every served SPA shell (runtime-configured SPAs). The blob is fixed at compile time, so an exact script hash keeps strict `script-src` policies intact — no `'unsafe-inline'`. |
|
|
133
133
|
|
|
134
134
|
**Scaffold rule:** if you set `defaultSrc` but omit the target directive (e.g. you wrote `defaultSrc: ['@self']` and nothing for `connectSrc`), auto-config creates the new directive seeded with your `defaultSrc` values plus the addition. `defaultSrc` itself stays clean. So `defaultSrc: ['@self']` + auto-config produces:
|
|
@@ -89,7 +89,11 @@ What is the same on every provider:
|
|
|
89
89
|
- `OLD.column` / `NEW.column` references use **SQL column names**
|
|
90
90
|
(`deleted_at`, not `deletedAt`) and are validated against the table at
|
|
91
91
|
compile time.
|
|
92
|
-
- Optional `when:` is a SQL expression guard (`WHEN` clause).
|
|
92
|
+
- Optional `when:` is a SQL expression guard (`WHEN` clause). On Postgres it
|
|
93
|
+
cannot contain a subquery (`EXISTS (SELECT …)`, `IN (SELECT …)`, or a scalar
|
|
94
|
+
`(SELECT …)`) — Postgres refuses that at `CREATE TRIGGER` time, so the
|
|
95
|
+
compile fails instead. Keep the subquery-free conjuncts in `when:` and move
|
|
96
|
+
the subquery into `sql:` as `IF EXISTS (SELECT …) THEN RAISE EXCEPTION '…'; END IF;`.
|
|
93
97
|
- SQL triggers run inside the triggering statement, so they are atomic with
|
|
94
98
|
the write, and a rejection rolls the whole statement back.
|
|
95
99
|
- Names are `qb_trg_<table>_<event-code>_<name>` and are the compiler's, not
|
|
@@ -203,7 +203,7 @@ WebAuthn needs a relying party ID and origin. The generated plugin resolves them
|
|
|
203
203
|
|
|
204
204
|
1. `advanced.crossSubDomainCookies.domain` (leading dot stripped) becomes the `rpID` when configured — credentials then work across sibling subdomains.
|
|
205
205
|
2. The `ACCOUNT_URL` env var, when set on the deploy target: `rpID` is its registrable hostname (`account.example.com` → `example.com`; a two-label host like `example.com` is kept whole) and the origin is its **bare origin** — a path suffix such as `/account` is dropped, so the same variable can keep serving as the email link base.
|
|
206
|
-
3. The compile-time account origin — `account.domain` when configured, else the
|
|
206
|
+
3. The compile-time account origin — `account.domain` when configured, else `domain` (or the first `routes` custom domain). Baked automatically; no env var required.
|
|
207
207
|
|
|
208
208
|
`rpID: 'localhost'` applies only when the project has no configured domain at all (pure local dev). If passkey registration returns 500 on a deployed worker, check that one of the three sources above resolves to the hostname the Account UI is actually served from.
|
|
209
209
|
|
|
@@ -302,8 +302,8 @@ The contract fails closed:
|
|
|
302
302
|
`domains` (`{ api: "api-dev.example.com" }`, or the bare `domain` shorthand
|
|
303
303
|
for a single-hostname project). Quickback emits no top-level `routes` block
|
|
304
304
|
here — Wrangler inherits that key, so a shared one would rebind production's
|
|
305
|
-
hostname on a dev deploy.
|
|
306
|
-
|
|
305
|
+
hostname on a dev deploy. Each target names its own all-in-one host with
|
|
306
|
+
`domains.primary`; none is inferred. See
|
|
307
307
|
[Named Environments](/configure/domains#named-environments).
|
|
308
308
|
|
|
309
309
|
Set secrets per target: `wrangler secret put BETTER_AUTH_SECRET --env dev`.
|
|
@@ -246,9 +246,8 @@ The environment contract is intentionally exact and fails closed:
|
|
|
246
246
|
hostname — and every generated source (`providers.runtime.config.routes`,
|
|
247
247
|
`domain`, CMS/Account/Admin domains, `auth.domain`, `api.domain`, app domains
|
|
248
248
|
and their aliases, and the derived `webhook.{baseDomain}` route) must be
|
|
249
|
-
claimed by each environment through `domains`.
|
|
250
|
-
`
|
|
251
|
-
`quickback-<env>.{baseDomain}`, overridable with `domains.primary`. See
|
|
249
|
+
claimed by each environment through `domains`. Each target names its own
|
|
250
|
+
all-in-one host with `domains.primary`; none is inferred. See
|
|
252
251
|
[Named Environments](/configure/domains#named-environments) for the key-by-key
|
|
253
252
|
mapping, the single-hostname `domain` shorthand, and the `domains: 'none'`
|
|
254
253
|
workers.dev-only opt-out.
|
|
@@ -253,10 +253,16 @@ postgres.js 3.4.9, drizzle-orm 0.45.2; sanitized record in the repository's
|
|
|
253
253
|
declares them.
|
|
254
254
|
|
|
255
255
|
Still to prove, and the reason this page keeps a qualifier: the deployed
|
|
256
|
-
Hyperdrive run
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
256
|
+
Hyperdrive run.
|
|
257
|
+
|
|
258
|
+
Objects a routine `db:migrate` creates as `quickback_admin` (trigger functions,
|
|
259
|
+
later tables) are re-owned to `quickback_owner` by the next security migration.
|
|
260
|
+
That works when the setup owner applies it: the bootstrap grants the setup owner
|
|
261
|
+
`quickback_admin` **WITH INHERIT TRUE** (PostgreSQL 16+ gives a role's creator
|
|
262
|
+
membership without INHERIT, which used to fail the re-own loop with
|
|
263
|
+
`must be owner of function qb_trgfn_…`). A changed security migration still
|
|
264
|
+
needs the setup-owner credential because of the role timeouts it sets (see
|
|
265
|
+
[Neon](/platform/database/neon#upgrading-an-existing-database)).
|
|
260
266
|
|
|
261
267
|
## Deploying to workers.dev only
|
|
262
268
|
|
|
@@ -161,7 +161,7 @@ Open your Worker URL in a browser — the CMS is served at the root. API routes
|
|
|
161
161
|
cms: { domain: "cms.example.com" }
|
|
162
162
|
```
|
|
163
163
|
|
|
164
|
-
This adds a custom domain route to `wrangler.toml`. Both domains serve the same Worker — `api.example.com` for the API, `cms.example.com` for the CMS.
|
|
164
|
+
This adds a custom domain route to `wrangler.toml`. Both domains serve the same Worker — `api.example.com` for the API, `cms.example.com` for the CMS. Set `domain` to the host where everything is available together — required when the CMS has its own hostname. See [Multi-Domain Architecture](/configure/domains).
|
|
165
165
|
|
|
166
166
|
### Access gate
|
|
167
167
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quickback-dev/cli",
|
|
3
|
-
"version": "0.70.
|
|
3
|
+
"version": "0.70.2",
|
|
4
4
|
"description": "CLI for Quickback — define your backend in TypeScript, compile to a fully wired Cloudflare Worker (or Bun / Node) with auth, database, migrations, security, CMS, and Account UI.",
|
|
5
5
|
"author": "Kardoe Incorporated <paul@kardoe.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -45,6 +45,12 @@ It is never dropped:
|
|
|
45
45
|
| `?resolvedAt.gte=yesterday` on a Postgres timestamp column | `400` — `"yesterday" is not an ISO 8601 timestamp` |
|
|
46
46
|
| `?resolvedAt.like=2026` on a Postgres timestamp column | `400` — use `eq`, `ne`, `gt`, `gte`, `lt`, `lte` or `in` |
|
|
47
47
|
|
|
48
|
+
A column named like a list parameter (`sort`, `order`, `limit`, `offset`,
|
|
49
|
+
`search`, `fields`, `total`, `include`, `starting_after`, `ending_before`) is
|
|
50
|
+
not filterable: `?sort=` is always the sort control, and the OpenAPI spec omits
|
|
51
|
+
the column filter rather than declaring the parameter twice. Filter it through
|
|
52
|
+
a view or rename the column.
|
|
53
|
+
|
|
48
54
|
Silently dropping a predicate would return **every row the firewall allows**
|
|
49
55
|
while still reading as a scoped list — a typo'd or join-table field turns a
|
|
50
56
|
narrow query into a full dump. The same rule closes `?search=` and `?sort=`.
|
|
@@ -36,7 +36,7 @@ Each resource table exposes:
|
|
|
36
36
|
| `Insert` | Createable fields, with defaults and nullable fields optional |
|
|
37
37
|
| `Update` | Updatable fields, all optional |
|
|
38
38
|
| `ListResponse` | `Qb.Page<Row>` |
|
|
39
|
-
| `columns.<name>` | Type of one row column |
|
|
39
|
+
| `columns.<name>` | Type of one row column. A column named like a TypeScript keyword or built-in type (`number`, `string`, `delete`, …) is prefixed: `columns._number` |
|
|
40
40
|
| `views.<name>.Item` | A view's projected row |
|
|
41
41
|
| `views.<name>.Response` | Page plus typed aggregations where declared |
|
|
42
42
|
| `actions.<name>.Input` | The action's Zod input contract |
|
|
@@ -253,6 +253,15 @@ export default defineConfig({
|
|
|
253
253
|
`types` output, and the compile fails if `types` is `false`. It is off by
|
|
254
254
|
default.
|
|
255
255
|
|
|
256
|
+
> **TanStack Start denies `*.client.*` on the server**
|
|
257
|
+
>
|
|
258
|
+
> TanStack Start's import protection rejects any `**/*.client.*` module in the
|
|
259
|
+
> server environment, which includes the SPA prerender, so importing the default
|
|
260
|
+
> `quickback.client.ts` fails that build with `Import denied in server
|
|
261
|
+
> environment`. Give the client a name outside that pattern:
|
|
262
|
+
> `client: "src/lib/quickback-client.ts"`.
|
|
263
|
+
|
|
264
|
+
|
|
256
265
|
```typescript
|
|
257
266
|
import { createClient, QuickbackError } from "./quickback.client";
|
|
258
267
|
|
|
@@ -419,9 +428,12 @@ export default defineConfig({
|
|
|
419
428
|
});
|
|
420
429
|
```
|
|
421
430
|
|
|
422
|
-
Use a custom path, fan out identical copies to colocated apps
|
|
423
|
-
|
|
424
|
-
|
|
431
|
+
Use a custom path, fan out identical copies to colocated apps, disable
|
|
432
|
+
branding, or turn the artifact off. Paths resolve inside the project root:
|
|
433
|
+
`..` segments and absolute paths fail the compile (`Path traversal is not
|
|
434
|
+
allowed`). A sibling package consumes the file through a path alias
|
|
435
|
+
(`"@api/*": ["../api/client/*"]` in its `tsconfig.json`), not by emitting
|
|
436
|
+
into it:
|
|
425
437
|
|
|
426
438
|
```typescript
|
|
427
439
|
export default defineConfig({
|
|
@@ -440,7 +452,7 @@ export default defineConfig({
|
|
|
440
452
|
| `true` or omitted | Write `quickback.gen.ts` |
|
|
441
453
|
| `false` | Do not emit the first-party type tree |
|
|
442
454
|
| `"src/lib/quickback.gen.ts"` | Write to one custom path |
|
|
443
|
-
| `["quickback.gen.ts", "
|
|
455
|
+
| `["quickback.gen.ts", "apps/web/src/lib/quickback.gen.ts"]` | Fan out identical copies inside the project |
|
|
444
456
|
| `{ output, brandIds: false }` | Configure paths and use structural IDs |
|
|
445
457
|
|
|
446
458
|
`api-types.gen.ts` remains available through `openapi.types` for `openapi-fetch` and third-party OpenAPI tools. The two artifacts are independent: disabling OpenAPI types does not disable the first-party tree.
|
|
@@ -9,7 +9,7 @@ When you configure custom domains for CMS, Account, Admin, or `apps`, the compil
|
|
|
9
9
|
1. Adds `custom_domain` routes to `wrangler.toml`
|
|
10
10
|
2. Generates hostname-based middleware in the Worker
|
|
11
11
|
3. Auto-configures cross-subdomain cookies for shared authentication
|
|
12
|
-
4.
|
|
12
|
+
4. Requires an explicit `domain` — the all-in-one host — when only cms/api/auth hostnames are declared and the bundled CMS or Account SPA is enabled
|
|
13
13
|
|
|
14
14
|
All configured domains point to the **same Worker** — there's only one deployment.
|
|
15
15
|
|
|
@@ -22,7 +22,7 @@ All configured domains point to the **same Worker** — there's only one deploym
|
|
|
22
22
|
| `auth.example.com` | `account: { domain }` | Account SPA | Pass-through |
|
|
23
23
|
| `admin.example.com` | `account: { adminDomain }` | Account SPA | Pass-through |
|
|
24
24
|
| `www.example.com` | `apps: { <name>: { domain } }` | User-authored SPA | Pass-through |
|
|
25
|
-
| `
|
|
25
|
+
| `app.example.com` | `domain` | Everything | All |
|
|
26
26
|
|
|
27
27
|
### CMS Domain
|
|
28
28
|
|
|
@@ -64,9 +64,7 @@ The names `cms`, `account`, and `public` are reserved (they collide with compile
|
|
|
64
64
|
|
|
65
65
|
### Unified Domain
|
|
66
66
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
On this domain, **everything is available** on a single origin:
|
|
67
|
+
Set `domain` to the host where **everything is available** on a single origin:
|
|
70
68
|
|
|
71
69
|
| Path | Content |
|
|
72
70
|
|------|---------|
|
|
@@ -80,7 +78,12 @@ On this domain, **everything is available** on a single origin:
|
|
|
80
78
|
| `/health` | Health check |
|
|
81
79
|
| `/openapi.json` | OpenAPI spec |
|
|
82
80
|
|
|
83
|
-
|
|
81
|
+
`domain` is required when the project's only custom hostnames are `cms.domain`, `api.domain` or `auth.domain` and the CMS or Account SPA is enabled: each of those hosts blocks part of the surface the SPAs need, so without it they would call an origin that 404s. The compile fails with `config.domain: … Set \`domain\` to the all-in-one hostname`. A `providers.runtime.config.routes` entry, an `account.domain`/`adminDomain`, or an `apps.<name>.domain` already serves everything, so projects with one of those need no `domain`.
|
|
82
|
+
|
|
83
|
+
> **No longer inferred**
|
|
84
|
+
>
|
|
85
|
+
> Earlier compilers inferred this host as `quickback.{baseDomain}` from the first declared hostname, which emitted a `custom_domain` route in a zone the deploying account might not own and failed `wrangler deploy` after the upload. Only declared hostnames are emitted now.
|
|
86
|
+
|
|
84
87
|
|
|
85
88
|
## Configuration
|
|
86
89
|
|
|
@@ -122,7 +125,7 @@ routes = [
|
|
|
122
125
|
{ pattern = "admin.example.com", custom_domain = true },
|
|
123
126
|
{ pattern = "www.example.com", custom_domain = true },
|
|
124
127
|
{ pattern = "example.com", custom_domain = true },
|
|
125
|
-
{ pattern = "
|
|
128
|
+
{ pattern = "app.example.com", custom_domain = true }
|
|
126
129
|
]
|
|
127
130
|
```
|
|
128
131
|
|
|
@@ -209,7 +212,7 @@ Each `domains` key maps 1:1 to a top-level source:
|
|
|
209
212
|
|
|
210
213
|
| `domains` key | Claims |
|
|
211
214
|
|---------------|--------|
|
|
212
|
-
| `primary` | `domain` |
|
|
215
|
+
| `primary` | `domain`, or this target's own all-in-one host when there is no top-level `domain` |
|
|
213
216
|
| `api` | `api.domain` |
|
|
214
217
|
| `auth` | `auth.domain` |
|
|
215
218
|
| `cms` | `cms.domain` |
|
|
@@ -227,31 +230,18 @@ The compile fails, naming the config path to fix, when an environment leaves a g
|
|
|
227
230
|
|
|
228
231
|
### The unified hostname per target
|
|
229
232
|
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
| Target | Claims | Inferred unified host |
|
|
233
|
-
|--------|--------|-----------------------|
|
|
234
|
-
| `dev` | `api-dev.attend.vip` | `quickback-dev.attend.vip` |
|
|
235
|
-
| `prod` | `api.attend.vip` | `quickback-prod.attend.vip` |
|
|
236
|
-
|
|
237
|
-
The single-target name can't carry over verbatim: every environment would infer the same `quickback.attend.vip` from a shared base domain, and one custom domain cannot belong to two Workers. The environment key is the only thing that makes the name unique by construction.
|
|
238
|
-
|
|
239
|
-
It's a hyphen rather than a new label (`quickback-dev.attend.vip`, not `quickback.dev.attend.vip`) because Cloudflare's Universal SSL covers exactly one level of subdomain — the extra label would deploy without a certificate.
|
|
240
|
-
|
|
241
|
-
Set `domains.primary` to override the name on any target. That's how one environment keeps the bare hostname a single-target project would have inferred:
|
|
233
|
+
Each target names its own all-in-one host with `domains.primary` — the host where every surface coexists and `/` redirects to `/cms/`:
|
|
242
234
|
|
|
243
235
|
```typescript
|
|
244
|
-
|
|
236
|
+
dev: { domains: { api: "api-dev.attend.vip", primary: "app-dev.attend.vip" } },
|
|
237
|
+
prod: { domains: { api: "api.attend.vip", primary: "app.attend.vip" } },
|
|
245
238
|
```
|
|
246
239
|
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
> **These are real custom domains**
|
|
250
|
-
>
|
|
251
|
-
> Every inferred hostname is emitted as a `custom_domain` route, so Wrangler provisions the DNS record on deploy — same as the single-target `quickback.{baseDomain}` has always done. The zone has to be on the deploying Cloudflare account.
|
|
240
|
+
One custom domain cannot belong to two Workers, so a project with named environments has no shared top-level `domain`; `domains.primary` is how each target claims its own. Keep it one label deep (`app-dev.attend.vip`, not `app.dev.attend.vip`): Cloudflare's Universal SSL covers exactly one level of subdomain.
|
|
252
241
|
|
|
242
|
+
A target whose claimed hostnames are all cms/api/auth roles fails the compile without `domains.primary` when the CMS or Account SPA is enabled (`dev claims custom hostnames but no \`domains.primary\``); an account, admin, app or `routes[i]` claim already serves everything. A `domains: 'none'` target needs none. When the project declares a top-level `domain`, that becomes a real `primary` source each target claims by hand instead.
|
|
253
243
|
|
|
254
|
-
Each target's
|
|
244
|
+
Each target's `domains.primary` host joins `trustedOrigins` and the CSP origin list, but does **not** become the target's `BETTER_AUTH_URL` — that stays on the auth or API hostname, matching what a single-target project resolves.
|
|
255
245
|
|
|
256
246
|
### One bundle, several hostnames
|
|
257
247
|
|
|
@@ -34,7 +34,8 @@ export default defineConfig({
|
|
|
34
34
|
// [quickback:options-start]
|
|
35
35
|
// ── Project ──
|
|
36
36
|
//
|
|
37
|
-
// Primary custom domain
|
|
37
|
+
// Primary custom domain serving /cms, /account, /api and /auth together.
|
|
38
|
+
// Required when only cms/api/auth hostnames are declared and the CMS or Account SPA is enabled; never inferred.
|
|
38
39
|
// domain: "example.com",
|
|
39
40
|
//
|
|
40
41
|
// ── Embedded UIs (CMS / Account) ──
|
|
@@ -93,7 +94,7 @@ Every optional top-level key the config accepts is listed below. You never have
|
|
|
93
94
|
|
|
94
95
|
| Field | Type | Description |
|
|
95
96
|
|-------|------|-------------|
|
|
96
|
-
| `domain` | `string` | Primary custom domain
|
|
97
|
+
| `domain` | `string` | Primary custom domain serving every surface. Required when only cms/api/auth hostnames are declared and the CMS or Account SPA is enabled; never inferred — see [Domains](/configure/domains) |
|
|
97
98
|
| `contract` | `{ routes?: "v1" \| "v2" }` | `routes` selects the URL prefix and nothing else (default `"v1"`). See [API Contract](/platform/api-contract#one-axis-routes). |
|
|
98
99
|
| `api` | `object` | Dedicated hostname for the selected feature API contract (`/api/v1/*` or `/api/v2/*`); additive alias — see [Domains](/configure/domains) |
|
|
99
100
|
| `auth` | `object` | App-level auth settings (`roles`, `roleHierarchy`, `jwt`, delegated `principals`, `loginUrl`, `domain`) — see [Auth](/configure/auth), [Access](/define/access#role-hierarchy), and [Delegated principals](#delegated-principals) |
|
|
@@ -510,11 +511,11 @@ If `signature.required: true` and no key is available, compilation fails with a
|
|
|
510
511
|
|
|
511
512
|
## Hostname architecture
|
|
512
513
|
|
|
513
|
-
A modern Quickback project runs on **one Cloudflare Worker** that serves multiple URL surfaces.
|
|
514
|
+
A modern Quickback project runs on **one Cloudflare Worker** that serves multiple URL surfaces. Everything lives under a single unified backend hostname — `config.domain`, or the first `providers.runtime.config.routes` custom domain. For larger deployments, you can opt-in to **dedicated hostnames** for specific surfaces — they're additive aliases, never replacements.
|
|
514
515
|
|
|
515
516
|
### The unified backend contract
|
|
516
517
|
|
|
517
|
-
|
|
518
|
+
The unified backend host (`domain`) is where **every compiler-emitted backend route** is reachable:
|
|
518
519
|
|
|
519
520
|
- `/api/v1/*` and `/auth/v1/*` by default, or `/api/v2/*` and `/auth/v2/*`
|
|
520
521
|
when `contract.routes` is `"v2"` (the URL axis — the standard shape does
|
|
@@ -524,9 +525,7 @@ When any subdomain is configured (`account.domain`, `cms.domain`, `auth.domain`,
|
|
|
524
525
|
- `/account/*`, `/cms/*` — bundled SPAs (when enabled)
|
|
525
526
|
- `/broadcast/v1/*` (realtime; `/broadcast/v2/*` under `contract.routes: 'v2'`), `/mcp` (MCP), etc.
|
|
526
527
|
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
This contract is forward-pointing: it gives a stable URL pattern for future management tooling — `https://quickback.{baseDomain}/...` will always reach a Quickback backend regardless of how the operator splits their surfaces.
|
|
528
|
+
When the only configured hostnames are `cms.domain`, `auth.domain` or `api.domain` and the CMS or Account SPA is enabled, `domain` is required; the compile fails without it. An `account.domain`, `apps.<n>.domain` or runtime route already serves the whole surface. It is never inferred — an earlier `quickback.{baseDomain}` inference emitted a route in a zone the account might not own.
|
|
530
529
|
|
|
531
530
|
### Dedicated hostnames (optional, additive)
|
|
532
531
|
|
|
@@ -563,9 +562,9 @@ Dual-reach is preserved on the unified host:
|
|
|
563
562
|
|
|
564
563
|
| URL on unified host | Handler | Notes |
|
|
565
564
|
|---|---|---|
|
|
566
|
-
| `https://
|
|
567
|
-
| `https://
|
|
568
|
-
| `https://
|
|
565
|
+
| `https://app.example.com/api/{version}/users` | feature route | Works for the selected version whether `api.domain` is set or not |
|
|
566
|
+
| `https://app.example.com/auth/{version}/sign-in/email` | Better Auth | Works for the selected version whether `auth.domain` is set or not |
|
|
567
|
+
| `https://app.example.com/{version}/users` | **404** | Shortcut only applies on dedicated hostnames |
|
|
569
568
|
|
|
570
569
|
Each dedicated hostname also:
|
|
571
570
|
|
|
@@ -128,7 +128,7 @@ When you opt into a `csp` object, the compiler additively widens directives base
|
|
|
128
128
|
| `cms: true` OR `account: true` | `https://fonts.googleapis.com` | `styleSrc` | Bundled SPAs `<link>` to Google Fonts CSS |
|
|
129
129
|
| `cms: true` OR `account: true` | `https://fonts.gstatic.com` | `fontSrc` | The googleapis CSS loads `.woff2` from gstatic |
|
|
130
130
|
| `csp` set (always) | `@trustedOrigins` | `connectSrc` | XHR/fetch must reach the same allowlist `cors()` permits — covers cross-subdomain APIs without re-listing them |
|
|
131
|
-
| `cms: true` OR `account: true` | `https://${domain}` for each `cms.domain` / `account.domain` / `domain`
|
|
131
|
+
| `cms: true` OR `account: true` | `https://${domain}` for each `cms.domain` / `account.domain` / `domain` | `connectSrc` | The Vite bundle hardcodes `VITE_QUICKBACK_API_URL` at compile time, so the SPA fetches that exact URL even when the page is served from a different origin (e.g. localhost dev hitting prod-baked SPA). Emitted with the host's first letter capitalised (`https://Api.example.com`) so `wrangler dev`'s response-header rewrite can't mangle it — see [the `wrangler dev` note below](#why-the-spa-baked-origin-shows-up-capitalised-in-csp). |
|
|
132
132
|
| `cms: true` OR `account: true` | `'sha256-…'` (one exact hash per bundled SPA) | `scriptSrc` | The worker injects `<script>window.__QUICKBACK_RUNTIME={...}</script>` into every served SPA shell (runtime-configured SPAs). The blob is fixed at compile time, so an exact script hash keeps strict `script-src` policies intact — no `'unsafe-inline'`. |
|
|
133
133
|
|
|
134
134
|
**Scaffold rule:** if you set `defaultSrc` but omit the target directive (e.g. you wrote `defaultSrc: ['@self']` and nothing for `connectSrc`), auto-config creates the new directive seeded with your `defaultSrc` values plus the addition. `defaultSrc` itself stays clean. So `defaultSrc: ['@self']` + auto-config produces:
|
|
@@ -89,7 +89,11 @@ What is the same on every provider:
|
|
|
89
89
|
- `OLD.column` / `NEW.column` references use **SQL column names**
|
|
90
90
|
(`deleted_at`, not `deletedAt`) and are validated against the table at
|
|
91
91
|
compile time.
|
|
92
|
-
- Optional `when:` is a SQL expression guard (`WHEN` clause).
|
|
92
|
+
- Optional `when:` is a SQL expression guard (`WHEN` clause). On Postgres it
|
|
93
|
+
cannot contain a subquery (`EXISTS (SELECT …)`, `IN (SELECT …)`, or a scalar
|
|
94
|
+
`(SELECT …)`) — Postgres refuses that at `CREATE TRIGGER` time, so the
|
|
95
|
+
compile fails instead. Keep the subquery-free conjuncts in `when:` and move
|
|
96
|
+
the subquery into `sql:` as `IF EXISTS (SELECT …) THEN RAISE EXCEPTION '…'; END IF;`.
|
|
93
97
|
- SQL triggers run inside the triggering statement, so they are atomic with
|
|
94
98
|
the write, and a rejection rolls the whole statement back.
|
|
95
99
|
- Names are `qb_trg_<table>_<event-code>_<name>` and are the compiler's, not
|
|
@@ -203,7 +203,7 @@ WebAuthn needs a relying party ID and origin. The generated plugin resolves them
|
|
|
203
203
|
|
|
204
204
|
1. `advanced.crossSubDomainCookies.domain` (leading dot stripped) becomes the `rpID` when configured — credentials then work across sibling subdomains.
|
|
205
205
|
2. The `ACCOUNT_URL` env var, when set on the deploy target: `rpID` is its registrable hostname (`account.example.com` → `example.com`; a two-label host like `example.com` is kept whole) and the origin is its **bare origin** — a path suffix such as `/account` is dropped, so the same variable can keep serving as the email link base.
|
|
206
|
-
3. The compile-time account origin — `account.domain` when configured, else the
|
|
206
|
+
3. The compile-time account origin — `account.domain` when configured, else `domain` (or the first `routes` custom domain). Baked automatically; no env var required.
|
|
207
207
|
|
|
208
208
|
`rpID: 'localhost'` applies only when the project has no configured domain at all (pure local dev). If passkey registration returns 500 on a deployed worker, check that one of the three sources above resolves to the hostname the Account UI is actually served from.
|
|
209
209
|
|
|
@@ -302,8 +302,8 @@ The contract fails closed:
|
|
|
302
302
|
`domains` (`{ api: "api-dev.example.com" }`, or the bare `domain` shorthand
|
|
303
303
|
for a single-hostname project). Quickback emits no top-level `routes` block
|
|
304
304
|
here — Wrangler inherits that key, so a shared one would rebind production's
|
|
305
|
-
hostname on a dev deploy.
|
|
306
|
-
|
|
305
|
+
hostname on a dev deploy. Each target names its own all-in-one host with
|
|
306
|
+
`domains.primary`; none is inferred. See
|
|
307
307
|
[Named Environments](/configure/domains#named-environments).
|
|
308
308
|
|
|
309
309
|
Set secrets per target: `wrangler secret put BETTER_AUTH_SECRET --env dev`.
|
|
@@ -246,9 +246,8 @@ The environment contract is intentionally exact and fails closed:
|
|
|
246
246
|
hostname — and every generated source (`providers.runtime.config.routes`,
|
|
247
247
|
`domain`, CMS/Account/Admin domains, `auth.domain`, `api.domain`, app domains
|
|
248
248
|
and their aliases, and the derived `webhook.{baseDomain}` route) must be
|
|
249
|
-
claimed by each environment through `domains`.
|
|
250
|
-
`
|
|
251
|
-
`quickback-<env>.{baseDomain}`, overridable with `domains.primary`. See
|
|
249
|
+
claimed by each environment through `domains`. Each target names its own
|
|
250
|
+
all-in-one host with `domains.primary`; none is inferred. See
|
|
252
251
|
[Named Environments](/configure/domains#named-environments) for the key-by-key
|
|
253
252
|
mapping, the single-hostname `domain` shorthand, and the `domains: 'none'`
|
|
254
253
|
workers.dev-only opt-out.
|
|
@@ -253,10 +253,16 @@ postgres.js 3.4.9, drizzle-orm 0.45.2; sanitized record in the repository's
|
|
|
253
253
|
declares them.
|
|
254
254
|
|
|
255
255
|
Still to prove, and the reason this page keeps a qualifier: the deployed
|
|
256
|
-
Hyperdrive run
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
256
|
+
Hyperdrive run.
|
|
257
|
+
|
|
258
|
+
Objects a routine `db:migrate` creates as `quickback_admin` (trigger functions,
|
|
259
|
+
later tables) are re-owned to `quickback_owner` by the next security migration.
|
|
260
|
+
That works when the setup owner applies it: the bootstrap grants the setup owner
|
|
261
|
+
`quickback_admin` **WITH INHERIT TRUE** (PostgreSQL 16+ gives a role's creator
|
|
262
|
+
membership without INHERIT, which used to fail the re-own loop with
|
|
263
|
+
`must be owner of function qb_trgfn_…`). A changed security migration still
|
|
264
|
+
needs the setup-owner credential because of the role timeouts it sets (see
|
|
265
|
+
[Neon](/platform/database/neon#upgrading-an-existing-database)).
|
|
260
266
|
|
|
261
267
|
## Deploying to workers.dev only
|
|
262
268
|
|
|
@@ -161,7 +161,7 @@ Open your Worker URL in a browser — the CMS is served at the root. API routes
|
|
|
161
161
|
cms: { domain: "cms.example.com" }
|
|
162
162
|
```
|
|
163
163
|
|
|
164
|
-
This adds a custom domain route to `wrangler.toml`. Both domains serve the same Worker — `api.example.com` for the API, `cms.example.com` for the CMS.
|
|
164
|
+
This adds a custom domain route to `wrangler.toml`. Both domains serve the same Worker — `api.example.com` for the API, `cms.example.com` for the CMS. Set `domain` to the host where everything is available together — required when the CMS has its own hostname. See [Multi-Domain Architecture](/configure/domains).
|
|
165
165
|
|
|
166
166
|
### Access gate
|
|
167
167
|
|