@caelo-cms/provisioning 0.11.21 → 0.12.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.
Files changed (135) hide show
  1. package/dist/adapter.d.ts +6 -1
  2. package/dist/adapter.d.ts.map +1 -1
  3. package/dist/agent-db.js +137 -9
  4. package/dist/bootstrap-token.d.ts +4 -3
  5. package/dist/bootstrap-token.d.ts.map +1 -1
  6. package/dist/bootstrap-token.js.map +1 -1
  7. package/dist/cli-routing.d.ts.map +1 -1
  8. package/dist/cli-routing.js +5 -0
  9. package/dist/cli-routing.js.map +1 -1
  10. package/dist/cli.js +4 -0
  11. package/dist/cli.js.map +1 -1
  12. package/dist/converge-job-gcp.d.ts +1 -16
  13. package/dist/converge-job-gcp.d.ts.map +1 -1
  14. package/dist/converge-job-gcp.js +10 -97
  15. package/dist/converge-job-gcp.js.map +1 -1
  16. package/dist/converge-job.d.ts +7 -46
  17. package/dist/converge-job.d.ts.map +1 -1
  18. package/dist/converge-job.js +22 -57
  19. package/dist/converge-job.js.map +1 -1
  20. package/dist/gateway-armor.d.ts.map +1 -1
  21. package/dist/gateway-armor.js +11 -3
  22. package/dist/gateway-armor.js.map +1 -1
  23. package/dist/gcp-names.d.ts +2 -0
  24. package/dist/gcp-names.d.ts.map +1 -1
  25. package/dist/gcp-names.js +4 -0
  26. package/dist/gcp-names.js.map +1 -1
  27. package/dist/index.d.ts +3 -2
  28. package/dist/index.d.ts.map +1 -1
  29. package/dist/index.js +1 -1
  30. package/dist/index.js.map +1 -1
  31. package/dist/infra-contract.d.ts +1 -1
  32. package/dist/infra-contract.d.ts.map +1 -1
  33. package/dist/infra-contract.js +14 -1
  34. package/dist/infra-contract.js.map +1 -1
  35. package/dist/job-handover-gcp.d.ts +40 -0
  36. package/dist/job-handover-gcp.d.ts.map +1 -0
  37. package/dist/job-handover-gcp.js +108 -0
  38. package/dist/job-handover-gcp.js.map +1 -0
  39. package/dist/job-handover.d.ts +141 -0
  40. package/dist/job-handover.d.ts.map +1 -0
  41. package/dist/job-handover.js +141 -0
  42. package/dist/job-handover.js.map +1 -0
  43. package/dist/owner-setup-token.d.ts +52 -0
  44. package/dist/owner-setup-token.d.ts.map +1 -0
  45. package/dist/owner-setup-token.js +111 -0
  46. package/dist/owner-setup-token.js.map +1 -0
  47. package/dist/project-status.d.ts +33 -0
  48. package/dist/project-status.d.ts.map +1 -1
  49. package/dist/project-status.js +116 -26
  50. package/dist/project-status.js.map +1 -1
  51. package/dist/stack-converge.d.ts.map +1 -1
  52. package/dist/stack-converge.js +9 -5
  53. package/dist/stack-converge.js.map +1 -1
  54. package/dist/static-security-headers.d.ts +6 -0
  55. package/dist/static-security-headers.d.ts.map +1 -1
  56. package/dist/static-security-headers.js +11 -1
  57. package/dist/static-security-headers.js.map +1 -1
  58. package/dist/upgrader-assess.d.ts +30 -3
  59. package/dist/upgrader-assess.d.ts.map +1 -1
  60. package/dist/upgrader-assess.js +77 -24
  61. package/dist/upgrader-assess.js.map +1 -1
  62. package/dist/upgrader-gcp.d.ts +4 -2
  63. package/dist/upgrader-gcp.d.ts.map +1 -1
  64. package/dist/upgrader-gcp.js +16 -3
  65. package/dist/upgrader-gcp.js.map +1 -1
  66. package/dist/upgrader-iam-preflight.d.ts +14 -3
  67. package/dist/upgrader-iam-preflight.d.ts.map +1 -1
  68. package/dist/upgrader-iam-preflight.js +40 -6
  69. package/dist/upgrader-iam-preflight.js.map +1 -1
  70. package/dist/upgrader-job.d.ts +51 -9
  71. package/dist/upgrader-job.d.ts.map +1 -1
  72. package/dist/upgrader-job.js +92 -37
  73. package/dist/upgrader-job.js.map +1 -1
  74. package/dist/upgrader-setup.d.ts +1 -1
  75. package/dist/upgrader-setup.d.ts.map +1 -1
  76. package/dist/upgrader-setup.js +5 -2
  77. package/dist/upgrader-setup.js.map +1 -1
  78. package/dist/wizards/gcp-install-job.d.ts.map +1 -1
  79. package/dist/wizards/gcp-install-job.js +11 -1
  80. package/dist/wizards/gcp-install-job.js.map +1 -1
  81. package/dist/wizards/gcp-pulumi.d.ts +0 -13
  82. package/dist/wizards/gcp-pulumi.d.ts.map +1 -1
  83. package/dist/wizards/gcp-pulumi.js +0 -12
  84. package/dist/wizards/gcp-pulumi.js.map +1 -1
  85. package/dist/wizards/gcp.d.ts.map +1 -1
  86. package/dist/wizards/gcp.js +21 -50
  87. package/dist/wizards/gcp.js.map +1 -1
  88. package/package.json +2 -2
  89. package/src/adapter.ts +6 -1
  90. package/src/bootstrap-token.ts +4 -3
  91. package/src/caddy-redirects.docker.test.ts +5 -0
  92. package/src/cli-routing.test.ts +1 -1
  93. package/src/cli-routing.ts +6 -0
  94. package/src/cli.ts +4 -0
  95. package/src/converge-job-gcp.test.ts +1 -40
  96. package/src/converge-job-gcp.ts +10 -100
  97. package/src/converge-job.test.ts +9 -3
  98. package/src/converge-job.ts +33 -115
  99. package/src/gateway-armor.ts +14 -3
  100. package/src/gateway-edge.test.ts +16 -1
  101. package/src/gcp-names.ts +4 -0
  102. package/src/gcp-url-map.test.ts +2 -0
  103. package/src/index.ts +3 -0
  104. package/src/infra-contract.test.ts +4 -3
  105. package/src/infra-contract.ts +14 -1
  106. package/src/job-handover-gcp.test.ts +129 -0
  107. package/src/job-handover-gcp.ts +135 -0
  108. package/src/job-handover.ts +259 -0
  109. package/src/owner-setup-token.test.ts +195 -0
  110. package/src/owner-setup-token.ts +138 -0
  111. package/src/project-status.test.ts +112 -3
  112. package/src/project-status.ts +141 -17
  113. package/src/stack-converge.ts +12 -5
  114. package/src/static-security-headers.test.ts +16 -0
  115. package/src/static-security-headers.ts +12 -1
  116. package/src/upgrader-assess.test.ts +75 -1
  117. package/src/upgrader-assess.ts +121 -57
  118. package/src/upgrader-gcp.ts +19 -5
  119. package/src/upgrader-iam-preflight.test.ts +28 -1
  120. package/src/upgrader-iam-preflight.ts +46 -6
  121. package/src/upgrader-job.test.ts +365 -31
  122. package/src/upgrader-job.ts +177 -53
  123. package/src/upgrader-setup.test.ts +17 -0
  124. package/src/upgrader-setup.ts +5 -2
  125. package/src/url-map-redirects-access.test.ts +1 -1
  126. package/src/wizards/gcp-install-job.ts +10 -1
  127. package/src/wizards/gcp-pulumi.ts +0 -18
  128. package/src/wizards/gcp.ts +24 -61
  129. package/stacks/aws/README.md +4 -2
  130. package/stacks/aws/index.ts +4 -8
  131. package/stacks/azure/README.md +4 -2
  132. package/stacks/azure/index.ts +4 -8
  133. package/stacks/gcp/README.md +6 -3
  134. package/stacks/gcp/index.ts +7 -8
  135. package/stacks/gcp-firebase/index.ts +4 -6
@@ -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 bootstrap-token URL is a Pulumi output:
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?token=<64-hex>
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.
@@ -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. Bootstrap token ===
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
- bootstrapUrl:
707
- pulumi.interpolate`https://${domain}/setup?token=${tokenInfo.token}` as unknown as string,
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;
@@ -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 bootstrap-token URL is a Pulumi output:
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
- pulumi stack output bootstrapUrlOut
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.
@@ -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
- opts,
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
- // Bootstrap token + outputs
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
- bootstrapUrl:
1429
- pulumi.interpolate`https://${adminDomain}/setup?token=${tokenInfo.token}` as unknown as string,
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
- bootstrapUrl:
1331
- pulumi.interpolate`https://${adminDomain}/setup?token=${tokenInfo.token}` as unknown as string,
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;