diff --git a/.dockerignore b/.dockerignore
index b9ddb743..1d55a42b 100755
--- a/.dockerignore
+++ b/.dockerignore
@@ -16,5 +16,4 @@ CONTRIBUTING
FUNDING.yml
config/.gitignore
db/.gitignore
-pialert/README.md
-pialert/README_ES.md
+
diff --git a/.github/ISSUE_TEMPLATE/i-have-an-issue.yml b/.github/ISSUE_TEMPLATE/i-have-an-issue.yml
index f5aedbf0..b50ae9b3 100755
--- a/.github/ISSUE_TEMPLATE/i-have-an-issue.yml
+++ b/.github/ISSUE_TEMPLATE/i-have-an-issue.yml
@@ -34,9 +34,9 @@ body:
required: false
- type: textarea
attributes:
- label: pialert.conf
+ label: app.conf
description: |
- Paste your `pialert.conf` (remove personal info)
+ Paste your `app.conf` (remove personal info)
render: python
validations:
required: false
@@ -58,13 +58,13 @@ body:
required: true
- type: textarea
attributes:
- label: pialert.log
+ label: app.log
description: |
Logs with debug enabled (https://github.com/jokob-sk/NetAlertX/blob/main/docs/DEBUG_TIPS.md) ⚠
***Generally speaking, all bug reports should have logs provided.***
Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in.
Additionally, any additional info? Screenshots? References? Anything that will give us more context about the issue you are encountering!
- You can use `tail -100 /home/pi/pialert/front/log/pialert.log` in teh container if you have troubles getting to the log files.
+ You can use `tail -100 /app/front/log/app.log` in the container if you have troubles getting to the log files.
validations:
required: false
- type: checkboxes
diff --git a/.github/workflows/docker_cache-cleaner.yml b/.github/workflows/docker_cache-cleaner.yml
index 8d7f61e7..43573815 100755
--- a/.github/workflows/docker_cache-cleaner.yml
+++ b/.github/workflows/docker_cache-cleaner.yml
@@ -4,8 +4,8 @@ on:
workflow_dispatch: # manual option
- schedule:
- - cron: '15 22 * * 1' # every Monday 10.15pm UTC (~11.15am Tuesday NZT)
+ # schedule:
+ # - cron: '15 22 * * 1' # every Monday 10.15pm UTC (~11.15am Tuesday NZT)
jobs:
diff --git a/.gitignore b/.gitignore
index 4fe462ba..ff1ef480 100755
--- a/.gitignore
+++ b/.gitignore
@@ -2,8 +2,10 @@
.DS_Store
config/*
config/pialert.conf
+config/app.conf
db/*
db/pialert.db
+db/app.db
front/log/*
front/api/*
**/plugins/**/*.log
diff --git a/Dockerfile b/Dockerfile
index 765c52f2..ab09a935 100755
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,6 +1,7 @@
FROM alpine:3.19 as builder
-ARG INSTALL_DIR=/home/pi
+ARG INSTALL_DIR=/app
+
ENV PYTHONUNBUFFERED 1
RUN apk add --no-cache bash python3 \
@@ -9,7 +10,7 @@ RUN apk add --no-cache bash python3 \
# Enable venv
ENV PATH="/opt/venv/bin:$PATH"
-COPY . ${INSTALL_DIR}/pialert/
+COPY . ${INSTALL_DIR}/
RUN pip install requests paho-mqtt scapy cron-converter pytz json2table dhcp-leases pyunifi speedtest-cli chardet \
&& bash -c "find ${INSTALL_DIR} -type d -exec chmod 750 {} \;" \
@@ -19,7 +20,7 @@ RUN pip install requests paho-mqtt scapy cron-converter pytz json2table dhcp-lea
# second stage
FROM alpine:3.19 as runner
-ARG INSTALL_DIR=/home/pi
+ARG INSTALL_DIR=/app
COPY --from=builder /opt/venv /opt/venv
@@ -40,12 +41,12 @@ RUN apk update --no-cache \
&& apk add --no-cache sqlite php82 php82-fpm php82-cgi php82-curl php82-sqlite3 php82-session \
&& apk add --no-cache python3 nginx \
&& ln -s /usr/bin/awake /usr/bin/wakeonlan \
- && bash -c "install -d -m 750 -o nginx -g www-data ${INSTALL_DIR} ${INSTALL_DIR}/pialert" \
+ && bash -c "install -d -m 750 -o nginx -g www-data ${INSTALL_DIR} ${INSTALL_DIR}" \
&& rm -f /etc/nginx/http.d/default.conf
-COPY --from=builder --chown=nginx:www-data ${INSTALL_DIR}/pialert/ ${INSTALL_DIR}/pialert/
+COPY --from=builder --chown=nginx:www-data ${INSTALL_DIR}/ ${INSTALL_DIR}/
-RUN ${INSTALL_DIR}/pialert/dockerfiles/pre-setup.sh
+RUN ${INSTALL_DIR}/dockerfiles/pre-setup.sh
HEALTHCHECK --interval=30s --timeout=5s --start-period=15s --retries=2 \
CMD curl -sf -o /dev/null ${LISTEN_ADDR}:${PORT}/api/app_state.json
diff --git a/Dockerfile.debian b/Dockerfile.debian
index 6b55d6fd..c2301beb 100755
--- a/Dockerfile.debian
+++ b/Dockerfile.debian
@@ -10,6 +10,7 @@ ENV USER=pi USER_ID=1000 USER_GID=1000 PORT=20211
RUN apt-get update
RUN apt-get install sudo -y
+ARG INSTALL_DIR=/app
# create pi user and group
# add root and www-data to pi group so they can r/w files and db
@@ -23,7 +24,7 @@ RUN groupadd --gid "${USER_GID}" "${USER}" && \
usermod -a -G ${USER_GID} root && \
usermod -a -G ${USER_GID} www-data
-COPY --chmod=775 --chown=${USER_ID}:${USER_GID} . /home/pi/pialert/
+COPY --chmod=775 --chown=${USER_ID}:${USER_GID} . ${INSTALL_DIR}/
# ❗ IMPORTANT - if you modify this file modify the /install/install_dependecies.debian.sh file as well ❗
@@ -43,8 +44,8 @@ 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"
# Create a buildtimestamp.txt to later check if a new version was released
-RUN date +%s > /home/pi/pialert/front/buildtimestamp.txt
+RUN date +%s > ${INSTALL_DIR}/front/buildtimestamp.txt
-CMD ["/home/pi/pialert/install/start.debian.sh"]
+CMD ["${INSTALL_DIR}/install/start.debian.sh"]
diff --git a/README.md b/README.md
index 20b8ec83..ae3fca74 100755
--- a/README.md
+++ b/README.md
@@ -74,7 +74,9 @@ Get visibility of what's going on on your WIFI/LAN network. Schedule scans for d
[](https://github.com/sponsors/jokob-sk)
-Thank you to all the wonderful people who are sponsoring this project (=preventing my burnout🔥🤯):
+Thank you to all the wonderful people who are sponsoring this project.
+
+> preventing my burnout😅 are:
| All Sponsors |
diff --git a/back/pialert.conf b/back/app.conf
similarity index 100%
rename from back/pialert.conf
rename to back/app.conf
diff --git a/back/pialert.db b/back/app.db
similarity index 100%
rename from back/pialert.db
rename to back/app.db
diff --git a/back/pialert-cli b/back/pialert-cli
index d7d2b720..8a800688 100755
--- a/back/pialert-cli
+++ b/back/pialert-cli
@@ -1,7 +1,7 @@
#!/bin/bash
SCRIPT=$(readlink -f $0)
SCRIPTPATH=`dirname $SCRIPT`
-CONFFILENAME="pialert.conf"
+CONFFILENAME="app.conf"
PIA_CONF_FILE=${SCRIPTPATH}'/../config/${CONFFILENAME}'
case $1 in
diff --git a/back/report_sample.html b/back/report_sample.html
index a00981a8..44d8c159 100755
--- a/back/report_sample.html
+++ b/back/report_sample.html
@@ -13,7 +13,7 @@
|
- NetAlertX Report
+ Net Alertx
|
diff --git a/back/report_template.html b/back/report_template.html
index 8a78b5f9..0b29cdd6 100755
--- a/back/report_template.html
+++ b/back/report_template.html
@@ -22,7 +22,7 @@
|
- NetAlertX Report
+ Net Alertx
|
@@ -55,7 +55,7 @@
NetAlertX
()
©2020 Puche (2022+
- jokob-sk) | Built on: | Version: |
+ jokob-sk) | Built on: | Version: |
Docs
diff --git a/back/report_template_new_version.html b/back/report_template_new_version.html
index 8576c3b9..40a4d3ab 100755
--- a/back/report_template_new_version.html
+++ b/back/report_template_new_version.html
@@ -22,7 +22,7 @@
|
- NetAlertX Report
+ Net Alertx Report
|
@@ -59,7 +59,7 @@
NetAlertX
()
©2020 Puche (2022+
- jokob-sk) | Built on: | Version: |
+ jokob-sk) | Built on: | Version: |
Docs
diff --git a/docker-compose.yml b/docker-compose.yml
index 243c219c..9bbfde2c 100755
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -11,12 +11,14 @@ services:
network_mode: host
# restart: unless-stopped
volumes:
- # - ${APP_DATA_LOCATION}/netalertx_dev/config:/home/pi/pialert/config
+ # - ${APP_DATA_LOCATION}/netalertx_dev/config:/app/config
+ # - ${APP_DATA_LOCATION}/netalertx/config:/app/config
- ${APP_DATA_LOCATION}/netalertx/config:/home/pi/pialert/config
- # - ${APP_DATA_LOCATION}/netalertx_dev/db:/home/pi/pialert/db
- - ${APP_DATA_LOCATION}/netalertx/db:/home/pi/pialert/db
+ # - ${APP_DATA_LOCATION}/netalertx_dev/db:/app/db
+ # - ${APP_DATA_LOCATION}/netalertx/db:/app/db
+ - ${APP_DATA_LOCATION}/netalertx/db:/home/pi/pialert/db
# (optional) useful for debugging if you have issues setting up the container
- # - ${LOGS_LOCATION}:/home/pi/pialert/front/log
+ # - ${LOGS_LOCATION}:/app/front/log
# ---------------------------------------------------------------------------
# DELETE START anyone trying to use this file: comment out / delete BELOW lines, they are only for development purposes
- ${APP_DATA_LOCATION}/netalertx/dhcp_samples/dhcp1.leases:/mnt/dhcp1.leases
@@ -24,39 +26,40 @@ services:
- ${APP_DATA_LOCATION}/netalertx/dhcp_samples/pihole_dhcp_full.leases:/etc/pihole/dhcp.leases
- ${APP_DATA_LOCATION}/netalertx/dhcp_samples/pihole_dhcp_2.leases:/etc/pihole/dhcp2.leases
- ${APP_DATA_LOCATION}/pihole/etc-pihole/pihole-FTL.db:/etc/pihole/pihole-FTL.db
- - ${DEV_LOCATION}/netalertx:/home/pi/pialert/netalertx
- - ${DEV_LOCATION}/dockerfiles:/home/pi/pialert/dockerfiles
+ - ${DEV_LOCATION}/server:/app/server
+ - ${DEV_LOCATION}/dockerfiles:/app/dockerfiles
- ${APP_DATA_LOCATION}/netalertx/php.ini:/etc/php/8.2/fpm/php.ini
- - ${DEV_LOCATION}/install:/home/pi/pialert/install
- - ${DEV_LOCATION}/front/css:/home/pi/pialert/front/css
- - ${DEV_LOCATION}/back/update_vendors.sh:/home/pi/pialert/back/update_vendors.sh
- - ${DEV_LOCATION}/front/lib/AdminLTE:/home/pi/pialert/front/lib/AdminLTE
- - ${DEV_LOCATION}/front/js:/home/pi/pialert/front/js
- - ${DEV_LOCATION}/install/start.debian.sh:/home/pi/pialert/install/start.debian.sh
- - ${DEV_LOCATION}/install/user-mapping.debian.sh:/home/pi/pialert/install/user-mapping.debian.sh
- - ${DEV_LOCATION}/install/install.debian.sh:/home/pi/pialert/install/install.debian.sh
- - ${DEV_LOCATION}/install/install_dependencies.debian.sh:/home/pi/pialert/install/install_dependencies.debian.sh
- - ${DEV_LOCATION}/front/api:/home/pi/pialert/front/api
- - ${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
- - ${DEV_LOCATION}/front/events.php:/home/pi/pialert/front/events.php
- - ${DEV_LOCATION}/front/plugins.php:/home/pi/pialert/front/plugins.php
- - ${DEV_LOCATION}/front/pluginsCore.php:/home/pi/pialert/front/pluginsCore.php
- - ${DEV_LOCATION}/front/help_faq.php:/home/pi/pialert/front/help_faq.php
- - ${DEV_LOCATION}/front/index.php:/home/pi/pialert/front/index.php
- - ${DEV_LOCATION}/front/maintenance.php:/home/pi/pialert/front/maintenance.php
- - ${DEV_LOCATION}/front/network.php:/home/pi/pialert/front/network.php
- - ${DEV_LOCATION}/front/presence.php:/home/pi/pialert/front/presence.php
- - ${DEV_LOCATION}/front/settings.php:/home/pi/pialert/front/settings.php
- - ${DEV_LOCATION}/front/systeminfo.php:/home/pi/pialert/front/systeminfo.php
- - ${DEV_LOCATION}/front/report.php:/home/pi/pialert/front/report.php
- - ${DEV_LOCATION}/front/workflows.php:/home/pi/pialert/front/workflows.php
- - ${DEV_LOCATION}/front/appEventsCore.php:/home/pi/pialert/front/appEventsCore.php
- - ${DEV_LOCATION}/front/multiEditCore.php:/home/pi/pialert/front/multiEditCore.php
- - ${DEV_LOCATION}/front/donations.php:/home/pi/pialert/front/donations.php
- - ${DEV_LOCATION}/front/plugins:/home/pi/pialert/front/plugins
+ - ${DEV_LOCATION}/install:/app/install
+ - ${DEV_LOCATION}/front/css:/app/front/css
+ - ${DEV_LOCATION}/front/img:/app/front/img
+ - ${DEV_LOCATION}/back/update_vendors.sh:/app/back/update_vendors.sh
+ - ${DEV_LOCATION}/front/lib/AdminLTE:/app/front/lib/AdminLTE
+ - ${DEV_LOCATION}/front/js:/app/front/js
+ - ${DEV_LOCATION}/install/start.debian.sh:/app/install/start.debian.sh
+ - ${DEV_LOCATION}/install/user-mapping.debian.sh:/app/install/user-mapping.debian.sh
+ - ${DEV_LOCATION}/install/install.debian.sh:/app/install/install.debian.sh
+ - ${DEV_LOCATION}/install/install_dependencies.debian.sh:/app/install/install_dependencies.debian.sh
+ - ${DEV_LOCATION}/front/api:/app/front/api
+ - ${DEV_LOCATION}/front/php:/app/front/php
+ - ${DEV_LOCATION}/front/deviceDetails.php:/app/front/deviceDetails.php
+ - ${DEV_LOCATION}/front/deviceDetailsTools.php:/app/front/deviceDetailsTools.php
+ - ${DEV_LOCATION}/front/devices.php:/app/front/devices.php
+ - ${DEV_LOCATION}/front/events.php:/app/front/events.php
+ - ${DEV_LOCATION}/front/plugins.php:/app/front/plugins.php
+ - ${DEV_LOCATION}/front/pluginsCore.php:/app/front/pluginsCore.php
+ - ${DEV_LOCATION}/front/help_faq.php:/app/front/help_faq.php
+ - ${DEV_LOCATION}/front/index.php:/app/front/index.php
+ - ${DEV_LOCATION}/front/maintenance.php:/app/front/maintenance.php
+ - ${DEV_LOCATION}/front/network.php:/app/front/network.php
+ - ${DEV_LOCATION}/front/presence.php:/app/front/presence.php
+ - ${DEV_LOCATION}/front/settings.php:/app/front/settings.php
+ - ${DEV_LOCATION}/front/systeminfo.php:/app/front/systeminfo.php
+ - ${DEV_LOCATION}/front/report.php:/app/front/report.php
+ - ${DEV_LOCATION}/front/workflows.php:/app/front/workflows.php
+ - ${DEV_LOCATION}/front/appEventsCore.php:/app/front/appEventsCore.php
+ - ${DEV_LOCATION}/front/multiEditCore.php:/app/front/multiEditCore.php
+ - ${DEV_LOCATION}/front/donations.php:/app/front/donations.php
+ - ${DEV_LOCATION}/front/plugins:/app/front/plugins
# DELETE END anyone trying to use this file: comment out / delete ABOVE lines, they are only for development purposes
# ---------------------------------------------------------------------------
environment:
diff --git a/dockerfiles/README.md b/dockerfiles/README.md
index aa2b5a95..7dc080b9 100755
--- a/dockerfiles/README.md
+++ b/dockerfiles/README.md
@@ -25,8 +25,8 @@
```yaml
docker run -d --rm --network=host \
- -v local/path/pialert/config:/home/pi/pialert/config \
- -v local/path/pialert/db:/home/pi/pialert/db \
+ -v local/path/config:/app/config \
+ -v local/path/db:/app/db \
-e TZ=Europe/Berlin \
-e PORT=20211 \
jokobsk/netalertx:latest
@@ -49,22 +49,22 @@ 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/NetAlertX/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 |
+| ✅ | `:/app/config` | Folder which will contain the `app.conf` & `devices.csv` ([read about devices.csv](https://github.com/jokob-sk/NetAlertX/blob/main/docs/DEVICES_BULK_EDITING.md)) files (see below for details). |
+| ✅ | `:/app/db` | Folder which will contain the `app.db` file |
+| | `:/app/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. |
| | `:/etc/pihole/dhcp.leases` | PiHole's `dhcp.leases` file. Required if you want to use PiHole `dhcp.leases` file. This has to be matched with a corresponding `DHCPLSS_paths_to_check` setting entry (the path in the container must contain `pihole`)|
-| | `:/home/pi/pialert/front/api` | A simple [API endpoint](https://github.com/jokob-sk/NetAlertX/blob/main/docs/API.md) containing static (but regularly updated) json and other files. |
-| | `:/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/NetAlertX/blob/main/front/plugins/README.md). |
+| | `:/app/front/api` | A simple [API endpoint](https://github.com/jokob-sk/NetAlertX/blob/main/docs/API.md) containing static (but regularly updated) json and other files. |
+| | `:/app/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/NetAlertX/blob/main/front/plugins/README.md). |
| | `:/etc/resolv.conf` | Use a custom `resolv.conf` file for [better name resolution](https://github.com/jokob-sk/NetAlertX/blob/main/docs/REVERSE_DNS.md). |
> Use separate `db` and `config` directories, don't nest them.
-### (If UI is not available) Modify the config (`pialert.conf`)
+### (If UI is not available) Modify the config (`app.conf`)
- The preferred way is to manage the configuration via the Settings section in the UI.
-- You can modify [pialert.conf](https://github.com/jokob-sk/NetAlertX/tree/main/config) directly, if needed.
-- If unavailable, the app generates a default `pialert.conf` and `pialert.db` file on the first run.
+- You can modify [app.conf](https://github.com/jokob-sk/NetAlertX/tree/main/config) directly, if needed.
+- If unavailable, the app generates a default `app.conf` and `app.db` file on the first run.
#### Important settings
@@ -130,10 +130,10 @@ services:
network_mode: "host"
restart: unless-stopped
volumes:
- - local/path/pialert/config:/home/pi/pialert/config
- - local/path/pialert/db:/home/pi/pialert/db
+ - local/path/config:/app/config
+ - local/path/db:/app/db
# (optional) useful for debugging if you have issues setting up the container
- - local/path/logs:/home/pi/pialert/front/log
+ - local/path/logs:/app/front/log
environment:
- TZ=Europe/Berlin
- PORT=20211
@@ -157,8 +157,8 @@ Example by [SeimuS](https://github.com/SeimusS).
- TZ=Europe/Bratislava
restart: always
volumes:
- - ./pialert/pialert_db:/home/pi/pialert/db
- - ./pialert/pialert_config:/home/pi/pialert/config
+ - ./netalertx/db:/app/db
+ - ./netalertx/config:/app/config
network_mode: host
```
@@ -179,10 +179,10 @@ services:
network_mode: "host"
restart: unless-stopped
volumes:
- - ${APP_DATA_LOCATION}/netalertx/config:/home/pi/pialert/config
- - ${APP_DATA_LOCATION}/netalertx/db/pialert.db:/home/pi/pialert/db/pialert.db
+ - ${APP_DATA_LOCATION}/netalertx/config:/app/config
+ - ${APP_DATA_LOCATION}/netalertx/db/:/app/db/
# (optional) useful for debugging if you have issues setting up the container
- - ${LOGS_LOCATION}:/home/pi/pialert/front/log
+ - ${LOGS_LOCATION}:/app/front/log
environment:
- TZ=${TZ}
- PORT=${PORT}
@@ -211,7 +211,7 @@ To run the container execute: `sudo docker-compose --env-file /path/to/.env up`
### Example 4
-Courtesy of [pbek](https://github.com/pbek). The volume `pialert_db` is used by the db directory. The two config files are mounted directly from a local folder to their places in the config folder. You can backup the `docker-compose.yaml` folder and the docker volumes folder.
+Courtesy of [pbek](https://github.com/pbek). The volume `netalertx_db` is used by the db directory. The two config files are mounted directly from a local folder to their places in the config folder. You can backup the `docker-compose.yaml` folder and the docker volumes folder.
```yaml
netalertx:
@@ -227,15 +227,15 @@ Courtesy of [pbek](https://github.com/pbek). The volume `pialert_db` is used by
ipv4_address: 192.168.1.2
restart: unless-stopped
volumes:
- - pialert_db:/home/pi/pialert/db
- - ./pialert/pialert.conf:/home/pi/pialert/config/pialert.conf
+ - netalertx_db:/app/db
+ - ./netalertx/:/app/config/
```
## 🏅 Recognitions
-Big thanks to @Macleykun & for help and tips&tricks for Dockerfile(s) and @vladaurosh for Alpine re-base help.
+Big thanks to @Macleykun & for help and tips & tricks for Dockerfile(s) and @vladaurosh for Alpine re-base help.
-## ❤ Support me to prevent my burnout 🔥🤯
+## ❤ Support me
| [](https://github.com/sponsors/jokob-sk) | [](https://www.buymeacoffee.com/jokobsk) | [](https://www.patreon.com/user?u=84385063) |
| --- | --- | --- |
diff --git a/dockerfiles/pre-setup.sh b/dockerfiles/pre-setup.sh
index 0f815dd8..1ab830c0 100755
--- a/dockerfiles/pre-setup.sh
+++ b/dockerfiles/pre-setup.sh
@@ -1,6 +1,7 @@
#!/bin/bash
-export INSTALL_DIR=/home/pi
+export INSTALL_DIR=/app
+export APP_NAME=netalertx
# php-fpm setup
install -d -o nginx -g www-data /run/php/
@@ -13,12 +14,12 @@ sed -i "/^group/c\group = www-data" /etc/php82/php-fpm.d/www.conf
# s6 overlay setup
mkdir -p /etc/s6-overlay/s6-rc.d/{SetupOneshot,php-fpm/dependencies.d,nginx/dependencies.d}
-mkdir -p /etc/s6-overlay/s6-rc.d/{SetupOneshot,php-fpm/dependencies.d,nginx/dependencies.d,pialert/dependencies.d}
+mkdir -p /etc/s6-overlay/s6-rc.d/{SetupOneshot,php-fpm/dependencies.d,nginx/dependencies.d,$APP_NAME/dependencies.d}
echo "oneshot" > /etc/s6-overlay/s6-rc.d/SetupOneshot/type
echo "longrun" > /etc/s6-overlay/s6-rc.d/php-fpm/type
echo "longrun" > /etc/s6-overlay/s6-rc.d/nginx/type
-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 "longrun" > /etc/s6-overlay/s6-rc.d/$APP_NAME/type
+echo -e "${INSTALL_DIR}/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
@@ -30,11 +31,11 @@ echo -e '#!/bin/execlineb -P
"
[INSTALL] 🚀 Starting app (:${PORT})
- " }' > /etc/s6-overlay/s6-rc.d/pialert/run
-echo -e "python ${INSTALL_DIR}/pialert/netalertx" >> /etc/s6-overlay/s6-rc.d/pialert/run
+ " }' > /etc/s6-overlay/s6-rc.d/$APP_NAME/run
+echo -e "python ${INSTALL_DIR}/server" >> /etc/s6-overlay/s6-rc.d/server/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/user/contents.d/{SetupOneshot,php-fpm,nginx,$APP_NAME} /etc/s6-overlay/s6-rc.d/{php-fpm,nginx,$APP_NAME}/dependencies.d/SetupOneshot
touch /etc/s6-overlay/s6-rc.d/nginx/dependencies.d/php-fpm
-touch /etc/s6-overlay/s6-rc.d/pialert/dependencies.d/nginx
+touch /etc/s6-overlay/s6-rc.d/$APP_NAME/dependencies.d/nginx
rm -f $0
diff --git a/dockerfiles/setup.sh b/dockerfiles/setup.sh
index c92ed48d..5e142ce8 100755
--- a/dockerfiles/setup.sh
+++ b/dockerfiles/setup.sh
@@ -4,14 +4,20 @@ echo "---------------------------------------------------------"
echo "[INSTALL] Run setup.sh"
echo "---------------------------------------------------------"
-export INSTALL_DIR=/home/pi # Specify the installation directory here
+export INSTALL_DIR=/app # Specify the installation directory here
# DO NOT CHANGE ANYTHING BELOW THIS LINE!
-CONFFILENAME="pialert.conf"
-NGINX_CONFIG_FILE="/etc/nginx/http.d/${CONFFILENAME}"
-DBFILENAME="pialert.db"
+
+CONF_FILE="app.conf"
+NGINX_CONF_FILE=netalertx.conf
+DB_FILE="app.db"
+
+NGINX_CONFIG_FILE="/etc/nginx/http.d/${NGINX_CONF_FILE}"
+
OUI_FILE="/usr/share/arp-scan/ieee-oui.txt" # Define the path to ieee-oui.txt and ieee-iab.txt
-FILEDB="${INSTALL_DIR}/pialert/db/${DBFILENAME}"
+
+
+FULL_FILEDB_PATH="${INSTALL_DIR}/db/${DB_FILE}"
# DO NOT CHANGE ANYTHING ABOVE THIS LINE!
@@ -21,25 +27,41 @@ if [[ $EUID -ne 0 ]]; then
exit 1
fi
-echo "[INSTALL] Copy starter ${DBFILENAME} and ${CONFFILENAME} if they don't exist"
+echo "[INSTALL] Copy starter ${DB_FILE} and ${CONF_FILE} if they don't exist"
# DANGER ZONE: ALWAYS_FRESH_INSTALL
if [ "$ALWAYS_FRESH_INSTALL" = true ]; then
echo "[INSTALL] ❗ ALERT /db and /config folders are cleared because the ALWAYS_FRESH_INSTALL is set to: $ALWAYS_FRESH_INSTALL❗"
- # Delete content of "$INSTALL_DIR/pialert/config/"
- rm -rf "$INSTALL_DIR/pialert/config/"*
+ # Delete content of "$INSTALL_DIR/config/"
+ rm -rf "$INSTALL_DIR/config/"*
- # Delete content of "$INSTALL_DIR/pialert/db/"
- rm -rf "$INSTALL_DIR/pialert/db/"*
+ # Delete content of "$INSTALL_DIR/db/"
+ rm -rf "$INSTALL_DIR/db/"*
fi
+# 🔻 FOR BACKWARD COMPATIBILITY - REMOVE AFTER 12/12/2024
+# Check if pialert.db exists, then copy to app.db
+INSTALL_DIR_OLD=/home/pi/pialert
+OLD_APP_NAME=pialert
+
+# Check if pialert.db exists, then create a symbolic link to app.db
+if [ -f "${INSTALL_DIR_OLD}/db/${OLD_APP_NAME}.db" ]; then
+ ln -s "${INSTALL_DIR_OLD}/db/${OLD_APP_NAME}.db" "${FULL_FILEDB_PATH}"
+fi
+
+# Check if ${OLD_APP_NAME}.conf exists, then create a symbolic link to app.conf
+if [ -f "${INSTALL_DIR_OLD}/config/${OLD_APP_NAME}.conf" ]; then
+ ln -s "${INSTALL_DIR_OLD}/config/${OLD_APP_NAME}.conf" "${INSTALL_DIR}/config/${CONF_FILE}"
+fi
+# 🔺 FOR BACKWARD COMPATIBILITY - REMOVE AFTER 12/12/2024
+
# Copy starter .db and .conf if they don't exist
-cp -na "${INSTALL_DIR}/pialert/back/${CONFFILENAME}" "${INSTALL_DIR}/pialert/config/${CONFFILENAME}"
-cp -na "${INSTALL_DIR}/pialert/back/${DBFILENAME}" "${FILEDB}"
+cp -na "${INSTALL_DIR}/back/${CONF_FILE}" "${INSTALL_DIR}/config/${CONF_FILE}"
+cp -na "${INSTALL_DIR}/back/${DB_FILE}" "${FULL_FILEDB_PATH}"
# if custom variables not set we do not need to do anything
if [ -n "${TZ}" ]; then
- FILECONF="${INSTALL_DIR}/pialert/config/${CONFFILENAME}"
+ FILECONF="${INSTALL_DIR}/config/${CONF_FILE}"
echo "[INSTALL] Setup timezone"
sed -i "\#^TIMEZONE=#c\TIMEZONE='${TZ}'" "${FILECONF}"
@@ -50,7 +72,7 @@ fi
echo "[INSTALL] Setup NGINX"
echo "Setting webserver to address ($LISTEN_ADDR) and port ($PORT)"
-envsubst '$INSTALL_DIR $LISTEN_ADDR $PORT' < "${INSTALL_DIR}/pialert/install/netalertx.template.conf" > "${NGINX_CONFIG_FILE}"
+envsubst '$INSTALL_DIR $LISTEN_ADDR $PORT' < "${INSTALL_DIR}/install/netalertx.template.conf" > "${NGINX_CONFIG_FILE}"
# Run the hardware vendors update at least once
echo "[INSTALL] Run the hardware vendors update"
@@ -62,27 +84,27 @@ else
echo "The file ieee-oui.txt does not exist. Running update_vendors..."
# Run the update_vendors.sh script
- if [ -f "${INSTALL_DIR}/pialert/back/update_vendors.sh" ]; then
- "${INSTALL_DIR}/pialert/back/update_vendors.sh"
+ if [ -f "${INSTALL_DIR}/back/update_vendors.sh" ]; then
+ "${INSTALL_DIR}/back/update_vendors.sh"
else
echo "update_vendors.sh script not found in ${INSTALL_DIR}."
fi
fi
# Create an empty log files
-# Create the execution_queue.log and pialert_front.log files if they don't exist
-touch "${INSTALL_DIR}"/pialert/front/log/{execution_queue.log,pialert_front.log,pialert.php_errors.log,stderr.log,stdout.log}
+# Create the execution_queue.log and app_front.log files if they don't exist
+touch "${INSTALL_DIR}"/front/log/{execution_queue.log,app_front.log,app.php_errors.log,stderr.log,stdout.log}
echo "[INSTALL] Fixing permissions after copied starter config & DB"
-chown -R nginx:www-data "${INSTALL_DIR}"/pialert/{config,front/log,db}
-chmod 750 "${INSTALL_DIR}"/pialert/{config,front/log,db}
-find "${INSTALL_DIR}"/pialert/{config,front/log,db} -type f -exec chmod 640 {} \;
+chown -R nginx:www-data "${INSTALL_DIR}"/{config,front/log,db}
+chmod 750 "${INSTALL_DIR}"/{config,front/log,db}
+find "${INSTALL_DIR}"/{config,front/log,db} -type f -exec chmod 640 {} \;
# Check if buildtimestamp.txt doesn't exist
-if [ ! -f "${INSTALL_DIR}/pialert/front/buildtimestamp.txt" ]; then
+if [ ! -f "${INSTALL_DIR}/front/buildtimestamp.txt" ]; then
# Create buildtimestamp.txt
- date +%s > "${INSTALL_DIR}/pialert/front/buildtimestamp.txt"
- chown nginx:www-data "${INSTALL_DIR}/pialert/front/buildtimestamp.txt"
+ date +%s > "${INSTALL_DIR}/front/buildtimestamp.txt"
+ chown nginx:www-data "${INSTALL_DIR}/front/buildtimestamp.txt"
fi
echo -e "
diff --git a/docs/API.md b/docs/API.md
index 7a3718b9..8f734d5f 100755
--- a/docs/API.md
+++ b/docs/API.md
@@ -9,7 +9,7 @@ The endpoints are updated when objects in the API endpoints are changed.
### Location of the endpoints
-In the container, these files are located under the `/home/pi/pialert/front/api/` folder and thus on the `/api/` url.
+In the container, these files are located under the `/app/front/api/` folder and thus on the `/api/` url.
### Available endpoints
diff --git a/docs/BACKUPS.md b/docs/BACKUPS.md
index 4dc8a163..45301117 100755
--- a/docs/BACKUPS.md
+++ b/docs/BACKUPS.md
@@ -7,8 +7,8 @@ There are 3 artifacts that can be used to backup the application:
| File | Description | Limitations |
|-----------------------|-------------------------------|-------------------------------|
-| `/db/pialert.db` | Database file(s) | The database file might be in an uncommitted state or corrupted |
-| `/config/pialert.conf` | Configuration file | Doesn't contain settings from the Maintenance section |
+| `/db/app.db` | Database file(s) | The database file might be in an uncommitted state or corrupted |
+| `/config/app.conf` | Configuration file | Doesn't contain settings from the Maintenance section |
| `/config/devices.csv` | CSV file containing device information | Doesn't contain historical data |
## Data and cackup storage
@@ -17,7 +17,7 @@ To decide on a backup strategy, check where the data is stored:
### Core Configuration
-The core application configuration is in the `pialert.conf` file (See [Settings System](https://github.com/jokob-sk/NetAlertX/blob/main/docs/SETTINGS_SYSTEM.md) for details), such as:
+The core application configuration is in the `app.conf` file (See [Settings System](https://github.com/jokob-sk/NetAlertX/blob/main/docs/SETTINGS_SYSTEM.md) for details), such as:
- Notification settings
- Scanner settings
@@ -35,7 +35,7 @@ The core device data is backed up to the `devices_.csv` file via the
### Historical data
-Historical data is stored in the `pialert.db` database (See [Database overview](https://github.com/jokob-sk/NetAlertX/blob/main/docs/DATABASE.md) for details). This data includes:
+Historical data is stored in the `app.db` database (See [Database overview](https://github.com/jokob-sk/NetAlertX/blob/main/docs/DATABASE.md) for details). This data includes:
- Plugin objects
- Plugin historical entries
@@ -46,7 +46,7 @@ Historical data is stored in the `pialert.db` database (See [Database overview](
The safest approach to backups is to backup all of the above, by taking regular file system backups (I use [Kopia](https://github.com/kopia/kopia)).
-Arguably, the most time is spent setting up the device list, so if only one file is kept I'd recommend to have a latest backup of the `devices_.csv` file, followed by the `pialert.conf` file.
+Arguably, the most time is spent setting up the device list, so if only one file is kept I'd recommend to have a latest backup of the `devices_.csv` file, followed by the `app.conf` file.
### Scenario 1: Full backup
@@ -54,8 +54,8 @@ End-result: Full restore
#### Source artifacts:
-- `/db/pialert.db` (uncorrupted)
-- `/config/pialert.conf`
+- `/db/app.db` (uncorrupted)
+- `/config/app.conf`
#### Recovery:
@@ -68,14 +68,14 @@ End-result: Partial restore (historical data & configurations from the Maintenan
#### Source artifacts:
-- `/config/pialert.conf`
+- `/config/app.conf`
- `/config/devices_.csv` or `/config/devices.csv`
#### Recovery:
Even with a corrupted database you can recover what I would argue is 99% of the configuration (except of a couple of settings under Maintenance).
-- map the `/config/pialert.conf` file as described in the [Setup documentation](https://github.com/jokob-sk/NetAlertX/blob/main/dockerfiles/README.md#docker-paths).
+- map the `/config/app.conf` file as described in the [Setup documentation](https://github.com/jokob-sk/NetAlertX/blob/main/dockerfiles/README.md#docker-paths).
- rename the `devices_.csv` to `devices.csv` and place it in the `/config` folder
- Restore the `devices.csv` backup via the [Maintenance section](https://github.com/jokob-sk/NetAlertX/blob/main/docs/DEVICES_BULK_EDITING.md)
diff --git a/docs/DATABASE.md b/docs/DATABASE.md
index bb2ae1d9..fedef963 100755
--- a/docs/DATABASE.md
+++ b/docs/DATABASE.md
@@ -1,5 +1,5 @@
- # A high-level description of the datbase structure
+ # A high-level description of the database structure
⚠ Disclaimer: As I'm not the original author, some of the information might be inaccurate. Feel free to submit a PR to correct anything within this page or documentation in general.
@@ -20,7 +20,7 @@
| Plugins_Language_Strings | Language strings colelcted from the plugin `config.json` files used for string resolution in the frontend. | ![Screen12][screen12] |
| Plugins_Objects | Unique objects detected by individual plugins. | ![Screen13][screen13] |
| Sessions | Used to display sessions in the charts | ![Screen15][screen15] |
- | Settings | Database representation of the sum of all settings from `pialert.conf` and plugins coming from `config.json` files. | ![Screen16][screen16] |
+ | Settings | Database representation of the sum of all settings from `app.conf` and plugins coming from `config.json` files. | ![Screen16][screen16] |
diff --git a/docs/DEBUG_PLUGINS.md b/docs/DEBUG_PLUGINS.md
index 512a10f9..27ca3865 100755
--- a/docs/DEBUG_PLUGINS.md
+++ b/docs/DEBUG_PLUGINS.md
@@ -19,7 +19,7 @@ For a more in-depth overview on how plugins work check the [Plugins development
#### Incorrect input data
-Input data from the plugin might cause mapping issues in specific edge cases. Look for a corresponding section in the `pialert.log` file, for example notice the first line of the execution run of the `PIHOLE` plugin below:
+Input data from the plugin might cause mapping issues in specific edge cases. Look for a corresponding section in the `app.log` file, for example notice the first line of the execution run of the `PIHOLE` plugin below:
```
17:31:05 [Scheduler] - Scheduler run for PIHOLE: YES
diff --git a/docs/DEBUG_TIPS.md b/docs/DEBUG_TIPS.md
index f2712862..7c180037 100755
--- a/docs/DEBUG_TIPS.md
+++ b/docs/DEBUG_TIPS.md
@@ -15,8 +15,8 @@ Start the container via the **terminal** with a command similar to this one:
```bash
docker run --rm --network=host \
- -v local/path/pialert/config:/home/pi/pialert/config \
- -v local/path/pialert/db:/home/pi/pialert/db \
+ -v local/path/netalertx/config:/app/config \
+ -v local/path/netalertx/db:/app/db \
-e TZ=Europe/Berlin \
-e PORT=20211 \
jokobsk/netalertx:latest
@@ -53,9 +53,9 @@ services:
### Permissions
-* If facing issues (AJAX errors, can't write to DB, empty screen, etc,) make sure permissions are set correctly, and check the logs under `/home/pi/pialert/front/log`.
-* To solve permission issues you can try setting the owner and group of the `pialert.db` by executing the following on the host system: `docker exec netalertx chown -R www-data:www-data /home/pi/pialert/db/pialert.db`.
-* If still facing issues, try to map the pialert.db file (⚠ not folder) to `:/home/pi/pialert/db/pialert.db` (see [docker-compose Examples](https://github.com/jokob-sk/NetAlertX/blob/main/dockerfiles/README.md#-docker-composeyml-examples) for details)
+* If facing issues (AJAX errors, can't write to DB, empty screen, etc,) make sure permissions are set correctly, and check the logs under `/app/front/log`.
+* To solve permission issues you can try setting the owner and group of the `app.db` by executing the following on the host system: `docker exec netalertx chown -R www-data:www-data /app/db/app.db`.
+* If still facing issues, try to map the app.db file (⚠ not folder) to `:/app/db/app.db` (see [docker-compose Examples](https://github.com/jokob-sk/NetAlertX/blob/main/dockerfiles/README.md#-docker-composeyml-examples) for details)
### Container restarts / crashes
diff --git a/docs/HOME_ASSISTANT.md b/docs/HOME_ASSISTANT.md
index 44c83182..8321a0f9 100755
--- a/docs/HOME_ASSISTANT.md
+++ b/docs/HOME_ASSISTANT.md
@@ -36,9 +36,9 @@ NetAlertX comes with MQTT support, allowing you to show all detected devices as
| ![Screen 3][list] | ![Screen 4][overview] |
- [configuration]: /docs/img/HOME_ASISSTANT/PiAlert-HomeAssistant-Configuration.png "configuration"
- [sensors]: /docs/img/HOME_ASISSTANT/PiAlert-HomeAssistant-Device-as-Sensors.png "sensors"
- [history]: /docs/img/HOME_ASISSTANT/PiAlert-HomeAssistant-Device-Presence-History.png "history"
- [list]: /docs/img/HOME_ASISSTANT/PiAlert-HomeAssistant-Devices-List.png "list"
- [overview]: /docs/img/HOME_ASISSTANT/PiAlert-HomeAssistant-Overview-Card.png "overview"
+ [configuration]: /docs/img/HOME_ASISSTANT/HomeAssistant-Configuration.png "configuration"
+ [sensors]: /docs/img/HOME_ASISSTANT/HomeAssistant-Device-as-Sensors.png "sensors"
+ [history]: /docs/img/HOME_ASISSTANT/HomeAssistant-Device-Presence-History.png "history"
+ [list]: /docs/img/HOME_ASISSTANT/HomeAssistant-Devices-List.png "list"
+ [overview]: /docs/img/HOME_ASISSTANT/HomeAssistant-Overview-Card.png "overview"
diff --git a/docs/HW_INSTALL.md b/docs/HW_INSTALL.md
index b973981c..94e37368 100755
--- a/docs/HW_INSTALL.md
+++ b/docs/HW_INSTALL.md
@@ -14,20 +14,20 @@ be dangerous, as you cannot see the code that's about to be executed on your sys
Alternatively you can download the installation script `install/install.debian.sh` from the repository and check the code yourself (beware other scripts are
downloaded too - only from this repo).
-NetAlertX will be installed in `home/pi/pialert/` and run on port number `20211`.
+NetAlertX will be installed in `/app` and run on port number `20211`.
Some facts about what and where something will be changed/installed by the HW install setup (may not contain everything!):
-- `/home/pi/pialert` directory will be deleted and newly created
-- `/home/pi/pialert` will contain the whole repository (downloaded by `install/install.debian.sh`)
+- `/app` directory will be deleted and newly created
+- `/app` will contain the whole repository (downloaded by `install/install.debian.sh`)
- The default NGINX site `/etc/nginx/sites-enabled/default` will be disabled (sym-link deleted or backed up to `sites-available`)
-- `/var/www/html/pialert` directory will be deleted and newly created
-- `/etc/nginx/conf.d/pialert.conf` will be sym-linked to `/home/pi/pialert/install/netalertx.debian.conf`
+- `/var/www/html/netalertx` directory will be deleted and newly created
+- `/etc/nginx/conf.d/netalertx.conf` will be sym-linked to `/app/install/netalertx.debian.conf`
- Some files (IEEE device vendors info, ...) will be created in the directory where the installation script is executed
## Limitations
-- No system service is provided. NetAlertX must be started using `/home/pi/pialert/install/start.debian.sh`.
+- No system service is provided. NetAlertX must be started using `/app/install/start.debian.sh`.
- No checks for other running software is done.
- Only tested to work on Debian Bookworm (Debian 12).
- **EXPERIMENTAL** and not recommended way to install NetAlertX.
diff --git a/docs/ICONS.md b/docs/ICONS.md
index d0546ab4..989ecd2d 100755
--- a/docs/ICONS.md
+++ b/docs/ICONS.md
@@ -45,7 +45,7 @@ Copying the HTML code from [Font Awesome](https://fontawesome.com/search?o=r&m=f
If you own the premium package of Font Awesome icons you can mount it in your Docker container the following way:
```yaml
-/font-awesome:/home/pi/pialert/front/lib/AdminLTE/bower_components/font-awesome:ro
+/font-awesome:/app/front/lib/AdminLTE/bower_components/font-awesome:ro
```
You can use the full range of Font Awesome icons afterwards.
diff --git a/docs/MIGRATION.md b/docs/MIGRATION.md
new file mode 100755
index 00000000..08ebcdc2
--- /dev/null
+++ b/docs/MIGRATION.md
@@ -0,0 +1,119 @@
+# Migration form PiAlert to NetAlertX
+
+The migration should be pretty straightforward. The application installation folder in the docker container has changed from `/home/pi/pialert` to `/app`. That means the new mount points are:
+
+ | Old mount point | New mount point |
+ |----------------------|---------------|
+ | `/home/pi/pialert/config` | `/app/config` |
+ | `/home/pi/pialert/db` | `/app/db` |
+
+
+ If you were mounting files directly, please note the file names have changed:
+
+ | Old file name | New file name |
+ |----------------------|---------------|
+ | `pialert.conf` | `app.conf` |
+ | `pialert.db` | `app.db` |
+
+
+> [!NOTE]
+> The application uses symlinks linking the old locations to the new ones, so data loss should not occur. [Backup strategies](https://github.com/jokob-sk/NetAlertX/blob/main/docs/BACKUPS.md) are still recommended to backup your setup.
+
+In summary, docker file mount locations in your `docker-compose.yml` or docker run command have changed. Examples follow.
+
+
+## Example 1: Mapping folders
+
+### Old docker-compose.yml
+
+```yaml
+version: "3"
+services:
+ pialert:
+ container_name: pialert
+ # use the below line if you want to test the latest dev image
+ # image: "jokobsk/netalertx-dev:latest"
+ image: "jokobsk/pialert:latest"
+ network_mode: "host"
+ restart: unless-stopped
+ volumes:
+ - local/path/config:/home/pi/pialert/config
+ - local/path/db:/home/pi/pialert/db
+ # (optional) useful for debugging if you have issues setting up the container
+ - local/path/logs:/home/pi/pialert/front/log
+ environment:
+ - TZ=Europe/Berlin
+ - PORT=20211
+```
+
+### New docker-compose.yml
+
+```yaml
+version: "3"
+services:
+ netalertx: # ⚠🟡 This has changed (optional) 🟡⚠
+ container_name: netalertx # ⚠🟡 This has changed (optional) 🟡⚠
+ # use the below line if you want to test the latest dev image
+ # image: "jokobsk/netalertx-dev:latest"
+ image: "jokobsk/netalertx:latest" # ⚠🔺🟡 This has changed (optional/required in future) 🟡🔺⚠
+ network_mode: "host"
+ restart: unless-stopped
+ volumes:
+ - local/path/config:/app/config # ⚠🔺 This has changed (required) 🔺⚠
+ - local/path/db:/app/db # ⚠🔺 This has changed (required) 🔺⚠
+ # (optional) useful for debugging if you have issues setting up the container
+ - local/path/logs:/app/front/log # ⚠🟡 This has changed (optional) 🟡⚠
+ environment:
+ - TZ=Europe/Berlin
+ - PORT=20211
+```
+
+
+## Example 2: Mapping files
+
+> [!NOTE]
+> The recommendation is to map folders as in Example 1, map files directly only when needed.
+
+### Old docker-compose.yml
+
+```yaml
+version: "3"
+services:
+ pialert:
+ container_name: pialert
+ # use the below line if you want to test the latest dev image
+ # image: "jokobsk/netalertx-dev:latest"
+ image: "jokobsk/pialert:latest"
+ network_mode: "host"
+ restart: unless-stopped
+ volumes:
+ - local/path/config/pialert.conf:/home/pi/pialert/config/pialert.conf
+ - local/path/db/pialert.db:/home/pi/pialert/db/pialert.db
+ # (optional) useful for debugging if you have issues setting up the container
+ - local/path/logs:/home/pi/pialert/front/log
+ environment:
+ - TZ=Europe/Berlin
+ - PORT=20211
+```
+
+### New docker-compose.yml
+
+```yaml
+version: "3"
+services:
+ netalertx: # ⚠🟡 This has changed (optional) 🟡⚠
+ container_name: netalertx # ⚠🟡 This has changed (optional) 🟡⚠
+ # use the below line if you want to test the latest dev image
+ # image: "jokobsk/netalertx-dev:latest"
+ image: "jokobsk/netalertx:latest" # ⚠🔺🟡 This has changed (optional/required in future) 🟡🔺⚠
+ network_mode: "host"
+ restart: unless-stopped
+ volumes:
+ - local/path/config/app.conf:/app/config/app.conf # ⚠🔺 This has changed (required) 🔺⚠
+ - local/path/db/app.db:/app/db/app.db # ⚠🔺 This has changed (required) 🔺⚠
+ # (optional) useful for debugging if you have issues setting up the container
+ - local/path/logs:/app/front/log # ⚠🟡 This has changed (optional) 🟡⚠
+ environment:
+ - TZ=Europe/Berlin
+ - PORT=20211
+```
diff --git a/docs/README.md b/docs/README.md
index 2e7b058f..a909a2ed 100755
--- a/docs/README.md
+++ b/docs/README.md
@@ -63,7 +63,7 @@ There is also an in-app Help / FAQ section that should be answering frequently a
#### 👩💻For Developers👨💻
-- [APP code structure](/netalertx/README.md)
+- [Server APP code structure](/server/README.md)
- [Database structure](/docs/DATABASE.md)
- [API endpoints details](/docs/API.md)
- [Plugin system details and how to develop your own](/front/plugins/README.md)
@@ -122,7 +122,7 @@ Suggested test cases:
Some additional context:
-* Permanent settings/config is stored in the `pialert.conf` file
+* Permanent settings/config is stored in the `app.conf` file
* Currently temporary (session?) settings are stored in the `Parameters` DB table as key-value pairs. This table is wiped during a container rebuild/restart and its values are re-initialized from cookies/session data from the browser.
## 🐛 Submitting an issue or bug
diff --git a/docs/REVERSE_DNS.md b/docs/REVERSE_DNS.md
index d7bc1aad..07bab836 100755
--- a/docs/REVERSE_DNS.md
+++ b/docs/REVERSE_DNS.md
@@ -41,9 +41,9 @@ services:
image: "jokobsk/netalertx:latest"
restart: unless-stopped
volumes:
- - ./config/pialert.conf:/home/pi/pialert/config/pialert.conf
- - ./pialert_db:/home/pi/pialert/db
- - ./log:/home/pi/pialert/front/log
+ - ./config/app.conf:/app/config/app.conf
+ - ./db:/app/db
+ - ./log:/app/front/log
- ./config/resolv.conf:/etc/resolv.conf # Mapping the /resolv.conf file for better name resolution
environment:
- TZ=Europe/Berlin
diff --git a/docs/REVERSE_PROXY.md b/docs/REVERSE_PROXY.md
index 1233cbe6..1e218703 100755
--- a/docs/REVERSE_PROXY.md
+++ b/docs/REVERSE_PROXY.md
@@ -472,9 +472,9 @@ Mapping the updated file (on the local filesystem at `/appl/docker/netalertx/def
```bash
docker run -d --rm --network=host \
--name=netalertx \
- -v /appl/docker/pialert/config:/home/pi/pialert/config \
- -v /appl/docker/pialert/db:/home/pi/pialert/db \
- -v /appl/docker/pialert/default:/etc/nginx/sites-available/default \
+ -v /appl/docker/netalertx/config:/app/config \
+ -v /appl/docker/netalertx/db:/app/db \
+ -v /appl/docker/netalertx/default:/etc/nginx/sites-available/default \
-e TZ=Europe/Amsterdam \
-e PORT=20211 \
jokobsk/netalertx:latest
diff --git a/docs/SETTINGS_SYSTEM.md b/docs/SETTINGS_SYSTEM.md
index 1207a6c1..128642b8 100755
--- a/docs/SETTINGS_SYSTEM.md
+++ b/docs/SETTINGS_SYSTEM.md
@@ -6,11 +6,11 @@ If you are a user of the app, settings have a detailed description in the _Setti
### 🛢 Data storage
-The source of truth for user-defined values is the `pialert.conf` file. Editing the file makes the App overwrite values in the `Settings` database table and in the `table_settings.json` file.
+The source of truth for user-defined values is the `app.conf` file. Editing the file makes the App overwrite values in the `Settings` database table and in the `table_settings.json` file.
#### Settings database table
-The `Settings` database table contains settings for App run purposes. The table is recreated every time the App restarts. The settings are loaded from the source-of-truth, that is the `pialert.conf` file. A high-level overview on the database structure can be found in the [database documentation](/docs/DATABASE.md).
+The `Settings` database table contains settings for App run purposes. The table is recreated every time the App restarts. The settings are loaded from the source-of-truth, that is the `app.conf` file. A high-level overview on the database structure can be found in the [database documentation](/docs/DATABASE.md).
#### table_settings.json
@@ -20,27 +20,27 @@ This is the [API endpoint](/docs/API.md) that reflects the state of the `Setting
The json file is also cached on the client-side local storage of the browser.
-#### pialert.conf
+#### app.conf
> [!NOTE]
> This is the source of truth for settings. User-defined values in this files always override default values specified in the Plugin definition.
-The App generates two `pialert.conf` entries for every setting (Since version 23.8+). One entry is the setting value, the second is the `__metadata` associated with the setting. This `__metadata` entry contains the full setting definition in JSON format. Currently unused, but intended to be used in future to extend the Settings system.
+The App generates two `app.conf` entries for every setting (Since version 23.8+). One entry is the setting value, the second is the `__metadata` associated with the setting. This `__metadata` entry contains the full setting definition in JSON format. Currently unused, but intended to be used in future to extend the Settings system.
#### Plugin settings
> [!NOTE]
> This is the preferred way adding settings going forward. I'll be likely migrating all app settings into plugin-based settings.
-Plugin settings are loaded dynamically from the `config.json` of individual plugins. If a setting isn't defined in the `pialert.conf` file, it is initialized via the `default_value` property of a setting from the `config.json` file. Check the [Plugins documentation](https://github.com/jokob-sk/NetAlertX/blob/main/front/plugins/README.md#-setting-object-structure), section `⚙ Setting object structure` for details on the structure of the setting.
+Plugin settings are loaded dynamically from the `config.json` of individual plugins. If a setting isn't defined in the `app.conf` file, it is initialized via the `default_value` property of a setting from the `config.json` file. Check the [Plugins documentation](https://github.com/jokob-sk/NetAlertX/blob/main/front/plugins/README.md#-setting-object-structure), section `⚙ Setting object structure` for details on the structure of the setting.
![Screen 1][screen1]
### Settings Process flow
-The process flow is mostly managed by the [initialise.py](/pialert/initialise.py) file.
+The process flow is mostly managed by the [initialise.py](/server/initialise.py) file.
-The script is responsible for reading user-defined values from a configuration file (`pialert.conf`), initializing settings, and importing them into a database. It also handles plugins and their configurations.
+The script is responsible for reading user-defined values from a configuration file (`app.conf`), initializing settings, and importing them into a database. It also handles plugins and their configurations.
Here's a high-level description of the code:
@@ -49,7 +49,7 @@ Here's a high-level description of the code:
- `importConfigs`: This function is the main entry point of the script. It imports user settings from a configuration file, processes them, and saves them to the database.
- - `read_config_file`: This function reads the configuration file (`pialert.conf`) and returns a dictionary containing the key-value pairs from the file.
+ - `read_config_file`: This function reads the configuration file (`app.conf`) and returns a dictionary containing the key-value pairs from the file.
2. Importing Configuration and Initializing Settings:
- The `importConfigs` function starts by checking the modification time of the configuration file to determine if it needs to be re-imported. If the file has not been modified since the last import, the function skips the import process.
diff --git a/docs/SUBNETS.md b/docs/SUBNETS.md
index ae2fb63a..24c7db0d 100755
--- a/docs/SUBNETS.md
+++ b/docs/SUBNETS.md
@@ -8,7 +8,7 @@ You need to specify the network interface and the network mask. You can also con
## Examples
> [!NOTE]
-> Please use the UI to configure settings as that ensures that the config file is in the correct format. Edit `pialert.conf` directly only when really necessary.
+> Please use the UI to configure settings as that ensures that the config file is in the correct format. Edit `app.conf` directly only when really necessary.
> 
* Examples for one and two subnets (❗ Note the `['...', '...']` format):
diff --git a/docs/VERSIONS.md b/docs/VERSIONS.md
index 40614a01..12185523 100755
--- a/docs/VERSIONS.md
+++ b/docs/VERSIONS.md
@@ -22,4 +22,4 @@ For a comparison, this is how the UI looks like if you are on the latest stable
## Implementation details
-During build a [/home/pi/pialert/front/buildtimestamp.txt](https://github.com/jokob-sk/NetAlertX/blob/092797e75ccfa8359444ad149e727358ac4da05f/Dockerfile#L44) file is created. The app then periodically checks if a new release is available with a newer timestamp in GitHub's rest-based JSON endpoint (check the `def isNewVersion():` method in `pialert.py` for details).
\ No newline at end of file
+During build a [/app/front/buildtimestamp.txt](https://github.com/jokob-sk/NetAlertX/blob/092797e75ccfa8359444ad149e727358ac4da05f/Dockerfile#L44) file is created. The app then periodically checks if a new release is available with a newer timestamp in GitHub's rest-based JSON endpoint (check the `def isNewVersion():` method for details).
\ No newline at end of file
diff --git a/docs/img/HOME_ASISSTANT/PiAlert-HomeAssistant-Configuration.png b/docs/img/HOME_ASISSTANT/HomeAssistant-Configuration.png
similarity index 100%
rename from docs/img/HOME_ASISSTANT/PiAlert-HomeAssistant-Configuration.png
rename to docs/img/HOME_ASISSTANT/HomeAssistant-Configuration.png
diff --git a/docs/img/HOME_ASISSTANT/PiAlert-HomeAssistant-Device-Presence-History.png b/docs/img/HOME_ASISSTANT/HomeAssistant-Device-Presence-History.png
similarity index 100%
rename from docs/img/HOME_ASISSTANT/PiAlert-HomeAssistant-Device-Presence-History.png
rename to docs/img/HOME_ASISSTANT/HomeAssistant-Device-Presence-History.png
diff --git a/docs/img/HOME_ASISSTANT/PiAlert-HomeAssistant-Device-as-Sensors.png b/docs/img/HOME_ASISSTANT/HomeAssistant-Device-as-Sensors.png
similarity index 100%
rename from docs/img/HOME_ASISSTANT/PiAlert-HomeAssistant-Device-as-Sensors.png
rename to docs/img/HOME_ASISSTANT/HomeAssistant-Device-as-Sensors.png
diff --git a/docs/img/HOME_ASISSTANT/PiAlert-HomeAssistant-Devices-List.png b/docs/img/HOME_ASISSTANT/HomeAssistant-Devices-List.png
similarity index 100%
rename from docs/img/HOME_ASISSTANT/PiAlert-HomeAssistant-Devices-List.png
rename to docs/img/HOME_ASISSTANT/HomeAssistant-Devices-List.png
diff --git a/docs/img/HOME_ASISSTANT/PiAlert-HomeAssistant-Overview-Card.png b/docs/img/HOME_ASISSTANT/HomeAssistant-Overview-Card.png
similarity index 100%
rename from docs/img/HOME_ASISSTANT/PiAlert-HomeAssistant-Overview-Card.png
rename to docs/img/HOME_ASISSTANT/HomeAssistant-Overview-Card.png
diff --git a/front/css/pialert.css b/front/css/app.css
similarity index 93%
rename from front/css/pialert.css
rename to front/css/app.css
index d31ebe29..0669546f 100755
--- a/front/css/pialert.css
+++ b/front/css/app.css
@@ -2,7 +2,7 @@
# NetAlertX
# Open Source Network Guard / WIFI & LAN intrusion detector
#
-# pialert.css - Front module. CSS styles
+# app.css - Front module. CSS styles
#-------------------------------------------------------------------------------
# Puche 2021 / 2022+ jokob jokob@duck.com GNU GPLv3
----------------------------------------------------------------------------- */
@@ -151,10 +151,26 @@
/* -----------------------------------------------------------------------------
Customized Main Menu
----------------------------------------------------------------------------- */
+
+.NetAlertX-logo
+{
+ border-color:transparent !important;
+ height: 50px !important;
+ width: 50px !important;
+ margin-top:15px !important;
+ border-radius: 1px !important;
+}
+
.main-header .logo {
width: 150px;
}
+
+.navbar-nav > .user-menu .user-image
+{
+ margin-top: 3px;
+}
+
.main-header>.navbar {
margin-left: 150px;
}
@@ -487,6 +503,73 @@
display: none;
}
+/* ticker setup */
+.ticker-li
+{
+ width: 40%;
+}
+
+#ticker_announcement_plc
+{
+
+ /* height: 50px; */
+ overflow: hidden;
+ width: 65%;
+ position: absolute;
+ left: 40px;
+ top: 15px;
+}
+
+@media (max-width: 1500px) and (min-width: 1101px) {
+ #ticker_announcement_plc {
+ width: 45%; /* Width for screen sizes between 1100px and 730px */
+ }
+}
+
+@media (max-width: 1100px) and (min-width: 801px) {
+ #ticker_announcement_plc {
+ width: 30%; /* Width for screen sizes between 1100px and 730px */
+ }
+}
+
+@media (max-width: 800px) {
+ #ticker_announcement_plc {
+ width: 25%; /* Width for screen sizes less than 730px */
+ }
+}
+
+#ticker-message a
+{
+ color:#3200bb;
+ text-decoration: underline;
+}
+
+#ticker-message
+{
+ color:#FFFFFF;
+}
+
+#ticker_announcement_plc:hover .ticker_announcement {
+ animation-play-state: paused;
+ }
+
+@keyframes marquee {
+ 0% {
+ transform: translateX(100%);
+ }
+ 100% {
+ transform: translateX(-150%);
+ }
+ }
+
+.ticker_announcement {
+ text-align: center;
+ white-space: nowrap;
+ animation: marquee 20s linear infinite;
+ cursor: default;
+}
+
+/* maintenance buttons */
.dbtools-button {
display: inline-block;
diff --git a/front/devices.php b/front/devices.php
index acacf7e5..7ef18f8b 100755
--- a/front/devices.php
+++ b/front/devices.php
@@ -19,8 +19,8 @@
// check permissions
- $dbPath = "../db/pialert.db";
- $confPath = "../config/pialert.conf";
+ $dbPath = "../db/app.db";
+ $confPath = "../config/app.conf";
checkPermissions([$dbPath, $confPath]);
?>
diff --git a/front/img/NetAlertX_black.png b/front/img/NetAlertX_black.png
new file mode 100755
index 00000000..8999fb37
Binary files /dev/null and b/front/img/NetAlertX_black.png differ
diff --git a/front/img/NetAlertX_white.png b/front/img/NetAlertX_white.png
new file mode 100755
index 00000000..2d8c3133
Binary files /dev/null and b/front/img/NetAlertX_white.png differ
diff --git a/front/img/NetAlertX_white_1.png b/front/img/NetAlertX_white_1.png
new file mode 100755
index 00000000..a6c717ba
Binary files /dev/null and b/front/img/NetAlertX_white_1.png differ
diff --git a/front/img/NetAlertX_white_2.png b/front/img/NetAlertX_white_2.png
new file mode 100755
index 00000000..f1676ce7
Binary files /dev/null and b/front/img/NetAlertX_white_2.png differ
diff --git a/front/img/manifest.json b/front/img/manifest.json
index 0e0dfe2c..24ff2693 100755
--- a/front/img/manifest.json
+++ b/front/img/manifest.json
@@ -1,6 +1,6 @@
{
- "name": "Pi-Alert Console",
- "short_name": "Pi-Alert",
+ "name": "NetAlertX Console",
+ "short_name": "NetAlertX",
"display": "standalone",
"icons": [
{
diff --git a/front/img/pialertLogoBlack.png b/front/img/pialertLogoBlack.png
deleted file mode 100755
index fe20f244..00000000
Binary files a/front/img/pialertLogoBlack.png and /dev/null differ
diff --git a/front/img/pialertLogoGray50.png b/front/img/pialertLogoGray50.png
deleted file mode 100755
index ab4563e0..00000000
Binary files a/front/img/pialertLogoGray50.png and /dev/null differ
diff --git a/front/img/pialertLogoGray80.png b/front/img/pialertLogoGray80.png
deleted file mode 100755
index 3c347c27..00000000
Binary files a/front/img/pialertLogoGray80.png and /dev/null differ
diff --git a/front/img/pialertLogoOrange.png b/front/img/pialertLogoOrange.png
deleted file mode 100755
index 00bf5dad..00000000
Binary files a/front/img/pialertLogoOrange.png and /dev/null differ
diff --git a/front/img/pialertLogoWhite.png b/front/img/pialertLogoWhite.png
deleted file mode 100755
index ae372da9..00000000
Binary files a/front/img/pialertLogoWhite.png and /dev/null differ
diff --git a/front/index.php b/front/index.php
index 8785e0c4..79e67463 100755
--- a/front/index.php
+++ b/front/index.php
@@ -1,5 +1,5 @@
-
+
-
@@ -148,7 +147,7 @@ if ($ENABLED_DARKMODE === True) {
- = lang('Login_Psw_run');?>
/home/pi/pialert/back/pialert-cli set_password = lang('Login_Psw_new');?>
= lang('Login_Psw_folder');?>
+ = lang('Login_Psw_run');?>
/app/back/pialert-cli set_password = lang('Login_Psw_new');?>
= lang('Login_Psw_folder');?>
diff --git a/front/js/common.js b/front/js/common.js
index 3706d3ef..beb7d818 100755
--- a/front/js/common.js
+++ b/front/js/common.js
@@ -409,6 +409,26 @@ function showMessage (textMessage="") {
}
}
+// -----------------------------------------------------------------------------
+function showTickerAnnouncement(textMessage = "") {
+ if (textMessage.toLowerCase().includes("error")) {
+ // show error
+ alert(textMessage);
+ } else {
+ // show permanent notification
+ $("#ticker-message").html(textMessage);
+ $("#tickerAnnouncement").removeClass("myhidden");
+ // Move the tickerAnnouncement element to ticker_announcement_plc
+ $("#tickerAnnouncement").appendTo("#ticker_announcement_plc");
+
+ // var $ticker = $('#tickerAnnouncement');
+ // var $tickerMessage = $('#ticker-message');
+
+ // Clone the ticker message to create continuous scrolling effect
+ // $tickerMessage.clone().appendTo($ticker);
+ }
+}
+
// -----------------------------------------------------------------------------
// String utilities
@@ -1154,7 +1174,7 @@ function arraysContainSameValues(arr1, arr2) {
// -----------------------------------------------------------------------------
// Define a unique key for storing the flag in sessionStorage
-var sessionStorageKey = "myScriptExecuted_pialert_common";
+var sessionStorageKey = "myScriptExecuted_common_js";
// -----------------------------------------------------------------------------
// Clearing all the caches
@@ -1202,7 +1222,7 @@ $.get('api/app_state.json?nocache=' + Date.now(), function(appState) {
// Display spinner and reload page if not yet initialized
function handleFirstLoad(callback)
{
- if(!pialert_common_init)
+ if(!app_common_init)
{
setTimeout(function() {
@@ -1214,7 +1234,7 @@ function handleFirstLoad(callback)
// -----------------------------------------------------------------------------
// Check if the code has been executed before by checking sessionStorage
-var pialert_common_init = sessionStorage.getItem(sessionStorageKey) === "true";
+var app_common_init = sessionStorage.getItem(sessionStorageKey) === "true";
var completedCalls = []
var completedCalls_final = ['cacheSettings', 'cacheStrings', 'cacheDevices'];
diff --git a/front/maintenance.php b/front/maintenance.php
index b72d65c3..a57eb46a 100755
--- a/front/maintenance.php
+++ b/front/maintenance.php
@@ -57,7 +57,7 @@ $pia_installed_skins = array('skin-black-light',
// Size and last mod of DB ------------------------------------------------------
-$pia_db = str_replace('front', 'db', getcwd()).'/pialert.db';
+$pia_db = str_replace('front', 'db', getcwd()).'/app.db';
$pia_db_size = number_format((filesize($pia_db) / 1000000),2,",",".") . ' MB';
$pia_db_mod = date ("F d Y H:i:s", filemtime($pia_db));
@@ -67,7 +67,7 @@ $pia_db_mod = date ("F d Y H:i:s", filemtime($pia_db));
$Pia_Archive_Path = str_replace('front', 'db', getcwd()).'/';
$Pia_Archive_count = 0;
$Pia_Archive_diskusage = 0;
-$files = glob($Pia_Archive_Path."pialertdb_*.zip");
+$files = glob($Pia_Archive_Path."appdb_*.zip");
if ($files){
$Pia_Archive_count = count($files);
}
@@ -78,7 +78,7 @@ $Pia_Archive_diskusage = number_format(($Pia_Archive_diskusage / 1000000),2,",",
// Find latest Backup for restore -----------------------------------------------
-$latestfiles = glob($Pia_Archive_Path."pialertdb_*.zip");
+$latestfiles = glob($Pia_Archive_Path."appdb_*.zip");
natsort($latestfiles);
$latestfiles = array_reverse($latestfiles,False);
@@ -403,14 +403,14 @@ $db->close();
-
-
pialert.log
-
+
-
+
-
-
pialert_front.log
-
+
-
+
-
+
-
pialert.php_errors.log
-
+
-
+
@@ -792,7 +792,7 @@ function scrollDown()
// Check if the parent
is active
if (elementToCheck.parent().hasClass("active")) {
{
- var areaIDs = ['pialert_log', 'pialert_front_log', 'IP_changes_log', 'stdout_log', 'stderr_log', 'pialert_pholus_log', 'pialert_pholus_lastrun_log', 'pialert_php_log'];
+ var areaIDs = ['app_log', 'app_front_log', 'IP_changes_log', 'stdout_log', 'stderr_log', 'app_pholus_log', 'app_pholus_lastrun_log', 'app_php_log'];
for (let i = 0; i < areaIDs.length; i++) {
diff --git a/front/php/server/db.php b/front/php/server/db.php
index 67d9f249..40e7b21f 100755
--- a/front/php/server/db.php
+++ b/front/php/server/db.php
@@ -10,7 +10,7 @@
//------------------------------------------------------------------------------
// DB File Path
-$DBFILE = dirname(__FILE__).'/../../../db/pialert.db';
+$DBFILE = dirname(__FILE__).'/../../../db/app.db';
//------------------------------------------------------------------------------
// Connect DB
diff --git a/front/php/server/devices.php b/front/php/server/devices.php
index a0056f35..15439930 100755
--- a/front/php/server/devices.php
+++ b/front/php/server/devices.php
@@ -331,7 +331,7 @@ function deleteActHistory() {
//------------------------------------------------------------------------------
function PiaBackupDBtoArchive() {
// prepare fast Backup
- $dbfilename = 'pialert.db';
+ $dbfilename = 'app.db';
$file = '../../../db/'.$dbfilename;
$newfile = '../../../db/'.$dbfilename.'.latestbackup';
@@ -340,7 +340,7 @@ function PiaBackupDBtoArchive() {
echo lang('BackDevices_Backup_CopError');
} else {
// Create archive with actual date
- $Pia_Archive_Name = 'pialertdb_'.date("Ymd_His").'.zip';
+ $Pia_Archive_Name = 'appdb_'.date("Ymd_His").'.zip';
$Pia_Archive_Path = '../../../db/';
exec('zip -j '.$Pia_Archive_Path.$Pia_Archive_Name.' ../../../db/'.$dbfilename, $output);
// chheck if archive exists
@@ -389,7 +389,7 @@ function PiaPurgeDBBackups() {
$Pia_Archive_Path = '../../../db';
$Pia_Backupfiles = array();
- $files = array_diff(scandir($Pia_Archive_Path, SCANDIR_SORT_DESCENDING), array('.', '..', $dbfilename, 'pialertdb-reset.zip'));
+ $files = array_diff(scandir($Pia_Archive_Path, SCANDIR_SORT_DESCENDING), array('.', '..', $dbfilename, 'netalertxdb-reset.zip'));
foreach ($files as &$item)
{
diff --git a/front/php/server/util.php b/front/php/server/util.php
index 83af9b6a..656745f4 100755
--- a/front/php/server/util.php
+++ b/front/php/server/util.php
@@ -250,7 +250,7 @@ function cleanLog($logFile)
$path = "";
- $allowedFiles = ['pialert.log', 'pialert_front.log', 'IP_changes.log', 'stdout.log', 'stderr.log', "pialert_pholus_lastrun.log", 'pialert.php_errors.log'];
+ $allowedFiles = ['app.log', 'app_front.log', 'IP_changes.log', 'stdout.log', 'stderr.log', "pholus_lastrun.log", 'app.php_errors.log'];
if(in_array($logFile, $allowedFiles))
{
@@ -387,7 +387,7 @@ function saveSettings()
// Replace the original file with the temporary file
rename($tempConfPath, $fullConfPath);
- displayMessage("
Settings saved to the pialert.conf file.
A time-stamped backup of the previous file created.
Reloading...
",
+ displayMessage("
Settings saved to the app.conf file.
A time-stamped backup of the previous file created.
Reloading...
",
FALSE, TRUE, TRUE, TRUE);
}
diff --git a/front/php/templates/build.php b/front/php/templates/build.php
index 0ab9f1e2..ed352c38 100755
--- a/front/php/templates/build.php
+++ b/front/php/templates/build.php
@@ -11,7 +11,7 @@
# cvc90 2023 https://github.com/cvc90 GNU GPLv3 #
#---------------------------------------------------------------------------------#
- $file = "/home/pi/pialert/front/buildtimestamp.txt";
+ $file = "/app/front/buildtimestamp.txt";
if (file_exists($file)) {
echo date("Y-m-d", ((int)file_get_contents($file)));
}
diff --git a/front/php/templates/footer.php b/front/php/templates/footer.php
index 16e663be..46a0e76c 100755
--- a/front/php/templates/footer.php
+++ b/front/php/templates/footer.php
@@ -58,5 +58,9 @@
+
+