@caelo-cms/provisioning 0.11.20 → 0.12.1
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/adapter.d.ts +6 -1
- package/dist/adapter.d.ts.map +1 -1
- package/dist/admin-internal-google.d.ts +13 -1
- package/dist/admin-internal-google.d.ts.map +1 -1
- package/dist/admin-internal-google.js +47 -0
- package/dist/admin-internal-google.js.map +1 -1
- package/dist/agent/command.d.ts +1 -1
- package/dist/agent-db.js +133 -8
- package/dist/bootstrap-token.d.ts +4 -3
- package/dist/bootstrap-token.d.ts.map +1 -1
- package/dist/bootstrap-token.js.map +1 -1
- package/dist/cli-routing.d.ts.map +1 -1
- package/dist/cli-routing.js +7 -2
- package/dist/cli-routing.js.map +1 -1
- package/dist/cli.js +9 -0
- package/dist/cli.js.map +1 -1
- package/dist/converge-checkpoint.d.ts +6 -0
- package/dist/converge-checkpoint.d.ts.map +1 -1
- package/dist/converge-job-gcp.d.ts +1 -16
- package/dist/converge-job-gcp.d.ts.map +1 -1
- package/dist/converge-job-gcp.js +10 -97
- package/dist/converge-job-gcp.js.map +1 -1
- package/dist/converge-job.d.ts +7 -46
- package/dist/converge-job.d.ts.map +1 -1
- package/dist/converge-job.js +22 -57
- package/dist/converge-job.js.map +1 -1
- package/dist/dns/manual.d.ts +5 -1
- package/dist/dns/manual.d.ts.map +1 -1
- package/dist/dns/manual.js +2 -1
- package/dist/dns/manual.js.map +1 -1
- package/dist/gateway-armor.d.ts.map +1 -1
- package/dist/gateway-armor.js +11 -3
- package/dist/gateway-armor.js.map +1 -1
- package/dist/gcp-names.d.ts +2 -0
- package/dist/gcp-names.d.ts.map +1 -1
- package/dist/gcp-names.js +4 -0
- package/dist/gcp-names.js.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/infra-contract.d.ts +1 -1
- package/dist/infra-contract.d.ts.map +1 -1
- package/dist/infra-contract.js +14 -1
- package/dist/infra-contract.js.map +1 -1
- package/dist/install-job-runner.d.ts.map +1 -1
- package/dist/install-job-runner.js +4 -3
- package/dist/install-job-runner.js.map +1 -1
- package/dist/install-job.d.ts +25 -1
- package/dist/install-job.d.ts.map +1 -1
- package/dist/install-job.js +72 -3
- package/dist/install-job.js.map +1 -1
- package/dist/job-handover-gcp.d.ts +40 -0
- package/dist/job-handover-gcp.d.ts.map +1 -0
- package/dist/job-handover-gcp.js +108 -0
- package/dist/job-handover-gcp.js.map +1 -0
- package/dist/job-handover.d.ts +141 -0
- package/dist/job-handover.d.ts.map +1 -0
- package/dist/job-handover.js +141 -0
- package/dist/job-handover.js.map +1 -0
- package/dist/operator-access.d.ts +7 -2
- package/dist/operator-access.d.ts.map +1 -1
- package/dist/operator-access.js +37 -6
- package/dist/operator-access.js.map +1 -1
- package/dist/owner-setup-token.d.ts +52 -0
- package/dist/owner-setup-token.d.ts.map +1 -0
- package/dist/owner-setup-token.js +111 -0
- package/dist/owner-setup-token.js.map +1 -0
- package/dist/project-status.d.ts +128 -0
- package/dist/project-status.d.ts.map +1 -0
- package/dist/project-status.js +303 -0
- package/dist/project-status.js.map +1 -0
- package/dist/stack-converge.d.ts.map +1 -1
- package/dist/stack-converge.js +9 -5
- package/dist/stack-converge.js.map +1 -1
- package/dist/state-attach.d.ts +17 -0
- package/dist/state-attach.d.ts.map +1 -1
- package/dist/state-attach.js +27 -9
- package/dist/state-attach.js.map +1 -1
- package/dist/static-security-headers.d.ts +6 -0
- package/dist/static-security-headers.d.ts.map +1 -1
- package/dist/static-security-headers.js +11 -1
- package/dist/static-security-headers.js.map +1 -1
- package/dist/upgrader-assess.d.ts +30 -3
- package/dist/upgrader-assess.d.ts.map +1 -1
- package/dist/upgrader-assess.js +77 -24
- package/dist/upgrader-assess.js.map +1 -1
- package/dist/upgrader-gcp.d.ts +4 -2
- package/dist/upgrader-gcp.d.ts.map +1 -1
- package/dist/upgrader-gcp.js +16 -3
- package/dist/upgrader-gcp.js.map +1 -1
- package/dist/upgrader-iam-preflight.d.ts +14 -3
- package/dist/upgrader-iam-preflight.d.ts.map +1 -1
- package/dist/upgrader-iam-preflight.js +40 -6
- package/dist/upgrader-iam-preflight.js.map +1 -1
- package/dist/upgrader-job.d.ts +51 -9
- package/dist/upgrader-job.d.ts.map +1 -1
- package/dist/upgrader-job.js +92 -37
- package/dist/upgrader-job.js.map +1 -1
- package/dist/upgrader-setup.d.ts +1 -1
- package/dist/upgrader-setup.d.ts.map +1 -1
- package/dist/upgrader-setup.js +5 -2
- package/dist/upgrader-setup.js.map +1 -1
- package/dist/wizards/gcp-install-job.d.ts +27 -4
- package/dist/wizards/gcp-install-job.d.ts.map +1 -1
- package/dist/wizards/gcp-install-job.js +73 -33
- package/dist/wizards/gcp-install-job.js.map +1 -1
- package/dist/wizards/gcp-pulumi.d.ts +0 -13
- package/dist/wizards/gcp-pulumi.d.ts.map +1 -1
- package/dist/wizards/gcp-pulumi.js +0 -12
- package/dist/wizards/gcp-pulumi.js.map +1 -1
- package/dist/wizards/gcp.d.ts +3 -0
- package/dist/wizards/gcp.d.ts.map +1 -1
- package/dist/wizards/gcp.js +30 -53
- package/dist/wizards/gcp.js.map +1 -1
- package/package.json +2 -2
- package/src/adapter.ts +6 -1
- package/src/admin-internal-google.ts +48 -0
- package/src/bootstrap-token.ts +4 -3
- package/src/caddy-redirects.docker.test.ts +5 -0
- package/src/cli-routing.test.ts +1 -1
- package/src/cli-routing.ts +9 -2
- package/src/cli.ts +9 -0
- package/src/converge-job-gcp.test.ts +1 -40
- package/src/converge-job-gcp.ts +10 -100
- package/src/converge-job.test.ts +9 -3
- package/src/converge-job.ts +33 -115
- package/src/dns/manual.ts +4 -1
- package/src/gateway-armor.ts +14 -3
- package/src/gateway-edge.test.ts +16 -1
- package/src/gcp-names.ts +4 -0
- package/src/gcp-url-map.test.ts +2 -0
- package/src/index.ts +3 -0
- package/src/infra-contract.test.ts +4 -3
- package/src/infra-contract.ts +14 -1
- package/src/install-job-runner.ts +4 -2
- package/src/install-job.ts +86 -4
- package/src/job-handover-gcp.test.ts +129 -0
- package/src/job-handover-gcp.ts +135 -0
- package/src/job-handover.ts +259 -0
- package/src/operator-access.test.ts +43 -0
- package/src/operator-access.ts +38 -6
- package/src/owner-setup-token.test.ts +195 -0
- package/src/owner-setup-token.ts +138 -0
- package/src/project-status.test.ts +571 -0
- package/src/project-status.ts +430 -0
- package/src/stack-converge.ts +12 -5
- package/src/state-attach.ts +46 -16
- package/src/static-security-headers.test.ts +16 -0
- package/src/static-security-headers.ts +12 -1
- package/src/upgrader-assess.test.ts +75 -1
- package/src/upgrader-assess.ts +121 -57
- package/src/upgrader-gcp.ts +19 -5
- package/src/upgrader-iam-preflight.test.ts +28 -1
- package/src/upgrader-iam-preflight.ts +46 -6
- package/src/upgrader-job.test.ts +365 -31
- package/src/upgrader-job.ts +177 -53
- package/src/upgrader-setup.test.ts +17 -0
- package/src/upgrader-setup.ts +5 -2
- package/src/url-map-redirects-access.test.ts +1 -1
- package/src/wizards/gcp-install-job.ts +101 -47
- package/src/wizards/gcp-pulumi.ts +0 -18
- package/src/wizards/gcp.ts +37 -67
- package/stacks/aws/README.md +4 -2
- package/stacks/aws/index.ts +4 -8
- package/stacks/azure/README.md +4 -2
- package/stacks/azure/index.ts +4 -8
- package/stacks/gcp/README.md +6 -3
- package/stacks/gcp/index.ts +7 -8
- package/stacks/gcp-firebase/index.ts +4 -6
|
@@ -281,24 +281,6 @@ export function presentImageOverrides(
|
|
|
281
281
|
return imageOverrideKeys(provider).filter((k) => config !== undefined && k in config);
|
|
282
282
|
}
|
|
283
283
|
|
|
284
|
-
/**
|
|
285
|
-
* One output of the install's stack, secrets included (the Automation API's
|
|
286
|
-
* `pulumi stack output --show-secrets`). Read at the moment of use, never
|
|
287
|
-
* checkpointed (#656). Needs the `pulumi` CLI and the stack's state.
|
|
288
|
-
*
|
|
289
|
-
* @returns the output's value, or undefined when the stack has no such output
|
|
290
|
-
*/
|
|
291
|
-
export async function readStackOutput(inputs: {
|
|
292
|
-
installRoot: string;
|
|
293
|
-
backend: ResolvedBackend;
|
|
294
|
-
provider: "gcp" | "gcp-firebase";
|
|
295
|
-
name: string;
|
|
296
|
-
}): Promise<unknown> {
|
|
297
|
-
const stack = await selectInstallStack(inputs.installRoot, inputs.backend, inputs.provider);
|
|
298
|
-
const outputs = await stack.outputs();
|
|
299
|
-
return outputs[inputs.name]?.value;
|
|
300
|
-
}
|
|
301
|
-
|
|
302
284
|
/**
|
|
303
285
|
* The install's stack settings file with secrets settings that can't
|
|
304
286
|
* contradict its state, or null when it is already fine (#696).
|
package/src/wizards/gcp.ts
CHANGED
|
@@ -80,12 +80,7 @@ import {
|
|
|
80
80
|
upgraderServiceAccountEmail,
|
|
81
81
|
} from "../gcp-names.js";
|
|
82
82
|
import { INFRA_CONTRACT_VERSION } from "../infra-contract.js";
|
|
83
|
-
import {
|
|
84
|
-
INSTALL_JOB_NAME,
|
|
85
|
-
INSTALL_JOB_ROLES,
|
|
86
|
-
INSTALL_SETUP_LINK_SECRET,
|
|
87
|
-
storeSetupLink,
|
|
88
|
-
} from "../install-job.js";
|
|
83
|
+
import { INSTALL_JOB_NAME, INSTALL_JOB_ROLES } from "../install-job.js";
|
|
89
84
|
import {
|
|
90
85
|
adoptStateBackend,
|
|
91
86
|
ensureInstallDir,
|
|
@@ -110,6 +105,7 @@ import {
|
|
|
110
105
|
resolveOperatorAccessTarget,
|
|
111
106
|
} from "../operator-access.js";
|
|
112
107
|
import { ensureOpsBackend } from "../ops-backend.js";
|
|
108
|
+
import { issueOwnerSetup } from "../owner-setup-token.js";
|
|
113
109
|
import { formatPlan, type PlannedStep, planGate, writePlanFile } from "../preview-plan.js";
|
|
114
110
|
import {
|
|
115
111
|
convergeKeylessProvisioner,
|
|
@@ -161,12 +157,7 @@ import { ensureUpgraderJob, resolveUpgraderTarget } from "../upgrader-setup.js";
|
|
|
161
157
|
import { ensureUrlMapRedirectsAccess } from "../url-map-redirects-access.js";
|
|
162
158
|
import { estimateGcpCost } from "./gcp-cost.js";
|
|
163
159
|
import { promptProjectId } from "./gcp-prompts.js";
|
|
164
|
-
import {
|
|
165
|
-
GCP_STACK_KNOB_DEFAULTS,
|
|
166
|
-
PulumiUpDeclinedError,
|
|
167
|
-
pulumiUpGcp,
|
|
168
|
-
readStackOutput,
|
|
169
|
-
} from "./gcp-pulumi.js";
|
|
160
|
+
import { GCP_STACK_KNOB_DEFAULTS, PulumiUpDeclinedError, pulumiUpGcp } from "./gcp-pulumi.js";
|
|
170
161
|
|
|
171
162
|
export interface GcpWizardOpts {
|
|
172
163
|
installId: string;
|
|
@@ -349,6 +340,8 @@ export interface GcpConvergeOpts {
|
|
|
349
340
|
readonly setupLink: "print" | "secret";
|
|
350
341
|
/** Called as each step starts — the install job records it in the bucket. */
|
|
351
342
|
readonly onPhase?: (phase: string, detail?: string) => void;
|
|
343
|
+
/** Called with DNS records the stack's outputs don't carry (the staging host's, #822). */
|
|
344
|
+
readonly onDnsRecords?: (records: InstallDnsRecord[]) => void;
|
|
352
345
|
}
|
|
353
346
|
|
|
354
347
|
/**
|
|
@@ -578,6 +571,7 @@ export async function runGcpConverge(opts: GcpConvergeOpts): Promise<void> {
|
|
|
578
571
|
domain,
|
|
579
572
|
installStagingHost(meta),
|
|
580
573
|
imageDigests,
|
|
574
|
+
opts.onDnsRecords ?? (() => {}),
|
|
581
575
|
);
|
|
582
576
|
|
|
583
577
|
// === 11.3. The quality-audit job: parallel Lighthouse runs (#875) ===
|
|
@@ -1610,6 +1604,7 @@ async function stepStagingGateway(
|
|
|
1610
1604
|
domain: string,
|
|
1611
1605
|
stagingHost: string,
|
|
1612
1606
|
imageDigests: ImageDigests,
|
|
1607
|
+
onDnsRecords: (records: InstallDnsRecord[]) => void,
|
|
1613
1608
|
): Promise<boolean> {
|
|
1614
1609
|
const s = spinner();
|
|
1615
1610
|
s.start(`Setting up the staging gateway behind the staging gate (${stagingHost})...`);
|
|
@@ -1634,6 +1629,14 @@ async function stepStagingGateway(
|
|
|
1634
1629
|
if (edge.dnsRecords.length > 0) {
|
|
1635
1630
|
log.info(` DNS for ${stagingHost} (Settings → Updates shows the same):`);
|
|
1636
1631
|
for (const d of edge.dnsRecords) log.info(` ${d.name} ${d.type} ${d.value}`);
|
|
1632
|
+
onDnsRecords(
|
|
1633
|
+
edge.dnsRecords.map((d) => ({
|
|
1634
|
+
hostname: d.name,
|
|
1635
|
+
type: d.type,
|
|
1636
|
+
value: d.value,
|
|
1637
|
+
purpose: `Protected staging site (${stagingHost})`,
|
|
1638
|
+
})),
|
|
1639
|
+
);
|
|
1637
1640
|
}
|
|
1638
1641
|
return true;
|
|
1639
1642
|
}
|
|
@@ -2452,32 +2455,6 @@ async function stepUploadStaticPlaceholder(
|
|
|
2452
2455
|
markStepDone(installId, stepName, { bucket: bucketName });
|
|
2453
2456
|
}
|
|
2454
2457
|
|
|
2455
|
-
/**
|
|
2456
|
-
* The Owner setup link from the install's stack (`bootstrapUrlOut`). A
|
|
2457
|
-
* secret: read here, at the moment it is shown, never checkpointed (#656).
|
|
2458
|
-
* Fails loudly when the stack can't be read: the run's last step, so a
|
|
2459
|
-
* re-run picks it up.
|
|
2460
|
-
*/
|
|
2461
|
-
async function readBootstrapUrl(installId: string, provider: string): Promise<string> {
|
|
2462
|
-
const meta = readMetadata(installId);
|
|
2463
|
-
if (!meta) throw new Error(`No install.json for install '${installId}'.`);
|
|
2464
|
-
const value = await readStackOutput({
|
|
2465
|
-
installRoot: installRoot(installId),
|
|
2466
|
-
backend: resolveBackend(meta, {
|
|
2467
|
-
installRoot: installRoot(installId),
|
|
2468
|
-
readPassphrase: () => readSecret(installId, "pulumi-passphrase"),
|
|
2469
|
-
}),
|
|
2470
|
-
provider: provider === "gcp-firebase" ? "gcp-firebase" : "gcp",
|
|
2471
|
-
name: "bootstrapUrlOut",
|
|
2472
|
-
});
|
|
2473
|
-
if (typeof value !== "string" || value === "") {
|
|
2474
|
-
throw new Error(
|
|
2475
|
-
"The stack has no bootstrapUrlOut output. Re-run the installer to refresh the stack.",
|
|
2476
|
-
);
|
|
2477
|
-
}
|
|
2478
|
-
return value;
|
|
2479
|
-
}
|
|
2480
|
-
|
|
2481
2458
|
/** The install's Pulumi outputs, as the `pulumi-up` step recorded them. */
|
|
2482
2459
|
async function recordedStackOutputs(
|
|
2483
2460
|
installId: string,
|
|
@@ -2566,37 +2543,31 @@ async function stepFinalize(installId: string, setupLink: "print" | "secret"): P
|
|
|
2566
2543
|
|
|
2567
2544
|
// v0.3.15 — On gcp-firebase, the admin DomainMapping is opt-in
|
|
2568
2545
|
// (`provisionAdminDomain=true` after Search Console verification);
|
|
2569
|
-
// without it, `admin.<domain>` doesn't resolve and the
|
|
2570
|
-
//
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
bootstrapUrl,
|
|
2590
|
-
);
|
|
2591
|
-
if (!stored.ok) {
|
|
2592
|
-
cancel(`Could not store the Owner setup link: ${stored.error}`);
|
|
2593
|
-
process.exit(1);
|
|
2594
|
-
}
|
|
2546
|
+
// without it, `admin.<domain>` doesn't resolve and the setup link must
|
|
2547
|
+
// point at the Cloud Run-generated *.run.app URL.
|
|
2548
|
+
const adminBase = provider === "gcp-firebase" ? adminCloudRunUrl : `https://${adminDomainOut}`;
|
|
2549
|
+
if (adminBase === "") {
|
|
2550
|
+
cancel("The stack reported no admin URL. Re-run the installer to refresh its outputs.");
|
|
2551
|
+
process.exit(1);
|
|
2552
|
+
}
|
|
2553
|
+
if (!meta.region) throw new Error(`install.json of ${installId} records no region.`);
|
|
2554
|
+
// #1476 — the token and its link: minted now so its 24 hours start with
|
|
2555
|
+
// this summary, stored for the admin and for `status --project`. #696 — the
|
|
2556
|
+
// install job's output lands in Cloud Logging, so the link is printed only
|
|
2557
|
+
// when this runs in the operator's terminal.
|
|
2558
|
+
const issued = await issueOwnerSetup(
|
|
2559
|
+
gcloud,
|
|
2560
|
+
{ projectId: meta.projectId, region: meta.region },
|
|
2561
|
+
adminBase,
|
|
2562
|
+
);
|
|
2563
|
+
if (!issued.ok) {
|
|
2564
|
+
cancel(`Could not store the Owner setup link: ${issued.error}`);
|
|
2565
|
+
process.exit(1);
|
|
2595
2566
|
}
|
|
2596
2567
|
const setupLinkLine =
|
|
2597
2568
|
setupLink === "print"
|
|
2598
|
-
? ` ${cyan(
|
|
2599
|
-
: ` ${dim(`(shown in your Cloud Shell terminal; or
|
|
2569
|
+
? ` ${cyan(issued.link)} ${dim(`(valid until ${issued.expiresAt})`)}`
|
|
2570
|
+
: ` ${dim(`(shown in your Cloud Shell terminal; or, from any terminal: ${selfCommand("status", "--project", meta.projectId)})`)}`;
|
|
2600
2571
|
|
|
2601
2572
|
// Both providers report their records in `dnsRecordsRequiredOut`; the
|
|
2602
2573
|
// summary lists them in two groups so the main-domain records that take a
|
|
@@ -2617,7 +2588,6 @@ async function stepFinalize(installId: string, setupLink: "print" | "secret"): P
|
|
|
2617
2588
|
}
|
|
2618
2589
|
}
|
|
2619
2590
|
|
|
2620
|
-
const adminBase = provider === "gcp-firebase" ? adminCloudRunUrl : `https://${adminDomainOut}`;
|
|
2621
2591
|
const adminNote: string[] =
|
|
2622
2592
|
provider === "gcp-firebase"
|
|
2623
2593
|
? [
|
package/stacks/aws/README.md
CHANGED
|
@@ -39,11 +39,13 @@ ADMIN_DATABASE_URL=$(pulumi stack output adminDatabaseUrlOut --show-secrets) \
|
|
|
39
39
|
bunx cms-provision pulumi-output-sync --environment production
|
|
40
40
|
```
|
|
41
41
|
|
|
42
|
-
The
|
|
42
|
+
The stack outputs the setup address without a token: nothing brings a token to
|
|
43
|
+
the admin on this provider yet, and `/setup` refuses until something does
|
|
44
|
+
(issue #1483).
|
|
43
45
|
|
|
44
46
|
```bash
|
|
45
47
|
pulumi stack output bootstrapUrlOut
|
|
46
|
-
# → https://example.com/setup
|
|
48
|
+
# → https://example.com/setup
|
|
47
49
|
```
|
|
48
50
|
|
|
49
51
|
Open that URL once CloudFront has issued the ACM cert (~10 minutes after DNS records propagate).
|
package/stacks/aws/index.ts
CHANGED
|
@@ -43,7 +43,6 @@ import {
|
|
|
43
43
|
type AwsTaskService,
|
|
44
44
|
secretsReadPolicy,
|
|
45
45
|
} from "../../dist/aws-task-roles.js";
|
|
46
|
-
import { generateBootstrapToken } from "../../dist/bootstrap-token.js";
|
|
47
46
|
import {
|
|
48
47
|
DEFAULT_ADMIN_MAX_INSTANCES,
|
|
49
48
|
DEFAULT_GATEWAY_MAX_INSTANCES,
|
|
@@ -555,10 +554,7 @@ new aws.iam.RolePolicyAttachment(`${namePrefix}-exec-managed`, {
|
|
|
555
554
|
policyArn: "arn:aws:iam::aws:policy/service-role/AmazonECSTaskExecutionRolePolicy",
|
|
556
555
|
});
|
|
557
556
|
|
|
558
|
-
// === 9.
|
|
559
|
-
const tokenInfo = generateBootstrapToken();
|
|
560
|
-
|
|
561
|
-
// === 10. Outputs (CloudAdapterOutputs shape) ===
|
|
557
|
+
// === 9. Outputs (CloudAdapterOutputs shape) ===
|
|
562
558
|
const dnsRecordsRequired: DnsRecord[] = [
|
|
563
559
|
{
|
|
564
560
|
hostname: domain,
|
|
@@ -582,8 +578,9 @@ const out: CloudAdapterOutputs = {
|
|
|
582
578
|
mediaStorageUrl: pulumi.interpolate`s3://${mediaBucket.bucket}` as unknown as string,
|
|
583
579
|
mediaCdnBaseUrl:
|
|
584
580
|
pulumi.interpolate`https://${distribution.domainName}/media` as unknown as string,
|
|
585
|
-
|
|
586
|
-
|
|
581
|
+
// No token: nothing would bring it to the admin, and /setup refuses until
|
|
582
|
+
// something does (#1483, #1476).
|
|
583
|
+
bootstrapUrl: `https://${domain}/setup`,
|
|
587
584
|
dnsRecordsRequired,
|
|
588
585
|
edgeLogSinkUrl:
|
|
589
586
|
pulumi.interpolate`cloudwatch://us-east-1/${edgeLogGroup.name}` as unknown as string,
|
|
@@ -630,7 +627,6 @@ export const poolBudgetEnvOut = poolBudget.env;
|
|
|
630
627
|
// CSRF/cookie secrets, Anthropic key) are stored in Pulumi's encrypted
|
|
631
628
|
// state via `pulumi.secret(...)`. Operators retrieve via
|
|
632
629
|
// `pulumi stack output --show-secrets`.
|
|
633
|
-
export const bootstrapTokenExpiresAtOut = tokenInfo.expiresAt;
|
|
634
630
|
|
|
635
631
|
/** A KeyValueStore's id: the last segment of its ARN. */
|
|
636
632
|
function kvsIdFromArn(arn: string): string {
|
package/stacks/azure/README.md
CHANGED
|
@@ -45,11 +45,13 @@ CAELO_ADMIN_URL=https://example.com \
|
|
|
45
45
|
bunx cms-provision pulumi-output-sync --environment production
|
|
46
46
|
```
|
|
47
47
|
|
|
48
|
-
The
|
|
48
|
+
The stack outputs the setup address without a token: nothing brings a token to
|
|
49
|
+
the admin on this provider yet, and `/setup` refuses until something does
|
|
50
|
+
(issue #1483).
|
|
49
51
|
|
|
50
52
|
```bash
|
|
51
53
|
pulumi stack output bootstrapUrlOut
|
|
52
|
-
# → https://example.com/setup
|
|
54
|
+
# → https://example.com/setup
|
|
53
55
|
```
|
|
54
56
|
|
|
55
57
|
`dnsRecordsRequiredOut` lists the two records the primary domain needs: a CNAME to the Front Door endpoint (`frontDoorEndpointHostNameOut`) and the `_dnsauth.<domain>` TXT record that validates the domain for Front Door's managed certificate. An apex domain needs a registrar that supports CNAME flattening / ALIAS records, or Azure DNS.
|
package/stacks/azure/index.ts
CHANGED
|
@@ -46,7 +46,6 @@ import {
|
|
|
46
46
|
type AzureDatabaseSecret,
|
|
47
47
|
type AzureSecretReader,
|
|
48
48
|
} from "../../dist/azure-secrets.js";
|
|
49
|
-
import { generateBootstrapToken } from "../../dist/bootstrap-token.js";
|
|
50
49
|
import {
|
|
51
50
|
DEFAULT_MAX_CONNECTIONS,
|
|
52
51
|
DEFAULT_STAGING_GATEWAY_MAX_INSTANCES,
|
|
@@ -681,10 +680,7 @@ const _runnerApp = containerApp({
|
|
|
681
680
|
databaseEnv: adminDatabaseEnv,
|
|
682
681
|
secrets: adminSecretReader,
|
|
683
682
|
});
|
|
684
|
-
// === 7.
|
|
685
|
-
const tokenInfo = generateBootstrapToken();
|
|
686
|
-
|
|
687
|
-
// === 8. CloudAdapterOutputs ===
|
|
683
|
+
// === 7. CloudAdapterOutputs ===
|
|
688
684
|
const dnsRecordsRequired = pulumi
|
|
689
685
|
.all([frontDoorEndpoint.hostName, siteDomain.validationProperties])
|
|
690
686
|
.apply(([endpointHostName, validation]) =>
|
|
@@ -703,8 +699,9 @@ const out: CloudAdapterOutputs = {
|
|
|
703
699
|
mediaStorageUrl:
|
|
704
700
|
pulumi.interpolate`https://${storage.name}.blob.core.windows.net/media` as unknown as string,
|
|
705
701
|
mediaCdnBaseUrl: pulumi.interpolate`https://${domain}/media` as unknown as string,
|
|
706
|
-
|
|
707
|
-
|
|
702
|
+
// No token: nothing would bring it to the admin, and /setup refuses until
|
|
703
|
+
// something does (#1483, #1476).
|
|
704
|
+
bootstrapUrl: `https://${domain}/setup`,
|
|
708
705
|
dnsRecordsRequired: dnsRecordsRequired as unknown as DnsRecord[],
|
|
709
706
|
edgeLogSinkUrl: pulumi.interpolate`loganalytics://${logWorkspace.name}` as unknown as string,
|
|
710
707
|
provider: "azure",
|
|
@@ -725,4 +722,3 @@ export const pgServerFqdnOut = pgServer.fullyQualifiedDomainName;
|
|
|
725
722
|
export const storageAccountNameOut = storage.name;
|
|
726
723
|
export const adminContainerAppFqdnOut = adminApp.configuration.apply((c) => c?.ingress?.fqdn);
|
|
727
724
|
export const frontDoorEndpointHostNameOut = frontDoorEndpoint.hostName;
|
|
728
|
-
export const bootstrapTokenExpiresAtOut = tokenInfo.expiresAt;
|
package/stacks/gcp/README.md
CHANGED
|
@@ -62,11 +62,14 @@ CAELO_INTERNAL_SECRET=$(gcloud secrets versions access latest \
|
|
|
62
62
|
bunx cms-provision pulumi-output-sync --environment production
|
|
63
63
|
```
|
|
64
64
|
|
|
65
|
-
The
|
|
65
|
+
The stack outputs the setup address without a token. The installer mints the
|
|
66
|
+
Owner setup token at the end of the install, stores it in Secret Manager for the
|
|
67
|
+
admin, and prints the link (`src/owner-setup-token.ts`). A plain `pulumi up` has
|
|
68
|
+
no token: `/setup` refuses until there is one. Get the link, or a new one after
|
|
69
|
+
its 24 hours:
|
|
66
70
|
|
|
67
71
|
```bash
|
|
68
|
-
|
|
69
|
-
# → https://example.com/setup?token=<64-hex>
|
|
72
|
+
bunx @caelo-cms/provisioning setup-link --project <gcp-project-id>
|
|
70
73
|
```
|
|
71
74
|
|
|
72
75
|
Open after the domain's and the admin's DNS A records point at the load balancer IP and the managed certificate is active.
|
package/stacks/gcp/index.ts
CHANGED
|
@@ -25,7 +25,6 @@ import * as gcp from "@pulumi/gcp";
|
|
|
25
25
|
import * as pulumi from "@pulumi/pulumi";
|
|
26
26
|
import * as random from "@pulumi/random";
|
|
27
27
|
import type { CloudAdapterOutputs, DnsRecord } from "../../dist/adapter.js";
|
|
28
|
-
import { generateBootstrapToken } from "../../dist/bootstrap-token.js";
|
|
29
28
|
import { gatewayArmorRuleArgs } from "../../dist/gateway-edge.js";
|
|
30
29
|
import {
|
|
31
30
|
gatewayServiceAccountId,
|
|
@@ -1052,7 +1051,8 @@ const staticBackendBucket = new gcp.compute.BackendBucket(
|
|
|
1052
1051
|
cdnPolicy: { ...STATIC_CDN_POLICY },
|
|
1053
1052
|
customResponseHeaders: [...GCP_STATIC_RESPONSE_HEADERS],
|
|
1054
1053
|
},
|
|
1055
|
-
|
|
1054
|
+
// #1454 — Publish live adds the live build's page headers to the list.
|
|
1055
|
+
{ ...opts, ignoreChanges: ["customResponseHeaders"] },
|
|
1056
1056
|
);
|
|
1057
1057
|
|
|
1058
1058
|
// Tier 3 backend — gateway Cloud Run via serverless NEG
|
|
@@ -1398,11 +1398,9 @@ new gcp.bigquery.DatasetIamMember(
|
|
|
1398
1398
|
);
|
|
1399
1399
|
|
|
1400
1400
|
// =========================================================================
|
|
1401
|
-
//
|
|
1401
|
+
// Outputs
|
|
1402
1402
|
// =========================================================================
|
|
1403
1403
|
|
|
1404
|
-
const tokenInfo = generateBootstrapToken();
|
|
1405
|
-
|
|
1406
1404
|
const dnsRecordsRequired: pulumi.Output<DnsRecord[]> = lbIp.address.apply((ip): DnsRecord[] => [
|
|
1407
1405
|
{
|
|
1408
1406
|
hostname: domain,
|
|
@@ -1425,8 +1423,10 @@ const out: CloudAdapterOutputs = {
|
|
|
1425
1423
|
publicStagingDatabaseUrl: dbUrls.publicStaging as unknown as string,
|
|
1426
1424
|
mediaStorageUrl: pulumi.interpolate`gs://${mediaBucket.name}` as unknown as string,
|
|
1427
1425
|
mediaCdnBaseUrl: pulumi.interpolate`https://${domain}/media` as unknown as string,
|
|
1428
|
-
|
|
1429
|
-
|
|
1426
|
+
// No token: the installer mints it at the end of the install and adds it to
|
|
1427
|
+
// the link (src/owner-setup-token.ts, #1476). Minted here, it would change
|
|
1428
|
+
// on every `pulumi up` and sit in the stack's state.
|
|
1429
|
+
bootstrapUrl: `https://${adminDomain}/setup`,
|
|
1430
1430
|
dnsRecordsRequired: dnsRecordsRequired as unknown as DnsRecord[],
|
|
1431
1431
|
edgeLogSinkUrl:
|
|
1432
1432
|
pulumi.interpolate`bigquery://${project}/${edgeLogDataset.datasetId}` as unknown as string,
|
|
@@ -1450,7 +1450,6 @@ export const adminCloudRunUrlOut = adminSvc.uri;
|
|
|
1450
1450
|
export const gatewayCloudRunUrlOut = gatewaySvc?.uri;
|
|
1451
1451
|
export const lbIpOut = lbIp.address;
|
|
1452
1452
|
export const adminDomainOut = adminDomain;
|
|
1453
|
-
export const bootstrapTokenExpiresAtOut = tokenInfo.expiresAt;
|
|
1454
1453
|
export const staticPublisherSaEmailOut = staticPublisherSa.email;
|
|
1455
1454
|
export const staticBucketNameOut = staticBucket.name;
|
|
1456
1455
|
// P15 self-hosted CDN-copy adapter ABI — kept for cross-stack compat.
|
|
@@ -42,7 +42,6 @@ import * as gcp from "@pulumi/gcp";
|
|
|
42
42
|
import * as pulumi from "@pulumi/pulumi";
|
|
43
43
|
import * as random from "@pulumi/random";
|
|
44
44
|
import type { CloudAdapterOutputs, DnsRecord } from "../../dist/adapter.js";
|
|
45
|
-
import { generateBootstrapToken } from "../../dist/bootstrap-token.js";
|
|
46
45
|
import {
|
|
47
46
|
firebaseStagingSiteId,
|
|
48
47
|
gatewayServiceAccountId,
|
|
@@ -1312,8 +1311,6 @@ const dnsRecords: pulumi.Output<DnsRecord[]> = pulumi
|
|
|
1312
1311
|
return out;
|
|
1313
1312
|
});
|
|
1314
1313
|
|
|
1315
|
-
const tokenInfo = generateBootstrapToken();
|
|
1316
|
-
|
|
1317
1314
|
// Cast pulumi.Output<string> values to plain `string` to satisfy the
|
|
1318
1315
|
// shared CloudAdapterOutputs shape. Pulumi serialises Outputs to
|
|
1319
1316
|
// plain strings in stack outputs at runtime; the cast bridges the
|
|
@@ -1327,8 +1324,10 @@ const out: CloudAdapterOutputs = {
|
|
|
1327
1324
|
// Firebase Hosting serves media via its own CDN; we proxy through
|
|
1328
1325
|
// the Firebase site's apex domain for canonical URLs.
|
|
1329
1326
|
mediaCdnBaseUrl: `https://${domain}/media` as unknown as string,
|
|
1330
|
-
|
|
1331
|
-
|
|
1327
|
+
// No token: the installer mints it at the end of the install and adds it to
|
|
1328
|
+
// the link (src/owner-setup-token.ts, #1476). Minted here, it would change
|
|
1329
|
+
// on every `pulumi up` and sit in the stack's state.
|
|
1330
|
+
bootstrapUrl: `https://${adminDomain}/setup`,
|
|
1332
1331
|
dnsRecordsRequired: dnsRecords as unknown as DnsRecord[],
|
|
1333
1332
|
// #1339 — no BigQuery export here (that dataset was never created):
|
|
1334
1333
|
// the services' request logs stay in Cloud Logging, the cross-cutting
|
|
@@ -1353,4 +1352,3 @@ export const gatewayCloudRunUrlOut = gatewaySvc?.uri;
|
|
|
1353
1352
|
export const mcpAuthProxyCloudRunUrlOut = mcpAuthProxySvc.uri;
|
|
1354
1353
|
export const adminDomainOut = adminDomain;
|
|
1355
1354
|
export const firebaseSiteIdOut = firebaseSiteId;
|
|
1356
|
-
export const bootstrapTokenExpiresAtOut = tokenInfo.expiresAt;
|