fix: server.json handling

This commit is contained in:
Stefan Stidl 2026-03-18 23:56:18 +01:00
parent 1c7c44ed9c
commit debd40b4f7
3 changed files with 5 additions and 6 deletions

View file

@ -27,8 +27,6 @@ COPY index-modern.html /speedtest/
COPY config.json /speedtest/
COPY favicon.ico /speedtest/
COPY docker/servers.json /servers.json
COPY docker/*.php /speedtest/
COPY docker/entrypoint.sh /

View file

@ -41,8 +41,6 @@ COPY index-modern.html /speedtest/
COPY config.json /speedtest/
COPY favicon.ico /speedtest/
COPY docker/servers.json /servers.json
COPY docker/*.php /speedtest/
COPY docker/entrypoint.sh /

View file

@ -69,8 +69,11 @@ if [[ "$MODE" == "frontend" || "$MODE" == "dual" || "$MODE" == "standalone" ]];
# Copy frontend config files
cp /speedtest/frontend/settings.json /var/www/html/settings.json 2>/dev/null || true
if [ ! -f /var/www/html/server-list.json ]; then
echo "no server-list.json found, create one for local host"
if [ -f /servers.json ]; then
echo "using mounted /servers.json for server-list.json"
cp /servers.json /var/www/html/server-list.json
else
echo "no /servers.json found, create one for local host"
# generate config for just the local server
echo '[{"name":"local","server":"/backend", "dlURL": "garbage.php", "ulURL": "empty.php", "pingURL": "empty.php", "getIpURL": "getIP.php", "sponsorName": "", "sponsorURL": "", "id":1 }]' > /var/www/html/server-list.json
fi