g1t/services/repos/wrangler.jsonc

100 lines5,019 bytesCodeBlame
1{
2 "$schema": "../../node_modules/wrangler/config-schema.json",
3 "name": "g1t-repos",
4 "account_id": "1e6f2cffa3f445920836e8ebe446bb58",
5 "compatibility_date": "2026-09-26",
6 // Runs next to its database: a request makes several queries in turn,
7 // and each would otherwise cross the distance to it.
8 "placement": { "mode": "off" },
9 "main": "build/index.js",
10 "build": { "command": "node ../../scripts/build-rust-worker.mjs" },
11 "workers_dev": false,
12 "d1_databases": [
13 {
14 "binding": "DB",
15 "database_name": "g1t-repos",
16 "database_id": "f9544c51-c3bf-4621-a96f-8a6d5cf24a97",
17 "migrations_dir": "migrations"
18 }
19 ],
20 // The git store. Every repository made before sharding is in `g1t`.
21 // More namespaces (src/shards.rs) are more bindings, named in
22 // ARTIFACTS_NAMESPACES below, e.g.
23 // { "binding": "ARTIFACTS_1", "namespace": "g1t-us-1" },
24 // { "binding": "ARTIFACTS_EU", "namespace": "g1t-eu", "jurisdiction": "eu" }
25 // and new repositories go to those named in ARTIFACTS_NEW_REPOS.
26 "artifacts": [{ "binding": "ARTIFACTS", "namespace": "g1t" }],
27 // Shared between isolates (src/shared.rs): the git store's credentials
28 // (src/store.rs) and the ref listings git asks for first
29 // (src/refs_cache.rs), every value sealed with the REPOS_KEY secret (64
30 // hex characters). Without the binding or the secret each isolate keeps
31 // only its own. Made by `npx wrangler kv namespace create g1t-repos-git-cache`:
32 "kv_namespaces": [{ "binding": "GIT_CACHE", "id": "be765052d0124c2a935b3db4dff99f1f" }],
33 "services": [
34 { "binding": "IDENTITY", "service": "g1t-identity" },
35 { "binding": "EVENTS", "service": "g1t-events" },
36 // Push protection asks which secrets were allowed, and records the rest.
37 { "binding": "SECURITY", "service": "g1t-security" },
38 // Whether a workspace far past its free git operations is on the
39 // plan (src/git_ops.rs); asked only then.
40 { "binding": "BILLING", "service": "g1t-billing" }
41 ],
42 // A free workspace past this many git operations in a month is slowed
43 // to this many an hour, never charged (src/git_ops.rs). It is billing's
44 // GIT_OPERATIONS_INCLUDED, the amount free for every workspace: past it,
45 // a workspace on the plan pays at cost plus 20% and is never slowed.
46 // FREE_PRIVATE_STORAGE_BYTES: a free workspace's private repositories may
47 // hold this much (1 GB); past it, pushes to them stop. Billing reads the
48 // same amount.
49 //
50 // The git store (docs/ARTIFACTS.md):
51 // REPO_STORAGE_LIMIT_BYTES: pushes stop before a repository holds this
52 // much; the store holds 1 GB (src/pack_limits.rs).
53 // LARGE_PUSHES: a push too large to scan for secrets (24 MiB) is
54 // "refuse"d, or streamed to the store "unscanned" (src/git_http.rs).
55 // FORK_RETENTION_DAYS: a pull request working copy is removed this long
56 // after its pull request merges or closes (src/forks.rs).
57 // ARTIFACTS_NAMESPACES: JSON, each Artifacts binding and its namespace;
58 // ARTIFACTS_NEW_REPOS: comma-separated namespaces new repositories go
59 // to (empty: g1t); ARTIFACTS_EU_NAMESPACE: for EU residency (src/shards.rs).
60 // ARTIFACTS_REMOTE_BASE (optional): where remotes start,
61 // https://<account>.artifacts.cloudflare.net/git, so a new isolate
62 // needs no info() call before its first credential (src/store.rs).
63 //
64 // Backups (src/backups.rs):
65 // BACKUP_STORE: r2 (the BACKUPS bucket) or s3 (BACKUP_S3_BUCKET on the
66 // installation's S3_ENDPOINT, as self-hosting uses).
67 // BACKUPS_PER_NIGHT: how many repositories one night queues, those
68 // longest since their last backup first.
69 // BACKUP_FULL_EVERY: incremental bundles before a full one again.
70 "vars": {
71 "BACKUP_STORE": "r2",
72 "BACKUPS_PER_NIGHT": "200",
73 "BACKUP_FULL_EVERY": "30",
74 "GIT_OPERATIONS_FREE_CAP": "50000",
75 "GIT_OPERATIONS_FREE_HOURLY": "60",
76 "FREE_PRIVATE_STORAGE_BYTES": "1000000000",
77 "REPO_STORAGE_LIMIT_BYTES": "950000000",
78 "LARGE_PUSHES": "unscanned",
79 "FORK_RETENTION_DAYS": "1",
80 "ARTIFACTS_NAMESPACES": "{\"ARTIFACTS\":\"g1t\"}",
81 "ARTIFACTS_NEW_REPOS": ""
82 },
83 // Every hour, deleted repositories whose 30 days to be restored have
84 // passed are purged, their git data with them (src/lifecycle.rs), and
85 // pull request working copies past FORK_RETENTION_DAYS are removed
86 // (src/forks.rs). At 02:53 UTC, the repositories whose refs moved since
87 // their last backup are queued for one (src/backups.rs, BACKUP_CRON);
88 // the runner's sweep starts them a few at a time.
89 "triggers": { "crons": ["23 * * * *", "53 2 * * *"] },
90 // Nightly backups: a git bundle per repository and a manifest of each
91 // chain (src/backups.rs). Made by
92 // `npx wrangler r2 bucket create g1t-backups`.
93 "r2_buckets": [{ "binding": "BACKUPS", "bucket_name": "g1t-backups" }],
94 // A workspace renamed moves its repositories to the new slug; one
95 // deleted purges the repositories it left in Recently deleted.
96 "queues": {
97 "consumers": [{ "queue": "g1t-events-repos", "max_batch_size": 20, "max_batch_timeout": 1 }]
98 },
99 "observability": { "enabled": true }
100}