From 0417a98646b05736a35c4bc4948bf53cf1532d94 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E2=80=9Cterorero=E2=80=9D?= <“devin@devinconde.com”>
Date: Sun, 7 Aug 2022 19:22:31 -0400
Subject: [PATCH 01/15] es
---
front/php/templates/language/es_es.php | 104 +++++++++++++------------
1 file changed, 53 insertions(+), 51 deletions(-)
diff --git a/front/php/templates/language/es_es.php b/front/php/templates/language/es_es.php
index 492049ec..25976e3b 100644
--- a/front/php/templates/language/es_es.php
+++ b/front/php/templates/language/es_es.php
@@ -186,7 +186,7 @@ $pia_lang['DevDetail_Nmap_buttonDefault_text'] = 'Escaneo predeterminado: NMAP e
$pia_lang['DevDetail_Nmap_buttonDetail_text'] = 'Escaneo detallado: escaneo predeterminado con detección de sistema operativo habilitado, detección de versiones, escaneo de script y traceroute (hasta 30 segundos o más)';
//////////////////////////////////////////////////////////////////
-// Maintenance Page - Update by @TeroRERO 03ago2022
+// Maintenance Page - Update by @TeroRERO 07ago2022
//////////////////////////////////////////////////////////////////
$pia_lang['Maintenance_Title'] = 'Herramientas de mantenimiento';
@@ -268,6 +268,8 @@ $pia_lang['Maintenance_Tool_ImportCSV'] = 'Importación CSV';
$pia_lang['Maintenance_Tool_ImportCSV_text'] = 'Antes de usar esta función, haga una copia de seguridad. Importe un archivo CSV (valor separado por comas) que contiene la lista de dispositivos, incluidas las relaciones de red entre nodos de red y dispositivos conectados. Para hacer eso, coloque el archivo CSV llamado devices.csv en su carpeta /config .';
$pia_lang['Maintenance_Tool_ImportCSV_noti'] = 'Importación CSV';
$pia_lang['Maintenance_Tool_ImportCSV_noti_text'] = '¿Está seguro de que quiere importar el archivo CSV? Esto sobrescribirá completamente los dispositivos de su base de datos.';
+$pia_lang['Maintenance_Github_package_a'] ='La última versión de Pi.Alert (Fork leiweibau) se publicó en ';
+$pia_lang['Maintenance_Github_package_b'] ='';
//////////////////////////////////////////////////////////////////
// Maintenance Page - Update by @TeroRERO 25jul2022
@@ -328,61 +330,61 @@ $pia_lang['Network_Table_Hostname'] = 'Nombre de host';
$pia_lang['Network_Table_IP'] = 'Dirección IP';
//////////////////////////////////////////////////////////////////
-// Help Page
+// Help Page - Update by @TeroRERO 07ago2022
//////////////////////////////////////////////////////////////////
-$pia_lang['HelpFAQ_Title'] = 'Hilfe / FAQ';
-$pia_lang['HelpFAQ_Cat_General'] = 'Allgemein';
-$pia_lang['HelpFAQ_Cat_Detail'] = 'Detailsansicht';
-$pia_lang['HelpFAQ_Cat_General_100_head'] = 'The clock on the top right and the times of the events/presence are not correct (time difference).';
-$pia_lang['HelpFAQ_Cat_General_100_text_a'] = 'On your PC the following time zone is set for the PHP environment:';
-$pia_lang['HelpFAQ_Cat_General_100_text_b'] = 'If this is not the timezone you are in, you should change the timezone in the PHP configuration file. You can find it in this directory:';
-$pia_lang['HelpFAQ_Cat_General_100_text_c'] = 'Search in this file for the entry "date.timezone", remove the leading ";" if necessary and enter the desired timezone. A list with the supported timezones can be found here (Link)';
-$pia_lang['HelpFAQ_Cat_General_101_head'] = 'My network seems to slow down, streaming "freezes".';
-$pia_lang['HelpFAQ_Cat_General_101_text'] = 'It may well be that low-powered devices reach their performance limits with the way Pi.Alert detects new devices on the network. This is amplified even more,
- if these devices communicate with the network via WLAN. Solutions here would be to switch to a wired connection if possible or, if the device is only to be used for a limited period of time, to use the arp scan.
- pause the arp scan on the maintenance page.';
-$pia_lang['HelpFAQ_Cat_General_102_head'] = 'I get the message that the database is read only.';
-$pia_lang['HelpFAQ_Cat_General_102_text'] = 'Check in the Pi.Alert directory if the database folder (db) has been assigned the correct permissions:
- drwxrwx--- 2 (your username) www-data
- If the permission is not correct, you can set it again with the following commands in the terminal or the console:
+$pia_lang['HelpFAQ_Title'] = 'Ayuda / FAQ';
+$pia_lang['HelpFAQ_Cat_General'] = 'General';
+$pia_lang['HelpFAQ_Cat_Detail'] = 'Detalles';
+$pia_lang['HelpFAQ_Cat_General_100_head'] = 'El reloj en la parte superior derecha y el tiempo de los eventos/presencia no son correctos (diferencia de tiempo).';
+$pia_lang['HelpFAQ_Cat_General_100_text_a'] = 'En su PC, la siguiente zona horaria está configurada para el entorno PHP:';
+$pia_lang['HelpFAQ_Cat_General_100_text_b'] = 'Si esta no es la zona horaria en la que se encuentra, debe cambiar la zona horaria en el archivo de configuración de PHP. Puedes encontrarlo en este directorio:';
+$pia_lang['HelpFAQ_Cat_General_100_text_c'] = 'Busque en este archivo la entrada "date.timezone", elimine el ";" inicial si es necesario e introduzca la zona horaria deseada. Puede encontrar una lista con las zonas horarias compatibles aquí (Link)';
+$pia_lang['HelpFAQ_Cat_General_101_head'] = 'Mi red parece ralentizarse, el streaming se "congela".';
+$pia_lang['HelpFAQ_Cat_General_101_text'] = 'Es muy posible que los dispositivos de baja potencia alcancen sus límites de rendimiento con la forma en que Pi.Alert detecta nuevos dispositivos en la red. Esto se amplifica aún más,
+ si estos dispositivos se comunican con la red a través de WLAN. Las soluciones aquí serían cambiar a una conexión por cable si es posible o, si el dispositivo sólo se va a utilizar durante un período de tiempo limitado, utilizar el arp scan.
+ pausar el arp scan en la página de mantenimiento.';
+$pia_lang['HelpFAQ_Cat_General_102_head'] = 'Me aparece el mensaje de que la base de datos es de sólo de lectura.';
+$pia_lang['HelpFAQ_Cat_General_102_text'] = 'Compruebe en el directorio Pi.Alert si la carpeta de la base de datos (db) tiene asignados los permisos correctos:
+ drwxrwx--- 2 (nombre de usuario) www-data
+ Si el permiso no es correcto, puede establecerlo de nuevo con los siguientes comandos en la terminal o la consola:
sudo chgrp -R www-data ~/pialert/db
chmod -R 770 ~/pialert/db
- If the database is still read-only, try reinstalling or restoring a database backup from the maintenance page.';
-$pia_lang['HelpFAQ_Cat_General_103_head'] = 'The login page does not appear, even after changing the password.';
-$pia_lang['HelpFAQ_Cat_General_103_text'] = 'In addition to the password, the configuration file must contain ~/pialert/config/pialert.conf
- also the parameter PIALERT_WEB_PROTECTION must set to True.';
-$pia_lang['HelpFAQ_Cat_Device_200_head'] = 'I have devices in my list that I do not know about. After deleting them, they always reappear.';
-$pia_lang['HelpFAQ_Cat_Device_200_text'] = 'If you use Pi-hole, please note that Pi.Alert retrieves information from Pi-hole. Pause Pi.Alert, go to the settings page in Pi-hole and
- delete the DHCP lease if necessary. Then, also in Pi-hole, look under Tools -> Network to see if you can find the recurring hosts there.
- If yes, delete them there as well. Now you can start Pi.Alert again. Now the device(s) should not show up anymore.';
-$pia_lang['HelpFAQ_Cat_Detail_300_head'] = 'What means ';
-$pia_lang['HelpFAQ_Cat_Detail_300_text_a'] = 'means a network device created from the network page.';
-$pia_lang['HelpFAQ_Cat_Detail_300_text_b'] = 'designates the port number where the currently edited device is connected to this network device.';
-$pia_lang['HelpFAQ_Cat_Detail_301_head_a'] = 'When is scanning now? At ';
-$pia_lang['HelpFAQ_Cat_Detail_301_head_b'] = ' says 1min but the graph shows 5min intervals.';
-$pia_lang['HelpFAQ_Cat_Detail_301_text'] = 'The time interval between the scans is defined by the "Cronjob", which is set to 5min by default. The designation "1min" refers to the expected duration of the scan.
- Depending on the network configuration, this time may vary. To edit the cronjob, you can use the following command in the terminal/console crontab -e
- and change the interval.';
-$pia_lang['HelpFAQ_Cat_Detail_302_head_a'] = 'What means ';
-$pia_lang['HelpFAQ_Cat_Detail_302_head_b'] = 'and why can\'t I select that?';
-$pia_lang['HelpFAQ_Cat_Detail_302_text'] = 'Some modern devices generate random MAC addresses for privacy reasons, which can no longer be associated with any manufacturer and which change again with each new connection.
- Pi.Alert detects if it is such a random MAC address and activates this "field" automatically. To disable this behavior you have to look in your device how to disable
- MAC address randomization.';
-$pia_lang['HelpFAQ_Cat_Detail_303_head'] = 'What is Nmap and what is it for?';
-$pia_lang['HelpFAQ_Cat_Detail_303_text'] = 'Nmap is a network scanner with multiple capabilities.
- When a new device appears in your list, you have the possibility to get more detailed information about the device via the Nmap scan.';
-$pia_lang['HelpFAQ_Cat_Presence_400_head'] = 'Devices are displayed with a yellow marker and the note "missing event".';
-$pia_lang['HelpFAQ_Cat_Presence_400_text'] = 'If this happens, you have the option to delete the events on the device in question (details view). Another possibility would be to switch on the device and wait until Pi.Alert detects the device as "online" with the next
- scan and then simply turn the device off again. Now Pi.Alert should properly note the state of the device in the database with the next scan.';
-$pia_lang['HelpFAQ_Cat_Presence_401_head'] = 'A device is displayed as present although it is "Offline".';
-$pia_lang['HelpFAQ_Cat_Presence_401_text'] = 'If this happens, you have the possibility to delete the events for the device in question (details view). Another possibility would be to switch on the device and wait until Pi.Alert recognizes the device as "online" with the next scan
- and then simply switch the device off again. Now Pi.Alert should properly note the state of the device in the database with the next scan.';
-$pia_lang['HelpFAQ_Cat_Network_600_head'] = 'What is this page for?';
-$pia_lang['HelpFAQ_Cat_Network_600_text'] = 'This page should offer you the possibility to map the assignment of your network devices. For this purpose, you can create one or more switches, WLANs, routers, etc., provide them with a port number if necessary and assign already detected
- devices to them. This assignment is done in the detailed view of the device to be assigned. So it is possible for you to quickly determine to which port a host is connected and if it is online. It is possible to assign a device to multiple
- ports (port bundling), as well as multiple devices to one port (virtual machines).';
+ Si la base de datos sigue siendo de sólo lectura, intente reinstalar o restaurar una copia de seguridad de la base de datos desde la página de mantenimiento.';
+$pia_lang['HelpFAQ_Cat_General_103_head'] = 'La página de inicio de sesión no aparece, incluso después de cambiar la contraseña.';
+$pia_lang['HelpFAQ_Cat_General_103_text'] = 'Además de la contraseña, el archivo de configuración debe contener ~/pialert/config/pialert.conf
+ además el parámetro PIALERT_WEB_PROTECTION debe ajustarse a True.';
+$pia_lang['HelpFAQ_Cat_Device_200_head'] = 'Tengo dispositivos en mi lista que no conozco. Después de borrarlos, siempre vuelven a aparecer.';
+$pia_lang['HelpFAQ_Cat_Device_200_text'] = 'Si utiliza Pi-hole, tenga en cuenta que Pi.Alert recupera información de Pi-hole. Ponga en pausa Pi.Alert, vaya a la página de configuración de Pi-hole y
+ elimine la concesión DHCP si es necesario. Luego, también en Pi-hole, revise en Herramientas -> Red para ver si puede encontrar los hosts recurrentes allí.
+ Si es así, elimínelos también allí. Ahora puede volver a iniciar Pi.Alert. Ahora el dispositivo(s) no debería aparecer más.';
+$pia_lang['HelpFAQ_Cat_Detail_300_head'] = '¿Qué significa? ';
+$pia_lang['HelpFAQ_Cat_Detail_300_text_a'] = 'significa un dispositivo de red creado a partir de la página de red.';
+$pia_lang['HelpFAQ_Cat_Detail_300_text_b'] = 'designa el número de puerto en el que el dispositivo editado actualmente está conectado a este dispositivo de red.';
+$pia_lang['HelpFAQ_Cat_Detail_301_head_a'] = '¿Cuándo está escaneando ahora? En ';
+$pia_lang['HelpFAQ_Cat_Detail_301_head_b'] = ' dice 1min pero el gráfico muestra intervalos de 5min.';
+$pia_lang['HelpFAQ_Cat_Detail_301_text'] = 'El intervalo de tiempo entre los escaneos está definido por el "Cronjob", que está configurado en 5 minutos de forma predeterminada. La designación "1min" se refiere a la duración esperada del escaneo.
+ Dependiendo de la configuración de la red, este tiempo puede variar. Para editar el cronjob, puede utilizar el siguiente comando en la terminal/consola crontab -e
+ y cambiar el intervalo.';
+$pia_lang['HelpFAQ_Cat_Detail_302_head_a'] = '¿Qué significa? ';
+$pia_lang['HelpFAQ_Cat_Detail_302_head_b'] = '¿y por qué no puedo seleccionarlo?';
+$pia_lang['HelpFAQ_Cat_Detail_302_text'] = 'Algunos dispositivos modernos generan direcciones MAC aleatorias por razones de privacidad, que ya no pueden asociarse a ningún fabricante y que vuelven a cambiar con cada nueva conexión.
+ Pi.Alert detecta si se trata de una dirección MAC aleatoria y activa este "campo" automáticamente. Para deshabilitar este comportamiento, debe buscar en su dispositivo cómo deshabilitar la
+ aleatorización de direcciones MAC.';
+$pia_lang['HelpFAQ_Cat_Detail_303_head'] = '¿Qué es Nmap y para qué sirve?';
+$pia_lang['HelpFAQ_Cat_Detail_303_text'] = 'Nmap es un escáner de red con múltiples capacidades.
+ Cuando aparece un nuevo dispositivo en su lista, tiene la posibilidad de obtener información más detallada sobre el dispositivo a través del escaneo de Nmap.';
+$pia_lang['HelpFAQ_Cat_Presence_400_head'] = 'Los dispositivos se muestran con un marcador amarillo y la nota "evento faltante".';
+$pia_lang['HelpFAQ_Cat_Presence_400_text'] = 'Si esto sucede, tiene la opción de eliminar los eventos en el dispositivo en cuestión (vista de detalles). Otra posibilidad sería encender el dispositivo y esperar hasta que Pi.Alert detecte el dispositivo como "online" con el siguiente
+ escaneo y luego simplemente apagar el dispositivo nuevamente. Ahora Pi.Alert debería anotar correctamente el estado del dispositivo en la base de datos con el próximo escaneo.';
+$pia_lang['HelpFAQ_Cat_Presence_401_head'] = 'Un dispositivo se muestra como presente aunque esté "Offline".';
+$pia_lang['HelpFAQ_Cat_Presence_401_text'] = 'Si esto sucede, tiene la posibilidad de eliminar los eventos del dispositivo en cuestión (vista de detalles). Otra posibilidad sería encender el dispositivo y esperar hasta que Pi.Alert reconozca el dispositivo como "online" con el siguiente escaneo
+ y luego simplemente apagar el dispositivo nuevamente. Ahora Pi.Alert debería anotar correctamente el estado del dispositivo en la base de datos con el próximo escaneo.';
+$pia_lang['HelpFAQ_Cat_Network_600_head'] = '¿Para qué sirve esta sección?';
+$pia_lang['HelpFAQ_Cat_Network_600_text'] = 'Esta sección debería ofrecerle la posibilidad de mapear la asignación de sus dispositivos de red. Para ello, puede crear uno o más conmutadores, WLAN, enrutadores, etc., proporcionarles un número de puerto si es necesario y asignarles dispositivos
+ ya detectados. Esta asignación se realiza en la vista detallada del dispositivo a asignar. Por lo tanto, es posible determinar rápidamente a qué puerto está conectado un host y si está en línea. Es posible asignar un dispositivo a múltiples
+ puertos (agrupación de puertos), así como múltiples dispositivos a un puerto (máquinas virtuales).';
?>
From bffec25f44e5de31925c55aab26579681fcda66a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E2=80=9Cterorero=E2=80=9D?= <“devin@devinconde.com”>
Date: Sun, 7 Aug 2022 19:31:09 -0400
Subject: [PATCH 02/15] Add $pia_lang['Navigation_HelpFAQ'] = 'Ayuda / FAQ'
Add $pia_lang['Navigation_HelpFAQ'] = 'Ayuda / FAQ'
---
front/php/templates/language/es_es.php | 1 +
1 file changed, 1 insertion(+)
diff --git a/front/php/templates/language/es_es.php b/front/php/templates/language/es_es.php
index 25976e3b..22724f44 100644
--- a/front/php/templates/language/es_es.php
+++ b/front/php/templates/language/es_es.php
@@ -37,6 +37,7 @@ $pia_lang['Navigation_Presence'] = 'Historial';
$pia_lang['Navigation_Events'] = 'Eventos';
$pia_lang['Navigation_Maintenance'] = 'Mantenimiento';
$pia_lang['Navigation_Network'] = 'Red';
+$pia_lang['Navigation_HelpFAQ'] = 'Ayuda / FAQ';
$pia_lang['Device_Title'] = 'Dispositivos';
$pia_lang['Device_Shortcut_AllDevices'] = 'Todos';
$pia_lang['Device_Shortcut_Connected'] = 'Conectado(s)';
From 81462816160c8a524471d24cbf18d9dfcadfb1f7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E2=80=9Cterorero=E2=80=9D?= <“devin@devinconde.com”>
Date: Sun, 7 Aug 2022 20:10:31 -0400
Subject: [PATCH 03/15] move sign out into language strings
---
front/php/templates/header.php | 6 +++---
front/php/templates/language/de_de.php | 7 +++++++
front/php/templates/language/en_us.php | 7 +++++++
front/php/templates/language/es_es.php | 7 +++++++
4 files changed, 24 insertions(+), 3 deletions(-)
diff --git a/front/php/templates/header.php b/front/php/templates/header.php
index 7ea03369..039d1574 100644
--- a/front/php/templates/header.php
+++ b/front/php/templates/header.php
@@ -167,8 +167,8 @@ function show_pia_servertime() {
@@ -176,7 +176,7 @@ function show_pia_servertime() {
diff --git a/front/php/templates/language/de_de.php b/front/php/templates/language/de_de.php
index 1745522a..ad91843a 100644
--- a/front/php/templates/language/de_de.php
+++ b/front/php/templates/language/de_de.php
@@ -1,4 +1,11 @@
(Código Abierto)';
+$pia_lang['About_Design'] = 'Diseñado para:';
+$pia_lang['About_Exit'] = 'Salir';
+
//////////////////////////////////////////////////////////////////
// General - Update by @TeroRERO 01ago2022
//////////////////////////////////////////////////////////////////
From 11142d263cae790b525beed96277dda0481417ca Mon Sep 17 00:00:00 2001
From: leiweibau <105860611+leiweibau@users.noreply.github.com>
Date: Mon, 8 Aug 2022 19:04:05 +0200
Subject: [PATCH 04/15] Merge pull request #22 from terorero/main
Help Page - update to spansih
Thanks
From 85ff3258389cd0aa68c3fd5de5606df5c0151e09 Mon Sep 17 00:00:00 2001
From: leiweibau <105860611+leiweibau@users.noreply.github.com>
Date: Mon, 8 Aug 2022 19:04:05 +0200
Subject: [PATCH 05/15] Merge pull request #22 from terorero/main
Help Page - update to spansih
Thanks
From 83395fd97e44e725a64a86b4a552e010eef2a508 Mon Sep 17 00:00:00 2001
From: leiweibau <105860611+leiweibau@users.noreply.github.com>
Date: Tue, 9 Aug 2022 21:56:54 +0200
Subject: [PATCH 06/15] delete reset_password.sh
deleted because of the switch to an alternative
---
config/reset_password.sh | 32 --------------------------------
1 file changed, 32 deletions(-)
delete mode 100644 config/reset_password.sh
diff --git a/config/reset_password.sh b/config/reset_password.sh
deleted file mode 100644
index 6f79e7a4..00000000
--- a/config/reset_password.sh
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/bin/sh
-PIA_CONF_FILE='pialert.conf'
-PIA_PASS=$1
-echo "Check of key PIALERT_WEB_PROTECTION exists:"
-CHECK_PROT=$(grep "PIALERT_WEB_PROTECTION" $PIA_CONF_FILE | wc -l)
-if [ $CHECK_PROT -eq 0 ]
-then
- cp $PIA_CONF_FILE $PIA_CONF_FILE.bak1
- echo " Key not found. Key 'PIALERT_WEB_PROTECTION' will be created."
- echo " Check Config after the script is finished."
- sed -i "/^VENDORS_DB.*/a PIALERT_WEB_PROTECTION = False" $PIA_CONF_FILE > pialert.tmp
-else
- echo " Key exists. Nothing to do."
-fi
-echo ""
-echo "Check of key PIALERT_WEB_PASSWORD exists:"
-CHECK_PWD=$(grep "PIALERT_WEB_PASSWORD" $PIA_CONF_FILE | wc -l)
-if [ $CHECK_PWD -eq 0 ]
-then
- cp $PIA_CONF_FILE $PIA_CONF_FILE.bak2
- echo " Key not found. Key 'PIALERT_WEB_PASSWORD' will be created."
- echo " Check Config after the script is finished."
- echo " If the key is just created, please run the script again to set a new password".
- sed -i "/^PIALERT_WEB_PROTECTION.*/a PIALERT_WEB_PASSWORD = '8d969eef6ecad3c29a3a629280e686cf0c3f5d5a86aff3ca12020c923adc6c92'" $PIA_CONF_FILE
-else
- echo " The password '$1' is hashed"
- PIA_PASS_HASH=$(echo -n $PIA_PASS | sha256sum | awk '{print $1}')
- echo " The hashed password is:"
- echo " $PIA_PASS_HASH"
- sed -i "/PIALERT_WEB_PASSWORD/c\PIALERT_WEB_PASSWORD = '$PIA_PASS_HASH'" $PIA_CONF_FILE
- echo " The hash was saved in the configuration file"
-fi
From ef6eac24cc065a1f0418713999514f4210cba90e Mon Sep 17 00:00:00 2001
From: leiweibau <105860611+leiweibau@users.noreply.github.com>
Date: Tue, 9 Aug 2022 22:04:41 +0200
Subject: [PATCH 07/15] alternative to reset_password.sh
This file is now located in the "back" directory and is the basis for the login configuration in the frontend
---
back/pialert-cli | 112 +++++++++++++++++++++++++++++++++++++
install/pialert_install.sh | 6 +-
2 files changed, 117 insertions(+), 1 deletion(-)
create mode 100644 back/pialert-cli
diff --git a/back/pialert-cli b/back/pialert-cli
new file mode 100644
index 00000000..00e38ba9
--- /dev/null
+++ b/back/pialert-cli
@@ -0,0 +1,112 @@
+#!/bin/bash
+PIA_CONF_FILE='../config/pialert.conf'
+PIA_PASS=$2
+
+case $1 in
+
+ help)
+ echo "pialert-cli v0.1 (https://github.com/leiweibau/Pi.Alert)"
+ echo "Usage: pialer-cli "
+ echo ""
+ echo "The is a list of supported commands:"
+ echo ""
+ echo " set_login - Set the parameter PIALERT_WEB_PROTECTION in the configfile to TRUE"
+ echo " - If the parameter is not present, it will be created with the default password '123456'."
+ echo ""
+ echo " unset_login - set the parameter PIALERT_WEB_PROTECTION in the configfile to FALSE"
+ echo " - If the parameter is not present, it will be created with the default password '123456'."
+ echo ""
+ echo " set_password - set the new password as a hased value"
+ echo ""
+ echo " set_autopassword - set the new random password as a hased value and show it plaintext in the console"
+ echo ""
+ echo ""
+ ;;
+
+ set_login)
+ ## Check if PIALERT_WEB_PROTECTION exists
+ CHECK_PROT=$(grep "PIALERT_WEB_PROTECTION" $PIA_CONF_FILE | wc -l)
+ if [ $CHECK_PROT -eq 0 ]
+ then
+ ## Create PIALERT_WEB_PROTECTION and enable it
+ sed -i "/^VENDORS_DB.*/a PIALERT_WEB_PROTECTION = True" $PIA_CONF_FILE
+ sed -i "/^PIALERT_WEB_PROTECTION.*/a PIALERT_WEB_PASSWORD = '8d969eef6ecad3c29a3a629280e686cf0c3f5d5a86aff3ca12020c923adc6c92'" $PIA_CONF_FILE
+ else
+ ## Switch PIALERT_WEB_PROTECTION to enable
+ sed -i "/PIALERT_WEB_PROTECTION/c\PIALERT_WEB_PROTECTION = True" $PIA_CONF_FILE
+ fi
+ echo "Login is now enabled"
+ ;;
+
+ unset_login)
+ ## Check if PIALERT_WEB_PROTECTION exists
+ CHECK_PROT=$(grep "PIALERT_WEB_PROTECTION" $PIA_CONF_FILE | wc -l)
+ if [ $CHECK_PROT -eq 0 ]
+ then
+ ## Create PIALERT_WEB_PROTECTION and disable it
+ sed -i "/^VENDORS_DB.*/a PIALERT_WEB_PROTECTION = False" $PIA_CONF_FILE
+ sed -i "/^PIALERT_WEB_PROTECTION.*/a PIALERT_WEB_PASSWORD = '8d969eef6ecad3c29a3a629280e686cf0c3f5d5a86aff3ca12020c923adc6c92'" $PIA_CONF_FILE
+ else
+ ## Switch PIALERT_WEB_PROTECTION to disable
+ sed -i "/PIALERT_WEB_PROTECTION/c\PIALERT_WEB_PROTECTION = False" $PIA_CONF_FILE
+ fi
+ echo "Login is now disabled"
+ ;;
+
+ set_password)
+ ## Check if PIALERT_WEB_PROTECTION exists
+ CHECK_PROT=$(grep "PIALERT_WEB_PROTECTION" $PIA_CONF_FILE | wc -l)
+ if [ $CHECK_PROT -eq 0 ]
+ then
+ ## Create PIALERT_WEB_PROTECTION and enable it
+ sed -i "/^VENDORS_DB.*/a PIALERT_WEB_PROTECTION = True" $PIA_CONF_FILE
+ fi
+ ## Prepare Hash
+ PIA_PASS_HASH=$(echo -n $PIA_PASS | sha256sum | awk '{print $1}')
+ echo " The hashed password is:"
+ echo " $PIA_PASS_HASH"
+ ## Check if the password parameter is set
+ CHECK_PWD=$(grep "PIALERT_WEB_PASSWORD" $PIA_CONF_FILE | wc -l)
+ if [ $CHECK_PWD -eq 0 ]
+ then
+ sed -i "/^PIALERT_WEB_PROTECTION.*/a PIALERT_WEB_PASSWORD = '$PIA_PASS_HASH'" $PIA_CONF_FILE
+ else
+ sed -i "/PIALERT_WEB_PASSWORD/c\PIALERT_WEB_PASSWORD = '$PIA_PASS_HASH'" $PIA_CONF_FILE
+ fi
+ echo " The new password is set"
+ ;;
+
+ set_autopassword)
+ ## Check if PIALERT_WEB_PROTECTION exists
+ CHECK_PROT=$(grep "PIALERT_WEB_PROTECTION" $PIA_CONF_FILE | wc -l)
+ if [ $CHECK_PROT -eq 0 ]
+ then
+ ## Create PIALERT_WEB_PROTECTION and enable it
+ sed -i "/^VENDORS_DB.*/a PIALERT_WEB_PROTECTION = True" $PIA_CONF_FILE
+ fi
+ ## Create autopassword
+ PIA_AUTOPASS=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 8 | head -n 1)
+ echo " The password is: $PIA_AUTOPASS"
+ ## Prepare Hash
+ PIA_AUTOPASS_HASH=$(echo -n $PIA_AUTOPASS | sha256sum | awk '{print $1}')
+ echo " The hashed password is:"
+ echo " $PIA_AUTOPASS_HASH"
+ ## Check if the password parameter is set
+ CHECK_PWD=$(grep "PIALERT_WEB_PASSWORD" $PIA_CONF_FILE | wc -l)
+ if [ $CHECK_PWD -eq 0 ]
+ then
+ ## Create password parameter
+ sed -i "/^PIALERT_WEB_PROTECTION.*/a PIALERT_WEB_PASSWORD = '$PIA_AUTOPASS_HASH'" $PIA_CONF_FILE
+ else
+ ## Overwrite password parameter
+ sed -i "/PIALERT_WEB_PASSWORD/c\PIALERT_WEB_PASSWORD = '$PIA_AUTOPASS_HASH'" $PIA_CONF_FILE
+ fi
+ echo " The new password is set"
+ ;;
+
+ *)
+ echo "pialert-cli v0.1 (https://github.com/leiweibau/Pi.Alert)"
+ echo "Use \"pialert-cli help\" for a list of supported commands."
+ echo ""
+esac
+
diff --git a/install/pialert_install.sh b/install/pialert_install.sh
index 4c997cd5..1e53f2bd 100644
--- a/install/pialert_install.sh
+++ b/install/pialert_install.sh
@@ -531,7 +531,11 @@ test_pialert() {
echo ""
print_msg "- Enable optional Speedtest..."
- chmod +x $PIALERT_HOME/back/speedtest-cli
+ chmod +x $PIALERT_HOME/back/speedtest-cli 2>&1 | tee -ai "$LOG"
+
+ echo ""
+ print_msg "- Enable optional pialert-cli..."
+ chmod +x $PIALERT_HOME/back/pialert-cli 2>&1 | tee -ai "$LOG"
if $FIRST_SCAN_KNOWN ; then
echo ""
From 65ddfd8fb20278bf679df6acc838d80d5d6d577c Mon Sep 17 00:00:00 2001
From: leiweibau <105860611+leiweibau@users.noreply.github.com>
Date: Tue, 9 Aug 2022 22:07:35 +0200
Subject: [PATCH 08/15] Update pialert-cli
---
back/pialert-cli | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/back/pialert-cli b/back/pialert-cli
index 00e38ba9..3f6d6cd8 100644
--- a/back/pialert-cli
+++ b/back/pialert-cli
@@ -18,7 +18,7 @@ case $1 in
echo ""
echo " set_password - set the new password as a hased value"
echo ""
- echo " set_autopassword - set the new random password as a hased value and show it plaintext in the console"
+ echo " set_autopassword - set the new random password as a hashed value and show it plaintext in the console"
echo ""
echo ""
;;
From 7c96059b7f86f9273eb371a32f8c785b3fdab759 Mon Sep 17 00:00:00 2001
From: leiweibau <105860611+leiweibau@users.noreply.github.com>
Date: Tue, 9 Aug 2022 22:11:07 +0200
Subject: [PATCH 09/15] Update pialert-cli
---
back/pialert-cli | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/back/pialert-cli b/back/pialert-cli
index 3f6d6cd8..125355a6 100644
--- a/back/pialert-cli
+++ b/back/pialert-cli
@@ -6,17 +6,17 @@ case $1 in
help)
echo "pialert-cli v0.1 (https://github.com/leiweibau/Pi.Alert)"
- echo "Usage: pialer-cli "
+ echo "Usage: pialert-cli "
echo ""
echo "The is a list of supported commands:"
echo ""
- echo " set_login - Set the parameter PIALERT_WEB_PROTECTION in the configfile to TRUE"
+ echo " set_login - Set the parameter PIALERT_WEB_PROTECTION in the config file to TRUE"
echo " - If the parameter is not present, it will be created with the default password '123456'."
echo ""
- echo " unset_login - set the parameter PIALERT_WEB_PROTECTION in the configfile to FALSE"
+ echo " unset_login - set the parameter PIALERT_WEB_PROTECTION in the config file to FALSE"
echo " - If the parameter is not present, it will be created with the default password '123456'."
echo ""
- echo " set_password - set the new password as a hased value"
+ echo " set_password - set the new password as a hashed value"
echo ""
echo " set_autopassword - set the new random password as a hashed value and show it plaintext in the console"
echo ""
@@ -73,7 +73,8 @@ case $1 in
else
sed -i "/PIALERT_WEB_PASSWORD/c\PIALERT_WEB_PASSWORD = '$PIA_PASS_HASH'" $PIA_CONF_FILE
fi
- echo " The new password is set"
+ echo ""
+ echo "The new password is set"
;;
set_autopassword)
@@ -101,12 +102,12 @@ case $1 in
## Overwrite password parameter
sed -i "/PIALERT_WEB_PASSWORD/c\PIALERT_WEB_PASSWORD = '$PIA_AUTOPASS_HASH'" $PIA_CONF_FILE
fi
- echo " The new password is set"
+ echo ""
+ echo "The new password is set"
;;
*)
echo "pialert-cli v0.1 (https://github.com/leiweibau/Pi.Alert)"
echo "Use \"pialert-cli help\" for a list of supported commands."
- echo ""
esac
From 8eb28d15b4719ce33409897f6a46d25c9c83e025 Mon Sep 17 00:00:00 2001
From: leiweibau <105860611+leiweibau@users.noreply.github.com>
Date: Tue, 9 Aug 2022 22:23:55 +0200
Subject: [PATCH 10/15] Update pialert-cli
---
back/pialert-cli | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/back/pialert-cli b/back/pialert-cli
index 125355a6..75ce7689 100644
--- a/back/pialert-cli
+++ b/back/pialert-cli
@@ -10,15 +10,15 @@ case $1 in
echo ""
echo "The is a list of supported commands:"
echo ""
- echo " set_login - Set the parameter PIALERT_WEB_PROTECTION in the config file to TRUE"
+ echo " set_login - Sets the parameter PIALERT_WEB_PROTECTION in the config file to TRUE"
echo " - If the parameter is not present, it will be created with the default password '123456'."
echo ""
- echo " unset_login - set the parameter PIALERT_WEB_PROTECTION in the config file to FALSE"
+ echo " unset_login - Sets the parameter PIALERT_WEB_PROTECTION in the config file to FALSE"
echo " - If the parameter is not present, it will be created with the default password '123456'."
echo ""
- echo " set_password - set the new password as a hashed value"
+ echo " set_password - Sets the new password as a hashed value"
echo ""
- echo " set_autopassword - set the new random password as a hashed value and show it plaintext in the console"
+ echo " set_autopassword - Sets a new random password as a hashed value and show it plaintext in the console"
echo ""
echo ""
;;
From 9e49ea1de7b4afbb4ba52ea5acc56cf4dedff3b8 Mon Sep 17 00:00:00 2001
From: leiweibau <105860611+leiweibau@users.noreply.github.com>
Date: Wed, 10 Aug 2022 12:36:23 +0200
Subject: [PATCH 11/15] readme update
---
README.md | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/README.md b/README.md
index b203ee4b..31219e6d 100644
--- a/README.md
+++ b/README.md
@@ -64,6 +64,7 @@ In charge of:
- Report the changes detected by e-mail and/or other services (Pushsafer, NTFY, Gotify)
- Optional speedtest for Device "Internet"
- DB cleanup tasks via cron
+ - a pialert-cli that helps to configure login and password
| ![Report 1][report1] | ![Report 2][report2] |
| -------------------- | -------------------- |
@@ -87,8 +88,16 @@ A web frontend that allows:
- Manual Nmap scans
- Optional speedtest for Device "Internet"
- Simple Network relationship display
+ - Maintenance tasks and Settings like:
+ - Status Infos (active scans, database size, backup counter)
+ - Theme Selection (blue, red, green, yellow, black, purple)
+ - Language Selection (english, german, spanish)
+ - Light/Dark-Mode Switch
+ - Pause arp-scan
+ - DB maintenance tools
+ - DB Backup and Restore
- CSV Export / Import (Experimental)
- - ...
+ - Help/FAQ Section
| ![Screen 1][screen1] | ![Screen 2][screen2] |
| -------------------- | -------------------- |
From 28177f20f4d74a43559a43a951f5512f42bfaf27 Mon Sep 17 00:00:00 2001
From: leiweibau <105860611+leiweibau@users.noreply.github.com>
Date: Wed, 10 Aug 2022 12:37:15 +0200
Subject: [PATCH 12/15] readme update
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 31219e6d..578e0d84 100644
--- a/README.md
+++ b/README.md
@@ -64,7 +64,7 @@ In charge of:
- Report the changes detected by e-mail and/or other services (Pushsafer, NTFY, Gotify)
- Optional speedtest for Device "Internet"
- DB cleanup tasks via cron
- - a pialert-cli that helps to configure login and password
+ - a pialert-cli that helps to configure login and password
| ![Report 1][report1] | ![Report 2][report2] |
| -------------------- | -------------------- |
From d29001ef32ec5223dc4bf085be7328cfa956c171 Mon Sep 17 00:00:00 2001
From: leiweibau <105860611+leiweibau@users.noreply.github.com>
Date: Wed, 10 Aug 2022 20:37:40 +0200
Subject: [PATCH 13/15] Add new commands to pialert-cli
enable and disable arp-scan
Update help commands
---
back/pialert-cli | 38 ++++++++++++++++++++++++++++++++------
1 file changed, 32 insertions(+), 6 deletions(-)
diff --git a/back/pialert-cli b/back/pialert-cli
index 75ce7689..e2f9abbe 100644
--- a/back/pialert-cli
+++ b/back/pialert-cli
@@ -10,15 +10,28 @@ case $1 in
echo ""
echo "The is a list of supported commands:"
echo ""
- echo " set_login - Sets the parameter PIALERT_WEB_PROTECTION in the config file to TRUE"
- echo " - If the parameter is not present, it will be created with the default password '123456'."
+ echo " set_login - Sets the parameter PIALERT_WEB_PROTECTION in the config file to TRUE"
+ echo " - If the parameter is not present, it will be created. Additionally the"
+ echo " default password '123456' is set."
echo ""
- echo " unset_login - Sets the parameter PIALERT_WEB_PROTECTION in the config file to FALSE"
- echo " - If the parameter is not present, it will be created with the default password '123456'."
+ echo " unset_login - Sets the parameter PIALERT_WEB_PROTECTION in the config file to FALSE"
+ echo " - If the parameter is not present, it will be created. Additionally the"
+ echo " default password '123456' is set."
echo ""
- echo " set_password - Sets the new password as a hashed value"
+ echo " set_password - Sets the new password as a hashed value."
+ echo " - If the PIALERT_WEB_PROTECTION parameter does not exist yet, it will be"
+ echo " created and set to 'True' (login enabled)"
echo ""
- echo " set_autopassword - Sets a new random password as a hashed value and show it plaintext in the console"
+ echo " set_autopassword - Sets a new random password as a hashed value and show it plaintext in"
+ echo " the console."
+ echo " - If the PIALERT_WEB_PROTECTION parameter does not exist yet, it will be"
+ echo " created and set to 'True' (login enabled)"
+ echo ""
+ echo " disable_scan - Stops all active scans"
+ echo " - Prevents new scans from starting"
+ echo ""
+ echo " enable_scan - Stops all active scans"
+ echo " - Prevents new scans from starting"
echo ""
echo ""
;;
@@ -106,6 +119,19 @@ case $1 in
echo "The new password is set"
;;
+ disable_scan)
+ ## stop active scans
+ sudo killall arp-scan
+ touch ../db/setting_stoparpscan
+ echo "The arp-scan is disabled"
+ ;;
+
+ enable_scan)
+ ## stop active scans
+ rm ../db/setting_stoparpscan
+ echo "The arp-scan is enable"
+ ;;
+
*)
echo "pialert-cli v0.1 (https://github.com/leiweibau/Pi.Alert)"
echo "Use \"pialert-cli help\" for a list of supported commands."
From 1ad41b18296e20ca5b3b2354aabe9c7848716ae9 Mon Sep 17 00:00:00 2001
From: leiweibau <105860611+leiweibau@users.noreply.github.com>
Date: Thu, 11 Aug 2022 21:10:54 +0200
Subject: [PATCH 14/15] Update pialert-cli
---
back/pialert-cli | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/back/pialert-cli b/back/pialert-cli
index e2f9abbe..655c9de8 100644
--- a/back/pialert-cli
+++ b/back/pialert-cli
@@ -129,7 +129,7 @@ case $1 in
enable_scan)
## stop active scans
rm ../db/setting_stoparpscan
- echo "The arp-scan is enable"
+ echo "The arp-scan is enabled"
;;
*)
From 5ffcd3db92e349ff9a1082a66bd43d4b9aa03c22 Mon Sep 17 00:00:00 2001
From: leiweibau <105860611+leiweibau@users.noreply.github.com>
Date: Thu, 11 Aug 2022 21:11:45 +0200
Subject: [PATCH 15/15] bugfixing
---
back/pialert-cli | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/back/pialert-cli b/back/pialert-cli
index 655c9de8..59a790ff 100644
--- a/back/pialert-cli
+++ b/back/pialert-cli
@@ -1,6 +1,7 @@
#!/bin/bash
-PIA_CONF_FILE='../config/pialert.conf'
-PIA_PASS=$2
+SCRIPT=$(readlink -f $0)
+SCRIPTPATH=`dirname $SCRIPT`
+PIA_CONF_FILE=${SCRIPTPATH}'/../config/pialert.conf'
case $1 in
@@ -67,6 +68,7 @@ case $1 in
;;
set_password)
+ PIA_PASS=$2
## Check if PIALERT_WEB_PROTECTION exists
CHECK_PROT=$(grep "PIALERT_WEB_PROTECTION" $PIA_CONF_FILE | wc -l)
if [ $CHECK_PROT -eq 0 ]
@@ -122,13 +124,13 @@ case $1 in
disable_scan)
## stop active scans
sudo killall arp-scan
- touch ../db/setting_stoparpscan
+ touch ${SCRIPTPATH}/../db/setting_stoparpscan
echo "The arp-scan is disabled"
;;
enable_scan)
## stop active scans
- rm ../db/setting_stoparpscan
+ rm ${SCRIPTPATH}/../db/setting_stoparpscan
echo "The arp-scan is enabled"
;;