From 8d4d985fba5436bac73d962c82fb539b46de6659 Mon Sep 17 00:00:00 2001 From: Jokob-sk Date: Fri, 22 Mar 2024 11:37:17 +1100 Subject: [PATCH] path debug output #593, docs #598, Unassign network node #601 --- dockerfiles/README.md | 3 ++- dockerfiles/pre-setup.sh | 12 ++++++++++-- dockerfiles/setup.sh | 8 ++++++++ front/deviceDetails.php | 8 ++++++++ front/js/ui_components.js | 4 ++-- front/multiEditCore.php | 2 +- front/php/server/devices.php | 3 +++ front/settings.php | 29 ++++++++--------------------- 8 files changed, 42 insertions(+), 27 deletions(-) diff --git a/dockerfiles/README.md b/dockerfiles/README.md index e7668402..aee628c9 100755 --- a/dockerfiles/README.md +++ b/dockerfiles/README.md @@ -49,7 +49,7 @@ docker run -d --rm --network=host \ | Required | Path | Description | | :------------- | :------------- | :-------------| -| ✅ | `:/home/pi/pialert/config` | Folder which will contain the `pialert.conf` & `devices.csv` ([read about devices.csv](https://github.com/jokob-sk/Pi.Alert/blob/main/docs/DEVICES_BULK_EDITING.md)) files (see below for details) | +| ✅ | `:/home/pi/pialert/config` | Folder which will contain the `pialert.conf` & `devices.csv` ([read about devices.csv](https://github.com/jokob-sk/Pi.Alert/blob/main/docs/DEVICES_BULK_EDITING.md)) files (see below for details). | | ✅ | `:/home/pi/pialert/db` | Folder which will contain the `pialert.db` file | | | `:/home/pi/pialert/front/log` | Logs folder useful for debugging if you have issues setting up the container | | | `:/etc/pihole/pihole-FTL.db` | PiHole's `pihole-FTL.db` database file. Required if you want to use PiHole DB mapping. | @@ -58,6 +58,7 @@ docker run -d --rm --network=host \ | | `:/home/pi/pialert/front/plugins//ignore_plugin` | Map a file `ignore_plugin` to ignore a plugin. Plugins can be soft-disabled via settings. More in the [Plugin docs](https://github.com/jokob-sk/Pi.Alert/blob/main/front/plugins/README.md). | | | `:/etc/resolv.conf` | Use a custom `resolv.conf` file for [better name resolution](https://github.com/jokob-sk/Pi.Alert/blob/main/docs/REVERSE_DNS.md). | +> Use separate `db` and `config` directories, don't nest them. ### Modify the config (`pialert.conf`) only if UI is not available diff --git a/dockerfiles/pre-setup.sh b/dockerfiles/pre-setup.sh index 26315e89..092271a0 100755 --- a/dockerfiles/pre-setup.sh +++ b/dockerfiles/pre-setup.sh @@ -21,9 +21,17 @@ echo "longrun" > /etc/s6-overlay/s6-rc.d/pialert/type echo -e "${INSTALL_DIR}/pialert/dockerfiles/setup.sh" > /etc/s6-overlay/s6-rc.d/SetupOneshot/up echo -e "#!/bin/execlineb -P\n/usr/sbin/php-fpm82 -F" > /etc/s6-overlay/s6-rc.d/php-fpm/run echo -e '#!/bin/execlineb -P\nnginx -g "daemon off;"' > /etc/s6-overlay/s6-rc.d/nginx/run -echo -e '#!/bin/execlineb -P\n\nwith-contenv\nimportas -i PORT PORT\nif { echo "[INSTALL] 🚀 Starting app - navigate to your :${PORT}" }' > /etc/s6-overlay/s6-rc.d/pialert/run +echo -e '#!/bin/execlineb -P + with-contenv + + importas -u PORT PORT + + if { echo + " + [INSTALL] 🚀 Starting app (:${PORT}) + + " }' > /etc/s6-overlay/s6-rc.d/pialert/run echo -e "python ${INSTALL_DIR}/pialert/pialert" >> /etc/s6-overlay/s6-rc.d/pialert/run -echo -e 'echo path is ${PATH}' >> /etc/s6-overlay/s6-rc.d/pialert/run touch /etc/s6-overlay/s6-rc.d/user/contents.d/{SetupOneshot,php-fpm,nginx} /etc/s6-overlay/s6-rc.d/{php-fpm,nginx}/dependencies.d/SetupOneshot touch /etc/s6-overlay/s6-rc.d/user/contents.d/{SetupOneshot,php-fpm,nginx,pialert} /etc/s6-overlay/s6-rc.d/{php-fpm,nginx,pialert}/dependencies.d/SetupOneshot touch /etc/s6-overlay/s6-rc.d/nginx/dependencies.d/php-fpm diff --git a/dockerfiles/setup.sh b/dockerfiles/setup.sh index 32c98003..2294cdc6 100755 --- a/dockerfiles/setup.sh +++ b/dockerfiles/setup.sh @@ -77,3 +77,11 @@ if [ ! -f "${INSTALL_DIR}/pialert/front/buildtimestamp.txt" ]; then date +%s > "${INSTALL_DIR}/pialert/front/buildtimestamp.txt" chown nginx:www-data "${INSTALL_DIR}/pialert/front/buildtimestamp.txt" fi + +echo -e " + [ENV] PATH is ${PATH} + [ENV] PORT is ${PORT} + [ENV] TZ is ${TZ} + [ENV] LISTEN_ADDR is ${LISTEN_ADDR} + [ENV] ALWAYS_FRESH_INSTALL is ${ALWAYS_FRESH_INSTALL} + " diff --git a/front/deviceDetails.php b/front/deviceDetails.php index fe920b98..f52d4e0e 100755 --- a/front/deviceDetails.php +++ b/front/deviceDetails.php @@ -621,6 +621,10 @@ + + + + `; - readData(optionsArray[0], generateDropdownOptions, valuesArray, targetLocation_options); + readData(optionsArray[0], callbackToGenerateEntries, valuesArray, targetLocation_options); } else // this should be already an array, e.g. from a setting or pre-defined { diff --git a/front/multiEditCore.php b/front/multiEditCore.php index bd763a5f..09ba394b 100755 --- a/front/multiEditCore.php +++ b/front/multiEditCore.php @@ -112,7 +112,7 @@ targetLocation = columns[j].Code_Name + "_initSettingDropdown" - initSettingDropdown(columns[j].Code_Name, [], targetLocation) + initSettingDropdown(columns[j].Code_Name, [], targetLocation, generateDropdownOptions) input = `