@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.
- package/dist/admin-domain.d.ts +54 -0
- package/dist/admin-domain.d.ts.map +1 -0
- package/dist/admin-domain.js +122 -0
- package/dist/admin-domain.js.map +1 -0
- package/dist/cli.js +71 -7
- package/dist/cli.js.map +1 -1
- package/dist/compose.d.ts +7 -9
- package/dist/compose.d.ts.map +1 -1
- package/dist/compose.js +17 -1
- package/dist/compose.js.map +1 -1
- package/dist/deployed-release.d.ts +84 -0
- package/dist/deployed-release.d.ts.map +1 -0
- package/dist/deployed-release.js +182 -0
- package/dist/deployed-release.js.map +1 -0
- package/dist/gcloud-retry.d.ts +16 -0
- package/dist/gcloud-retry.d.ts.map +1 -0
- package/dist/gcloud-retry.js +17 -0
- package/dist/gcloud-retry.js.map +1 -0
- package/dist/gcloud.d.ts.map +1 -1
- package/dist/gcloud.js +2 -0
- package/dist/gcloud.js.map +1 -1
- package/dist/gcp-names.d.ts +58 -0
- package/dist/gcp-names.d.ts.map +1 -0
- package/dist/gcp-names.js +88 -0
- package/dist/gcp-names.js.map +1 -0
- package/dist/install-state.d.ts +31 -0
- package/dist/install-state.d.ts.map +1 -1
- package/dist/install-state.js +38 -0
- package/dist/install-state.js.map +1 -1
- package/dist/lifecycle.d.ts +5 -0
- package/dist/lifecycle.d.ts.map +1 -1
- package/dist/lifecycle.js +340 -50
- package/dist/lifecycle.js.map +1 -1
- package/dist/mcp-iap.d.ts +5 -26
- package/dist/mcp-iap.d.ts.map +1 -1
- package/dist/mcp-iap.js +6 -18
- package/dist/mcp-iap.js.map +1 -1
- package/dist/migration-runner.d.ts +25 -0
- package/dist/migration-runner.d.ts.map +1 -1
- package/dist/migration-runner.js +60 -19
- package/dist/migration-runner.js.map +1 -1
- package/dist/operator-access.d.ts +83 -0
- package/dist/operator-access.d.ts.map +1 -0
- package/dist/operator-access.js +562 -0
- package/dist/operator-access.js.map +1 -0
- package/dist/region-data.d.ts +30 -0
- package/dist/region-data.d.ts.map +1 -0
- package/dist/region-data.js +406 -0
- package/dist/region-data.js.map +1 -0
- package/dist/regions.d.ts +130 -0
- package/dist/regions.d.ts.map +1 -0
- package/dist/regions.js +247 -0
- package/dist/regions.js.map +1 -0
- package/dist/runtime-secrets.d.ts +128 -0
- package/dist/runtime-secrets.d.ts.map +1 -0
- package/dist/runtime-secrets.js +444 -0
- package/dist/runtime-secrets.js.map +1 -0
- package/dist/stack-contract.d.ts +231 -0
- package/dist/stack-contract.d.ts.map +1 -0
- package/dist/stack-contract.js +455 -0
- package/dist/stack-contract.js.map +1 -0
- package/dist/stack-converge.d.ts +183 -0
- package/dist/stack-converge.d.ts.map +1 -0
- package/dist/stack-converge.js +513 -0
- package/dist/stack-converge.js.map +1 -0
- package/dist/wizard.d.ts +7 -0
- package/dist/wizard.d.ts.map +1 -1
- package/dist/wizard.js +11 -1
- package/dist/wizard.js.map +1 -1
- package/dist/wizards/gcp-cost.d.ts +10 -10
- package/dist/wizards/gcp-cost.d.ts.map +1 -1
- package/dist/wizards/gcp-cost.js +40 -3
- package/dist/wizards/gcp-cost.js.map +1 -1
- package/dist/wizards/gcp-firebase.d.ts +2 -0
- package/dist/wizards/gcp-firebase.d.ts.map +1 -1
- package/dist/wizards/gcp-firebase.js +1 -0
- package/dist/wizards/gcp-firebase.js.map +1 -1
- package/dist/wizards/gcp-pulumi.d.ts +51 -1
- package/dist/wizards/gcp-pulumi.d.ts.map +1 -1
- package/dist/wizards/gcp-pulumi.js +89 -6
- package/dist/wizards/gcp-pulumi.js.map +1 -1
- package/dist/wizards/gcp.d.ts +2 -0
- package/dist/wizards/gcp.d.ts.map +1 -1
- package/dist/wizards/gcp.js +171 -23
- package/dist/wizards/gcp.js.map +1 -1
- package/package.json +3 -3
- package/stacks/aws/Pulumi.yaml +5 -2
- package/stacks/aws/README.md +3 -1
- package/stacks/aws/index.ts +21 -1
- package/stacks/azure/Pulumi.yaml +6 -3
- package/stacks/azure/README.md +1 -1
- package/stacks/azure/index.ts +22 -3
- package/stacks/gcp/Pulumi.yaml +5 -5
- package/stacks/gcp/README.md +15 -3
- package/stacks/gcp/index.ts +204 -141
- package/stacks/gcp-firebase/Pulumi.yaml +5 -2
- package/stacks/gcp-firebase/index.ts +169 -76
- package/stacks/self-hosted/Pulumi.yaml +4 -0
- package/stacks/self-hosted/index.ts +3 -0
package/stacks/azure/index.ts
CHANGED
|
@@ -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 `
|
|
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
|
-
|
|
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}` }],
|
package/stacks/gcp/Pulumi.yaml
CHANGED
|
@@ -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
|
-
|
|
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`.
|
package/stacks/gcp/README.md
CHANGED
|
@@ -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
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|