mirror of
https://github.com/librespeed/speedtest.git
synced 2026-08-04 14:48:38 +00:00
fix: server.json handling
This commit is contained in:
parent
1c7c44ed9c
commit
debd40b4f7
3 changed files with 5 additions and 6 deletions
|
|
@ -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 /
|
||||
|
||||
|
|
|
|||
|
|
@ -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 /
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue