e8da88b6c1
The FastAPI backend kept one analysis session shared by every visitor and spooled each upload to the server's /tmp, and the browser copied audio into persistent OPFS storage. None of that fits a tool for unreleased masters, so the web UI is now a static site that decodes and analyses in the tab: - web/decode.js: WAV/AIFF PCM and float read directly with libsndfile's scaling (bit-identical to librosa.load; Chromium's WAV decoder scales positive int16 by 1/32767), other formats via decodeAudioData on an OfflineAudioContext at the header-sniffed native rate. ID3 song names. - web/dsp.js: ports of every Metric.compute with the same numerics (pyloudnorm K-weighting via lfilter's DF2T recurrence, BS.1770 gating, EBU LRA, resample_poly's Kaiser filter for true peak, librosa.stft and amplitude_to_db), streaming passes with no signal-length intermediates. - web/metrics.js: build_spec ports producing the existing plot payload. - web/analysis-worker.js + app.js: per-tab track list and result cache, a worker job queue where the visible metric jumps background prefetch, and the renderer, which now also draws the metrics' own reference lines. Deployment is nginx-unprivileged serving web/ read-only with Content-Security-Policy connect-src 'none', so the page cannot make network requests at all, and no access log. No secure context is needed, so plain http on a LAN works. The Python web backend, its smoke test, the web extra and the OPFS store are removed; the desktop app is unchanged. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015UXA39Sh9coAx4FhRkd8R2
38 lines
899 B
YAML
38 lines
899 B
YAML
# uj-mastering-master — web UI, container deployment template.
|
|
#
|
|
# docker compose up -d --build
|
|
# open http://localhost:8080
|
|
#
|
|
# The container serves static files only. Audio is decoded and analysed inside
|
|
# the visitor's browser tab and never sent anywhere (the page's CSP forbids
|
|
# network requests), so there is nothing to upload, persist or log here — and no
|
|
# volumes, on purpose.
|
|
|
|
services:
|
|
ujm-web:
|
|
build: .
|
|
image: uj-mastering-master-web:local
|
|
container_name: ujm-web
|
|
|
|
ports:
|
|
- "8080:8080"
|
|
|
|
# Nothing to write: nginx only needs somewhere for its pid file and empty
|
|
# temp directories.
|
|
read_only: true
|
|
tmpfs:
|
|
- /tmp:size=16m,mode=1777
|
|
|
|
security_opt:
|
|
- no-new-privileges:true
|
|
cap_drop:
|
|
- ALL
|
|
|
|
restart: unless-stopped
|
|
|
|
logging:
|
|
driver: json-file
|
|
options:
|
|
max-size: "1m"
|
|
max-file: "2"
|