Update INSTALL.md

This commit is contained in:
pucherot
2021-01-18 15:52:57 +01:00
committed by GitHub
parent 7583174edd
commit 2049c2bebc

View File

@@ -25,79 +25,79 @@ Estimated time: 20'
- *Lite version (without Descktop) is enough for Pi.Alert* - *Lite version (without Descktop) is enough for Pi.Alert*
1.2 - Activate ssh 1.2 - Activate ssh
- Create a empty file with name 'ssh' in the boot partition of the SD - Create a empty file with name 'ssh' in the boot partition of the SD
1.3 - Start the raspberry 1.3 - Start the raspberry
1.4 - Login to the system with pi user 1.4 - Login to the system with pi user
``` ```
user: pi user: pi
password: raspberry password: raspberry
``` ```
1.5 - Change the default password of pi user 1.5 - Change the default password of pi user
``` ```
passwd passwd
``` ```
1.6 - Setup the basic configuration 1.6 - Setup the basic configuration
``` ```
sudo raspi-config sudo raspi-config
``` ```
1.7 - Optionally, configure a static IP in raspi-config 1.7 - Optionally, configure a static IP in raspi-config
1.8 - Update the OS 1.8 - Update the OS
``` ```
sudo apt-get update sudo apt-get update
sudo apt-get upgrade sudo apt-get upgrade
sudo shutdown -r now sudo shutdown -r now
``` ```
## Pi-hole Setup ## Pi-hole Setup
<!--- --------------------------------------------------------------------- ---> <!--- --------------------------------------------------------------------- --->
2.1 - Links & Doc 2.1 - Links & Doc
- https://pi-hole.net/ - https://pi-hole.net/
- https://github.com/pi-hole/pi-hole - https://github.com/pi-hole/pi-hole
- https://github.com/pi-hole/pi-hole/#one-step-automated-install - https://github.com/pi-hole/pi-hole/#one-step-automated-install
2.2 - Login to the system with pi user 2.2 - Login to the system with pi user
2.3 - Install Pi-hole 2.3 - Install Pi-hole
``` ```
curl -sSL https://install.pi-hole.net | bash curl -sSL https://install.pi-hole.net | bash
``` ```
- Select "Install web admin interface" - Select "Install web admin interface"
- Select "Install web server lighttpd" - Select "Install web server lighttpd"
2.4 - Configure Pi-hole admin password 2.4 - Configure Pi-hole admin password
``` ```
pihole -a -p PASSWORD pihole -a -p PASSWORD
``` ```
2.5 - Connect to web admin panel 2.5 - Connect to web admin panel
- http://192.168.1.x/admin/ - http://192.168.1.x/admin/
- (*replace 192.168.1.x with your Raspberry IP*) - (*replace 192.168.1.x with your Raspberry IP*)
2.6 - Activate DHCP server 2.6 - Activate DHCP server
- Pi-hole -> Settings -> DHCP -> Mark "DHCP server enabled" - Pi-hole -> Settings -> DHCP -> Mark "DHCP server enabled"
2.7 - Add pi.alert DNS Record 2.7 - Add pi.alert DNS Record
``` ```
hostname -I hostname -I
``` ```
- Pi-hole -> Local DNS -> DNS Records -> Add new domain /IP - Pi-hole -> Local DNS -> DNS Records -> Add new domain /IP
- pi.alert 192.168.1.x - pi.alert 192.168.1.x
- (*replace 192.168.1.x with your Raspberry IP*) - (*replace 192.168.1.x with your Raspberry IP*)
2.8 - Deactivate your current DHCP Server (*Normaly at your router or AP*) 2.8 - Deactivate your current DHCP Server (*Normaly at your router or AP*)
2.9 - Renew your computer IP to unsure you are using the new DHCP and DNS server 2.9 - Renew your computer IP to unsure you are using the new DHCP and DNS server
- Windows: cmd -> ipconfig /renew - Windows: cmd -> ipconfig /renew
- Linux: shell -> sudo dhclient -r; sudo dhclient - Linux: shell -> sudo dhclient -r; sudo dhclient
- Mac: Apple menu -> System Preferences -> Network -> Select the network - Mac: Apple menu -> System Preferences -> Network -> Select the network
-> Advanced -> TCP/IP -> Renew DHCP Lease -> Advanced -> TCP/IP -> Renew DHCP Lease
## Lighttpd & PHP ## Lighttpd & PHP
@@ -105,134 +105,134 @@ Estimated time: 20'
If you have already installed pi.hole, this step is not necessary If you have already installed pi.hole, this step is not necessary
3.1 - Install lighttpd 3.1 - Install lighttpd
``` ```
sudo apt-get install lighttpd -y sudo apt-get install lighttpd -y
``` ```
3.2 - Install PHP 3.2 - Install PHP
``` ```
sudo apt-get install php php-cgi php-fpm php-sqlite3 -y sudo apt-get install php php-cgi php-fpm php-sqlite3 -y
``` ```
3.3 - Activate PHP 3.3 - Activate PHP
``` ```
sudo lighttpd-enable-mod fastcgi-php sudo lighttpd-enable-mod fastcgi-php
sudo service lighttpd force-reload sudo service lighttpd force-reload
``` ```
## arp-scan & Python ## arp-scan & Python
<!--- --------------------------------------------------------------------- ---> <!--- --------------------------------------------------------------------- --->
4.1 - Install arp-scan utility and test 4.1 - Install arp-scan utility and test
``` ```
sudo apt-get install arp-scan sudo apt-get install arp-scan
sudo arp-scan -l sudo arp-scan -l
``` ```
4.2 - Test Python 4.2 - Test Python
New versions of 'Raspberry Pi OS' includes python. You can check that New versions of 'Raspberry Pi OS' includes python. You can check that
Python is installed with the command: Python is installed with the command:
``` ```
python -V python -V
``` ```
4.3 - If python is not installed in your system, you can install it with this 4.3 - If python is not installed in your system, you can install it with this
command: command:
``` ```
sudo apt-get install python sudo apt-get install python
``` ```
## Pi.Alert ## Pi.Alert
<!--- --------------------------------------------------------------------- ---> <!--- --------------------------------------------------------------------- --->
5.1 - Download Pi.Alert and uncompress 5.1 - Download Pi.Alert and uncompress
``` ```
curl -LO https://github.com/pucherot/Pi.Alert/raw/main/install/pialert_latest.tar curl -LO https://github.com/pucherot/Pi.Alert/raw/main/install/pialert_latest.tar
tar xvf pialert_latest.tar tar xvf pialert_latest.tar
rm pialert_latest.tar rm pialert_latest.tar
``` ```
5.2 - Public the front portal 5.2 - Public the front portal
``` ```
sudo ln -s /home/pi/pialert/front /var/www/html/pialert sudo ln -s /home/pi/pialert/front /var/www/html/pialert
``` ```
5.3 - Update lighttpd config 5.3 - Update lighttpd config
``` ```
sudo sh -c "printf '\n\n\$HTTP[\"host\"] == \"pi.alert\" {\n server.document-root = \"/var/www/html/pialert/\"\n}\n' >> /etc/lighttpd/external.conf" sudo sh -c "printf '\n\n\$HTTP[\"host\"] == \"pi.alert\" {\n server.document-root = \"/var/www/html/pialert/\"\n}\n' >> /etc/lighttpd/external.conf"
sudo /etc/init.d/lighttpd restart sudo /etc/init.d/lighttpd restart
``` ```
5.4 - If you want to use email reporting with gmail 5.4 - If you want to use email reporting with gmail
- Go to your Google Account https://myaccount.google.com/ - Go to your Google Account https://myaccount.google.com/
- On the left navigation panel, click Security - On the left navigation panel, click Security
- On the bottom of the page, in the Less secure app access panel, - On the bottom of the page, in the Less secure app access panel,
click Turn on access click Turn on access
- Click Save button - Click Save button
5.5 - Config Pialert parameters 5.5 - Config Pialert parameters
```
nano ~/pialert/back/pialert.conf
```
- If you want to use email reporting, configure this parameters
```ini
REPORT_MAIL = True
SMTP_USER = 'user@gmail.com'
SMTP_PASS = 'password'
REPORT_TO = 'user@gmail.com'
``` ```
nano ~/pialert/back/pialert.conf
```
- If you want to use email reporting, configure this parameters
```ini
REPORT_MAIL = True
SMTP_USER = 'user@gmail.com'
SMTP_PASS = 'password'
REPORT_TO = 'user@gmail.com'
```
- If you want to update your Dynamic DNS, configure this parameters - If you want to update your Dynamic DNS, configure this parameters
```ini ```ini
DDNS_ACTIVE = True DDNS_ACTIVE = True
DDNS_DOMAIN = 'your_domain.freeddns.org' DDNS_DOMAIN = 'your_domain.freeddns.org'
DDNS_USER = 'dynu_user' DDNS_USER = 'dynu_user'
DDNS_PASSWORD = 'A0000000B0000000C0000000D0000000' DDNS_PASSWORD = 'A0000000B0000000C0000000D0000000'
DDNS_UPDATE_URL = 'https://api.dynu.com/nic/update?' DDNS_UPDATE_URL = 'https://api.dynu.com/nic/update?'
``` ```
- If you have installed Pi.hole and DHCP, activate this parameters - If you have installed Pi.hole and DHCP, activate this parameters
```ini ```ini
PIHOLE_ACTIVE = True PIHOLE_ACTIVE = True
DHCP_ACTIVE = True DHCP_ACTIVE = True
``` ```
5.6 - Update vendors DB 5.6 - Update vendors DB
``` ```
python ~/pialert/back/pialert.py update_vendors python ~/pialert/back/pialert.py update_vendors
``` ```
5.7 - Test Pi.Alert Scan 5.7 - Test Pi.Alert Scan
``` ```
python ~/pialert/back/pialert.py internet_IP python ~/pialert/back/pialert.py internet_IP
python ~/pialert/back/pialert.py 1 python ~/pialert/back/pialert.py 1
``` ```
5.8 - Add crontab jobs 5.8 - Add crontab jobs
``` ```
(crontab -l 2>/dev/null; cat ~/pialert/back/pialert.cron) | crontab - (crontab -l 2>/dev/null; cat ~/pialert/back/pialert.cron) | crontab -
``` ```
5.9 - Add permissions to the web-server user 5.9 - Add permissions to the web-server user
``` ```
sudo chgrp -R www-data ~/pialert/back ~/pialert/back/pialert.conf ~/pialert/front ~/pialert/db sudo chgrp -R www-data ~/pialert/back ~/pialert/back/pialert.conf ~/pialert/front ~/pialert/db
chmod -R 770 ~/pialert/back ~/pialert/back/pialert.conf ~/pialert/front ~/pialert/db chmod -R 770 ~/pialert/back ~/pialert/back/pialert.conf ~/pialert/front ~/pialert/db
``` ```
5.10 - Check DNS record for pi.alert (explained in point 2.7 of Pi.hole 5.10 - Check DNS record for pi.alert (explained in point 2.7 of Pi.hole
installation) installation)
- Add pi.alert DNS Record - Add pi.alert DNS Record
``` ```
hostname -I hostname -I
``` ```
- Pi-hole -> Local DNS -> DNS Records -> Add new domain /IP - Pi-hole -> Local DNS -> DNS Records -> Add new domain /IP
- pi.alert 192.168.1.x - pi.alert 192.168.1.x
- (*replace 192.168.1.x with your Raspberry IP*) - (*replace 192.168.1.x with your Raspberry IP*)
5.11 - Use admin panel to configure the devices 5.11 - Use admin panel to configure the devices
- http://pi.alert/ - http://pi.alert/
- http://192.168.1.x/pialert/ - http://192.168.1.x/pialert/
- (*replace 192.168.1.x with your Raspberry IP*) - (*replace 192.168.1.x with your Raspberry IP*)
## Device Management ## Device Management