separate tar and install folders

This commit is contained in:
pucherot
2021-01-18 19:41:02 +01:00
parent 2c71d36662
commit 40a61167e0
7 changed files with 66 additions and 24 deletions

View File

@@ -110,12 +110,19 @@ block is not necessary
sudo apt-get install lighttpd -y
```
3.2 - Install PHP
3.2 - If Pi.Alert is the only site available in this webserver, you can redirect
the default server page to pialert subfolder
```
sudo mv /var/www/html/index.lighttpd.html /var/www/html/index.lighttpd.html.old
sudo ln -s /home/pi/pialert/install/index.html /var/www/html/index.html
```
3.3 - Install PHP
```
sudo apt-get install php php-cgi php-fpm php-sqlite3 -y
```
3.3 - Activate PHP
3.4 - Activate PHP
```
sudo lighttpd-enable-mod fastcgi-php
sudo service lighttpd force-reload
@@ -148,7 +155,7 @@ block is not necessary
<!--- --------------------------------------------------------------------- --->
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/tar/pialert_latest.tar
tar xvf pialert_latest.tar
rm pialert_latest.tar
```
@@ -158,10 +165,13 @@ block is not necessary
sudo ln -s /home/pi/pialert/front /var/www/html/pialert
```
5.3 - Update lighttpd config
5.3 - If you have configured your DNS server (Pi.hole or other) to resolve
the pi.alert to your raspberry, youy must configure lighttpd to redirect
these requests to the correct pialert web folder
```
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 cp pialert/front/pialert_front.conf /etc/lighttpd/conf-available
sudo ln -s ../conf-available/pialert_front.conf /etc/lighttpd/conf-enabled/pialert_front.conf
sudo service lighttpd force-reload
```
5.4 - If you want to use email reporting with gmail

View File

@@ -1,18 +0,0 @@
#
PIALERT_VERSION=`awk '$1=="VERSION" { print $3 }' ../back/pialert.conf | tr -d \'`
PIALERT_DEV_PATH=/media/WD_4TB/dev
cd $PIALERT_DEV_PATH
pwd
ls -l pialert/install/pialert*.tar
tar tvf pialert/install/pialert_latest.tar | wc -l
rm pialert/install/pialert_*.tar
tar cvf pialert/install/pialert_$PIALERT_VERSION.tar --exclude="pialert/install" --exclude="pialert/.git" pialert | wc -l
ln -s pialert_$PIALERT_VERSION.tar pialert/install/pialert_latest.tar
ls -l pialert/install/pialert*.tar

10
install/index.html Normal file
View File

@@ -0,0 +1,10 @@
<!-- ---------------------------------------------------------------------------
# Pi.Alert
# Open Source Network Guard / WIFI & LAN intrusion detector
#
# index.html - Redirect file to pialert subdirectory
#-------------------------------------------------------------------------------
# Puche 2021 pi.alert.application@gmail.com GNU GPLv3
#--------------------------------------------------------------------------- -->
<meta http-equiv="refresh" content="0; url=pialert"/>

View File

@@ -0,0 +1,12 @@
<!-- ---------------------------------------------------------------------------
# Pi.Alert
# Open Source Network Guard / WIFI & LAN intrusion detector
#
# index.html - Redirect file to pialert subdirectory
#-------------------------------------------------------------------------------
# Puche 2021 pi.alert.application@gmail.com GNU GPLv3
#--------------------------------------------------------------------------- -->
$HTTP["host"] == "pi.alert" {
server.document-root = "/var/www/html/pialert/"
}

28
tar/create_tar.sh Normal file
View File

@@ -0,0 +1,28 @@
#!/bin/sh
# ------------------------------------------------------------------------------
# Pi.Alert
# Open Source Network Guard / WIFI & LAN intrusion detector
#
# create_tar.sh - Create the installation file
# ------------------------------------------------------------------------------
# Puche 2021 pi.alert.application@gmail.com GNU GPLv3
# ------------------------------------------------------------------------------
PIALERT_VERSION=`awk '$1=="VERSION" { print $3 }' ../back/pialert.conf | tr -d \'`
PIALERT_DEV_PATH=/media/WD_4TB/dev
# ------------------------------------------------------------------------------
cd $PIALERT_DEV_PATH
pwd
# ------------------------------------------------------------------------------
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_$PIALERT_VERSION.tar --exclude="pialert/tar" --exclude="pialert/.git" pialert | wc -l
ln -s pialert_$PIALERT_VERSION.tar pialert/tar/pialert_latest.tar
ls -l pialert/tar/pialert*.tar