@wtfalch/foundry 0.6.0 → 0.8.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/bootstrap.d.ts +12 -8
- package/dist/bootstrap/bootstrap.js +4 -12
- package/dist/bootstrap/declare.d.ts +3 -1
- package/dist/bootstrap/declare.js +6 -2
- package/dist/bootstrap/versions.d.ts +25 -0
- package/dist/bootstrap/versions.js +43 -0
- package/dist/calls-sfu-deploy-support.d.ts +1 -1
- package/dist/calls-sfu-deploy-support.js +1 -1
- package/dist/calls-sfu-ssh-adapter.d.ts +1 -1
- package/dist/calls-sfu-ssh-adapter.js +1 -1
- package/dist/calls-sfu.d.ts +8 -6
- package/dist/calls-sfu.js +9 -6
- package/dist/index.d.ts +3 -4
- package/dist/index.js +5 -2
- package/dist/migrations/0022_chat_enabled.sql +6 -0
- package/dist/migrations/0023_hosting_app_env.sql +8 -0
- package/dist/migrations/0024_audit_events.sql +211 -0
- package/dist/migrations/0025_audit_display.sql +147 -0
- package/dist/migrations/0026_audit_erase_email_guard.sql +78 -0
- package/dist/migrations/0027_audit_chain.sql +170 -0
- package/dist/migrations/0028_audit_rls.sql +111 -0
- package/dist/migrations-dir.d.ts +9 -0
- package/dist/migrations-dir.js +10 -0
- package/dist/org.d.ts +24 -0
- package/dist/org.js +13 -0
- package/dist/plan/agora.d.ts +21 -0
- package/dist/plan/agora.js +23 -0
- package/dist/plan/calls-matrix.d.ts +4 -2
- package/dist/plan/calls-matrix.js +5 -2
- package/dist/plan/cloudflared-connector.d.ts +3 -2
- package/dist/plan/cloudflared-connector.js +5 -3
- package/dist/plan/diff.d.ts +18 -3
- package/dist/plan/diff.js +369 -42
- package/dist/plan/executor.d.ts +378 -44
- package/dist/plan/executor.js +816 -57
- package/dist/plan/index.d.ts +2 -0
- package/dist/plan/index.js +1 -0
- package/dist/plan/login-host.d.ts +88 -0
- package/dist/plan/login-host.js +73 -0
- package/dist/plan/plan-apply.d.ts +23 -8
- package/dist/plan/plan-apply.js +30 -10
- package/dist/plan/platform-diff.d.ts +102 -2
- package/dist/plan/platform-diff.js +232 -1
- package/dist/plan/platform-providers.d.ts +37 -2
- package/dist/plan/platform-providers.js +223 -36
- package/dist/plan/providers-readers.js +44 -1
- package/dist/plan.d.ts +43 -0
- package/dist/plan.js +16 -1
- package/dist/store/audit.d.ts +36 -4
- package/dist/store/audit.js +110 -29
- package/dist/store/postgres.d.ts +14 -0
- package/dist/store/postgres.js +17 -9
- package/dist/store/schema.d.ts +37 -1
- package/dist/store/schema.js +7 -0
- package/package.json +10 -5
- package/versions.json +8 -0
- package/dist/migrate.d.ts +0 -38
- package/dist/migrate.js +0 -47
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { VERSIONS } from '../bootstrap/versions.js';
|
|
2
|
+
import { VERSION_CHANGE_KIND, } from '../plan.js';
|
|
1
3
|
/**
|
|
2
4
|
* The `Plan` (#19's public contract) a {@link PlatformPlanDetail} carries,
|
|
3
5
|
* mirroring `diff.ts`'s `toPlan`. There is no separate platform-shaped `Plan`
|
|
@@ -12,6 +14,7 @@ export function toPlatformPlan(detail, ownerOrgId) {
|
|
|
12
14
|
orgId: ownerOrgId,
|
|
13
15
|
steps: detail.plannedSteps.map((p) => p.step),
|
|
14
16
|
unmanaged: detail.unmanaged,
|
|
17
|
+
versionChanges: detail.versionChanges,
|
|
15
18
|
};
|
|
16
19
|
}
|
|
17
20
|
function resourceKey(system, kind, key) {
|
|
@@ -25,6 +28,72 @@ function resourceKey(system, kind, key) {
|
|
|
25
28
|
* an org's own (which is keyed by that org's id).
|
|
26
29
|
*/
|
|
27
30
|
export const PLATFORM_AUTH_KEY = 'platform:auth';
|
|
31
|
+
/**
|
|
32
|
+
* #251: the ZITADEL image tag the last successful auth run actually set
|
|
33
|
+
* live. `provisionPlatformAuth` records this only when it set the tag --
|
|
34
|
+
* today that is creation alone, `findOrCreatePlatformApp`'s own
|
|
35
|
+
* `justCreated`, since nothing yet patches `docker_registry_image_tag` on
|
|
36
|
+
* an app found already running (unlike mail, which does). Recording it on
|
|
37
|
+
* every run regardless, the way the app id itself is recorded, would make
|
|
38
|
+
* {@link versionNotAppliedLine} compare the pinned version against a value
|
|
39
|
+
* that was never actually applied.
|
|
40
|
+
*/
|
|
41
|
+
export const PLATFORM_AUTH_ZITADEL_APPLIED_IMAGE_TAG_SCOPE_KEY = 'auth_zitadel_applied_image_tag';
|
|
42
|
+
/**
|
|
43
|
+
* #251: the Synapse/MAS image tags an org's calls Matrix stack last
|
|
44
|
+
* successful apply actually set live. `coolifyCalls` (`executor.ts`)
|
|
45
|
+
* records these only at creation, for the same reason
|
|
46
|
+
* {@link PLATFORM_AUTH_ZITADEL_APPLIED_IMAGE_TAG_SCOPE_KEY} is: nothing yet
|
|
47
|
+
* patches either tag on an app `findOrCreateCallsApp` found already
|
|
48
|
+
* running.
|
|
49
|
+
*/
|
|
50
|
+
export const CALLS_SYNAPSE_APPLIED_IMAGE_TAG_SCOPE_KEY = 'calls_synapse_applied_image_tag';
|
|
51
|
+
export const CALLS_MAS_APPLIED_IMAGE_TAG_SCOPE_KEY = 'calls_mas_applied_image_tag';
|
|
52
|
+
/**
|
|
53
|
+
* One line for a service whose own step genuinely redeploys when its
|
|
54
|
+
* recorded applied ref differs from the declared or pinned one (mail,
|
|
55
|
+
* archon, ai, files, integrations) -- `from` undefined (nothing applied
|
|
56
|
+
* yet, a first-ever apply) or already equal to `to` means nothing to
|
|
57
|
+
* report.
|
|
58
|
+
*/
|
|
59
|
+
export function versionChangeLine(service, from, to, note) {
|
|
60
|
+
if (!from || from === to)
|
|
61
|
+
return null;
|
|
62
|
+
return {
|
|
63
|
+
kind: VERSION_CHANGE_KIND,
|
|
64
|
+
service,
|
|
65
|
+
description: `${service}: ${from} -> ${to} (${note})`,
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* One line for a service whose own step never patches a running app's
|
|
70
|
+
* image tag once created -- zitadel, synapse, mas. #251 round 3: a prior
|
|
71
|
+
* attempt worded this line the same as {@link versionChangeLine}'s
|
|
72
|
+
* "X -> Y (image, redeploy)", which promised a redeploy `apply` can never
|
|
73
|
+
* actually perform for these three. `appLive` false means nothing live yet
|
|
74
|
+
* to compare against (no line, the same first-apply case
|
|
75
|
+
* {@link versionChangeLine} has); a live app with no recorded `applied`
|
|
76
|
+
* value predates this tracking and is reported as `running tag unknown`
|
|
77
|
+
* rather than silently showing nothing.
|
|
78
|
+
*/
|
|
79
|
+
export function versionNotAppliedLine(service, appLive, applied, pinned) {
|
|
80
|
+
if (!appLive)
|
|
81
|
+
return null;
|
|
82
|
+
if (!applied) {
|
|
83
|
+
return {
|
|
84
|
+
kind: VERSION_CHANGE_KIND,
|
|
85
|
+
service,
|
|
86
|
+
description: `${service}: pinned ${pinned}, running tag unknown`,
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
if (applied === pinned)
|
|
90
|
+
return null;
|
|
91
|
+
return {
|
|
92
|
+
kind: VERSION_CHANGE_KIND,
|
|
93
|
+
service,
|
|
94
|
+
description: `${service}: pinned ${pinned}, running ${applied} (not applied by foundry)`,
|
|
95
|
+
};
|
|
96
|
+
}
|
|
28
97
|
/**
|
|
29
98
|
* Scope keys (colon-free, so never mistaken for a `system:kind:key` resource
|
|
30
99
|
* id) for foundry's ZITADEL admin machine user. The delivered key is the guard
|
|
@@ -273,6 +342,41 @@ export function platformMailMxHost(apex) {
|
|
|
273
342
|
*/
|
|
274
343
|
export const ORG_MAIL_APPLIED_APEX_SCOPE_KEY = 'mail_applied_apex';
|
|
275
344
|
export const ORG_MAIL_APPLIED_HOST_SCOPE_KEY = 'mail_applied_host';
|
|
345
|
+
/**
|
|
346
|
+
* #243: the org's `hosting.appEnv` values the last `coolify:app` apply pushed,
|
|
347
|
+
* recorded as one JSON object (env name to value; ids and a domain, never a
|
|
348
|
+
* secret). `planApp` plans the step again when {@link resolveAppEnv} differs
|
|
349
|
+
* from it, so a changed map reaches an app that is already live.
|
|
350
|
+
*/
|
|
351
|
+
export const APP_ENV_APPLIED_SCOPE_KEY = 'app_env_applied';
|
|
352
|
+
/**
|
|
353
|
+
* #239: set to '1' once an app has been restarted after its database URLs
|
|
354
|
+
* were pushed. Not a URL. Without it a crash between the push and the restart
|
|
355
|
+
* would leave a stale container that no plan notices.
|
|
356
|
+
*/
|
|
357
|
+
export const DB_ENV_APPLIED_SCOPE_KEY = 'db_env_applied';
|
|
358
|
+
/**
|
|
359
|
+
* The `hosting.appEnv` entries whose source has a recorded value, in env-name
|
|
360
|
+
* order, and the env names whose source has none yet. Shared by `planApp` and
|
|
361
|
+
* the executor's `pushAppEnv` so both read the same recorded ids.
|
|
362
|
+
*/
|
|
363
|
+
export function resolveAppEnv(org, recorded) {
|
|
364
|
+
const sources = {
|
|
365
|
+
filesOrganisationId: recorded[`files:organisation:${org.id}`],
|
|
366
|
+
aiOrganisationId: recorded[`ai:organisation:${org.id}`],
|
|
367
|
+
mailDomain: recorded.mail_domain,
|
|
368
|
+
};
|
|
369
|
+
const values = {};
|
|
370
|
+
const unresolved = [];
|
|
371
|
+
for (const [name, source] of Object.entries(org.hosting.appEnv).sort(([a], [b]) => a < b ? -1 : 1)) {
|
|
372
|
+
const value = sources[source];
|
|
373
|
+
if (value)
|
|
374
|
+
values[name] = value;
|
|
375
|
+
else
|
|
376
|
+
unresolved.push([name, source]);
|
|
377
|
+
}
|
|
378
|
+
return { values, unresolved };
|
|
379
|
+
}
|
|
276
380
|
/**
|
|
277
381
|
* #172: the resource key `planAi` plans under and `FoundryPlatformStepExecutor`
|
|
278
382
|
* dispatches on, the same `platform:<service>` shape as
|
|
@@ -455,6 +559,40 @@ export function planPlatform(platform, live, options = {}) {
|
|
|
455
559
|
const archon = planArchon(platform, recordedIds, blocked.archon, authReady, drifted.archon);
|
|
456
560
|
if (archon.step)
|
|
457
561
|
plannedSteps.push(archon.step);
|
|
562
|
+
// #257: after every service above, so a database any of them just
|
|
563
|
+
// recorded is already visible to `recordedIds` on this same plan.
|
|
564
|
+
const backups = planBackups(byKey, claimed, recordedIds, blocked.backupExecutorMissing ?? false);
|
|
565
|
+
plannedSteps.push(...backups.steps);
|
|
566
|
+
// #251: one line per service whose recorded applied ref no longer matches
|
|
567
|
+
// what the next apply would use (or, for zitadel, what is actually live).
|
|
568
|
+
// Never pushed into `plannedSteps` -- see `VersionChangeItem`'s own doc
|
|
569
|
+
// comment (`plan.ts`) for why. Withheld exactly where that service's own
|
|
570
|
+
// step is blocked: advertising a version it cannot run yet, or cannot be
|
|
571
|
+
// read for, is premature, not informational.
|
|
572
|
+
const versionChanges = [];
|
|
573
|
+
for (const change of [
|
|
574
|
+
mail.blocked
|
|
575
|
+
? null
|
|
576
|
+
: versionChangeLine('mail', recordedIds[PLATFORM_MAIL_APPLIED_GIT_REF_SCOPE_KEY], platform.mail.gitRef, 'image, redeploy'),
|
|
577
|
+
archon.blocked
|
|
578
|
+
? null
|
|
579
|
+
: versionChangeLine('archon', recordedIds[PLATFORM_ARCHON_APPLIED_GIT_REF_SCOPE_KEY], platform.archon.gitRef, 'git ref, redeploy'),
|
|
580
|
+
ai.blocked
|
|
581
|
+
? null
|
|
582
|
+
: versionChangeLine('ai', recordedIds[PLATFORM_AI_APPLIED_GITREF_SCOPE_KEY], platform.ai.gitRef, 'git ref, redeploy'),
|
|
583
|
+
files.blocked
|
|
584
|
+
? null
|
|
585
|
+
: versionChangeLine('files', recordedIds[PLATFORM_FILES_APPLIED_GIT_REF_SCOPE_KEY], platform.files.gitRef, 'git ref, redeploy'),
|
|
586
|
+
integrations.blocked
|
|
587
|
+
? null
|
|
588
|
+
: versionChangeLine('integrations', recordedIds[PLATFORM_INTEGRATIONS_APPLIED_GITREF_SCOPE_KEY], platform.integrations.gitRef, 'git ref, redeploy'),
|
|
589
|
+
auth.blocked
|
|
590
|
+
? null
|
|
591
|
+
: versionNotAppliedLine('zitadel', Boolean(recordedIds[resourceKey('coolify', 'app', PLATFORM_AUTH_KEY)]), recordedIds[PLATFORM_AUTH_ZITADEL_APPLIED_IMAGE_TAG_SCOPE_KEY], VERSIONS.zitadel),
|
|
592
|
+
]) {
|
|
593
|
+
if (change)
|
|
594
|
+
versionChanges.push(change);
|
|
595
|
+
}
|
|
458
596
|
const unmanaged = live
|
|
459
597
|
.filter((r) => !claimed.has(resourceKey(r.system, r.kind, r.key)))
|
|
460
598
|
.map((r) => ({
|
|
@@ -481,7 +619,8 @@ export function planPlatform(platform, live, options = {}) {
|
|
|
481
619
|
unmanaged.push({ description: ai.blocked, key: 'ai' });
|
|
482
620
|
if (archon.blocked)
|
|
483
621
|
unmanaged.push({ description: archon.blocked, key: 'archon' });
|
|
484
|
-
|
|
622
|
+
unmanaged.push(...backups.blocked);
|
|
623
|
+
return { plannedSteps, unmanaged, versionChanges };
|
|
485
624
|
}
|
|
486
625
|
/**
|
|
487
626
|
* The platform's own Cloudflare zone for its shared apex (`platform.ts`'s
|
|
@@ -575,6 +714,98 @@ function planJobs(platform, byKey, claimed, observable) {
|
|
|
575
714
|
},
|
|
576
715
|
};
|
|
577
716
|
}
|
|
717
|
+
/**
|
|
718
|
+
* #257: the six platform databases foundry itself creates, each keyed by
|
|
719
|
+
* the scope id `platform-providers.ts`'s own `createPostgresDatabase` call
|
|
720
|
+
* site records once that service's database exists --
|
|
721
|
+
* `JOBS_DATABASE_SCOPE_KEY`, `PLATFORM_AUTH_DB_SCOPE_KEY`,
|
|
722
|
+
* `PLATFORM_ARCHON_DB_SCOPE_KEY`, `PLATFORM_AI_DB_SCOPE_KEY`,
|
|
723
|
+
* `PLATFORM_FILES_DB_SCOPE_KEY`, `INTEGRATIONS_DATABASE_SCOPE_KEY`. Those
|
|
724
|
+
* constants stay module-private in `platform-providers.ts`, grouped with
|
|
725
|
+
* each service's other scope keys; the string values here are a second,
|
|
726
|
+
* documented copy rather than an import, so `planBackups` below never
|
|
727
|
+
* reaches into that file and `platform-providers.ts` keeps importing *from*
|
|
728
|
+
* this one, never the other way (every other scope key constant already
|
|
729
|
+
* flows that direction). `platform-providers.test.ts`'s own
|
|
730
|
+
* `coolify:backup` suite exercises both the executor's real constants and
|
|
731
|
+
* this planner end to end, so a renamed key on either side shows up as a
|
|
732
|
+
* database the planner can no longer see -- reported blocked, per rule 2,
|
|
733
|
+
* never a wrong step.
|
|
734
|
+
*/
|
|
735
|
+
export const PLATFORM_BACKUP_DATABASE_SCOPE_KEYS = {
|
|
736
|
+
jobs: 'coolify_jobs_database',
|
|
737
|
+
auth: 'coolify_platform_auth_database',
|
|
738
|
+
archon: 'coolify_platform_archon_database',
|
|
739
|
+
ai: 'coolify_platform_ai_database',
|
|
740
|
+
files: 'coolify_platform_files_database',
|
|
741
|
+
integrations: 'coolify_integrations_database',
|
|
742
|
+
};
|
|
743
|
+
export const PLATFORM_BACKUP_SERVICE_KEYS = [
|
|
744
|
+
'jobs',
|
|
745
|
+
'auth',
|
|
746
|
+
'archon',
|
|
747
|
+
'ai',
|
|
748
|
+
'files',
|
|
749
|
+
'integrations',
|
|
750
|
+
];
|
|
751
|
+
/**
|
|
752
|
+
* #257: a nightly backup for each platform database foundry itself creates,
|
|
753
|
+
* one `coolify:backup:<service>` step per service -- unconditional, the
|
|
754
|
+
* same "no enabled toggle, always wanted" shape {@link planApexZone} has,
|
|
755
|
+
* since a database that exists always wants a backup whether or not its own
|
|
756
|
+
* service is currently `enabled` (platform-steps rule 2, this repo's
|
|
757
|
+
* CLAUDE.md: blocked, not failing). A service with no database recorded yet
|
|
758
|
+
* has nothing to back up, so it is reported blocked rather than planned --
|
|
759
|
+
* the same way `planJobs` blocks rather than plans with no Coolify reader --
|
|
760
|
+
* and so is every service once a database exists but `executorMissing` says
|
|
761
|
+
* the host built the platform executor without backup dependencies (the
|
|
762
|
+
* R2/S3 credentials `FoundryPlatformStepExecutorOptions.backup` carries).
|
|
763
|
+
* Once a step's own `coolify:backup:<service>` resource is live, it is
|
|
764
|
+
* claimed and never re-planned: like every other provision-only step here,
|
|
765
|
+
* there is no park branch for a backup already scheduled.
|
|
766
|
+
*/
|
|
767
|
+
function planBackups(byKey, claimed, recordedIds, executorMissing) {
|
|
768
|
+
const steps = [];
|
|
769
|
+
const blocked = [];
|
|
770
|
+
for (const service of PLATFORM_BACKUP_SERVICE_KEYS) {
|
|
771
|
+
const key = resourceKey('coolify', 'backup', service);
|
|
772
|
+
const live = byKey.get(key);
|
|
773
|
+
if (live) {
|
|
774
|
+
claimed.add(key);
|
|
775
|
+
continue;
|
|
776
|
+
}
|
|
777
|
+
// No database yet is not reported: unlike a Coolify reader or a backup
|
|
778
|
+
// executor missing (below), there is nothing here for a host to fix --
|
|
779
|
+
// the database arrives on its own once that service's own step is
|
|
780
|
+
// enabled and applied, and this step simply follows next time. Reporting
|
|
781
|
+
// it would make every platform with a service not yet applied carry a
|
|
782
|
+
// standing "blocked" note nobody can act on.
|
|
783
|
+
const databaseId = recordedIds[PLATFORM_BACKUP_DATABASE_SCOPE_KEYS[service]];
|
|
784
|
+
if (!databaseId)
|
|
785
|
+
continue;
|
|
786
|
+
if (executorMissing) {
|
|
787
|
+
blocked.push({
|
|
788
|
+
description: `platform:backup:${service} is blocked, not planned: the host built the platform executor without its backup dependencies`,
|
|
789
|
+
key: `backup:${service}`,
|
|
790
|
+
});
|
|
791
|
+
continue;
|
|
792
|
+
}
|
|
793
|
+
steps.push({
|
|
794
|
+
action: {
|
|
795
|
+
system: 'coolify',
|
|
796
|
+
kind: 'backup',
|
|
797
|
+
key: service,
|
|
798
|
+
desired: { databaseId },
|
|
799
|
+
},
|
|
800
|
+
step: {
|
|
801
|
+
description: `schedule a nightly R2 backup of the platform's ${service} database`,
|
|
802
|
+
destroys: false,
|
|
803
|
+
migrates: false,
|
|
804
|
+
},
|
|
805
|
+
});
|
|
806
|
+
}
|
|
807
|
+
return { steps, blocked };
|
|
808
|
+
}
|
|
578
809
|
/**
|
|
579
810
|
* The platform's shared calls SFU (#170), keyed `sfu:livekit:platform` --
|
|
580
811
|
* there is exactly one, so `key` names the platform itself rather than a
|
|
@@ -102,6 +102,13 @@ export interface FoundryPlatformStepExecutorOptions {
|
|
|
102
102
|
* -- optional for the same reason as {@link auth}.
|
|
103
103
|
*/
|
|
104
104
|
archon?: PlatformArchonDeps;
|
|
105
|
+
/**
|
|
106
|
+
* #257: dependencies for every `coolify:backup:<service>` step -- optional
|
|
107
|
+
* for the same reason as `auth`; a service whose database already exists
|
|
108
|
+
* without this set has its backup step reported blocked rather than
|
|
109
|
+
* planned.
|
|
110
|
+
*/
|
|
111
|
+
backup?: PlatformBackupDeps;
|
|
105
112
|
}
|
|
106
113
|
/**
|
|
107
114
|
* The real {@link PlatformStepExecutor} for the two steps built so far:
|
|
@@ -159,6 +166,10 @@ export interface FoundryPlatformStepExecutorOptions {
|
|
|
159
166
|
* #175 adds `coolify:app` keyed {@link PLATFORM_ARCHON_KEY}, Archon itself
|
|
160
167
|
* ({@link provisionPlatformArchon}), once a host passes
|
|
161
168
|
* {@link PlatformArchonDeps}.
|
|
169
|
+
*
|
|
170
|
+
* #257 adds `coolify:backup:<service>`, a nightly R2 backup of each
|
|
171
|
+
* platform database ({@link provisionPlatformBackup}), once a host passes
|
|
172
|
+
* {@link PlatformBackupDeps}.
|
|
162
173
|
*/
|
|
163
174
|
export declare class FoundryPlatformStepExecutor implements PlatformStepExecutor {
|
|
164
175
|
private readonly cloudflare;
|
|
@@ -172,6 +183,7 @@ export declare class FoundryPlatformStepExecutor implements PlatformStepExecutor
|
|
|
172
183
|
private readonly files?;
|
|
173
184
|
private readonly ai?;
|
|
174
185
|
private readonly archon?;
|
|
186
|
+
private readonly backup?;
|
|
175
187
|
constructor(cloudflare: Pick<CloudflarePort, 'findZoneByApex' | 'createZone'>, declaredOrgStore: Pick<DeclaredOrgStore, 'findOrgIdForZone' | 'list'>, options?: FoundryPlatformStepExecutorOptions);
|
|
176
188
|
blockedSteps(platform: DeclaredPlatform, recordedIds?: Readonly<Record<string, string>>): Promise<{
|
|
177
189
|
auth?: string;
|
|
@@ -182,6 +194,7 @@ export declare class FoundryPlatformStepExecutor implements PlatformStepExecutor
|
|
|
182
194
|
ai?: string;
|
|
183
195
|
archon?: string;
|
|
184
196
|
mail?: string;
|
|
197
|
+
backupExecutorMissing?: boolean;
|
|
185
198
|
}>;
|
|
186
199
|
/**
|
|
187
200
|
* Whether Archon's live Access policy lets through anyone but the declared
|
|
@@ -291,7 +304,7 @@ export interface PlatformMailRuntime {
|
|
|
291
304
|
* {@link PlatformStepExecutionContext}, bundled like {@link PlatformAuthDeps}.
|
|
292
305
|
*/
|
|
293
306
|
export interface PlatformArchonDeps {
|
|
294
|
-
coolify: Pick<CoolifyPort, 'findProjectByName' | 'createProject' | 'findOrCreateEnvironment' | 'listServers' | 'findApplicationByName' | 'getApplication' | 'requireGithubApp' | 'createGithubAppApplication' | 'createDockerfileApplication' | 'createPostgresDatabase' | 'getDatabase' | 'bulkUpsertEnvs' | 'listEnvs' | 'updateApplication' | 'deploy'>;
|
|
307
|
+
coolify: Pick<CoolifyPort, 'findProjectByName' | 'createProject' | 'findOrCreateEnvironment' | 'listServers' | 'findApplicationByName' | 'getApplication' | 'requireGithubApp' | 'createGithubAppApplication' | 'createDockerfileApplication' | 'listDatabases' | 'createPostgresDatabase' | 'getDatabase' | 'bulkUpsertEnvs' | 'listEnvs' | 'updateApplication' | 'deploy'>;
|
|
295
308
|
cloudflare: Pick<CloudflarePort, 'findZoneByApex' | 'findTunnelByName' | 'createTunnel' | 'putTunnelConfig' | 'getTunnelToken' | 'findDnsRecord' | 'createDnsRecord' | 'updateDnsRecord' | 'listAccessApps' | 'createAccessApp' | 'listAccessPolicies' | 'createAccessPolicy' | 'deleteAccessApp'>;
|
|
296
309
|
/** Must target the platform's own ZITADEL instance, or `zitadelForInstance` must be set. */
|
|
297
310
|
zitadel: Pick<ZitadelPort, 'findOrCreateOrg' | 'findOrCreateProject' | 'createOidcApp' | 'listApps' | 'deleteApp'>;
|
|
@@ -580,6 +593,28 @@ export declare const INTEGRATIONS_MANAGEMENT_ISSUER = "foundry";
|
|
|
580
593
|
* its signed request; fixed, since there is one key until rotation is built.
|
|
581
594
|
*/
|
|
582
595
|
export declare const INTEGRATIONS_MANAGEMENT_KEY_ID = "foundry-1";
|
|
596
|
+
/**
|
|
597
|
+
* #257: everything {@link provisionPlatformBackup} needs beyond
|
|
598
|
+
* {@link PlatformStepExecutionContext} -- the narrow Coolify slice for the
|
|
599
|
+
* backup calls themselves, and the R2 (or any S3-compatible) bucket every
|
|
600
|
+
* platform database's dump lands in. A person creates or confirms the
|
|
601
|
+
* bucket and these credentials by hand (the issue's own "Human steps"); this
|
|
602
|
+
* package only ever registers the bucket with Coolify and schedules the
|
|
603
|
+
* dump, never creates or reads the bucket itself.
|
|
604
|
+
*/
|
|
605
|
+
export interface PlatformBackupDeps {
|
|
606
|
+
coolify: Pick<CoolifyPort, 'listS3Storages' | 'createS3Storage' | 'listDatabaseBackups' | 'createDatabaseBackup'>;
|
|
607
|
+
r2: {
|
|
608
|
+
endpoint: string;
|
|
609
|
+
bucket: string;
|
|
610
|
+
accessKeyId: string;
|
|
611
|
+
secretAccessKey: string;
|
|
612
|
+
/** R2 takes `'auto'` (`CoolifyPort.createS3Storage`'s own doc comment). Default `'auto'`. */
|
|
613
|
+
region?: string;
|
|
614
|
+
};
|
|
615
|
+
/** A cron string or one of Coolify's names (`daily`, `weekly`, ...). Default `'daily'`. */
|
|
616
|
+
frequency?: string;
|
|
617
|
+
}
|
|
583
618
|
/**
|
|
584
619
|
* The real {@link PlatformCloudflareReader}: the platform's apex zone as
|
|
585
620
|
* `planApexZone` expects to see it, and nothing else. The zone's DNS records
|
|
@@ -609,7 +644,7 @@ export declare class ProvidersPlatformCloudflareReader implements PlatformCloudf
|
|
|
609
644
|
export declare class ProvidersPlatformCoolifyReader implements PlatformCoolifyReader {
|
|
610
645
|
private readonly client;
|
|
611
646
|
private readonly platformStore;
|
|
612
|
-
constructor(client: Pick<CoolifyPort, 'getApplication'>, platformStore: Pick<PlatformStore, 'getServiceIds'>);
|
|
647
|
+
constructor(client: Pick<CoolifyPort, 'getApplication' | 'listDatabaseBackups'>, platformStore: Pick<PlatformStore, 'getServiceIds'>);
|
|
613
648
|
listResources(): Promise<LiveResource[]>;
|
|
614
649
|
}
|
|
615
650
|
export {};
|