Fix MUSIC_PATH direct mount + backend URL prefill

- MUSIC_PATH is now used 1:1 inside the container (no /music remapping)
- config.js 404-safe with inline fallback defaults
- Prefill uses .trim() so empty strings don't overwrite fields

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
HoneyandClaude Sonnet 4.6 committed 2026-04-25 17:37:30 +02:00
1 parent 56c5662a11
commit 6e00b78219
5 files changed
+11 -9

No files matched your search

+3 -2
View File
@@ -4,8 +4,9 @@
NAVIDROME_URL=https://music.yourdomain.com
BACKEND_URL=https://novasonic-api.yourdomain.com
# Path to your Navidrome music library on the host
MUSIC_PATH=/path/to/your/navidrome/music
# Absolute path to your Navidrome music library on the host
# This exact path is used inside the container — no subdirectory is added
MUSIC_PATH=/srv/navidrome/music
AUDIO_FMT=mp3 # mp3 | flac | opus | best
AUDIO_QUALITY=0 # 0 = best quality
+2 -2
View File
@@ -111,8 +111,8 @@ window.addEventListener('load',()=>{
const saved=localStorage.getItem('ns_cfg');
if(saved){cfg=JSON.parse(saved);startApp()}
// Autofill URLs from Docker env (set via config.js)
if(window.NS_SERVER_URL){const el=document.getElementById('srv-url');if(el&&!el.value)el.value=window.NS_SERVER_URL;}
if(window.NS_BACKEND_URL){const el=document.getElementById('backend-url');if(el&&!el.value)el.value=window.NS_BACKEND_URL;}
if(window.NS_SERVER_URL?.trim()){const el=document.getElementById('srv-url');if(el&&!el.value)el.value=window.NS_SERVER_URL.trim();}
if(window.NS_BACKEND_URL?.trim()){const el=document.getElementById('backend-url');if(el&&!el.value)el.value=window.NS_BACKEND_URL.trim();}
document.getElementById('srv-pass').addEventListener('keydown',e=>{if(e.key==='Enter')doConnect()});
audio.addEventListener('timeupdate',updateProgress);
audio.addEventListener('ended',onEnded);
+3 -3
View File
@@ -19,12 +19,12 @@ services:
working_dir: /app
volumes:
- ./backend/novasonic-server.js:/app/novasonic-server.js:ro
- ${MUSIC_PATH:-/music}:/music # your Navidrome music library
- ${MUSIC_PATH}:${MUSIC_PATH} # exact path from .env, no remapping
ports:
- "3700:3700" # route this port through your reverse proxy
- "3700:3700" # route this port through your reverse proxy
environment:
- PORT=3700
- MUSIC_PATH=/music
- MUSIC_PATH=${MUSIC_PATH} # same path inside the container
- AUDIO_FMT=${AUDIO_FMT:-mp3}
- AUDIO_QUALITY=${AUDIO_QUALITY:-0}
- MAX_PARALLEL=${MAX_PARALLEL:-2}
+2 -1
View File
@@ -13,7 +13,8 @@
<link rel="preconnect" href="https://fonts.googleapis.com">
<link href="https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@300;400;500&display=swap" rel="stylesheet">
<link rel="stylesheet" href="styles.css">
<script src="config.js"></script>
<script>window.NS_SERVER_URL='';window.NS_BACKEND_URL='';</script>
<script src="config.js" onerror="0"></script>
<script src="app.js" defer></script>
</head>
<body>
+1 -1
View File
@@ -1,4 +1,4 @@
const CACHE = 'ns-v17';
const CACHE = 'ns-v18';
const PRECACHE = ['/', 'index.html', 'styles.css', 'app.js', 'sw.js', 'manifest.json', 'icon.svg'];
const SKIP_URLS = ['/rest/stream', '/rest/download', '/config.js'];