Skip to content

Where people and agents ship software together. The open-source git platform for the whole job: issues, agents, checks and deploys to the edge.

Commit

Billing's key is declared for deploys and made on a self-hosted first start

Provider cost reports seal admin keys with BILLING_KEY. The manifest names it, so doctor says when g1t.sh lacks it, and a self-hosted install makes one on its first start as it does the other sealing keys. Part of #157

G1t-Session:
ses_01m57128wre9bvvj1y4z4b8dk0
syntaqxcommitted Parentef0f8b0Browse files
4 files+8−30/4 viewed
+2−1
2020 //
2121 // Usage: node configs.mjs [outDir]
2222 // Environment: PUBLIC_URL, GITSTORE_URL, GITSTORE_SECRET, MAIL_URL,
23−// ACTIONS_KEY, INTEGRATIONS_KEY, WEBHOOKS_KEY, IDENTITY_KEY, USERCONTENT_KEY, REPOS_KEY,
23+// ACTIONS_KEY, INTEGRATIONS_KEY, WEBHOOKS_KEY, IDENTITY_KEY, USERCONTENT_KEY, REPOS_KEY, BILLING_KEY,
2424 // USERCONTENT_URL,
2525 // PACKAGES_TOKEN_SECRET, S3_ENDPOINT, S3_BUCKET, BACKUP_S3_BUCKET, DOCS_S3_BUCKET, S3_REGION,
2626 // S3_ACCESS_KEY_ID, S3_SECRET_ACCESS_KEY, S3_PUBLIC_ENDPOINT, and optionally
8282 "g1t-actions": "ACTIONS_KEY",
8383 "g1t-integrations": "INTEGRATIONS_KEY",
8484 "g1t-webhooks": "WEBHOOKS_KEY",
85+ "g1t-billing": "BILLING_KEY",
8586 };
8687
8788 /**
+4−0
3838 if ! grep -q '^REPOS_KEY=' "$KEYS"; then
3939 echo "REPOS_KEY=$(node -e 'console.log(require("crypto").randomBytes(32).toString("hex"))')" >> "$KEYS"
4040 fi
41+# Billing's key, which seals the admin keys of providers' cost reports.
42+if ! grep -q '^BILLING_KEY=' "$KEYS"; then
43+ echo "BILLING_KEY=$(node -e 'console.log(require("crypto").randomBytes(32).toString("hex"))')" >> "$KEYS"
44+fi
4145 # The packages service's key, which signs registry tokens.
4246 if ! grep -q '^PACKAGES_TOKEN_SECRET=' "$KEYS"; then
4347 echo "PACKAGES_TOKEN_SECRET=$(node -e 'console.log(require("crypto").randomBytes(32).toString("hex"))')" >> "$KEYS"
+1−1
191191 "worker": "g1t-billing",
192192 "d1": { "database": "g1t-billing", "migrations": "migrations" },
193193 "stage": "core",
194− "secrets": ["STRIPE_SECRET_KEY", "STRIPE_WEBHOOK_SECRET", "CLOUDFLARE_USAGE_TOKEN"],
194+ "secrets": ["STRIPE_SECRET_KEY", "STRIPE_WEBHOOK_SECRET", "CLOUDFLARE_USAGE_TOKEN", "BILLING_KEY"],
195195 "self_host": "run"
196196 },
197197 "integrations": {
+1−1
340340
341341 test("a shared crate's change reaches every unit built from it, and no other", () => {
342342 assert.deepEqual(ids(stack.units, ["crates/scan/src/lib.rs"]), ["repos", "work", "security", "runner"]);
343− assert.deepEqual(ids(stack.units, ["crates/secrets/src/lib.rs"]), ["identity", "repos", "integrations", "webhooks", "actions"]);
343+ assert.deepEqual(ids(stack.units, ["crates/secrets/src/lib.rs"]), ["identity", "repos", "billing", "integrations", "webhooks", "actions"]);
344344 const kit = ids(stack.units, ["crates/kit/src/lib.rs"]);
345345 assert.deepEqual(kit, stack.units.filter((u) => u.kind === "rust-worker").map((u) => u.id));
346346 assert.deepEqual(ids(stack.units, ["crates/runner/src/main.rs"]), ["runner"]);

Comments

Sign in to comment.