| 10 | 10 | | // which keeps repositories in the git store (gitstore/server.mjs); |
| 11 | 11 | | // - EMAIL (Email Sending) becomes a service binding to workers/mail; |
| 12 | 12 | | // - the packages service keeps files in S3-compatible storage (MinIO) |
| 13 | | − | // instead of R2; |
| 13 | + | // instead of R2, and the repos service its nightly backups (a bucket of |
| 14 | + | // their own, BACKUP_S3_BUCKET); |
| 14 | 15 | | // - services that are off in this phase (agents, the context hub, the |
| 15 | 16 | | // g1t.page dispatcher, model proxy) are bound to workers/off instead, and |
| 16 | 17 | | // events stop queueing work for them; |
| ⋯ |
| 19 | 20 | | // Usage: node configs.mjs [outDir] |
| 20 | 21 | | // Environment: PUBLIC_URL, GITSTORE_URL, GITSTORE_SECRET, MAIL_URL, |
| 21 | 22 | | // ACTIONS_KEY, INTEGRATIONS_KEY, WEBHOOKS_KEY, IDENTITY_KEY, |
| 22 | | − | // PACKAGES_TOKEN_SECRET, S3_ENDPOINT, S3_BUCKET, S3_REGION, |
| 23 | + | // PACKAGES_TOKEN_SECRET, S3_ENDPOINT, S3_BUCKET, BACKUP_S3_BUCKET, S3_REGION, |
| 23 | 24 | | // S3_ACCESS_KEY_ID, S3_SECRET_ACCESS_KEY, S3_PUBLIC_ENDPOINT, and optionally |
| 24 | 25 | | // your own GitHub App: GITHUB_APP_ID, GITHUB_APP_SLUG, GITHUB_APP_CLIENT_ID, |
| 25 | 26 | | // GITHUB_APP_CLIENT_SECRET, GITHUB_APP_PRIVATE_KEY, GITHUB_APP_WEBHOOK_SECRET. |
| ⋯ |
| 216 | 217 | | delete config.vars.R2_ACCOUNT_ID; |
| 217 | 218 | | delete config.vars.R2_BUCKET; |
| 218 | 219 | | } |
| 220 | + | // Nightly backups' bundles go to a bucket of their own on the same |
| 221 | + | // S3-compatible store, instead of the BACKUPS R2 bucket. |
| 222 | + | if (hosted.name === "g1t-repos") { |
| 223 | + | Object.assign(config.vars, { |
| 224 | + | BACKUP_STORE: "s3", |
| 225 | + | BACKUP_S3_BUCKET: process.env.BACKUP_S3_BUCKET ?? "g1t-backups", |
| 226 | + | S3_ENDPOINT: process.env.S3_ENDPOINT ?? "http://minio:9000", |
| 227 | + | S3_REGION: process.env.S3_REGION ?? "us-east-1", |
| 228 | + | S3_ACCESS_KEY_ID: process.env.S3_ACCESS_KEY_ID ?? "", |
| 229 | + | S3_SECRET_ACCESS_KEY: process.env.S3_SECRET_ACCESS_KEY ?? "", |
| 230 | + | }); |
| 231 | + | } |
| 219 | 232 | | // Nothing to deploy to: deployments are off (no Cloudflare API token). |
| 220 | 233 | | if (hosted.name === "g1t-deployments") delete config.vars.CUSTOM_HOSTNAMES_ZONE_ID; |
| 221 | 234 | | |