change index.html logic

This commit is contained in:
aptalca 2020-01-06 16:28:18 -05:00 committed by Ryan Kuba
parent f5d46b8945
commit 73817b69fa
3 changed files with 9 additions and 12 deletions

View File

@ -156,9 +156,9 @@ In this instance `PUID=1000` and `PGID=1000`, to find yours use `id user` as bel
 
## Application Setup
Access the speedtest webui at `http://<server-ip>`.
The results database can be accessed at `http://<server-ip>/results/stats.php`.
The default template used is based on `example-singleServer-full.html`. However, all templates are provided for reference at `/config/www/`. If you place a custom file at `/config/www/index.html`, the custom file will be served after a container restart. Delete the file and restart to go back to the default.
Access the speedtest webui at `http://<server-ip>`. The results database can be accessed at `http://<server-ip>/results/stats.php` with the password set.
The default template used is based on `example-singleServer-full.html`. However, all templates are provided for reference at `/config/www/`. Feel free to customize `/config/www/index.html` as you like. Delete the file and restart to go back to the image default.
You can optionally place customized `speedtest.js` and `speedtest_worker.js` files under `/config/www` and they will supersede the defaults after a container start. Keep in mind that once you do so, they will no longer be updated. You can delete them and recreate the container to go back to the image defaults.
If you are setting up a mysql or postgresql database, you first need to import the tables into your database as described at the following link

View File

@ -49,9 +49,9 @@ optional_block_1_items: ""
# application setup block
app_setup_block_enabled: true
app_setup_block: |
Access the speedtest webui at `http://<server-ip>`.
The results database can be accessed at `http://<server-ip>/results/stats.php`.
The default template used is based on `example-singleServer-full.html`. However, all templates are provided for reference at `/config/www/`. If you place a custom file at `/config/www/index.html`, the custom file will be served after a container restart. Delete the file and restart to go back to the default.
Access the speedtest webui at `http://<server-ip>`. The results database can be accessed at `http://<server-ip>/results/stats.php` with the password set.
The default template used is based on `example-singleServer-full.html`. However, all templates are provided for reference at `/config/www/`. Feel free to customize `/config/www/index.html` as you like. Delete the file and restart to go back to the image default.
You can optionally place customized `speedtest.js` and `speedtest_worker.js` files under `/config/www` and they will supersede the defaults after a container start. Keep in mind that once you do so, they will no longer be updated. You can delete them and recreate the container to go back to the image defaults.
If you are setting up a mysql or postgresql database, you first need to import the tables into your database as described at the following link

View File

@ -4,12 +4,9 @@
mkdir -p \
/config/www
# create index.html
if [ -f /config/www/index.html ]; then
cp /config/www/index.html /usr/share/webapps/librespeed/index.html
else
cp /defaults/index.html /usr/share/webapps/librespeed/index.html
fi
# create symlink to index.html
[[ ! -L /usr/share/webapps/librespeed/index.html ]] && \
ln -s /config/www/index.html /usr/share/webapps/librespeed/index.html
# update templates
cp /usr/share/webapps/librespeed/example*.html /config/www/