diff --git a/readme-vars.yml b/readme-vars.yml index 132cd5c..bacdec3 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -45,6 +45,7 @@ opt_param_env_vars: - { env_var: "DB_USERNAME", env_value: "DB_USERNAME", desc: "Database username. Required for mysql and pgsql."} - { env_var: "DB_PASSWORD", env_value: "DB_PASSWORD", desc: "Database password. Required for mysql and pgsql."} - { env_var: "DB_PORT", env_value: "DB_PORT", desc: "Database port. Required for mysql."} + - { env_var: "IPINFO_APIKEY", env_value: "ACCESS_TOKEN", desc: "Access token from ipinfo.io. Required for detailed IP information."} optional_block_1: false optional_block_1_items: "" @@ -64,6 +65,7 @@ app_setup_block: | # changelog changelogs: + - { date: "14.05.23:", desc: "Added support for ipinfo.io" } - { date: "20.01.23:", desc: "Rebase to alpine 3.17 with php8.1." } - { date: "20.08.22:", desc: "Rebasing to alpine 3.15 with php8. Restructure nginx configs ([see changes announcement](https://info.linuxserver.io/issues/2022-08-20-nginx-base))." } - { date: "01.03.21:", desc: "Fix up database settings. Make sure `index.html` is recreated." } diff --git a/root/etc/s6-overlay/s6-rc.d/init-librespeed-config/run b/root/etc/s6-overlay/s6-rc.d/init-librespeed-config/run index 77fb5ac..626d21e 100755 --- a/root/etc/s6-overlay/s6-rc.d/init-librespeed-config/run +++ b/root/etc/s6-overlay/s6-rc.d/init-librespeed-config/run @@ -21,6 +21,12 @@ if [[ -f /config/www/speedtest_worker.js ]]; then cp /config/www/speedtest_worker.js /app/www/public/speedtest_worker.js fi +# sets apikey for ipinfo.io, if it exists +if [ -n "$IPINFO_APIKEY" ]; then + sed -i "s/\$IPINFO_APIKEY = .*/\$IPINFO_APIKEY = '${IPINFO_APIKEY:-}';/g" \ + /app/www/public/backend/getIP_ipInfo_apikey.php +fi + # enables custom results page if [ "$CUSTOM_RESULTS" == "true" ]; then echo "custom results"