diff --git a/back/pialert.py b/back/pialert.py index 43c1640c..a4ac26f8 100755 --- a/back/pialert.py +++ b/back/pialert.py @@ -46,11 +46,10 @@ PIALERT_BACK_PATH = os.path.dirname(os.path.abspath(__file__)) PIALERT_PATH = PIALERT_BACK_PATH + "/.." STOPARPSCAN = PIALERT_PATH + "/db/setting_stoparpscan" -if (sys.version_info > (3,0)): - exec(open(PIALERT_PATH + "/config/version.conf").read()) + +if (sys.version_info > (3,0)): exec(open(PIALERT_PATH + "/config/pialert.conf").read()) -else: - execfile (PIALERT_PATH + "/config/version.conf") +else: execfile (PIALERT_PATH + "/config/pialert.conf") # INITIALIZE ALL CONSTANTS from pialert.conf diff --git a/config/version.conf b/config/version.conf deleted file mode 100755 index 8c624fb1..00000000 --- a/config/version.conf +++ /dev/null @@ -1,3 +0,0 @@ -VERSION = '3.7_jokobsk' -VERSION_YEAR = '2022' -VERSION_DATE = '2022-11-20' diff --git a/dockerfiles/README.md b/dockerfiles/README.md index 798ccf24..32757723 100755 --- a/dockerfiles/README.md +++ b/dockerfiles/README.md @@ -30,21 +30,36 @@ Big thanks to @Macleykun for help and ## 💾 Setup and Backups -1. (**required**) Download `pialert.conf` and `version.conf` from [here](https://github.com/jokob-sk/Pi.Alert/tree/main/config). -2. (**required**) In `pialert.conf` specify your network adapter (will probably be `eth0` or `eth1`) and the network filter (which **significantly** speeds up the scan process), e.g. if your DHCP server assigns IPs in the 192.168.1.0 to 192.168.1.255 range, specify it the following way: - * `SCAN_SUBNETS = '192.168.1.0/24 --interface=eth0'` -3. (**required**) Use your configuration by: - * Mapping the container folder `/home/pi/pialert/config` to a persistent folder containing `pialert.conf` and `version.conf`, - * ... or by mapping the files individually `pialert.conf:/home/pi/pialert/config/pialert.conf` and `version.conf:/home/pi/pialert/config/version.conf` -4. Set the `TZ` environment variable to your current time zone (e.g.`Europe/Paris`). Find your time zone [here](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). -5. Database backup +### ❗ **Required** + +1. Download `pialert.conf` from [here](https://github.com/jokob-sk/Pi.Alert/tree/main/config). +2. In `pialert.conf` define your network adapter(s) with the `SCAN_SUBNETS` variable. + * The adapter will probably be `eth0` or `eth1`. + * Specify the network filter (which **significantly** speeds up the scan process). For example, the filter `192.168.1.0/24` covers IP ranges 192.168.1.0 to 192.168.1.255. + * Examples for one and two subnets: + * `SCAN_SUBNETS = '192.168.1.0/24 --interface=eth0'` + * `SCAN_SUBNETS = ['192.168.1.0/24 --interface=eth0', '192.168.1.0/24 --interface=eth1']` + +3. Use your configuration by: + * Mapping the container folder to a persistent folder containing `pialert.conf`: + * `persistent/path/config:/home/pi/pialert/config` + * ... or by mapping the file directly: + * `pialert.conf:/home/pi/pialert/config/pialert.conf` + +### 👍 **Recommended** + +1. Database backup * Download the [original DB from GitHub](https://github.com/jokob-sk/Pi.Alert/blob/main/db/pialert.db). * Map the `pialert.db` file (⚠ not folder) from above to `/home/pi/pialert/db/pialert.db` (see [Examples](https://github.com/jokob-sk/Pi.Alert/tree/main/dockerfiles#-examples) for details). * If facing issues (AJAX errors, can't write to DB, etc,) make sure permissions are set correctly, and check the logs under `/home/pi/pialert/log`. * To solve permission issues you can also try to create a DB backup and then run a DB Restore via the **Maintenance > Backup/Restore** section. * You can try also setting the owner and group of the `pialert.db` by executing the following on the host system: `docker exec pialert chown -R www-data:www-data /home/pi/pialert/db/pialert.db`. -6. The container supports mapping to local User nad Group IDs. Specify the enviroment variables `HOST_USER_ID` and `HOST_USER_GID` if needed. -7. You can override the port by specifying the `PORT` env variable. +2. Map to local User nad Group IDs. Specify the enviroment variables `HOST_USER_ID` and `HOST_USER_GID` if needed. +3. Set the `TZ` environment variable to your current time zone (e.g.`Europe/Paris`). Find your time zone [here](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). +4. Use a custom port by specifying the `PORT` env variable. +5. Map an empty file with the name `setting_darkmode` if you want to force the dark mode on container rebuilt + * `- persistent/path/db/setting_darkmode:/home/pi/pialert/db/setting_darkmode` +6. Check and enable notification service(s) in the `pialert.conf` file. Docker-compose examples can be found below. @@ -61,7 +76,7 @@ services: container_name: pialert image: "jokobsk/pi.alert:latest" network_mode: "host" - restart: always + restart: unless-stopped volumes: - ${APP_DATA_LOCATION}/pialert/config:/home/pi/pialert/config - ${APP_DATA_LOCATION}/pialert/db/pialert.db:/home/pi/pialert/db/pialert.db @@ -116,8 +131,7 @@ Courtesy of [pbek](https://github.com/pbek). The volume `pialert_db` is used by restart: unless-stopped volumes: - pialert_db:/home/pi/pialert/db - - ./pialert/pialert.conf:/home/pi/pialert/config/pialert.conf - - ./pialert/version.conf:/home/pi/pialert/config/version.conf + - ./pialert/pialert.conf:/home/pi/pialert/config/pialert.conf ``` ## ☕ Support diff --git a/docs/VERSIONS_HISTORY.md b/docs/VERSIONS_HISTORY.md index 94c34ac5..bc2cb87d 100755 --- a/docs/VERSIONS_HISTORY.md +++ b/docs/VERSIONS_HISTORY.md @@ -67,6 +67,7 @@ - Added compatibility with Python 3 (default version installed with Ubuntu) - Added compatibility in the Installation guide with Ubuntu server - Eliminated some unnecessary packages from the installation + ### License diff --git a/front/php/templates/footer.php b/front/php/templates/footer.php index 0bc35294..4b8aafe6 100755 --- a/front/php/templates/footer.php +++ b/front/php/templates/footer.php @@ -13,18 +13,14 @@ © '. $conf_data['VERSION_YEAR'] .' Puche'; + echo '© 2020 Puche (+2022 jokob-sk)'; ?>
('. $conf_data['VERSION_DATE'] .')'; + echo 'Pi.Alert'; ?>
diff --git a/tar/create.sh b/tar/create.sh deleted file mode 100755 index 06c6e3de..00000000 --- a/tar/create.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/sh -# ------------------------------------------------------------------------------ -# Pi.Alert -# Open Source Network Guard / WIFI & LAN intrusion detector -# -# create_tar.sh - Create the tar file for installation -# ------------------------------------------------------------------------------ -# Puche 2021 pi.alert.application@gmail.com GNU GPLv3 -# ------------------------------------------------------------------------------ - -PIALERT_DEV_PATH=../../ -cd $PIALERT_DEV_PATH -pwd -PIALERT_VERSION=`awk '$1=="VERSION" { print $3 }' pialert/config/version.conf | tr -d \'` - -# ------------------------------------------------------------------------------ -ls -l pialert/tar/pialert*.tar -tar tvf pialert/tar/pialert_latest.tar | wc -l -rm pialert/tar/pialert_*.tar - -# ------------------------------------------------------------------------------ -tar cvf pialert/tar/pialert_latest.tar --no-xattrs --exclude="pialert/tar" --exclude="pialert/.git" --exclude="pialert/.gitignore" pialert | wc -l - -#ln -s pialert_$PIALERT_VERSION.tar pialert/package/pialert_latest.tar -#ls -l pialert/package/pialert*.tar diff --git a/tar/create_tar.sh b/tar/create_tar.sh deleted file mode 100755 index 0af9b429..00000000 --- a/tar/create_tar.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/sh -# ------------------------------------------------------------------------------ -# Pi.Alert -# Open Source Network Guard / WIFI & LAN intrusion detector -# -# create_tar.sh - Create the tar file for installation -# ------------------------------------------------------------------------------ -# Puche 2021 pi.alert.application@gmail.com GNU GPLv3 -# ------------------------------------------------------------------------------ - -PIALERT_DEV_PATH=$(pwd) -cd $PIALERT_DEV_PATH'/../' - -PIALERT_VERSION=`awk '$1=="VERSION" { print $3 }' config/version.conf | tr -d \'` -echo $PIALERT_VERSION - -# ------------------------------------------------------------------------------ -ls -l tar/pialert*.tar -tar tvf tar/pialert_latest.tar | wc -l -rm tar/pialert_*.tar - -# ------------------------------------------------------------------------------ -tar cvf tar/pialert_$PIALERT_VERSION.tar --exclude="tar" --exclude=".git" --exclude=".gitignore" ./ | wc -l - -#ln -s pialert_$PIALERT_VERSION.tar tar/pialert_latest.tar -cp tar/pialert_$PIALERT_VERSION.tar tar/pialert_latest.tar -#ls -l tar/pialert*.tar \ No newline at end of file