@caelo-cms/provisioning 0.10.29 → 0.10.31

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 (99) hide show
  1. package/dist/admin-domain.d.ts +54 -0
  2. package/dist/admin-domain.d.ts.map +1 -0
  3. package/dist/admin-domain.js +122 -0
  4. package/dist/admin-domain.js.map +1 -0
  5. package/dist/cli.js +71 -7
  6. package/dist/cli.js.map +1 -1
  7. package/dist/compose.d.ts +7 -9
  8. package/dist/compose.d.ts.map +1 -1
  9. package/dist/compose.js +17 -1
  10. package/dist/compose.js.map +1 -1
  11. package/dist/deployed-release.d.ts +84 -0
  12. package/dist/deployed-release.d.ts.map +1 -0
  13. package/dist/deployed-release.js +182 -0
  14. package/dist/deployed-release.js.map +1 -0
  15. package/dist/gcloud-retry.d.ts +16 -0
  16. package/dist/gcloud-retry.d.ts.map +1 -0
  17. package/dist/gcloud-retry.js +17 -0
  18. package/dist/gcloud-retry.js.map +1 -0
  19. package/dist/gcloud.d.ts.map +1 -1
  20. package/dist/gcloud.js +2 -0
  21. package/dist/gcloud.js.map +1 -1
  22. package/dist/gcp-names.d.ts +58 -0
  23. package/dist/gcp-names.d.ts.map +1 -0
  24. package/dist/gcp-names.js +88 -0
  25. package/dist/gcp-names.js.map +1 -0
  26. package/dist/install-state.d.ts +31 -0
  27. package/dist/install-state.d.ts.map +1 -1
  28. package/dist/install-state.js +38 -0
  29. package/dist/install-state.js.map +1 -1
  30. package/dist/lifecycle.d.ts +5 -0
  31. package/dist/lifecycle.d.ts.map +1 -1
  32. package/dist/lifecycle.js +340 -50
  33. package/dist/lifecycle.js.map +1 -1
  34. package/dist/mcp-iap.d.ts +5 -26
  35. package/dist/mcp-iap.d.ts.map +1 -1
  36. package/dist/mcp-iap.js +6 -18
  37. package/dist/mcp-iap.js.map +1 -1
  38. package/dist/migration-runner.d.ts +25 -0
  39. package/dist/migration-runner.d.ts.map +1 -1
  40. package/dist/migration-runner.js +60 -19
  41. package/dist/migration-runner.js.map +1 -1
  42. package/dist/operator-access.d.ts +83 -0
  43. package/dist/operator-access.d.ts.map +1 -0
  44. package/dist/operator-access.js +562 -0
  45. package/dist/operator-access.js.map +1 -0
  46. package/dist/region-data.d.ts +30 -0
  47. package/dist/region-data.d.ts.map +1 -0
  48. package/dist/region-data.js +406 -0
  49. package/dist/region-data.js.map +1 -0
  50. package/dist/regions.d.ts +130 -0
  51. package/dist/regions.d.ts.map +1 -0
  52. package/dist/regions.js +247 -0
  53. package/dist/regions.js.map +1 -0
  54. package/dist/runtime-secrets.d.ts +128 -0
  55. package/dist/runtime-secrets.d.ts.map +1 -0
  56. package/dist/runtime-secrets.js +444 -0
  57. package/dist/runtime-secrets.js.map +1 -0
  58. package/dist/stack-contract.d.ts +231 -0
  59. package/dist/stack-contract.d.ts.map +1 -0
  60. package/dist/stack-contract.js +455 -0
  61. package/dist/stack-contract.js.map +1 -0
  62. package/dist/stack-converge.d.ts +183 -0
  63. package/dist/stack-converge.d.ts.map +1 -0
  64. package/dist/stack-converge.js +513 -0
  65. package/dist/stack-converge.js.map +1 -0
  66. package/dist/wizard.d.ts +7 -0
  67. package/dist/wizard.d.ts.map +1 -1
  68. package/dist/wizard.js +11 -1
  69. package/dist/wizard.js.map +1 -1
  70. package/dist/wizards/gcp-cost.d.ts +10 -10
  71. package/dist/wizards/gcp-cost.d.ts.map +1 -1
  72. package/dist/wizards/gcp-cost.js +40 -3
  73. package/dist/wizards/gcp-cost.js.map +1 -1
  74. package/dist/wizards/gcp-firebase.d.ts +2 -0
  75. package/dist/wizards/gcp-firebase.d.ts.map +1 -1
  76. package/dist/wizards/gcp-firebase.js +1 -0
  77. package/dist/wizards/gcp-firebase.js.map +1 -1
  78. package/dist/wizards/gcp-pulumi.d.ts +51 -1
  79. package/dist/wizards/gcp-pulumi.d.ts.map +1 -1
  80. package/dist/wizards/gcp-pulumi.js +89 -6
  81. package/dist/wizards/gcp-pulumi.js.map +1 -1
  82. package/dist/wizards/gcp.d.ts +2 -0
  83. package/dist/wizards/gcp.d.ts.map +1 -1
  84. package/dist/wizards/gcp.js +171 -23
  85. package/dist/wizards/gcp.js.map +1 -1
  86. package/package.json +3 -3
  87. package/stacks/aws/Pulumi.yaml +5 -2
  88. package/stacks/aws/README.md +3 -1
  89. package/stacks/aws/index.ts +21 -1
  90. package/stacks/azure/Pulumi.yaml +6 -3
  91. package/stacks/azure/README.md +1 -1
  92. package/stacks/azure/index.ts +22 -3
  93. package/stacks/gcp/Pulumi.yaml +5 -5
  94. package/stacks/gcp/README.md +15 -3
  95. package/stacks/gcp/index.ts +204 -141
  96. package/stacks/gcp-firebase/Pulumi.yaml +5 -2
  97. package/stacks/gcp-firebase/index.ts +169 -76
  98. package/stacks/self-hosted/Pulumi.yaml +4 -0
  99. package/stacks/self-hosted/index.ts +3 -0
@@ -26,7 +26,7 @@
26
26
  *
27
27
  * Constraints worth knowing:
28
28
  * - Container Apps not in every region; the stack errors loudly at
29
- * preview if `location` is unsupported.
29
+ * preview if the `region` is unsupported.
30
30
  * - Front Door cert auto-management requires the apex domain to point
31
31
  * at Front Door; if the operator manages DNS elsewhere they must
32
32
  * publish the CNAME validation TXT record themselves.
@@ -40,14 +40,30 @@ import * as azure from "@pulumi/azure-native";
40
40
  import * as pulumi from "@pulumi/pulumi";
41
41
  import type { CloudAdapterOutputs, DnsRecord } from "../../dist/adapter.js";
42
42
  import { generateBootstrapToken } from "../../dist/bootstrap-token.js";
43
+ import { ADMIN_MEMORY_DEFAULT, azureContainerAppResources } from "../../dist/stack-contract.js";
43
44
 
44
45
  const cfg = new pulumi.Config();
45
46
  const domain = cfg.require("domain");
46
47
  const _ownerEmail = cfg.require("ownerEmail");
47
48
  const subscription = cfg.require("subscription");
48
49
  const rgName = cfg.get("resourceGroup") ?? "caelo-rg";
49
- const location = cfg.get("location") ?? "westeurope";
50
+ // #607 — the region the operator chose (same key as every adapter, §11.B);
51
+ // no default, so a stack run without it fails instead of picking one.
52
+ // A stack configured with the pre-#607 key is told how to move, not
53
+ // silently mapped (no fallbacks pre-1.0).
54
+ const legacyLocation = cfg.get("location");
55
+ if (legacyLocation !== undefined) {
56
+ throw new Error(
57
+ `caelo-azure:location was renamed to caelo-azure:region. Run \`pulumi config set caelo-azure:region ${legacyLocation}\` and \`pulumi config rm caelo-azure:location\`, then re-run (keep the same value: the region is fixed after install).`,
58
+ );
59
+ }
60
+ const location = cfg.require("region");
50
61
  const flexibleServerSku = cfg.get("flexibleServerSku") ?? "Standard_B2s";
62
+ // #553 — the admin runs the Lighthouse quality audit; same knob + default
63
+ // as every adapter (stack-contract.ts). Container Apps only accepts fixed
64
+ // CPU/memory pairs (2 GiB per vCPU), so the admin's CPU follows its memory
65
+ // and an unsupported size is refused here.
66
+ const adminResources = azureContainerAppResources(cfg.get("adminMemory") ?? ADMIN_MEMORY_DEFAULT);
51
67
 
52
68
  const env = pulumi.getStack() as "dev" | "staging" | "production";
53
69
  const namePrefix = `caelo${env}`; // Azure resource names disallow hyphens in some types.
@@ -200,6 +216,8 @@ const cappEnv = new azure.app.ManagedEnvironment(`${namePrefix}-capp-env`, {
200
216
  interface ContainerAppArgs {
201
217
  readonly serviceName: string;
202
218
  readonly extraEnv?: ReadonlyArray<{ name: string; value: pulumi.Input<string> }>;
219
+ /** Defaults to 0.5 vCPU / 1 GiB. */
220
+ readonly resources?: { readonly cpu: number; readonly memory: string };
203
221
  }
204
222
 
205
223
  function containerApp(args: ContainerAppArgs): azure.app.ContainerApp {
@@ -236,7 +254,7 @@ function containerApp(args: ContainerAppArgs): azure.app.ContainerApp {
236
254
  },
237
255
  ...(args.extraEnv ?? []),
238
256
  ],
239
- resources: { cpu: 0.5, memory: "1.0Gi" },
257
+ resources: args.resources ?? { cpu: 0.5, memory: "1.0Gi" },
240
258
  },
241
259
  ],
242
260
  },
@@ -245,6 +263,7 @@ function containerApp(args: ContainerAppArgs): azure.app.ContainerApp {
245
263
 
246
264
  const adminApp = containerApp({
247
265
  serviceName: "admin",
266
+ resources: adminResources,
248
267
  // #551 — the public site URL; the admin seeds site_defaults.site_base_url
249
268
  // from it (canonical, og:url, sitemap) when it is not configured yet.
250
269
  extraEnv: [{ name: "CAELO_SITE_URL", value: `https://${domain}` }],
@@ -32,8 +32,7 @@ config:
32
32
  # The 8 cross-provider knobs (CLAUDE.md §11.B)
33
33
  caelo-gcp:region:
34
34
  type: string
35
- default: us-central1
36
- description: Primary GCP region (Cloud SQL, Cloud Run, GCS).
35
+ description: Primary GCP region (Cloud SQL, Cloud Run, GCS). Required, no default; chosen in the wizard and fixed after install (#607).
37
36
  caelo-gcp:cloudSqlTier:
38
37
  type: string
39
38
  default: db-f1-micro
@@ -50,6 +49,10 @@ config:
50
49
  type: string
51
50
  default: "0"
52
51
  description: Admin Cloud Run min instances. 0 = scale to zero. 1 = no cold start (+~$15/mo).
52
+ caelo-gcp:adminMemory:
53
+ type: string
54
+ default: "2Gi"
55
+ description: Admin Cloud Run memory. 2Gi leaves room for the Lighthouse quality audit next to editor requests; billed only while an instance runs.
53
56
  caelo-gcp:adminMaxInstances:
54
57
  type: string
55
58
  default: "5"
@@ -87,8 +90,5 @@ config:
87
90
  default: false
88
91
  description: Block `pulumi destroy` on Cloud SQL + Cloud Run. Defaults off for operator-friendly teardown; flip true for production deploys you never want to accidentally destroy.
89
92
  # Optional config NOT declared above:
90
- # caelo-gcp:resendApiKey (secret) — Resend API key for newsletter / auth
91
- # plugin email transport. Set via `cat key | pulumi config set --secret`.
92
- # Omit to ship without email transport (plugins log to stderr until wired).
93
93
  # caelo-gcp:image-admin / image-gateway — image tags for Cloud Run services.
94
94
  # Default `<region>-docker.pkg.dev/<project>/caelo/<service>:latest`.
@@ -11,7 +11,7 @@ Pulumi stack provisioning Caelo on GCP managed services. Implements the shared `
11
11
  | CDN | Cloud CDN backend bucket (operator wires the URL map + load balancer for v1; full LB in P15 review-pass) |
12
12
  | Edge compute (A/B + redirects) | Cloud Run service `<env>-edge-router` running `edge-handler.ts` with `@caelo-cms/edge-router` |
13
13
  | Container runtime | Four Cloud Run services (admin / gateway / orchestrator / runner) |
14
- | Secret store | Secret Manager (postgres-password, csrf-secret, cookie-secret, anthropic-api-key, resend-api-key) |
14
+ | Secret store | Secret Manager: postgres-password + secret-kek (Pulumi), internal-secret + tool-approval-secret (created by the CLI before `pulumi up`, see `src/runtime-secrets.ts`). Cloud Run reads each as a `secretKeyRef`; database URLs carry no password. |
15
15
  | Edge-log sink | Cloud Logging project sink → BigQuery dataset `<env>_edge_logs` (queryable by P12A analytics plugin) |
16
16
 
17
17
  The Caelo runtime never knows it's on GCP — every Cloud Run service consumes plain `DATABASE_URL` / `MEDIA_STORAGE_URL` / `SECRETS_PROVIDER` env vars.
@@ -24,7 +24,8 @@ pulumi stack init prod
24
24
  pulumi config set caelo-gcp:domain example.com
25
25
  pulumi config set caelo-gcp:ownerEmail me@example.com
26
26
  pulumi config set caelo-gcp:project my-gcp-project
27
- pulumi config set caelo-gcp:region us-central1
27
+ # Required (#607): no default, fixed after install.
28
+ pulumi config set caelo-gcp:region europe-west1
28
29
 
29
30
  # Optional: scale up beyond the safe-by-default ceiling. The defaults
30
31
  # size for a small editorial install (admin maxScale 5 × Bun SQL pool
@@ -37,12 +38,23 @@ gcloud auth configure-docker us-central1-docker.pkg.dev
37
38
  gcloud builds submit ... --tag us-central1-docker.pkg.dev/$PROJECT/caelo/admin:latest
38
39
  # Repeat for gateway, orchestrator, runner, edge-router.
39
40
 
41
+ # The stack references two secrets it does not create (the CLI wizard and
42
+ # `upgrade` create them; a direct `pulumi up` needs them first). Values go
43
+ # on stdin, never argv. Match --replication-policy to the stack's
44
+ # secretReplication config (`automatic` or `user-managed --locations=<region>`).
45
+ for s in internal-secret tool-approval-secret; do
46
+ openssl rand -hex 32 | tr -d '\n' | gcloud secrets create "caelo-production-$s" \
47
+ --project=$PROJECT --replication-policy=automatic --data-file=-
48
+ done
49
+
40
50
  # Bring the stack up.
41
51
  pulumi up
42
52
 
43
53
  # Sync outputs into cms_admin.provisioning_outputs so the admin's
44
54
  # /security/dns page surfaces the required DNS records.
45
- ADMIN_DATABASE_URL=$(pulumi stack output adminDatabaseUrlOut --show-secrets) \
55
+ CAELO_INTERNAL_SECRET=$(gcloud secrets versions access latest \
56
+ --secret=caelo-production-internal-secret --project=$PROJECT) \
57
+ CAELO_ADMIN_URL=https://admin.example.com \
46
58
  bunx cms-provision pulumi-output-sync --environment production
47
59
  ```
48
60