mirror of
https://github.com/block/buzz.git
synced 2026-11-14 13:21:02 +00:00
## Summary - add one strict `BUZZ_S3_ADDRESSING_STYLE=path|virtual` setting shared by media and Git/CAS storage - preserve path-style defaults for bundled Compose/Helm MinIO while supporting Railway's virtual-hosted bucket contract - fail startup on invalid or non-Unicode values before dependency connection, and validate the Helm value with the same two choices - document operator mappings and why endpoint and bucket remain separate for routing and SigV4 signing ## Best-practice rationale AWS documents both URL forms and favors virtual-hosted addressing for S3, while compatibility endpoints such as the bundled MinIO deployment can require path style. `rust-s3` defaults to virtual/subdomain addressing and provides `with_path_style()` for the explicit compatibility case. Some providers buckets only support as virtual-hosted bucket styles. This PR therefore uses one explicit, provider-neutral switch rather than endpoint heuristics or fallback behavior, while retaining `path` as Buzz's backward-compatible default. Sources: - https://docs.aws.amazon.com/AmazonS3/latest/userguide/VirtualHosting.html - https://docs.rs/rust-s3/0.37.0/s3/bucket/struct.Bucket.html - https://docs.railway.com/storage-buckets#url-style - https://github.com/minio/minio/blob/master/docs/config/README.md#domain ## Validation - `cargo fmt --all` - `cargo check --workspace --all-targets` - targeted `buzz-media` and `buzz-relay` parsing/client-construction tests for defaults, strict errors, and both URL styles - Helm unittest: 45/45 passed - Compose config/render validation passed - local MinIO path-mode relay startup passed the Git A3 conformance probe and became ready - unreachable object storage failed startup and readiness never opened - push hooks completed the broader Rust and desktop suites successfully --------- Signed-off-by: npub122y0pqkertljmedu303rl0aqrj3w8pvu43t6jxm6875lzg6f2pwqegc3xc <5288f082d91aff2de5bc8be23fbfa01ca2e3859cac57a91b7a3fa9f12349505c@buzz.block.builderlab.xyz> Signed-off-by: Kalvin Chau <kalvin@block.xyz> Co-authored-by: npub122y0pqkertljmedu303rl0aqrj3w8pvu43t6jxm6875lzg6f2pwqegc3xc <5288f082d91aff2de5bc8be23fbfa01ca2e3859cac57a91b7a3fa9f12349505c@buzz.block.builderlab.xyz>
80 lines
2.8 KiB
YAML
80 lines
2.8 KiB
YAML
suite: validation
|
|
templates:
|
|
- templates/deployment.yaml
|
|
tests:
|
|
- it: fails when relayUrl is missing
|
|
set:
|
|
relayUrl: ""
|
|
ownerPubkey: "0000000000000000000000000000000000000000000000000000000000000000"
|
|
externalPostgresql.url: postgres://u:p@h:5432/d
|
|
asserts:
|
|
- failedTemplate:
|
|
errorMessage: "relayUrl is required: set --set relayUrl=wss://your.domain"
|
|
|
|
- it: fails when ownerPubkey is missing and requireRelayMembership is true
|
|
set:
|
|
relayUrl: wss://buzz.example.com
|
|
ownerPubkey: ""
|
|
externalPostgresql.url: postgres://u:p@h:5432/d
|
|
asserts:
|
|
- failedTemplate:
|
|
errorPattern: "ownerPubkey is required when relay.requireRelayMembership=true"
|
|
|
|
- it: fails when ownerPubkey is not 64 lowercase hex (schema-level)
|
|
set:
|
|
relayUrl: wss://buzz.example.com
|
|
ownerPubkey: "NOTAHEX"
|
|
externalPostgresql.url: postgres://u:p@h:5432/d
|
|
asserts:
|
|
- failedTemplate:
|
|
errorPattern: "ownerPubkey: Does not match pattern"
|
|
|
|
- it: fails when replicaCount>1 without Redis
|
|
set:
|
|
relayUrl: wss://buzz.example.com
|
|
ownerPubkey: "0000000000000000000000000000000000000000000000000000000000000000"
|
|
externalPostgresql.url: postgres://u:p@h:5432/d
|
|
replicaCount: 3
|
|
asserts:
|
|
- failedTemplate:
|
|
errorPattern: "minimum replica count 3 requires Redis"
|
|
|
|
- it: fails when ingress and httproute both enabled
|
|
set:
|
|
relayUrl: wss://buzz.example.com
|
|
ownerPubkey: "0000000000000000000000000000000000000000000000000000000000000000"
|
|
externalPostgresql.url: postgres://u:p@h:5432/d
|
|
ingress.enabled: true
|
|
httproute.enabled: true
|
|
asserts:
|
|
- failedTemplate:
|
|
errorPattern: "cannot both be true"
|
|
|
|
- it: fails when Postgres source is missing
|
|
set:
|
|
relayUrl: wss://buzz.example.com
|
|
ownerPubkey: "0000000000000000000000000000000000000000000000000000000000000000"
|
|
asserts:
|
|
- failedTemplate:
|
|
errorPattern: "Postgres source missing"
|
|
|
|
- it: rejects an invalid S3 addressing style
|
|
set:
|
|
relayUrl: wss://buzz.example.com
|
|
ownerPubkey: "0000000000000000000000000000000000000000000000000000000000000000"
|
|
externalPostgresql.url: postgres://u:p@h:5432/d
|
|
s3.endpoint: http://minio:9000
|
|
s3.addressingStyle: auto
|
|
asserts:
|
|
- failedTemplate:
|
|
errorPattern: "s3.addressingStyle: s3.addressingStyle must be one of the following:.*path.*virtual"
|
|
|
|
- it: fails when S3/object-storage source is missing
|
|
set:
|
|
relayUrl: wss://buzz.example.com
|
|
ownerPubkey: "0000000000000000000000000000000000000000000000000000000000000000"
|
|
externalPostgresql.url: postgres://u:p@h:5432/d
|
|
asserts:
|
|
- failedTemplate:
|
|
errorPattern: "S3/object-storage source missing"
|