diff --git a/.env b/.env
index 7ac7cf6a..c75c843a 100644
--- a/.env
+++ b/.env
@@ -2,5 +2,9 @@
APP_DATA_LOCATION=/path/to/docker_appdata
APP_CONFIG_LOCATION=/path/to/docker_config
LOGS_LOCATION=/path/to/docker_logs
+TZ=Europe/Paris
+HOST_USER_ID=1000
+HOST_USER_GID=1000
+PORT=20211
diff --git a/Dockerfile b/Dockerfile
index 02d225a6..cd17f6c6 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -7,7 +7,7 @@ ENV USER=pi USER_ID=1000 USER_GID=1000 TZ=Europe/London PORT=20211
# Todo, do we still need all these packages? I can already see sudo which isn't needed
RUN apt-get update \
- && apt-get install --no-install-recommends ca-certificates curl libwww-perl arp-scan perl apt-utils cron sudo lighttpd php php-cgi php-fpm php-sqlite3 sqlite3 dnsutils net-tools python iproute2 nmap python-pip -y \
+ && apt-get install --no-install-recommends ca-certificates curl libwww-perl arp-scan perl apt-utils cron sudo lighttpd php php-cgi php-fpm php-sqlite3 sqlite3 dnsutils net-tools python iproute2 nmap python-pip zip -y \
&& pip install requests \
&& apt-get clean autoclean \
&& apt-get autoremove \
@@ -29,8 +29,7 @@ RUN groupadd --gid "${USER_GID}" "${USER}" && \
COPY . /home/pi/pialert
# Pi.Alert
-RUN sed -ie "s|TIMEZONE|${TZ}|g" /home/pi/pialert/install/pialert.cron \
- && python /home/pi/pialert/back/pialert.py update_vendors \
+RUN python /home/pi/pialert/back/pialert.py update_vendors \
&& sed -ie 's/= 80/= '${PORT}'/g' /etc/lighttpd/lighttpd.conf \
&& (crontab -l 2>/dev/null; cat /home/pi/pialert/install/pialert.cron) | crontab -
diff --git a/README.md b/README.md
index 42901f45..58ff9da2 100644
--- a/README.md
+++ b/README.md
@@ -4,25 +4,26 @@
WIFI / LAN intruder detector.
Scan the devices connected to your WIFI / LAN and alert you the connection of
-unknown devices. It also warns the disconnection of "always connected" devices.
+unknown devices. It also warns if a "always connected" devices disconnects.
![Main screen][main]
*(Apologies for my English and my limited knowledge of Python, php and
JavaScript)*
-# Docker image :whale:
+# Docker image 🐳
[](https://github.com/jokob-sk/Pi.Alert/actions/workflows/docker.yml)
[](https://hub.docker.com/r/jokobsk/pi.alert)
-All credit for Pi.Alert goes to: [pucherot/Pi.Alert](https://github.com/pucherot/Pi.Alert).
-A pre-built image is available on :whale: Docker Hub: [jokobsk/Pi.Alert](https://registry.hub.docker.com/r/jokobsk/pi.alert).
-The source :page_facing_up: Dockerfile is available [here](https://github.com/jokob-sk/Pi.Alert/blob/main/Dockerfile) with a detailed :books: [readme](https://github.com/jokob-sk/Pi.Alert/blob/main//dockerfiles/README.md) included.
+🥇 Pi.Alert credit goes to [pucherot/Pi.Alert](https://github.com/pucherot/Pi.Alert).
+🐳 Docker Image: [jokobsk/Pi.Alert](https://registry.hub.docker.com/r/jokobsk/pi.alert).
+📄 [Dockerfile](https://github.com/jokob-sk/Pi.Alert/blob/main/Dockerfile)
+📚 [Dockerfile instructions](https://github.com/jokob-sk/Pi.Alert/blob/main//dockerfiles/README.md).
![Main screen dark][main_dark]
-Optional Darkmode (and 12H activity chart) within this fork courtesy of [leiweibau](https://github.com/leiweibau/Pi.Alert)
+Dark mode (and Device presence over time) within this fork courtesy of [leiweibau](https://github.com/leiweibau/Pi.Alert)
## How it works
The system continuously scans the network for:
@@ -54,14 +55,18 @@ In charge of:
- Scan the network searching connected devices using the scanning methods
described
- Store the information in the DB
- - Report the changes detected by e-mail
+ - Report the changes detected by e-mail and/or other services (Pushsafer, NTFY, Gotify)
- Optional speedtest for Device "Internet"
| ![Report 1][report1] | ![Report 2][report2] |
| -------------------- | -------------------- |
### Front
-A web frontal that allows:
+There is a configurable login to prevent unauthorized use.
+
+> * Set `PIALERT_WEB_PROTECTION = True` in `pialert.conf` to enable
+
+A web frontend that allows:
- Manage the devices inventory and the characteristics
- Display in a visual way all the information collected by the back
- Sessions
@@ -72,7 +77,7 @@ A web frontal that allows:
- Concurrent devices
- Down alerts
- IP's
- - manuel nmap scans
+ - Manual Nmap scans
- Optional speedtest for Device "Internet"
- ...
@@ -98,9 +103,9 @@ Initially designed to run on a Raspberry Pi, probably it can run on many other
Linux distributions.
- One-step Automated Install:
- #### `curl -sSL https://github.com/pucherot/Pi.Alert/raw/main/install/pialert_install.sh | bash`
+ #### `curl -sSL https://github.com/leiweibau/Pi.Alert/raw/main/install/pialert_install.sh | bash`
-- One-step Automated Install (forked) without Webserver:
+- One-step Automated Install without Webserver if another Webserver is already installed. (not recommended):
#### `curl -sSL https://github.com/leiweibau/Pi.Alert/raw/main/install/pialert_install_no_webserver.sh | bash`
- [Installation Guide (step by step)](docs/INSTALL.md)
@@ -109,7 +114,7 @@ Linux distributions.
# Update
- One-step Automated Update:
- #### `curl -sSL https://github.com/pucherot/Pi.Alert/raw/main/install/pialert_update.sh | bash`
+ #### `curl -sSL https://github.com/leiweibau/Pi.Alert/raw/main/install/pialert_update.sh | bash`
# Uninstall process
@@ -159,6 +164,16 @@ Linux distributions.
***Suggestions and comments are welcome***
+### Special thanks 🥇
+
+ This code is a collaborative body of work, with special thanks to:
+
+ - [leiweibau](https://github.com/leiweibau/Pi.Alert): Dark mode (and Last X scans activity chart)
+ - [Macleykun](https://github.com/Macleykun): Help with Dockerfile clean-up
+ - [Final-Hawk](https://github.com/Final-Hawk): Help with NTFY, styling and other fixes
+ - [terorero](https://github.com/terorero): Spanish translation
+ - [jokob-sk](https://github.com/jokob-sk/Pi.Alert): DB Maintenance tools
+ - Please see the [Git commit history](https://github.com/jokob-sk/Pi.Alert/commits/main) for a full list of people and their contributions to the project
[main]: ./docs/img/1_devices.jpg "Main screen"
diff --git a/back/pialert.py b/back/pialert.py
index 3cc7c5bb..76dc2db2 100644
--- a/back/pialert.py
+++ b/back/pialert.py
@@ -1230,21 +1230,21 @@ def email_reporting ():
mail_text = mail_text.replace ('', socket.gethostname() )
mail_html = mail_html.replace ('', socket.gethostname() )
- mail_text = mail_text.replace ('', VERSION )
- mail_html = mail_html.replace ('', VERSION )
+ # mail_text = mail_text.replace ('', VERSION )
+ # mail_html = mail_html.replace ('', VERSION )
- mail_text = mail_text.replace ('', VERSION_DATE )
- mail_html = mail_html.replace ('', VERSION_DATE )
+ # mail_text = mail_text.replace ('', VERSION_DATE )
+ # mail_html = mail_html.replace ('', VERSION_DATE )
- mail_text = mail_text.replace ('', VERSION_YEAR )
- mail_html = mail_html.replace ('', VERSION_YEAR )
+ # mail_text = mail_text.replace ('', VERSION_YEAR )
+ # mail_html = mail_html.replace ('', VERSION_YEAR )
# Compose Internet Section
print (' Formating report...')
mail_section_Internet = False
mail_text_Internet = ''
mail_html_Internet = ''
- text_line_template = '{}\t{}\n{}\t{}\n{}\t{}\n{}\t{}\n\n'
+ text_line_template = '{} \t{}\t{}\t{}\n'
html_line_template = '