@wtfalch/foundry 0.9.0 → 0.11.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/apply.d.ts +16 -0
- package/dist/index.d.ts +4 -3
- package/dist/index.js +1 -1
- package/dist/migrations/0030_hosting_entry_hostnames.sql +24 -0
- package/dist/migrations/0031_adoptions.sql +37 -0
- package/dist/org.d.ts +49 -4
- package/dist/org.js +134 -1
- package/dist/plan/adopt.d.ts +112 -0
- package/dist/plan/adopt.js +252 -0
- package/dist/plan/adoption-vault.d.ts +9 -0
- package/dist/plan/adoption-vault.js +1 -0
- package/dist/plan/agora.d.ts +7 -0
- package/dist/plan/agora.js +9 -0
- package/dist/plan/broker-entries.d.ts +108 -0
- package/dist/plan/broker-entries.js +214 -0
- package/dist/plan/cloudflared-connector.d.ts +10 -2
- package/dist/plan/cloudflared-connector.js +24 -16
- package/dist/plan/diff.d.ts +14 -0
- package/dist/plan/diff.js +488 -47
- package/dist/plan/executor.d.ts +141 -3
- package/dist/plan/executor.js +1100 -149
- package/dist/plan/hostnames.d.ts +24 -0
- package/dist/plan/hostnames.js +56 -0
- package/dist/plan/index.d.ts +2 -0
- package/dist/plan/index.js +1 -0
- package/dist/plan/locked-hostnames.d.ts +8 -0
- package/dist/plan/locked-hostnames.js +26 -0
- package/dist/plan/login-host.d.ts +1 -1
- package/dist/plan/login-host.js +5 -2
- package/dist/plan/plan-apply.d.ts +63 -3
- package/dist/plan/plan-apply.js +163 -5
- package/dist/plan/platform-diff.d.ts +66 -13
- package/dist/plan/platform-diff.js +117 -15
- package/dist/plan/platform-providers.d.ts +95 -2
- package/dist/plan/platform-providers.js +393 -27
- package/dist/plan/providers-readers.d.ts +8 -1
- package/dist/plan/providers-readers.js +58 -4
- package/dist/plan.d.ts +6 -0
- package/dist/store/postgres.d.ts +6 -1
- package/dist/store/postgres.js +80 -5
- package/dist/store/schema.d.ts +162 -0
- package/dist/store/schema.js +19 -1
- package/dist/store.d.ts +37 -0
- package/package.json +1 -1
|
@@ -54,8 +54,15 @@ export async function ensureCloudflaredConnector(input) {
|
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
if (!appId) {
|
|
57
|
+
if (input.adopted) {
|
|
58
|
+
throw new Error(`cloudflared connector ${input.appName}: the adopted app was not found`);
|
|
59
|
+
}
|
|
60
|
+
const { projectUuid, environment } = input;
|
|
61
|
+
if (!projectUuid || !environment) {
|
|
62
|
+
throw new Error(`cloudflared connector ${input.appName}: no project to find or create it in`);
|
|
63
|
+
}
|
|
57
64
|
const found = await coolify.findApplicationByName(input.appName, {
|
|
58
|
-
environmentIds: [
|
|
65
|
+
environmentIds: [environment.id],
|
|
59
66
|
});
|
|
60
67
|
if (found) {
|
|
61
68
|
const live = await liveStatus(found.uuid);
|
|
@@ -64,21 +71,21 @@ export async function ensureCloudflaredConnector(input) {
|
|
|
64
71
|
status = live.status;
|
|
65
72
|
}
|
|
66
73
|
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
74
|
+
if (!appId) {
|
|
75
|
+
const server = await input.resolveServer();
|
|
76
|
+
const created = await coolify.createDockerfileApplication({
|
|
77
|
+
project_uuid: projectUuid,
|
|
78
|
+
server_uuid: server.uuid,
|
|
79
|
+
environment_name: environment.name,
|
|
80
|
+
environment_uuid: environment.uuid,
|
|
81
|
+
dockerfile: cloudflaredDockerfile(),
|
|
82
|
+
name: input.appName,
|
|
83
|
+
description: 'cloudflared connector for a Cloudflare tunnel',
|
|
84
|
+
instant_deploy: false,
|
|
85
|
+
});
|
|
86
|
+
appId = created.uuid;
|
|
87
|
+
justCreated = true;
|
|
88
|
+
}
|
|
82
89
|
}
|
|
83
90
|
if (appId !== input.recordedConnectorAppId)
|
|
84
91
|
await input.recordAppId(appId);
|
|
@@ -86,6 +93,7 @@ export async function ensureCloudflaredConnector(input) {
|
|
|
86
93
|
const tokenChanged = justCreated || (await tunnelTokenDiffers(coolify, appId, token));
|
|
87
94
|
if (tokenChanged) {
|
|
88
95
|
try {
|
|
96
|
+
await input.beforeTokenWrite?.(token);
|
|
89
97
|
await coolify.bulkUpsertEnvs(appId, [{ key: 'TUNNEL_TOKEN', value: token, literal: true }]);
|
|
90
98
|
}
|
|
91
99
|
catch {
|
package/dist/plan/diff.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { DeclaredOrg, OrgId } from '../org.js';
|
|
2
2
|
import type { Plan, PlanStep, UnmanagedItem, VersionChangeItem } from '../plan.js';
|
|
3
|
+
import type { Adoption } from '../store.js';
|
|
3
4
|
import { type AgoraHostReading } from './agora.js';
|
|
4
5
|
import type { LiveResource } from './live.js';
|
|
5
6
|
import { type OrgPlatformReadiness } from './platform-org.js';
|
|
@@ -34,6 +35,19 @@ export interface PlannedStep {
|
|
|
34
35
|
export interface PlanOrgOptions {
|
|
35
36
|
/** #267: the executor was built with a `loginHostBindings` port. */
|
|
36
37
|
loginHostBindings?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* #311: the host wired an `AdoptionVault` and an `AdoptionStore`, and the
|
|
40
|
+
* rows it holds. An adopting org plans a `coolify:adopt` step for each
|
|
41
|
+
* resource with no active snapshot (`isActiveSnapshot`), or, with nothing
|
|
42
|
+
* wired, reports adoption blocked and plans neither it nor the resource's
|
|
43
|
+
* own step.
|
|
44
|
+
*/
|
|
45
|
+
adoption?: {
|
|
46
|
+
wired: boolean;
|
|
47
|
+
adopted: readonly Adoption[];
|
|
48
|
+
};
|
|
49
|
+
/** F5: the executor was built with a `broker` port. */
|
|
50
|
+
broker?: boolean;
|
|
37
51
|
}
|
|
38
52
|
export interface PlanDetail {
|
|
39
53
|
orgId: OrgId;
|