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
20 lines
762 B
Docker
20 lines
762 B
Docker
# uj-mastering-master — web UI
|
|
#
|
|
# The web UI is a static site: decoding and every metric run in the visitor's
|
|
# browser (web/dsp.js inside a Web Worker). This image only serves files — no
|
|
# application server, no upload endpoint, nothing written anywhere — so it runs
|
|
# read-only as nginx's unprivileged user. See deploy/nginx.conf for the CSP that
|
|
# stops the page from making network requests at all.
|
|
#
|
|
# The desktop app (PyQt5) is unaffected and not part of this image.
|
|
|
|
FROM nginxinc/nginx-unprivileged:stable-alpine
|
|
|
|
COPY deploy/nginx.conf /etc/nginx/conf.d/default.conf
|
|
COPY web/ /usr/share/nginx/html/
|
|
|
|
EXPOSE 8080
|
|
|
|
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
|
|
CMD wget -q -O /dev/null http://127.0.0.1:8080/ || exit 1
|