mirror of
https://github.com/block/buzz.git
synced 2026-08-18 06:50:31 +02:00
## Summary Adds a durable, operator-controlled V1 for deleting an entire Buzz community without deleting another tenant's data. The workflow is exposed through `buzz-admin deletions`: - `sweep` records independent fleet storage-taxonomy observations - `submit`, `list`, `inspect`, and `approve` manage a deletion request - `unblock` resumes a fail-closed request after an operator records remediation identity and reason - `run` and `drain` execute bounded work Requests advance through a PostgreSQL-backed state machine and stop at `retention_pending` after logical deletion has been independently verified across PostgreSQL, object storage, and Redis. This PR ships the engine and CLI, not a continuously running worker or Kubernetes packaging. For V1, a cluster/VM administrator invokes `/usr/local/bin/buzz-admin` from the existing relay image, for example with `kubectl exec` or an equivalent container/VM exec path. ## What whole-community V1 removes For the target community, V1 removes: - rows from the allowlisted community-scoped PostgreSQL catalog, including members, profiles, authored events and bodies, DMs, reactions, mentions, memberships, tokens, workflows, moderation, audit, feedback, and rate-limit state - media sidecars and upload-attribution records under `_meta/<community>/` and `_uploads/<community>/` - Git repository pointers under `repos/<community>/` - Redis keys under `buzz:<community>:*` The community row survives as a permanent tombstone, and deletion control-plane records remain as evidence of the request, approval, execution, and result. ## Safety model Deletion is not a broad `DELETE CASCADE` followed by optimistic cleanup. The destructive boundaries are durable and fail closed. ### 1. Inventory and approval - `submit` resolves the target and freezes the schema plus summary-only storage inventory. - Approval is bound to the exact request, community, and frozen inventory digest. - Unsupported manifest versions, malformed keys inside the target's owned prefixes, live scoped-table/write-fence coverage drift, frozen-inventory mismatch, and approval mismatch block execution rather than guessing. Migration and catalog revision numbers are not authorization gates; the executor validates the live safety shape instead. - Storage inventory is server-side prefix scoped to exactly: - `_meta/<community>/` - `_uploads/<community>/` - `repos/<community>/` - The deletion path never lists the whole shared bucket and has no arbitrary per-community object cap. Its listing work is proportional to the target community's bindings, not total fleet storage. - Fleet-wide taxonomy sweeps remain independent observability. They report unknown writer shapes but do not gate deletion submission, fencing, or destructive progress. Maintainers must add deletion taxonomy coverage whenever a new community-owned object-key class is introduced; writer-coverage tests bind the current media and Git writers to that contract. ### 2. Quiesce, fence, and destructive freeze - Writes continue through submission, inventory, and approval. They stop when execution moves the target into `quiescing` and then establishes the durable fence. - Already-admitted external effects finish under heartbeated serving-write leases; the exact admitted lease may renew while the community is quiescing, but new lease acquisition is rejected. The executor drains admitted leases before destructive work. - Invite minting after quiescing begins fails as typed `AccessDenied` (HTTP 503 at the relay boundary) before an invite can be persisted. - Database triggers enforce the community write fence across the complete catalog of community-scoped tables. Startup/readiness and destructive execution validate that catalog so a newly added but unfenced table cannot silently escape. - **Named isolation assumption — fresh write snapshot.** Every writer transaction that can reach a community-fenced relation must use PostgreSQL `READ COMMITTED`; each guarded write therefore observes a statement snapshot no older than acquisition of the community deletion lock. `REPEATABLE READ` and `SERIALIZABLE` can retain a pre-fence snapshot and are unsupported for writers. The writer pool refuses non-`READ COMMITTED` sessions at connection setup, and both SQL fence functions reject an explicit per-transaction isolation override with SQLSTATE `25000`. Configuration-delivered bad isolation can surface through SQLx as a pool-acquire timeout because every `after_connect` attempt is rejected; the precise `community writes require READ COMMITTED isolation` reason remains observable when the SQL guard is reached. Read-only replica transactions are outside this assumption. - Holding the shared advisory lock until the guarded write executes is a separate liveness condition: under `READ COMMITTED`, releasing it early does not permit resurrection because the trigger rechecks the fence, but it can turn a fleet sweep into a statement-wide SQLSTATE `55000` abort. - After the fence closes writers, storage is re-enumerated into chunked side-table rows. Per-prefix counts and digests bind those concrete keys to the destructive manifest. - Manifest chunk insertion, update, and deletion are protected after freeze. This closes the race where an unbound key could otherwise appear after the manifest was committed. ### 3. Checkpointed destruction - Target-owned object bindings are deleted from the frozen destructive manifest in bounded batches with durable progress. - The concrete key list lives in chunked side-table rows rather than one request-row JSON value. It supports large communities, resumable execution, and terminal cleanup. - Missing objects are accepted as idempotent crash-window outcomes; malformed ownership, changed evidence, and unexplained target-prefix drift fail closed. - PostgreSQL purging remains scoped by `community_id`, including the guarded NIP-RS hard-delete path discovered with real Desktop kind `30078` read-state data. - Redis cleanup explicitly scans and `UNLINK`s only `buzz:<community_id>:*`. Natural expiry is insufficient because some keys, including tunnel generation counters used as fencing state, are deliberately persistent. ### 4. Independent verification - PostgreSQL logical absence is checked after purge. - The three target-owned storage prefixes are freshly inventoried again and must be empty. - Redis requires two complete empty namespace scans. - Only after all three stores pass does the request advance through `logically_verified` to `retention_pending`. ## What V1 deliberately does not erase ### Shared content-addressed storage Per-community deletion removes bindings, metadata, attribution records, and Git pointers. It does **not** physically delete fleet-shared CAS bytes that another community may still reference: - media blobs and thumbnails - Git manifests, packs, and indexes (`manifests/`, `packs/`, and `idx/`) Safe reclamation requires a separate fleet-wide reachability and retention GC. Unknown keys elsewhere in the shared bucket do not block one community's deletion; malformed or unrecognized keys inside that community's three owned prefixes still fail closed. ### External retained copies The online logical-deletion proof does not erase object versions/replicas, database backups/WAL, CDN copies, provider retention copies, or observability exports. Those require their own retention and purge controls. ### Member-only erasure This PR erases a whole community. It does not implement the different operation "erase one npub while preserving the community." Removing membership or accepting NIP-09 is not member erasure. A member-only workflow would need to find and selectively remove or redact authored event content and pubkeys, profile data, DMs, reactions, mentions, memberships/roles, tokens, workflows/subscriptions, upload attribution, moderation/audit history, repository attribution, and identity embedded in tags or JSON. It would also need explicit rules for ownership transfer, surviving replies and thread metadata, audit-chain integrity, immutable Git history, and shared-CAS reachability. That requires a pubkey-level fence and selective graph rewrite; it is a separate deletion product, not a safe extension of this whole-tenant worker. ## In scope - migration `0029_community_deletion.sql`: requests, approvals, leases, manifest chunks, checkpoints, tombstones, and the universal write-fence catalog - durable executor leases, generations, heartbeats, retry/block state, and resumable stage transitions - operator-driven `sweep`, `submit`, `list`, `inspect`, `approve`, `unblock`, `run`, and `drain` commands - serving-path fences for database writes and external effects across event ingest, media, Git, workflow, push, invites, mesh/tunnel, and related paths - target-prefix-only storage inventory, summary manifests, post-fence destructive chunks, and bounded batch deletion - exact community Redis namespace purge and two-pass absence verification - cross-community isolation, crash/resume, manifest-integrity, writer-taxonomy, and schema/migration regressions - desired-state `schema/schema.sql` support without requiring a SQLx migration ledger ## Deferred / not covered - dedicated Helm/chart worker Deployment, service account, secrets, probes, resources, and network policy - autonomous `buzz-admin deletions worker` poll loop and worker-only health server - least-privilege separation among migration, relay-serving, and destructive execution roles - fleet-wide shared-CAS physical GC - backup/provider/CDN/observability retention completion - member-only erasure - provider-native conditional-delete improvements - a general force-continue escape hatch; permanent safety failures remain fail closed unless an operator remediates the cause and records an audited `unblock` The removed continuous-worker implementation remains deferred; no remote follow-up branch is claimed by this PR. ## Validation ### Current PR head and repository state Current pushed head: `359d8402ee15f049768f54156f67b953c7a7e2ed`, rebased onto `cc9a2f783375e51a6e8d1f2f9d01d5f7e22813d1` (`origin/main` at push time). The complete PR diff is now 47 files, 9,834 additions, and 517 deletions. The bespoke source-scanner stack was removed to keep this PR scoped to community deletion. Tyler/team requested the underlying fenced-write safety behavior, not `ast-grep`, `crates/buzz-db/tests/community_fenced_writes.rs`, its 27 fixtures, or the new `scripts/lints/community_*.yml` rules. Those scanner-specific files, dependencies, Hermit links, and runner wiring are absent from the current tree. The production database write fence, startup/destructive live-catalog validation, and deletion behavior remain. Source validation on this exact SHA passed: - `cargo fmt --all -- --check` - `bash -n scripts/run-tests.sh` - `cargo nextest run -p buzz-db --all-targets`: 102 passed, 173 skipped, 0 failed - `cargo nextest run -p buzz-deletion --all-targets`: 10 passed, 9 skipped, 0 failed - `cargo nextest run -p buzz-admin --all-targets`: 1 passed, 0 failed - affected-package/all-target Clippy with warnings denied - lockfile consistency - Helm 3.16.4 lint and all 44 chart unit tests - Helm region controls using that fixture: default `BUZZ_S3_REGION=us-east-1`, explicit `eu-west-2` override, and blank-region schema rejection The prior Kubernetes battery below was run against `928992237358a3294621ac0280830b77155abc04`. It remains useful evidence for the patch-equivalent production deletion implementation, but it is **not** claimed as exact-SHA evidence for current head `359d8402ee15f049768f54156f67b953c7a7e2ed`; the current cleanup removes only scanner/test/tooling infrastructure. CI restarted for the new head after the rebase and is pending. Human review remains `CHANGES_REQUESTED`. ### Prior-head live Kubernetes deletion and safety gates The full program used one immutable image, real PostgreSQL, Redis, MinIO, and a three-relay Kubernetes release: - source: `928992237358a3294621ac0280830b77155abc04` (**prior head**) - image: `buzz-e2e:sha-928992237358` - immutable image digest: `sha256:a1a204f4618ac22d9e210be5e5290645a15d79831ae30b0e44379357c8e4a895` - evidence root: `/tmp/buzz-e2e/20260807T033025Z-928992237358-full-gates/` - evidence-manifest digest: `82875c5bc9bea7370b796a7aef3457b3a1c8306c84c59e0f7388bbb5ad30e865` Passed gates at that prior head: - **Chart/operator region:** default `us-east-1`, explicit nondefault propagation, blank-region schema rejection, live in-pod environment, and an in-pod taxonomy sweep over 18 objects with zero unknown. - **Fenced writers and lifecycle:** open-write/fence ordering; 100-attempt anti-starvation; invite, push matcher, and exhausted-reaper bystander isolation; non-`READ-COMMITTED` rejection; manifest/tombstone contracts; eight-failure stage block and audited `unblock`. - **Destructive lifecycle:** submit → approve → run → `retention_pending`; PostgreSQL tombstone and Redis/S3 verification true; zero retries/errors; terminal reruns rejected with exit 5. - **Fresh 10,001-object crash boundary:** exactly two chunks (10,000 + 1). The executor deleted chunk 0 from MinIO while its PostgreSQL stamp was row-lock-blocked, was killed with `SIGKILL`, left one object and both stamps absent, then resumed the same request under generation 2 to zero objects and terminal state. - **Independent dead-owner recovery:** a dedicated executor claimed generation 1, blocked before effects, and was killed through containerd with `SIGKILL` (no TERM cleanup). The request remained owned and unreclaimable before lease expiry; a successor claimed generation 2 after 60 seconds and completed with two attempts and zero retries. - **Three-pod socket isolation:** ordinary NIP-42 and joined huddle-audio target witnesses on every replica received exact `1008 / community deleted`; healthy-tenant witnesses on those pods remained live; deleted-host reconnect returned HTTP 404. - **Health/provenance:** all replicas independently returned ready and retained the exact image digest before/after destructive runs and an audio-enabled rolling restart; PostgreSQL, Redis, and MinIO were healthy at close. Instrument corrections were retained as evidence rather than counted as product failures: a foreground PostgreSQL forward caused an initial `PoolTimedOut`; Kubernetes pod deletion exercised graceful TERM rather than dead-owner recovery; shell-background socket witnesses died with their parent; and the first image build hit the corporate TLS proxy. Detached forwarding/witnesses, containerd `SIGKILL`, and the configured internal CA/Artifactory mirror produced the discriminating runs without weakening product security. ### Prior-head cleanup For the prior-head Kubernetes run, the Helm release was removed, namespace absence was verified, run-owned Screen sessions were absent, and that source worktree remained clean. The evidence manifest was independently recomputed and every indexed artifact passed `shasum -a 256 -c`. The current `359d8402` source worktree is also clean after the scanner-only cleanup and push. --------- Signed-off-by: npub122y0pqkertljmedu303rl0aqrj3w8pvu43t6jxm6875lzg6f2pwqegc3xc <5288f082d91aff2de5bc8be23fbfa01ca2e3859cac57a91b7a3fa9f12349505c@buzz.block.builderlab.xyz> Signed-off-by: npub1dccv64krpcpse5cmkzfeh998cftungyatw3djt8jwdw6g43f7fyqzzmrf7 <6e30cd56c30e030cd31bb0939b94a7c257c9a09d5ba2d92cf2735da45629f248@buzz.block.builderlab.xyz> Signed-off-by: Kalvin Chau <kalvin@block.xyz> Signed-off-by: am <6e30cd56c30e030cd31bb0939b94a7c257c9a09d5ba2d92cf2735da45629f248@buzz.block.builderlab.xyz> Signed-off-by: cid <d9f92a72922bf45c17379a47d64dae84b6020397c2d5a52b5317d512068cd9d3@buzz.block.builderlab.xyz> Co-authored-by: npub122y0pqkertljmedu303rl0aqrj3w8pvu43t6jxm6875lzg6f2pwqegc3xc <5288f082d91aff2de5bc8be23fbfa01ca2e3859cac57a91b7a3fa9f12349505c@buzz.block.builderlab.xyz> Co-authored-by: npub1dccv64krpcpse5cmkzfeh998cftungyatw3djt8jwdw6g43f7fyqzzmrf7 <6e30cd56c30e030cd31bb0939b94a7c257c9a09d5ba2d92cf2735da45629f248@buzz.block.builderlab.xyz> Co-authored-by: cid <d9f92a72922bf45c17379a47d64dae84b6020397c2d5a52b5317d512068cd9d3@buzz.block.builderlab.xyz>
395 lines
17 KiB
YAML
395 lines
17 KiB
YAML
# Default values for buzz.
|
|
#
|
|
# Two supported tiers:
|
|
#
|
|
# PRODUCTION (default) — external Postgres/Redis/S3, existingSecret
|
|
# refs everywhere, no chart-side autogeneration, GitOps-safe (ArgoCD/Flux).
|
|
# HA-ready: replicaCount >= 2 (requires Redis; git state is object-store-
|
|
# backed, so no ReadWriteMany volume is needed — RWO per replica is fine).
|
|
#
|
|
# QUICKSTART — bundles in-cluster Postgres + Redis + MinIO and
|
|
# auto-generates relay secrets via the `lookup` pattern (NOT GitOps-safe —
|
|
# see README), single replica, evaluation only. Opt in by enabling each
|
|
# bundled service: postgresql.enabled, redis.enabled, minio.enabled.
|
|
# See ci/quickstart-values.yaml and the README.
|
|
#
|
|
# See examples/argocd-app.yaml and examples/flux-helmrelease.yaml for the
|
|
# canonical GitOps configurations.
|
|
|
|
# Intent marker for the evaluation profile, surfaced in NOTES.txt. It does NOT
|
|
# by itself enable any bundled service — set the per-service .enabled flags
|
|
# (postgresql / redis / minio) to bring them up in-cluster.
|
|
quickstart: false
|
|
|
|
# ── Image ────────────────────────────────────────────────────────────────────
|
|
image:
|
|
repository: ghcr.io/block/buzz
|
|
tag: "" # empty → .Chart.AppVersion
|
|
pullPolicy: IfNotPresent
|
|
pullSecrets: []
|
|
|
|
# ── Topology ────────────────────────────────────────────────────────────────
|
|
# replicaCount > 1 hard-requires Redis for buzz-pubsub (in-cluster or external).
|
|
# It does NOT require ReadWriteMany git storage: git ref/object state is
|
|
# object-store-backed (each request hydrates an ephemeral repo from S3; writer
|
|
# serialization is the object-store pointer CAS), and repo-name uniqueness lives
|
|
# in Postgres. Each replica can use its own ReadWriteOnce volume (or none).
|
|
replicaCount: 1
|
|
|
|
# ── Autoscaling ──────────────────────────────────────────────────────────────
|
|
# Requires Metrics Server for CPU. Optional WebSocket scaling additionally
|
|
# requires a custom-metrics adapter exposing its pod-level Prometheus gauge.
|
|
# Kubernetes HPA uses the larger replica recommendation from enabled metrics.
|
|
autoscaling:
|
|
enabled: false
|
|
minReplicas: 5
|
|
maxReplicas: 15
|
|
targetCPUUtilizationPercentage: 65
|
|
websocketMetricEnabled: true
|
|
websocketMetricName: buzz_ws_connections_active
|
|
targetWebsocketConnections: 5000
|
|
behavior:
|
|
scaleUp:
|
|
stabilizationWindowSeconds: 0
|
|
policies:
|
|
- type: Percent
|
|
value: 100
|
|
periodSeconds: 60
|
|
- type: Pods
|
|
value: 4
|
|
periodSeconds: 60
|
|
selectPolicy: Max
|
|
scaleDown:
|
|
stabilizationWindowSeconds: 600
|
|
policies:
|
|
- type: Pods
|
|
value: 1
|
|
periodSeconds: 120
|
|
selectPolicy: Min
|
|
|
|
# ── Public URL ───────────────────────────────────────────────────────────────
|
|
# Required. The wss:// URL clients use to connect. Drives:
|
|
# - RELAY_URL env (relay-side)
|
|
# - Default mediaBaseUrl (https://<host>/media)
|
|
# - Default ingress host
|
|
relayUrl: ""
|
|
mediaBaseUrl: ""
|
|
|
|
# ── Owner ────────────────────────────────────────────────────────────────────
|
|
# 64-char lowercase hex Nostr pubkey of the relay operator. Required when
|
|
# relay.requireRelayMembership=true (the production default).
|
|
ownerPubkey: ""
|
|
|
|
# ── Chart-managed secrets ────────────────────────────────────────────────────
|
|
# Production / GitOps path: create a Secret out-of-band with these keys and
|
|
# point `secrets.existingSecret` at it. Any key omitted from the existing
|
|
# Secret falls back to chart-side autogen (only effective at first install).
|
|
#
|
|
# Expected keys (all optional unless required by relay config):
|
|
# BUZZ_RELAY_PRIVATE_KEY — 64-char hex; relay identity (rotation = identity change)
|
|
# BUZZ_GIT_HOOK_HMAC_SECRET — 32+ chars; required when replicaCount > 1
|
|
# DATABASE_URL — full Postgres URL (preferred over externalPostgresql.url)
|
|
# READ_DATABASE_URL — optional Postgres read-replica URL; omit to keep all reads on the writer
|
|
# REDIS_URL — full Redis URL with auth
|
|
# BUZZ_S3_ACCESS_KEY — S3 access key
|
|
# BUZZ_S3_SECRET_KEY — S3 secret key
|
|
secrets:
|
|
existingSecret: ""
|
|
# Inline overrides (NOT recommended for production; they land in values).
|
|
relayPrivateKey: ""
|
|
gitHookHmacSecret: ""
|
|
|
|
# ── Relay behavior ───────────────────────────────────────────────────────────
|
|
relay:
|
|
bindAddr: "0.0.0.0:3000"
|
|
maxConnections: 10000
|
|
maxConcurrentHandlers: 1024
|
|
sendBuffer: 1000
|
|
# Graceful-shutdown reconnect jitter. On SIGTERM the relay closes every live
|
|
# WebSocket with a 1012 Service Restart frame; with a rolling deploy this can
|
|
# release a whole pod's sockets at once and stampede reconnects into the DB
|
|
# pool. A positive value (milliseconds) spreads each close over a per-socket
|
|
# random delay in [1, drainJitterMs], smoothing the reconnect herd. 0 (the
|
|
# default) closes all sockets at once, preserving the previous behavior.
|
|
# Values above 20000 are capped to 20000, leaving close-frame delivery
|
|
# headroom under the relay's 30s hard-drain timeout (itself inside the 60s
|
|
# terminationGracePeriodSeconds below).
|
|
drainJitterMs: 0
|
|
requireAuthToken: true
|
|
requireRelayMembership: true
|
|
allowNipOaAuth: true
|
|
pubkeyAllowlist: false
|
|
corsOrigins: []
|
|
# Huddle audio is safe only for single-pod relay deployments until an SFU
|
|
# exists. null lets the chart render false automatically when
|
|
# replicaCount > 1. Explicit true with replicaCount > 1 means the operator
|
|
# accepts/owns the external multi-pod audio/SFU behavior.
|
|
huddleAudioAvailable: null
|
|
ephemeralTtlOverride: 0
|
|
# Per-upload-event records (`_uploads/` moderation side channel). Off by
|
|
# default. Operators hosting communities for other people may have legal
|
|
# obligations (e.g. NCMEC reporting for US-serving providers) that require
|
|
# recording the network address of an upload; Buzz never collects IPs unless
|
|
# uploadIpHeader is set. When set (e.g. "cf-connecting-ip"), the connecting
|
|
# address reported by YOUR trusted edge is stored in the per-event record
|
|
# only — never served to clients, never in event data. uploadRecords must be
|
|
# true for uploadIpHeader to be valid (startup-checked).
|
|
uploadRecords: false
|
|
uploadIpHeader: ""
|
|
uploadPortHeader: ""
|
|
|
|
livenessProbe:
|
|
httpGet:
|
|
path: /_liveness
|
|
port: health
|
|
initialDelaySeconds: 5
|
|
periodSeconds: 10
|
|
timeoutSeconds: 3
|
|
failureThreshold: 3
|
|
readinessProbe:
|
|
httpGet:
|
|
path: /_readiness
|
|
port: health
|
|
initialDelaySeconds: 5
|
|
periodSeconds: 5
|
|
timeoutSeconds: 3
|
|
failureThreshold: 3
|
|
startupProbe:
|
|
httpGet:
|
|
path: /_liveness
|
|
port: health
|
|
failureThreshold: 60
|
|
periodSeconds: 2
|
|
|
|
resources:
|
|
requests:
|
|
cpu: "500m"
|
|
memory: "512Mi"
|
|
limits:
|
|
cpu: "2"
|
|
memory: "2Gi"
|
|
|
|
podAnnotations: {}
|
|
podLabels: {}
|
|
nodeSelector: {}
|
|
tolerations: []
|
|
affinity: {}
|
|
topologySpreadConstraints: []
|
|
securityContext:
|
|
runAsNonRoot: true
|
|
runAsUser: 65532
|
|
runAsGroup: 65532
|
|
fsGroup: 65532
|
|
seccompProfile:
|
|
type: RuntimeDefault
|
|
containerSecurityContext:
|
|
allowPrivilegeEscalation: false
|
|
capabilities:
|
|
drop: [ALL]
|
|
readOnlyRootFilesystem: false # git writes need a writable repo path
|
|
terminationGracePeriodSeconds: 60
|
|
|
|
# Optional image entrypoint/arguments overrides. Empty arrays preserve the
|
|
# relay image's defaults. Consumers own compatibility with the selected image.
|
|
command: []
|
|
args: []
|
|
# Appended to the chart-owned relay mounts. Names must match extraVolumes (or
|
|
# another volume supplied by the platform) and must not collide with built-ins.
|
|
extraVolumeMounts: []
|
|
|
|
extraEnv: []
|
|
extraEnvFrom: []
|
|
|
|
# ── Pod extensions ──────────────────────────────────────────────────────────
|
|
# Raw Kubernetes fragments appended to the relay Pod. They are rendered with
|
|
# toYaml, not tpl. Init containers must define their own securityContext and
|
|
# resources; names must not collide with chart-owned containers or volumes.
|
|
extraInitContainers: []
|
|
extraVolumes: []
|
|
|
|
# ── Device pairing relay ─────────────────────────────────────────────────────
|
|
# Optional, stateless NIP-AB relay. When enabled, the main relay advertises
|
|
# pairingRelay.url in NIP-11 and Buzz clients use it instead of the legacy
|
|
# same-host /pair convention.
|
|
pairingRelay:
|
|
enabled: false
|
|
url: ""
|
|
replicaCount: 1
|
|
service:
|
|
type: ClusterIP
|
|
port: 5000
|
|
annotations: {}
|
|
podAnnotations: {}
|
|
podLabels: {}
|
|
resources:
|
|
requests:
|
|
cpu: "50m"
|
|
memory: "32Mi"
|
|
limits:
|
|
cpu: "250m"
|
|
memory: "128Mi"
|
|
|
|
# ── Service ──────────────────────────────────────────────────────────────────
|
|
service:
|
|
type: ClusterIP
|
|
port: 3000
|
|
healthPort: 8080
|
|
metricsPort: 9102
|
|
annotations: {}
|
|
|
|
serviceAccount:
|
|
create: true
|
|
name: ""
|
|
annotations: {}
|
|
|
|
podDisruptionBudget:
|
|
enabled: true
|
|
minAvailable: 1
|
|
maxUnavailable: ""
|
|
|
|
# ── Ingress (classic) ────────────────────────────────────────────────────────
|
|
# Mutually exclusive with httproute.enabled.
|
|
ingress:
|
|
enabled: false
|
|
className: ""
|
|
annotations: {}
|
|
hosts: [] # empty → derived from relayUrl
|
|
tls: [] # [{hosts: [...], secretName: "..."}]
|
|
|
|
# ── Gateway API (HTTPRoute) ──────────────────────────────────────────────────
|
|
httproute:
|
|
enabled: false
|
|
parentRefs: []
|
|
hostnames: []
|
|
rules: [] # empty → default match-all → service
|
|
|
|
# ── Git scratch volume ───────────────────────────────────────────────────────
|
|
# Ephemeral working space only. No persistent git state lives here — reads/writes
|
|
# hydrate ephemeral repos from object storage per request, and repo-name
|
|
# uniqueness lives in Postgres.
|
|
#
|
|
# enabled: true → mount a PVC at mountPath (durable across pod restarts, but a
|
|
# single ReadWriteOnce PVC binds to one node, so it does NOT support multi-pod
|
|
# scheduling across nodes on a Deployment).
|
|
# enabled: false → mount a per-pod emptyDir at mountPath (pure scratch), bounded
|
|
# by size. This is the correct choice for multi-replica HA: each pod gets its
|
|
# own local working space, nothing is shared, and there is no volume to
|
|
# multi-attach. Safe because the object store + Postgres are the sources of
|
|
# truth, not this disk.
|
|
persistence:
|
|
git:
|
|
enabled: true
|
|
mountPath: /var/lib/buzz/git
|
|
storageClass: ""
|
|
accessMode: ReadWriteOnce
|
|
size: 10Gi # PVC capacity or emptyDir sizeLimit
|
|
annotations: {}
|
|
existingClaim: ""
|
|
|
|
# ── Postgres ─────────────────────────────────────────────────────────────────
|
|
# Eval-only CloudPirates subchart. The relay's DATABASE_URL is composed in the
|
|
# chart-managed Secret with a chart-generated password; auth.existingSecret
|
|
# points this subchart at that same Secret/key so server and client agree.
|
|
postgresql:
|
|
enabled: false
|
|
auth:
|
|
database: buzz
|
|
username: buzz
|
|
existingSecret: '{{ if contains "buzz" .Release.Name }}{{ .Release.Name }}-relay{{ else }}{{ .Release.Name }}-buzz-relay{{ end }}'
|
|
secretKeys:
|
|
adminPasswordKey: postgres-password
|
|
persistence:
|
|
enabled: true
|
|
size: 10Gi
|
|
externalPostgresql:
|
|
url: "" # postgres://user:pass@host:5432/db — placeholder example, sadscan:disable np.postgres.1
|
|
|
|
# ── Redis ────────────────────────────────────────────────────────────────────
|
|
# Eval-only CloudPirates subchart (standalone). REDIS_URL is composed in the
|
|
# chart-managed Secret; auth.existingSecret points the subchart at that Secret
|
|
# so the server password matches the URL the relay dials.
|
|
redis:
|
|
enabled: false
|
|
auth:
|
|
existingSecret: '{{ if contains "buzz" .Release.Name }}{{ .Release.Name }}-relay{{ else }}{{ .Release.Name }}-buzz-relay{{ end }}'
|
|
existingSecretPasswordKey: redis-password
|
|
persistence:
|
|
enabled: true
|
|
size: 4Gi
|
|
externalRedis:
|
|
url: "" # redis://:pass@host:6379
|
|
|
|
# ── S3 / object storage (media) ──────────────────────────────────────────────
|
|
# Production: point endpoint/bucket at an external S3-compatible service and
|
|
# supply credentials (inline below or via secrets.existingSecret).
|
|
# Quickstart (`minio.enabled: true`): the chart runs an in-cluster, eval-only
|
|
# MinIO Deployment, creates the bucket via a post-install Job, and composes
|
|
# the endpoint + autogenerated credentials automatically.
|
|
#
|
|
# Storage metrics (hourly bucket sweep, BUZZ_STORAGE_METRICS — see env docs):
|
|
# the credentials above must additionally grant `s3:ListBucket` on the bucket
|
|
# ARN itself (bucket-level; distinct from the object-level GetObject/
|
|
# PutObject/DeleteObject perms already required for media). Without it the
|
|
# first sweep fails AccessDenied and buzz_storage_sweep_ok stays 0 — no other
|
|
# media functionality is affected. Set BUZZ_STORAGE_METRICS=off to disable
|
|
# the sweep entirely on a deployment that can't grant it.
|
|
# Note: buzz_storage_sweep_failures is a process-local gauge — on leader
|
|
# failover it resets to the new leader's local count, not a global total.
|
|
# Note: on a failed sweep attempt, the next retry fires on the next usage tick
|
|
# (default 300 s BUZZ_USAGE_METRICS_INTERVAL_SECS), not at sweep-interval
|
|
# cadence — so a permanently missing s3:ListBucket yields one cheap LIST call
|
|
# per tick until the permission is added.
|
|
s3:
|
|
endpoint: ""
|
|
bucket: "buzz-media"
|
|
# SigV4 signing region shared by the relay and `buzz-admin deletions`.
|
|
# Keep the MinIO/local default operable; production providers should set
|
|
# their credential region explicitly when it differs.
|
|
region: "us-east-1"
|
|
# path: https://endpoint/bucket/key (bundled MinIO-compatible default)
|
|
# virtual: https://bucket.endpoint/key (standard S3; required by new Railway buckets)
|
|
addressingStyle: path
|
|
accessKey: ""
|
|
secretKey: ""
|
|
|
|
# In-cluster MinIO for the quickstart profile only. Production deploys leave
|
|
# this disabled and use s3.* (or secrets.existingSecret) against managed S3.
|
|
minio:
|
|
enabled: false # quickstart: set true for bundled in-cluster MinIO
|
|
image: minio/minio:RELEASE.2025-09-07T16-13-09Z
|
|
mcImage: minio/mc:RELEASE.2025-08-13T08-35-41Z
|
|
persistence:
|
|
enabled: true
|
|
size: 10Gi
|
|
|
|
# ── Git server config ────────────────────────────────────────────────────────
|
|
git:
|
|
maxPackBytes: 524288000 # 500 MiB
|
|
packCachePath: /var/cache/buzz/git-packs
|
|
packCacheMaxBytes: 5368709120 # 5 GiB
|
|
packCacheMaxConcurrentPopulations: 2
|
|
packCacheVolumeSize: 7Gi # per-pod emptyDir; includes cold-population staging
|
|
maxReposPerPubkey: 100
|
|
maxConcurrentOps: 20
|
|
|
|
# ── Migrations ───────────────────────────────────────────────────────────────
|
|
# Relay runs sqlx migrations at startup via BUZZ_AUTO_MIGRATE=true.
|
|
migrate:
|
|
autoMigrate: true
|
|
preUpgradeJob:
|
|
enabled: false
|
|
resources: {}
|
|
backoffLimit: 3
|
|
activeDeadlineSeconds: 600
|
|
|
|
# ── Monitoring ───────────────────────────────────────────────────────────────
|
|
serviceMonitor:
|
|
enabled: false
|
|
namespace: ""
|
|
interval: 30s
|
|
scrapeTimeout: 10s
|
|
labels: {}
|
|
|
|
# ── Free-form extra manifests ────────────────────────────────────────────────
|
|
extraManifests: []
|