Skip to content

Commit debd40b

Browse files
author
Stefan Stidl
committed
fix: server.json handling
1 parent 1c7c44e commit debd40b

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

Dockerfile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ COPY index-modern.html /speedtest/
2727
COPY config.json /speedtest/
2828
COPY favicon.ico /speedtest/
2929

30-
COPY docker/servers.json /servers.json
31-
3230
COPY docker/*.php /speedtest/
3331
COPY docker/entrypoint.sh /
3432

Dockerfile.alpine

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@ COPY index-modern.html /speedtest/
4141
COPY config.json /speedtest/
4242
COPY favicon.ico /speedtest/
4343

44-
COPY docker/servers.json /servers.json
45-
4644
COPY docker/*.php /speedtest/
4745
COPY docker/entrypoint.sh /
4846

docker/entrypoint.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,11 @@ if [[ "$MODE" == "frontend" || "$MODE" == "dual" || "$MODE" == "standalone" ]];
6969

7070
# Copy frontend config files
7171
cp /speedtest/frontend/settings.json /var/www/html/settings.json 2>/dev/null || true
72-
if [ ! -f /var/www/html/server-list.json ]; then
73-
echo "no server-list.json found, create one for local host"
72+
if [ -f /servers.json ]; then
73+
echo "using mounted /servers.json for server-list.json"
74+
cp /servers.json /var/www/html/server-list.json
75+
else
76+
echo "no /servers.json found, create one for local host"
7477
# generate config for just the local server
7578
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
7679
fi

0 commit comments

Comments
 (0)