@wtfalch/foundry 0.8.0 → 0.9.0
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/bootstrap/declare.js +1 -5
- package/dist/index.d.ts +3 -3
- package/dist/index.js +2 -2
- package/dist/migrations/0029_hosting_entries.sql +109 -0
- package/dist/org.d.ts +59 -27
- package/dist/org.js +98 -26
- package/dist/plan/diff.js +25 -19
- package/dist/plan/executor.d.ts +45 -29
- package/dist/plan/executor.js +291 -158
- package/dist/plan/index.d.ts +1 -1
- package/dist/plan/index.js +1 -1
- package/dist/plan/plan-apply.js +6 -9
- package/dist/plan/platform-diff.d.ts +23 -11
- package/dist/plan/platform-diff.js +39 -14
- package/dist/plan/platform-providers.d.ts +7 -0
- package/dist/plan/platform-providers.js +93 -13
- package/dist/plan/zitadel-system-api.d.ts +64 -0
- package/dist/plan/zitadel-system-api.js +125 -0
- package/dist/platform.d.ts +1 -1
- package/dist/store/postgres.js +2 -10
- package/dist/store/schema.d.ts +20 -1
- package/dist/store/schema.js +7 -1
- package/package.json +1 -1
package/dist/plan/executor.d.ts
CHANGED
|
@@ -1198,7 +1198,7 @@ export declare class FoundryStepExecutor implements StepExecutor, StepDestroyer
|
|
|
1198
1198
|
} | undefined>;
|
|
1199
1199
|
/**
|
|
1200
1200
|
* `plan/diff.ts`'s `planAccess` (#84): puts the org's app hostname behind a
|
|
1201
|
-
* Cloudflare Access app that lets only `
|
|
1201
|
+
* Cloudflare Access app that lets only the `app` entry's `accessEmails` through.
|
|
1202
1202
|
* foundry names its Access app `foundry:<orgId>` and reuses only an app with
|
|
1203
1203
|
* that name, so a re-run after a crash does not duplicate it. It refuses,
|
|
1204
1204
|
* rather than adopt, when another Access app already holds the hostname:
|
|
@@ -1384,7 +1384,7 @@ export declare class FoundryStepExecutor implements StepExecutor, StepDestroyer
|
|
|
1384
1384
|
* P2, `.plans/2026-09-26-level-1-org-map.md`) -- a second `bulkUpsertEnvs`
|
|
1385
1385
|
* call rather than folding into `pushDatabaseUrl`'s, since this one runs
|
|
1386
1386
|
* unconditionally (`coolifyApp`) where that one runs only once
|
|
1387
|
-
* `
|
|
1387
|
+
* the `app` entry's `database` is declared and provisioned.
|
|
1388
1388
|
*
|
|
1389
1389
|
* `APP_URL` and `LOG_DIR` (#75) are pushed unconditionally; every other
|
|
1390
1390
|
* value is pushed only once its own source step has actually recorded it
|
|
@@ -1397,7 +1397,7 @@ export declare class FoundryStepExecutor implements StepExecutor, StepDestroyer
|
|
|
1397
1397
|
* is its own design question, left out of #204's own "How" rather than
|
|
1398
1398
|
* guessed) is out of scope here (task brief). `DATABASE_URL_OWNER`/
|
|
1399
1399
|
* `DATABASE_URL` are pushed by `pushDatabaseUrl` instead, not here --
|
|
1400
|
-
* that call runs only once `
|
|
1400
|
+
* that call runs only once the `app` entry's `database` is declared and
|
|
1401
1401
|
* provisioned, where this one is unconditional (#239).
|
|
1402
1402
|
*/
|
|
1403
1403
|
private pushAppEnv;
|
|
@@ -1793,15 +1793,27 @@ export declare class FoundryStepExecutor implements StepExecutor, StepDestroyer
|
|
|
1793
1793
|
* existed falls back to the old zone-wide pass, the one case where no
|
|
1794
1794
|
* hostname list was ever written to look up instead.
|
|
1795
1795
|
*
|
|
1796
|
-
* `
|
|
1797
|
-
* published under whatever tunnel id was live the *last*
|
|
1798
|
-
* recorded that domain, which
|
|
1799
|
-
* `tunnelId` -- a tunnel recreated under
|
|
1800
|
-
* (`findTunnelByName` returning a new id)
|
|
1801
|
-
*
|
|
1802
|
-
*
|
|
1803
|
-
*
|
|
1804
|
-
*
|
|
1796
|
+
* `previousIds` (round 4 finding 1, round 6 finding 2): the old domain's
|
|
1797
|
+
* CNAMEs were published under whatever tunnel id was live the *last*
|
|
1798
|
+
* time this step recorded that domain, which may be any id this step has
|
|
1799
|
+
* ever replaced, not necessarily `tunnelId` -- a tunnel recreated under
|
|
1800
|
+
* the same name (`findTunnelByName` returning a new id), possibly more
|
|
1801
|
+
* than once with no successful publish in between, in the same apply
|
|
1802
|
+
* that also changes the domain leaves the old domain's records pointed
|
|
1803
|
+
* at an old id. Matching only `tunnelId`'s target left them live
|
|
1804
|
+
* forever; matching only the single most recent previous id (round 4)
|
|
1805
|
+
* still missed an older one two unresolved recreates back. Every target
|
|
1806
|
+
* is checked so this stays a no-op once a retry has already moved the
|
|
1807
|
+
* old domain onto the current id.
|
|
1808
|
+
*
|
|
1809
|
+
* Round 6 finding 1: once `previousHostnames` is non-empty, every name in
|
|
1810
|
+
* it has now been looked up -- deleted (its CNAME matched one of
|
|
1811
|
+
* `dnsTargets`), left alone (found but foreign), or never found at all
|
|
1812
|
+
* (already gone) -- so none of them needs tracking under `previousDomain`
|
|
1813
|
+
* in {@link CLOUDFLARE_TUNNEL_DNS_TRACKED_SCOPE_KEY} any longer; dropped
|
|
1814
|
+
* from that set accordingly. The zone-wide fallback path (no recorded
|
|
1815
|
+
* hostnames) never added entries of its own to begin with, so there is
|
|
1816
|
+
* nothing of this domain's left in that set either way.
|
|
1805
1817
|
*/
|
|
1806
1818
|
private deleteStaleTunnelDnsRecords;
|
|
1807
1819
|
/**
|
|
@@ -1828,13 +1840,15 @@ export declare class FoundryStepExecutor implements StepExecutor, StepDestroyer
|
|
|
1828
1840
|
* (round 4 finding 3), so a crash mid-write is recovered by re-running
|
|
1829
1841
|
* this same idempotent step, never silently skipped.
|
|
1830
1842
|
*
|
|
1831
|
-
* Round 3: `
|
|
1832
|
-
*
|
|
1833
|
-
*
|
|
1834
|
-
*
|
|
1835
|
-
*
|
|
1836
|
-
*
|
|
1837
|
-
*
|
|
1843
|
+
* Round 3, round 6 finding 2: `previousIds` is every tunnel id this same
|
|
1844
|
+
* step has ever replaced (`cloudflareTunnel`'s own accumulated set,
|
|
1845
|
+
* captured before `tunnel` above is computed for this run) -- a tunnel
|
|
1846
|
+
* Cloudflare shows as recreated under the same name (`findTunnelByName`
|
|
1847
|
+
* returning a new id for `<slug>-tunnel`), possibly more than once with
|
|
1848
|
+
* no successful publish in between, leaves every CNAME still pointed at
|
|
1849
|
+
* one of those old ids. That is this org's own stale record, not a
|
|
1850
|
+
* foreign one, so it is repointed rather than refused, whichever of
|
|
1851
|
+
* `previousIds` it still names.
|
|
1838
1852
|
*
|
|
1839
1853
|
* Round 4 finding 2: `previousHostnames` is this domain's own previously
|
|
1840
1854
|
* recorded hostname list (empty when the domain just changed --
|
|
@@ -1844,17 +1858,19 @@ export declare class FoundryStepExecutor implements StepExecutor, StepDestroyer
|
|
|
1844
1858
|
* `hostnames` below but was never cleaned up before this round: its CNAME
|
|
1845
1859
|
* stayed live and its name stayed in the recorded list forever, because
|
|
1846
1860
|
* only a domain *change* ever ran cleanup. Each dropped name's CNAME is
|
|
1847
|
-
* deleted here when it still points at this tunnel or
|
|
1848
|
-
*
|
|
1849
|
-
* simply left out of the returned list -- nothing here is
|
|
1850
|
-
* reclaim or report as a conflict.
|
|
1861
|
+
* deleted here when it still points at this tunnel or any of
|
|
1862
|
+
* `previousIds`; a name already gone, or now pointed at something
|
|
1863
|
+
* foreign, is simply left out of the returned list -- nothing here is
|
|
1864
|
+
* this method's to reclaim or report as a conflict.
|
|
1851
1865
|
*
|
|
1852
|
-
* Round 5 finding 1: `context` is used
|
|
1853
|
-
*
|
|
1854
|
-
* {@link
|
|
1855
|
-
*
|
|
1856
|
-
*
|
|
1857
|
-
*
|
|
1866
|
+
* Round 5 finding 1, round 6 finding 1: `context` is used to add every
|
|
1867
|
+
* hostname this call confirms correct (settled, created or repointed) to
|
|
1868
|
+
* {@link CLOUDFLARE_TUNNEL_DNS_TRACKED_SCOPE_KEY} as soon as it is
|
|
1869
|
+
* confirmed, and to drop a dropped hostname from it once that hostname's
|
|
1870
|
+
* own CNAME is resolved one way or another -- additively, alongside
|
|
1871
|
+
* whatever other domains that shared set already names, never
|
|
1872
|
+
* overwriting them. `destroy` and {@link deleteStaleTunnelDnsRecords}
|
|
1873
|
+
* both read this set.
|
|
1858
1874
|
*/
|
|
1859
1875
|
private publishTunnelDnsRecords;
|
|
1860
1876
|
/**
|