veza/veza-backend-api/internal/config
senke d5152d89a2
Some checks failed
Veza CI / Rust (Stream Server) (push) Successful in 5m28s
Security Scan / Secret Scanning (gitleaks) (push) Failing after 53s
Veza CI / Backend (Go) (push) Failing after 7m59s
Veza CI / Frontend (Web) (push) Failing after 17m43s
Veza CI / Notify on failure (push) Successful in 4s
E2E Playwright / e2e (full) (push) Failing after 20m55s
feat(stream): HLS default on + marketplace 30s pre-listen + FLAC tier checkbox (W4 Day 17)
Three pieces shipping under one banner since they're the day's
deliverables and share no review-time coupling :

1. HLS_STREAMING default flipped true
   - config.go : getEnvBool default true (was false). Operators wanting
     a lightweight dev / unit-test env explicitly set HLS_STREAMING=false
     to skip the transcoder pipeline.
   - .env.template : default flipped + comment explaining the opt-out.
   - Effect : every new track upload routes through the HLS transcoder
     by default ; ABR ladder served via /tracks/:id/master.m3u8.

2. Marketplace 30s pre-listen (creator opt-in)
   - migrations/989 : adds products.preview_enabled BOOLEAN NOT NULL
     DEFAULT FALSE + partial index on TRUE values. Default off so
     adoption is opt-in.
   - core/marketplace/models.go : PreviewEnabled field on Product.
   - handlers/marketplace.go : StreamProductPreview gains a fall-through.
     When no file-based ProductPreview exists AND the product is a
     track product AND preview_enabled=true, redirect to the underlying
     /tracks/:id/stream?preview=30. Header X-Preview-Cap-Seconds: 30
     surfaces the policy.
   - core/track/track_hls_handler.go : StreamTrack accepts ?preview=30
     and gates anonymous access via isMarketplacePreviewAllowed (raw
     SQL probe of products.preview_enabled to avoid the
     track→marketplace import cycle ; the reverse arrow already exists).
   - Trust model : 30s cap is enforced client-side (HTML5 audio
     currentTime). Industry standard for tease-to-buy ; not anti-rip.
     Documented in the migration + handler doc comment.

3. FLAC tier preview checkbox (Premium-gated, hidden by default)
   - upload-modal/constants.ts : optional flacAvailable on UploadFormData.
   - upload-modal/UploadModalMetadataForm.tsx : new optional props
     showFlacAvailable + flacAvailable + onFlacAvailableChange.
     Checkbox renders only when showFlacAvailable=true ; consumers
     pass that based on the user's role/subscription tier (deferred
     to caller wiring — Item G phase 4 will replace the role check
     with a real subscription-tier check).
   - Today the checkbox is a UI affordance only ; the actual lossless
     distribution path (ladder + storage class) is post-launch work.

Acceptance (Day 17) : new uploads serve HLS ABR by default ;
products.preview_enabled flag wires anonymous 30s pre-listen ;
checkbox visible to premium users on the upload form. All 4 tested
backend packages pass : handlers, core/track, core/marketplace, config.

W4 progress : Day 16 ✓ · Day 17 ✓ · Day 18 (faceted search)  ·
Day 19 (HAProxy sticky WS)  · Day 20 (k6 nightly) .

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-29 09:56:02 +02:00
..
config.go feat(stream): HLS default on + marketplace 30s pre-listen + FLAC tier checkbox (W4 Day 17) 2026-04-29 09:56:02 +02:00
config_test.go fix(ci): unblock CI red after v1.0.9 sprint 1 push (migration 986 + config tests) 2026-04-27 05:02:07 +02:00
cors.go feat: backend, stream server & infra improvements 2026-03-18 11:36:06 +01:00
db_init.go refactor(config): découper config.go par domaine (audit 2.7) 2026-02-15 14:44:33 +01:00
defaults.go adding initial backend API (Go) 2025-12-03 20:29:37 +01:00
defaults_test.go adding initial backend API (Go) 2025-12-03 20:29:37 +01:00
docs.go adding initial backend API (Go) 2025-12-03 20:29:37 +01:00
docs_test.go adding initial backend API (Go) 2025-12-03 20:29:37 +01:00
env_detection.go adding initial backend API (Go) 2025-12-03 20:29:37 +01:00
env_detection_test.go adding initial backend API (Go) 2025-12-03 20:29:37 +01:00
env_helpers.go feat(backend): OAuth FRONTEND_URL from config, docs update 2026-02-17 16:42:23 +01:00
env_loader.go adding initial backend API (Go) 2025-12-03 20:29:37 +01:00
env_loader_test.go adding initial backend API (Go) 2025-12-03 20:29:37 +01:00
middlewares_init.go feat(middleware): wire UserRateLimiter into AuthMiddleware (BE-SVC-002) 2026-04-21 09:52:07 +02:00
rabbitmq.go feat: backend — config, handlers, services, logging, migration 2026-03-23 15:46:57 +01:00
rate_limit.go feat: backend, stream server & infra improvements 2026-03-18 11:36:06 +01:00
redis_init.go feat(redis): Sentinel HA + cache hit rate metrics (W3 Day 11) 2026-04-28 13:36:55 +02:00
reloader.go adding initial backend API (Go) 2025-12-03 20:29:37 +01:00
reloader_test.go v0.9.4 2026-03-05 23:03:43 +01:00
secrets.go [BE-SEC-014] be-sec: Implement secrets management 2025-12-24 12:30:18 +01:00
secrets_test.go STABILISATION: phase 3–5 – API contract, tests & chat-server hardening 2025-12-06 17:21:59 +01:00
services_init.go v0.9.1 2026-03-05 19:22:31 +01:00
testutils.go fix(backend): use explicit DISABLE_RATE_LIMIT_FOR_TESTS flag instead of env-based bypass 2026-02-15 15:56:53 +01:00
testutils_test.go adding initial backend API (Go) 2025-12-03 20:29:37 +01:00
upload_limits.go feat(backend,web): single source of truth for upload-size limits 2026-04-16 19:37:37 +02:00
upload_limits_test.go feat(backend,web): single source of truth for upload-size limits 2026-04-16 19:37:37 +02:00
validation.go refactor(backend): split config into domain modules (P2) 2026-02-16 11:12:21 +01:00
validation_test.go fix(ci): unblock CI red after v1.0.9 sprint 1 push (migration 986 + config tests) 2026-04-27 05:02:07 +02:00
validator.go adding initial backend API (Go) 2025-12-03 20:29:37 +01:00
validator_test.go adding initial backend API (Go) 2025-12-03 20:29:37 +01:00
watcher.go adding initial backend API (Go) 2025-12-03 20:29:37 +01:00
watcher_test.go adding initial backend API (Go) 2025-12-03 20:29:37 +01:00