mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2025-12-06 17:15:38 -08:00
remove version.conf + README cleanup
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
VERSION = '3.7_jokobsk'
|
||||
VERSION_YEAR = '2022'
|
||||
VERSION_DATE = '2022-11-20'
|
||||
@@ -30,21 +30,36 @@ Big thanks to <a href="https://github.com/Macleykun">@Macleykun</a> 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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -13,18 +13,14 @@
|
||||
|
||||
<!-- © 2020 Puche -->
|
||||
<?php
|
||||
$conf_file = '../config/version.conf';
|
||||
$conf_data = parse_ini_file($conf_file);
|
||||
echo '<span style="display:inline-block; transform: rotate(180deg)">©</span> '. $conf_data['VERSION_YEAR'] .' Puche';
|
||||
echo '<span style="display:inline-block; transform: rotate(180deg)">©</span> 2020 Puche (+2022 jokob-sk)';
|
||||
?>
|
||||
<!-- To the right -->
|
||||
<div class="pull-right no-hidden-xs">
|
||||
|
||||
<!-- Pi.Alert 2.50 <small>(2019-12-30)</small> -->
|
||||
<?php
|
||||
$conf_file = '../config/version.conf';
|
||||
$conf_data = parse_ini_file($conf_file);
|
||||
echo 'Pi.Alert '. $conf_data['VERSION'] .' <small>('. $conf_data['VERSION_DATE'] .')</small>';
|
||||
echo 'Pi.Alert';
|
||||
?>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user