Commit graph

50 commits

Author SHA1 Message Date
senke
12dbb5bbe4 chore(release): v0.921 — Rustproof (Rust test coverage >30%)
Some checks failed
Stream Server CI / test (push) Failing after 0s
2026-03-02 12:28:20 +01:00
senke
f9120c322b release(v0.903): Vault - ORDER BY whitelist, rate limiter, VERSION sync, chat-server cleanup, Go 1.24
Some checks failed
Backend API CI / test-unit (push) Failing after 0s
Backend API CI / test-integration (push) Failing after 0s
Frontend CI / test (push) Failing after 0s
Storybook Audit / Build & audit Storybook (push) Failing after 0s
Stream Server CI / test (push) Failing after 0s
- ORDER BY dynamiques : whitelist explicite, fallback created_at DESC
- Login/register soumis au rate limiter global
- VERSION sync + check CI
- Nettoyage références veza-chat-server
- Go 1.24 partout (Dockerfile, workflows)
- TODO/FIXME/HACK convertis en issues ou résolus
2026-02-27 09:43:25 +01:00
senke
73533bea77 feat(v0.501): Sprint 2 -- HLS production-ready
- S1-01: Add multi-bitrate streaming profiles (128k, 256k, 320k)
- S1-02: Update master.m3u8 endpoint with 3-tier quality system
- S1-03: Integrate hls.js with ABR + useHLSPlayer hook
- S1-04: Add Cache-Control headers on HLS segments and manifests
- S1-05: Create WaveformService with async generation (FFmpeg + audiowaveform)
- S1-06: Add GET /tracks/:id/waveform endpoint with Redis cache
- S1-07: Create WaveformDisplay component with story
- S1-08: Add 4 Prometheus metrics for streaming monitoring
2026-02-22 18:16:37 +01:00
senke
f25cc115b2 test(rust): add 51 unit tests across chat and stream servers
Some checks failed
Chat Server CI / test (push) Failing after 0s
Stream Server CI / test (push) Failing after 0s
INT-05: 26 tests in chat-server (config, error, permissions, rate
limiter, logging, utils) and 25 tests in stream-server (config,
error, auth, HLS, signature, utils). All test pure logic.
2026-02-22 17:55:27 +01:00
senke
aeda9120b3 fix(chat-server): ensure sqlx-data.json available for Docker build
- Remove sqlx-data.json from .dockerignore to allow SQLX_OFFLINE build
- Use repo root as build context for veza-common path dependency
- Add SQLX_OFFLINE=true and COPY sqlx-data.json in Dockerfile
2026-02-18 12:38:16 +01:00
senke
b103a09a25 chore: consolidate CI, E2E, backend and frontend updates
- CI: workflows updates (cd, ci), remove playwright.yml
- E2E: global-setup, auth/playlists/profile specs
- Remove playwright-report and test-results artifacts from tracking
- Backend: auth, handlers, services, workers, migrations
- Frontend: components, features, vite config
- Add e2e-results.json to gitignore
- Docs: REMEDIATION_PROGRESS, audit archive
- Rust: chat-server, stream-server updates
2026-02-17 16:43:21 +01:00
senke
348ff092ef fix(stream): replace expect in production signature (stability) 2026-02-16 11:08:11 +01:00
senke
28f6885492 chore: align Go version in CI with go.mod (1.24) 2026-02-16 10:23:47 +01:00
senke
f6fd3a131b fix(security): protect /v1/stream/hls/* endpoints with JWT auth (A01) 2026-02-16 10:16:08 +01:00
senke
67271c7b34 chore: audit 2.8 et 2.9 — gitignore et Tokio
2.8: Mise à jour .gitignore
- .turbo/ (cache Turborepo)
- *.out (Go coverage, artefacts)
- test-results/ et playwright-report/ (patterns globaux)

2.9: Alignement Tokio 1.0 → 1.35
- veza-common: dependencies + dev-dependencies
- veza-stream-server/tools
2026-02-15 14:47:31 +01:00
senke
a6a9be9ada fix(audit-1.5): replace critical .unwrap() in Rust production paths
- Add unix_timestamp_secs() helper to avoid SystemTime panics
- Replace SystemTime::now().duration_since(UNIX_EPOCH).unwrap() in stream + chat
- Fix Option::unwrap() in adaptive.rs, encoding_pool, advanced_moderation
- Fix partial_cmp().unwrap() in prometheus_metrics, soundcloud
- Use expect() for lazy_static Regex (compile-time invariant)
- Fix Response::builder().body().unwrap() in simple_stream_server

Refs: AUDIT_TECHNIQUE_INTEGRAL_2026_02_15.md item 1.5
2026-02-15 14:14:29 +01:00
senke
aceba5d991 fix(security): add JWT auth to HLS endpoints (audit 1.3, P0)
- Add hls_auth_middleware in stream server (Bearer + ?token=)
- Apply auth to /hls/:track_id/* routes
- Update frontend hlsService to use stream server URL + pass JWT via xhrSetup
- Add getHLSXhrSetup() and getHLSURLWithToken() for hls.js integration
- Add VITE_HLS_BASE_URL config (derived from VITE_STREAM_URL when unset)
- Add unit tests for token extraction and HLS helpers
- Mark audit item 1.3 as done
2026-02-15 12:48:58 +01:00
senke
83a9a3537c chore: add Turborepo for monorepo orchestration
- Add turbo devDependency and packageManager to root
- Create turbo.json with build, test, lint pipeline
- Add package.json to veza-backend-api, veza-chat-server, veza-stream-server
- Extend workspaces to include Go and Rust services
- Migrate CI to use turbo run for build, test, lint
2026-02-14 22:38:32 +01:00
senke
92f432fb9e chore: consolidate pending changes (Hyperswitch, PostCard, dashboard, stream server, etc.) 2026-02-14 21:45:15 +01:00
senke
fb8411c6ad feat(stream): implement real encoding pipeline in create_pipeline 2026-02-14 18:15:30 +01:00
senke
ae586f6134 Phase 2 stabilisation: code mort, Modal→Dialog, feature flags, tests, router split, Rust legacy
Bloc A - Code mort:
- Suppression Studio (components, views, features)
- Suppression gamification + services mock (projectService, storageService, gamificationService)
- Mise à jour Sidebar, Navbar, locales

Bloc B - Frontend:
- Suppression modal.tsx deprecated, Modal.stories (doublon Dialog)
- Feature flags: PLAYLIST_SEARCH, PLAYLIST_RECOMMENDATIONS, ROLE_MANAGEMENT = true
- Suppression 19 tests orphelins, retrait exclusions vitest.config

Bloc C - Backend:
- Extraction routes_auth.go depuis router.go

Bloc D - Rust:
- Suppression security_legacy.rs (code mort, patterns déjà dans security/)
2026-02-14 17:23:32 +01:00
senke
8582be5982 fix(stream-server): fix partial move in buffer get_next_chunk (fix compilation) 2026-02-14 14:09:07 +01:00
senke
37981c2c17 chore(refactor/sumi-migration): commit pending changes — tests, stream server, dist_verification
- apps/web: test updates (Vitest/setup), playbackAnalyticsService, TrackGrid, serviceErrorHandler
- veza-common: logging, metrics, traits, validation, random
- veza-stream-server: audio pipeline, codecs, cache, monitoring, routes
- apps/web/dist_verification: refresh build assets (content-hashed filenames)

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-13 19:39:18 +01:00
senke
101cbd0f48 chore(stream): remove orphan modules and artifacts
- Remove src/eventbus/ directory (orphan — event_bus.rs is the active module)
- Remove src/prometheus_metrics.rs (orphan duplicate — monitoring/prometheus_metrics.rs is active)
- Remove src/core/sync.rs_test_snippet (leftover artifact)

Stream server compiles with zero errors.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 23:33:37 +01:00
senke
8f1ccd8a56 fix(ci): correct Rust service paths and reactivate CD pipeline
- Fix chat-ci.yml and stream-ci.yml to reference veza-chat-server/
  and veza-stream-server/ instead of non-existent apps/ paths
- Add veza-common/ to CI triggers so shared library changes are tested
- Reactivate CD pipeline with Docker registry push and Kubernetes
  deployment steps (gated on secrets availability)
- Standardize Redis dependency to v0.32 across both Rust services

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 22:44:56 +01:00
senke
2d664f9177 fix(security): add SSRF protection, real track access validation, and pagination bounds
- Add IsURLSafe() function to webhook service blocking private IPs,
  localhost, and cloud metadata endpoints (SSRF protection)
- Implement real validate_track_access() in stream server querying DB
  for track visibility, ownership, and purchase status
- Remove dangerous JWT fallback user in chat server that allowed
  deleted users to maintain access with forged credentials
- Add upper limit (100) on pagination in profile, track, and room handlers
- Fix Dockerfile.production healthcheck path to /api/v1/health

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 22:44:03 +01:00
senke
e273827879 fix(stream): replace critical .unwrap() with safe alternatives
- middleware/logging.rs: UUID header parse .unwrap() -> unwrap_or_else
- routes/api.rs: serde_json::to_value().unwrap() -> proper error return
- routes/api.rs: event_bus.as_ref().unwrap() -> map_or(false, ...) guard
- structured_logging.rs: file_path.parent().unwrap() -> unwrap_or_else(".")
- cache/audio_cache.rs: NonZeroUsize::new().unwrap() -> fallback to 1024

Focuses on highest-risk locations: request handlers and middleware.

Addresses audit finding D9: .unwrap() in production code.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-11 23:22:03 +01:00
senke
57fdcda75e feat(stream): implement real rate limiting middleware using governor
Replace the stub check_rate_limit() that always returned true with a
real implementation backed by the governor crate (already in Cargo.toml).

- Per-IP keyed rate limiter with DashMap store
- Default quota: 120 requests/minute per IP
- Sliding window enforcement via governor's GCRA algorithm
- Returns 429 Too Many Requests when limit exceeded

Addresses audit findings D7, A04: missing rate limiting on stream-server.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-11 23:19:27 +01:00
senke
05e26f9342 fix(deps): upgrade outdated Rust dependencies across services
stream-server (Cargo.toml):
- sqlx 0.7 -> 0.8
- redis 0.25 -> 0.27 (fix query_async generic args in revocation_store.rs)
- bcrypt 0.15 -> 0.17
- thiserror 1.0 -> 2.0
- dashmap 5.5 -> 6.1

veza-common (Cargo.toml):
- sqlx 0.7 -> 0.8 (required to avoid libsqlite3-sys link conflict)
- thiserror 1.0 -> 2.0

chat-server (Cargo.toml):
- sqlx 0.7 -> 0.8 (alignment with veza-common)

Addresses audit findings D2, A06: outdated Rust dependencies.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-11 23:18:34 +01:00
senke
40db0b4c43 fix(ci): upgrade deprecated actions, fix Go version
production-deploy.yml:
- Replace actions-rs/toolchain@v1 with dtolnay/rust-toolchain@stable
- Upgrade actions/cache@v3 -> @v4
- Upgrade github/codeql-action/upload-sarif@v2 -> @v3
- Upgrade actions/upload-artifact@v3 -> @v4

backend-ci.yml:
- Upgrade Go 1.22 -> 1.23 to match go.mod (1.23.8)

Addresses audit findings A08: deprecated actions and outdated Go version.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-11 23:14:50 +01:00
senke
0a269ed664 chore: remove dead code, backups, and deprecated docker-compose files
Removed files:
- apps/web/src/utils/storeSelectors.ts.backup (committed backup file)
- apps/web/desy/ (69 files, unused legacy design system)
- docker-compose.production.yml (root, superseded by docker-compose.prod.yml)
- config/docker/docker-compose.production.yml (deprecated copy)
- veza-stream-server/docker-compose.production.yml (deprecated copy)

Annotated ghost features in MSW handlers:
- Education endpoints marked as GHOST FEATURE (no backend)
- Gamification endpoints marked as GHOST FEATURE (no backend)

Not removed (out of scope for this commit):
- veza-desktop/ and veza-mobile/ (separate issue)
- Root-level audit markdown reports (product owner decision)

Addresses audit findings: debt items 12-18 (dead code, ghost features).

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-11 22:52:59 +01:00
senke
c62d63fc05 fix(stream): migrate sqlx query! macros to runtime queries
- Convert all sqlx::query!() and sqlx::query_scalar!() compile-time
  macros to runtime sqlx::query() and sqlx::query_scalar() with .bind()
- Affected files: segment_tracker.rs, processor.rs, callbacks.rs
- This removes the dependency on .sqlx/ directory for offline mode
- Update Dockerfile to remove SQLX_OFFLINE=true and .sqlx COPY
- Stream server can now compile without a live database connection

The compile-time macros required either a DATABASE_URL at build time or
a .sqlx directory with cached query metadata (neither was available).
Runtime queries trade compile-time SQL validation for buildability.

Addresses audit finding: debt item 1 (stream server compilation).

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-11 22:49:30 +01:00
senke
2d3cb18b7c fix(security): restrict CORS origins in stream-server
- Change default ALLOWED_ORIGINS from wildcard (*) to localhost:5173
  in veza-stream-server/docker-compose.yml
- Also fixed local .env (untracked) to use specific dev domains

Previously, the stream-server docker-compose defaulted to ALLOWED_ORIGINS=*
which would allow any origin to access the streaming API.

Addresses audit finding: A05 (Security Misconfiguration) — HIGH.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-11 22:42:04 +01:00
senke
db47f203f6 fix(security): implement JWT auth on stream-server WebSocket
- Validate JWT token via AuthManager before accepting WebSocket connections
- Extract user_id from validated token claims instead of trusting query params
- Reject unauthenticated connections with 401 Unauthorized
- Add `authenticated` field to WebSocketConnection struct
- Update websocket_handler_wrapper to handle auth error responses

Previously, the WebSocket handler accepted all connections without
validating the token (comment: "pour l'instant, on accepte la connexion").
Now requires a valid JWT token via ?token= query param or Authorization header.

Addresses audit finding: A01 (Broken Access Control) — CRITICAL.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-11 22:41:35 +01:00
senke
a83a76e942 chore(rust): chat server env, veza-common auth, stream server routes/websocket
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-11 22:19:17 +01:00
senke
55fbeb9e48 feat(stream): add JWT revocation persistante Redis (P3.1)
- Add SessionRevocationStore trait with InMemoryRevocationStore and RedisRevocationStore
- Wire Redis store when REDIS_URL in config.cache, fallback in-memory
- Session revocation by session_id persists across restarts when using Redis

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-11 22:10:07 +01:00
senke
f52858f14b fix(security): validate OAuth redirect URL against allowlist, require auth for internal transcode endpoint
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-11 21:28:26 +01:00
senke
7f63bc6641 fix(security): remove hardcoded credentials from stream server auth
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-11 19:50:17 +01:00
senke
44ddd3b858 chore(incus): add env template, document setup
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-11 19:49:01 +01:00
senke
d7bb127920 fix(security): stop tracking veza-stream-server/.env and config/incus env files
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-11 19:48:51 +01:00
senke
ad60247f33 feat: global update including storybook setup and backend fixes
- Web: Setup Storybook, added addons, configured Tailwind, added stories for UI components.
- Backend: Updated API router, database, workers, and auth in common.
- Stream Server: Removed SQLx queries and updated auth.
- Docs & Scripts: Updated documentation and recovery scripts.
2026-02-02 19:34:14 +01:00
senke
f74b020d4b api-contracts: install openapi-generator-cli and create type generation script
- Completed Action 1.1.2.1: Installed @openapitools/openapi-generator-cli
- Completed Action 1.1.2.2: Created generate-types.sh script
- Added swagger annotations to cmd/modern-server/main.go
- Regenerated swagger.yaml with proper info section
- Successfully generated TypeScript types to src/types/generated/

The script generates types from veza-backend-api/openapi.yaml using
typescript-axios generator and creates barrel exports.
2026-01-11 16:30:43 +01:00
senke
228d6a166a fix(backend): re-enable audio streaming dependencies
- Uncommented m3u8-rs in stream-server configuration
- This unblocks the audio streaming capability for the MVP
2026-01-11 03:19:18 +01:00
senke
718265ad01 docs: finalize walkthrough with dashboard screenshot and verification results 2026-01-04 01:44:23 +01:00
senke
634d0db22f fix: resolve stream server compilation errors and integrate chat stability fixes 2026-01-04 01:44:22 +01:00
senke
0e7b6fede1 [T0-002] fix(rust): Corriger erreurs compilation Rust
- Conflit SQLx résolu (alignement sur version 0.7)
- build.rs configurés pour protoc dans chat/stream servers
- API Prometheus migrée vers HistogramOpts
- Traits Display/Debug corrigés (String au lieu de &dyn Display)
- API TOTP corrigée (totp-rs 5.4 avec Secret::Encoded)
- Layers tracing-subscriber corrigés (types conditionnels)
- VezaError/VezaResult exportés dans lib.rs
- TransactionProvider simplifié (retour void au lieu de Box<dyn>)
- VezaConfig contraint Serialize pour to_json()

Files: veza-common/Cargo.toml, veza-common/src/*.rs, veza-chat-server/Cargo.toml, veza-chat-server/build.rs, veza-stream-server/Cargo.toml, veza-stream-server/build.rs, VEZA_ROADMAP.json
Hours: 8 estimated, 3 actual
2026-01-04 01:44:20 +01:00
senke
cdf7da36d1 [FIX] PROD-003: Corriger imports use-toast → useToast 2026-01-04 01:44:17 +01:00
senke
bd7f184dce [LOGGING] Fix #24: Standardisation LOG_LEVEL pour tous les services - Support LOG_LEVEL dans Rust et frontend avec fallback 2026-01-04 01:44:16 +01:00
senke
9cd76a512f [LOGGING] Fix #10: Erreurs silencieuses - Ajout de logs avec contexte pour toutes les erreurs dans core/auth et core/track 2026-01-04 01:44:15 +01:00
senke
2dfde29f7d refonte: backend-api go first; phase 1 2025-12-12 21:34:34 -05:00
okinrev
87c6461900 report generation and future tasks selection 2025-12-08 19:57:54 +01:00
okinrev
cfe6ed0119 STABILISATION: phase 1 & phase 2 2025-12-06 14:45:07 +01:00
okinrev
201a3adcff fix(stream-processor): replace unsafe abort with graceful join to drain events 2025-12-06 11:52:34 +01:00
okinrev
b7955a680c P0: stabilisation backend/chat/stream + nouvelle base migrations v1
Backend Go:
- Remplacement complet des anciennes migrations par la base V1 alignée sur ORIGIN.
- Durcissement global du parsing JSON (BindAndValidateJSON + RespondWithAppError).
- Sécurisation de config.go, CORS, statuts de santé et monitoring.
- Implémentation des transactions P0 (RBAC, duplication de playlists, social toggles).
- Ajout d’un job worker structuré (emails, analytics, thumbnails) + tests associés.
- Nouvelle doc backend : AUDIT_CONFIG, BACKEND_CONFIG, AUTH_PASSWORD_RESET, JOB_WORKER_*.

Chat server (Rust):
- Refonte du pipeline JWT + sécurité, audit et rate limiting avancé.
- Implémentation complète du cycle de message (read receipts, delivered, edit/delete, typing).
- Nettoyage des panics, gestion d’erreurs robuste, logs structurés.
- Migrations chat alignées sur le schéma UUID et nouvelles features.

Stream server (Rust):
- Refonte du moteur de streaming (encoding pipeline + HLS) et des modules core.
- Transactions P0 pour les jobs et segments, garanties d’atomicité.
- Documentation détaillée de la pipeline (AUDIT_STREAM_*, DESIGN_STREAM_PIPELINE, TRANSACTIONS_P0_IMPLEMENTATION).

Documentation & audits:
- TRIAGE.md et AUDIT_STABILITY.md à jour avec l’état réel des 3 services.
- Cartographie complète des migrations et des transactions (DB_MIGRATIONS_*, DB_TRANSACTION_PLAN, AUDIT_DB_TRANSACTIONS, TRANSACTION_TESTS_PHASE3).
- Scripts de reset et de cleanup pour la lab DB et la V1.

Ce commit fige l’ensemble du travail de stabilisation P0 (UUID, backend, chat et stream) avant les phases suivantes (Coherence Guardian, WS hardening, etc.).
2025-12-06 11:14:38 +01:00
okinrev
a01d7a25ac adding initial stream server (Rust) 2025-12-03 20:36:56 +01:00