diff --git a/.gitignore b/.gitignore
index 77e9e3ed..4fe462ba 100755
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,6 @@
.vscode
.DS_Store
+config/*
config/pialert.conf
db/*
db/pialert.db
diff --git a/Dockerfile b/Dockerfile
index e1502cc4..a9f5eda5 100755
--- a/Dockerfile
+++ b/Dockerfile
@@ -25,8 +25,24 @@ RUN groupadd --gid "${USER_GID}" "${USER}" && \
COPY --chmod=775 --chown=${USER_ID}:${USER_GID} . /home/pi/pialert/
-# ENTRYPOINT ["tini", "--"]
+
+# β IMPORTANT - if you modify this file modify the /install/install_dependecies.sh file as well β
+
+RUN apt-get install -y \
+ tini snmp ca-certificates curl libwww-perl arp-scan perl apt-utils cron sudo \
+ nginx-light php php-cgi php-fpm php-sqlite3 php-curl sqlite3 dnsutils net-tools \
+ python3 iproute2 nmap python3-pip zip systemctl usbutils traceroute
+
+# Alternate dependencies
+RUN apt-get install nginx nginx-core mtr php-fpm php8.2-fpm php-cli php8.2 php8.2-sqlite3 -y
+RUN phpenmod -v 8.2 sqlite3
+
+# Setup virtual python environment and use pip3 to install packages
+RUN apt-get install -y python3-venv
+RUN python3 -m venv myenv
+RUN /bin/bash -c "source myenv/bin/activate && update-alternatives --install /usr/bin/python python /usr/bin/python3 10 && pip3 install requests paho-mqtt scapy cron-converter pytz json2table dhcp-leases pyunifi speedtest-cli chardet"
+
CMD ["/home/pi/pialert/dockerfiles/start.sh"]
-## command to build docker: DOCKER_BUILDKIT=1 docker build . --iidfile dockerID
+
diff --git a/config/pialert.conf b/back/pialert.conf
similarity index 100%
rename from config/pialert.conf
rename to back/pialert.conf
diff --git a/db/pialert.db b/back/pialert.db
similarity index 100%
rename from db/pialert.db
rename to back/pialert.db
diff --git a/docker-compose.yml b/docker-compose.yml
index f82406fb..db933b65 100755
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -11,10 +11,10 @@ services:
network_mode: host
# restart: unless-stopped
volumes:
- # - ${APP_DATA_LOCATION}/pialert_dev/config:/home/pi/pialert/config
- - ${APP_DATA_LOCATION}/pialert/config:/home/pi/pialert/config
- # - ${APP_DATA_LOCATION}/pialert_dev/db:/home/pi/pialert/db
- - ${APP_DATA_LOCATION}/pialert/db:/home/pi/pialert/db
+ - ${APP_DATA_LOCATION}/pialert_dev/config:/home/pi/pialert/config
+ # - ${APP_DATA_LOCATION}/pialert/config:/home/pi/pialert/config
+ - ${APP_DATA_LOCATION}/pialert_dev/db:/home/pi/pialert/db
+ # - ${APP_DATA_LOCATION}/pialert/db:/home/pi/pialert/db
# (optional) useful for debugging if you have issues setting up the container
- ${LOGS_LOCATION}:/home/pi/pialert/front/log
# ---------------------------------------------------------------------------
@@ -33,11 +33,10 @@ services:
- ${DEV_LOCATION}/front/js:/home/pi/pialert/front/js
- ${DEV_LOCATION}/dockerfiles/start.sh:/home/pi/pialert/dockerfiles/start.sh
- ${DEV_LOCATION}/dockerfiles/user-mapping.sh:/home/pi/pialert/dockerfiles/user-mapping.sh
- - ${DEV_LOCATION}/install/install.sh:/home/pi/pialert/install/install.sh
- - ${DEV_LOCATION}/install/install_python.sh:/home/pi/pialert/install/install_python.sh
+ - ${DEV_LOCATION}/install/install.sh:/home/pi/pialert/install/install.sh
- ${DEV_LOCATION}/install/install_dependencies.sh:/home/pi/pialert/install/install_dependencies.sh
- ${DEV_LOCATION}/front/api:/home/pi/pialert/front/api
- - ${DEV_LOCATION}/front/php:/home/pi/pialert/front/php
+ - ${DEV_LOCATION}/front/php:/home/pi/pialert/front/php
- ${DEV_LOCATION}/front/deviceDetails.php:/home/pi/pialert/front/deviceDetails.php
- ${DEV_LOCATION}/front/deviceDetailsTools.php:/home/pi/pialert/front/deviceDetailsTools.php
- ${DEV_LOCATION}/front/devices.php:/home/pi/pialert/front/devices.php
diff --git a/dockerfiles/start.sh b/dockerfiles/start.sh
index 177cd615..0cad0a04 100755
--- a/dockerfiles/start.sh
+++ b/dockerfiles/start.sh
@@ -27,8 +27,7 @@ fi
echo "[INSTALL] Run setup scripts"
"$INSTALL_DIR/pialert/dockerfiles/user-mapping.sh"
-"$INSTALL_DIR/pialert/install/install_dependencies.sh"
-"$INSTALL_DIR/pialert/install/install_python.sh"
+"$INSTALL_DIR/pialert/install/install_dependencies.sh" # if modifying this file transfer the chanegs into the root Dockerfile as well!
# Change port number if set
if [ -n "${PORT}" ]; then
@@ -73,11 +72,10 @@ fi
# Fixing file permissions
echo "[INSTALL] Fixing file permissions"
-chmod -R a+rwx $INSTALL_DIR
+
chmod -R a+rwx /var/www/html
chmod -R a+rw $INSTALL_DIR/pialert/front/log
-chmod -R a+rw $INSTALL_DIR/pialert/config
-sudo chgrp -R www-data $INSTALL_DIR/pialert
+chmod -R a+rwx $INSTALL_DIR
FILEDB=$INSTALL_DIR/pialert/db/pialert.db
@@ -85,14 +83,16 @@ if [ -f "$FILEDB" ]; then
chown -R www-data:www-data $INSTALL_DIR/pialert/db/pialert.db
fi
+echo "[INSTALL] Copy starter pialert.db and pialert.conf if they don't exist"
-echo "[INSTALL] Create pialert.db and pialert.conf backups"
+# Copy starter pialert.db and pialert.conf if they don't exist
+cp -n "$INSTALL_DIR/pialert/back/pialert.conf" "$INSTALL_DIR/pialert/config/pialert.conf"
+cp -n "$INSTALL_DIR/pialert/back/pialert.db" "$INSTALL_DIR/pialert/db/pialert.db"
-# Create a backup of pialert.conf
-cp "$INSTALL_DIR/pialert/config/pialert.conf" "$INSTALL_DIR/pialert/back/pialert.conf_bak"
-# Create a backup of pialert.db
-cp "$INSTALL_DIR/pialert/db/pialert.db" "$INSTALL_DIR/pialert/back/pialert.db_bak"
+chmod -R a+rwx $INSTALL_DIR # second time after we copied the files
+chmod -R a+rw $INSTALL_DIR/pialert/config
+sudo chgrp -R www-data $INSTALL_DIR/pialert
# Create buildtimestamp.txt
date +%s > "$INSTALL_DIR/pialert/front/buildtimestamp.txt"
diff --git a/front/php/templates/language/en_us.json b/front/php/templates/language/en_us.json
index fcbeb034..69f89552 100755
--- a/front/php/templates/language/en_us.json
+++ b/front/php/templates/language/en_us.json
@@ -607,6 +607,8 @@
"Systeminfo_USB_Devices" : "USB Devices",
"report_select_format": "Select Format:",
"report_time": "Notification time:",
+ "report_guid": "Notification guid:",
+ "report_guid_missing": "Linked notification not found. The selected notification might have been deleted during maintenance as specified in the DBCLNP_NOTIFI_HIST setting. The latest notification is dispalyed instead. The missing notification has the following GUID:",
"Donations_Title" : "Donations",
"Donations_Text" : "Hey π! Thanks for clicking on this menu item π
I'm trying to collect some donations to make you better software. Also, it would help me not to get burned out. Me burning out might mean end of support for this app. Any small (recurring or not) sponsorship makes me want ot put more effort into this app. I don't want to lock features (new plugins) behind paywalls π. Currently, I'm waking up 2h before work so I contribute to the app a bit. If I had some recurring income I could shorten my workweek and in the remaining time fully focus on PiAlert. You'd get more functionality, a more polished app and less bugs. Thanks for reading - I'm super grateful for any support β€π TL;DR: By supporting me you get:
${guid}`)
}
+
+ // Load the notification with the specified GUID
+ updateData(formatSelect.value, index);
+
})
.catch(error => {
console.error('Error:', error);
diff --git a/install/install_dependencies.sh b/install/install_dependencies.sh
index b4620df4..4e54dea5 100755
--- a/install/install_dependencies.sh
+++ b/install/install_dependencies.sh
@@ -4,8 +4,7 @@ echo "---------------------------------------------------------"
echo "[INSTALL] Run install_dependencies.sh"
echo "---------------------------------------------------------"
-# Set environment variables
-INSTALL_DIR=/home/pi # Specify the installation directory here
+# β IMPORTANT - if you modify this file modify the root Dockerfile as well β
# Check if script is run as root
if [[ $EUID -ne 0 ]]; then
@@ -13,19 +12,22 @@ if [[ $EUID -ne 0 ]]; then
exit 1
fi
-
# Install dependencies
apt-get install -y \
tini snmp ca-certificates curl libwww-perl arp-scan perl apt-utils cron sudo \
nginx-light php php-cgi php-fpm php-sqlite3 php-curl sqlite3 dnsutils net-tools \
python3 iproute2 nmap python3-pip zip systemctl usbutils traceroute
-# ---------------------------------------------------------------
# alternate dependencies
-# sudo apt-get install mtr-tiny -y
-sudo apt-get install nginx nginx-core mtr php-fpm php8.2-fpm -y
-sudo apt-get install php-cli php8.2 php8.2-fpm -y
-sudo apt-get install php8.2-sqlite3 -y
+sudo apt-get install nginx nginx-core mtr php-fpm php8.2-fpm php-cli php8.2 php8.2-sqlite3 -y
sudo phpenmod -v 8.2 sqlite3
-# sudo apt-get install net-tools -y
-# ---------------------------------------------------------------
+
+# setup virtual python environment so we can use pip3 to install packages
+apt-get install python3.11-venv -y
+python3 -m venv myenv
+source myenv/bin/activate
+
+update-alternatives --install /usr/bin/python python /usr/bin/python3 10
+
+# install packages thru pip3
+pip3 install requests paho-mqtt scapy cron-converter pytz json2table dhcp-leases pyunifi speedtest-cli chardet
diff --git a/install/install_python.sh b/install/install_python.sh
deleted file mode 100755
index 381a1b80..00000000
--- a/install/install_python.sh
+++ /dev/null
@@ -1,17 +0,0 @@
-#!/bin/bash
-
-# apt-get install python3-requests python3-paho-mqtt python3-scapy -y
-echo "---------------------------------------------------------"
-echo "[INSTALL] Run install_python.sh"
-echo "---------------------------------------------------------"
-
-# setup virtual python environment so we can use pip3 to install packages
-apt-get install python3.11-venv -y
-python3 -m venv myenv
-source myenv/bin/activate
-
-update-alternatives --install /usr/bin/python python /usr/bin/python3 10
-
-# install packages thru pip3
-pip3 install requests paho-mqtt scapy cron-converter pytz json2table dhcp-leases pyunifi speedtest-cli chardet
-
diff --git a/pialert/helper.py b/pialert/helper.py
index 57718e7f..3cde4d0b 100755
--- a/pialert/helper.py
+++ b/pialert/helper.py
@@ -191,11 +191,11 @@ def filePermissions():
(confR_access, dbR_access) = checkPermissionsOK() # Initial check
if confR_access == False:
- initialiseFile(fullConfPath, "/home/pi/pialert/back/pialert.conf_bak" )
+ initialiseFile(fullConfPath, "/home/pi/pialert/back/pialert.conf" )
# check and initialize pialert.db
if dbR_access == False:
- initialiseFile(fullDbPath, "/home/pi/pialert/back/pialert.db_bak")
+ initialiseFile(fullDbPath, "/home/pi/pialert/back/pialert.db")
# last attempt
fixPermissions()