From 6398df70d410e9411625ac4aaca7aeab6f9dc085 Mon Sep 17 00:00:00 2001 From: leiweibau <105860611+leiweibau@users.noreply.github.com> Date: Thu, 21 Jul 2022 06:36:46 +0200 Subject: [PATCH 1/8] Updating language files As part of a pull request (Spanish translation), the existing language files were updated. --- front/maintenance.php | 175 +++++++++---------------- front/php/templates/language/de_de.php | 1 + front/php/templates/language/en_us.php | 1 + 3 files changed, 65 insertions(+), 112 deletions(-) diff --git a/front/maintenance.php b/front/maintenance.php index 99e15650..a78abd09 100644 --- a/front/maintenance.php +++ b/front/maintenance.php @@ -162,14 +162,13 @@ if (submit && isset($_POST['langselector_set'])) { } ?> -

Status

-
+
@@ -207,19 +206,40 @@ if (submit && isset($_POST['langselector_set'])) {
-
-
-
-
-

:

-
-
-
+ +
+
+
+ +
@@ -375,7 +343,6 @@ if (submit && isset($_POST['langselector_set'])) { diff --git a/front/php/templates/language/de_de.php b/front/php/templates/language/de_de.php index e2e9f256..2a22a88f 100644 --- a/front/php/templates/language/de_de.php +++ b/front/php/templates/language/de_de.php @@ -176,6 +176,7 @@ $pia_lang['Maintenance_lang_selector_lable'] = 'Sprachauswahl'; $pia_lang['Maintenance_lang_selector_empty'] = 'Sprache wählen'; $pia_lang['Maintenance_lang_en_us'] = 'Englisch (US)'; $pia_lang['Maintenance_lang_de_de'] = 'Deutsch (DE)'; +$pia_lang['Maintenance_lang_es_es'] = 'Spanisch (ES)'; $pia_lang['Maintenance_lang_selector_text'] = 'Die Änderung findet serverseitig statt, betrifft also alle verwendeten Geräte.'; $pia_lang['Maintenance_lang_selector_apply'] = 'Übernehmen'; $pia_lang['Maintenance_Tool_darkmode'] = 'Darstellungswechsel (Dunkel/Hell)'; diff --git a/front/php/templates/language/en_us.php b/front/php/templates/language/en_us.php index b560ba4b..bc5ecf65 100644 --- a/front/php/templates/language/en_us.php +++ b/front/php/templates/language/en_us.php @@ -176,6 +176,7 @@ $pia_lang['Maintenance_lang_selector_lable'] = 'Select Language'; $pia_lang['Maintenance_lang_selector_empty'] = 'Choose Language'; $pia_lang['Maintenance_lang_en_us'] = 'English (US)'; $pia_lang['Maintenance_lang_de_de'] = 'German (DE)'; +$pia_lang['Maintenance_lang_es_es'] = 'Spanish (ES)'; $pia_lang['Maintenance_lang_selector_text'] = 'The change takes place on the server side, so it affects all devices in use.'; $pia_lang['Maintenance_lang_selector_apply'] = 'Apply'; $pia_lang['Maintenance_Tool_darkmode'] = 'Toggle Modes (Dark/Light)'; From e084b48959377e7af2baa18ecdd493489d2f0dbd Mon Sep 17 00:00:00 2001 From: leiweibau <105860611+leiweibau@users.noreply.github.com> Date: Thu, 21 Jul 2022 06:55:16 +0200 Subject: [PATCH 2/8] Updating language file again I noticed that there is an extension to the language files from another fork (https://github.com/jokob-sk/Pi.Alert). These have been added again. The language files are now compatible with each other again --- front/php/templates/language/de_de.php | 5 +++++ front/php/templates/language/en_us.php | 5 +++++ front/php/templates/language/es_es.php | 4 ++++ 3 files changed, 14 insertions(+) diff --git a/front/php/templates/language/de_de.php b/front/php/templates/language/de_de.php index 2a22a88f..9d613253 100644 --- a/front/php/templates/language/de_de.php +++ b/front/php/templates/language/de_de.php @@ -191,6 +191,9 @@ $pia_lang['Maintenance_Tool_del_empty_macs'] = 'Alle Geräte ohne MAC löschen'; $pia_lang['Maintenance_Tool_del_empty_macs_text'] = 'Machen Sie ein Backup, bevor Sie diese Funk­tion nutzen. Der Vor­gang kann ohne Back­up nicht rück­gängig gemacht werden. Alle Geäte ohne MAC-Adresse werden aus der Datenbank ge­löscht.'; $pia_lang['Maintenance_Tool_del_empty_macs_noti'] = 'Geräte löschen'; $pia_lang['Maintenance_Tool_del_empty_macs_noti_text'] = 'Sind Sie sicher, dass Sie alle Geräte ohne MAC-Adresse löschen wollen?
(Vielleicht bevorzugenn Sie eine Archivierung.)'; +$pia_lang['Maintenance_Tool_upgrade_database_noti'] = 'Aktualisiere Datenbank'; +$pia_lang['Maintenance_Tool_upgrade_database_text'] = 'Mit dieser Schaltfläche wird die Datenbank aktualisiert, um das Diagramm der Netzwerkaktivitäten der letzten 12 Stunden zu aktivieren. Bitte sichern Sie Ihre Datenbank, falls Probleme auftreten.'; +$pia_lang['Maintenance_Tool_upgrade_database_noti_text'] = 'Machen Sie ein Backup, bevor Sie diese Funk­tion nutzen.'; $pia_lang['Maintenance_Tool_del_alldev'] = 'Alle Geräte löschen'; $pia_lang['Maintenance_Tool_del_alldev_text'] = 'Machen Sie ein Backup, bevor Sie diese Funk­tion nutzen. Der Vor­gang kann ohne Back­up nicht rück­gängig gemacht werden. Alle Geräte werden in der Datenbank ge­löscht.'; $pia_lang['Maintenance_Tool_del_alldev_noti'] = 'Geräte löschen'; @@ -234,5 +237,7 @@ $pia_lang['BackDevices_DBTools_DelDevError_a'] = 'Fehler beim Löschen des Gerä $pia_lang['BackDevices_DBTools_DelDevError_b'] = 'Fehler beim Löschen der Geräte'; $pia_lang['BackDevices_DBTools_UpdDev'] = 'Gerät erfolgreich aktualisiert'; $pia_lang['BackDevices_DBTools_UpdDevError'] = 'Fehler beim Aktualisieren des Gerätes'; +$pia_lang['BackDevices_DBTools_Upgrade'] = 'Datenbank erfolgreich aktualisiert'; +$pia_lang['BackDevices_DBTools_UpgradeError'] = 'Fehler beim Aktualisieren der Datenbank'; ?> diff --git a/front/php/templates/language/en_us.php b/front/php/templates/language/en_us.php index bc5ecf65..3a98ebc8 100644 --- a/front/php/templates/language/en_us.php +++ b/front/php/templates/language/en_us.php @@ -191,6 +191,9 @@ $pia_lang['Maintenance_Tool_del_empty_macs'] = 'Delete Devices with empty MACs'; $pia_lang['Maintenance_Tool_del_empty_macs_text'] = 'Before using this function, please make a backup. The deletion cannot be undone. All devices without MAC will be deleted from the database.'; $pia_lang['Maintenance_Tool_del_empty_macs_noti'] = 'Delete Devices'; $pia_lang['Maintenance_Tool_del_empty_macs_noti_text'] = 'Are you sure you want to delete all devices with empty MAC addresses?
(maybe you prefer to archive it)'; +$pia_lang['Maintenance_Tool_upgrade_database_noti'] = 'Upgrade database'; +$pia_lang['Maintenance_Tool_upgrade_database_text'] = 'This button will upgrade the database to enable the Network activity over last 12 hours chart. Please backup your database in case of issues.'; +$pia_lang['Maintenance_Tool_upgrade_database_noti_text'] = 'Are you sure you want to upgrade the database?
(maybe you prefer to archive it)'; $pia_lang['Maintenance_Tool_del_alldev'] = 'Delete all Devices'; $pia_lang['Maintenance_Tool_del_alldev_text'] = 'Before using this function, please make a backup. The deletion cannot be undone. All devices will be deleted from the database.'; $pia_lang['Maintenance_Tool_del_alldev_noti'] = 'Delete Devices'; @@ -234,5 +237,7 @@ $pia_lang['BackDevices_DBTools_DelDevError_a'] = 'Error deleting Device'; $pia_lang['BackDevices_DBTools_DelDevError_b'] = 'Error deleting Devices'; $pia_lang['BackDevices_DBTools_UpdDev'] = 'Device updated successfully'; $pia_lang['BackDevices_DBTools_UpdDevError'] = 'Error updating device'; +$pia_lang['BackDevices_DBTools_Upgrade'] = 'Database upgraded successfully'; +$pia_lang['BackDevices_DBTools_UpgradeError'] = 'Database upgrade failed'; ?> diff --git a/front/php/templates/language/es_es.php b/front/php/templates/language/es_es.php index c8cf874b..59615751 100644 --- a/front/php/templates/language/es_es.php +++ b/front/php/templates/language/es_es.php @@ -135,6 +135,8 @@ $pia_lang['DevDetail_EveandAl_Skip'] = 'Omitir notificaciones repetidas durante' $pia_lang['DevDetail_EveandAl_NewDevice'] = 'Nuevo dispositivo'; $pia_lang['DevDetail_EveandAl_Archived'] = 'Archivada'; $pia_lang['DevDetail_EveandAl_RandomMAC'] = 'MAC al azar'; +$pia_lang['DevDetail_EveandAl_ScanCycle_a'] = 'Scan Device (1 min)'; +$pia_lang['DevDetail_EveandAl_ScanCycle_z'] = 'Don't Scan Device (0 min)'; $pia_lang['DevDetail_button_Delete'] = 'Eliminar dispositivo'; $pia_lang['DevDetail_button_Reset'] = 'Restablecer cambios'; $pia_lang['DevDetail_button_Save'] = 'Guardar'; @@ -169,12 +171,14 @@ $pia_lang['Maintenance_arp_status_on'] = 'escaneo(s) actualmente en ejecución'; $pia_lang['Maintenance_themeselector_lable'] = 'Seleccionar Skin'; $pia_lang['Maintenance_themeselector_empty'] = 'Elige un Skin'; $pia_lang['Maintenance_themeselector_text'] = 'El cambio tiene lugar en el lado del servidor, por lo que afecta todos los dispositivos en uso.'; +$pia_lang['Maintenance_themeselector_apply'] = 'Apply'; $pia_lang['Maintenance_lang_selector_lable'] = 'Seleccione el idioma'; $pia_lang['Maintenance_lang_selector_empty'] = 'Elija el idioma'; $pia_lang['Maintenance_lang_en_us'] = 'English (US)'; $pia_lang['Maintenance_lang_de_de'] = 'German (DE)'; $pia_lang['Maintenance_lang_es_es'] = 'Spanish (ES)'; $pia_lang['Maintenance_lang_selector_text'] = 'El cambio tiene lugar en el lado del servidor, por lo que afecta todos los dispositivos en uso.'; +$pia_lang['Maintenance_lang_selector_apply'] = 'Apply'; $pia_lang['Maintenance_Tool_darkmode'] = 'Cambiar Modo (Dark/Light)'; $pia_lang['Maintenance_Tool_darkmode_text'] = 'Alternar entre el modo oscuro y el modo de luz. Si el interruptor no funciona correctamente, intente borrar el caché del navegador. El cambio tiene lugar en el lado del servidor, por lo que afecta todos los dispositivos en uso.'; $pia_lang['Maintenance_Tool_darkmode_noti'] = 'Cambiar Modo'; From 19da0da0a44e384b512c1b084c0c5a8c2293dc9d Mon Sep 17 00:00:00 2001 From: leiweibau <105860611+leiweibau@users.noreply.github.com> Date: Thu, 21 Jul 2022 08:42:41 +0200 Subject: [PATCH 3/8] Update README.md add spanish as a included language --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9afc86b4..4d3016f3 100644 --- a/README.md +++ b/README.md @@ -73,7 +73,7 @@ A web frontal that allows: With the work of [jokob-sk/Pi.Alert](https://github.com/jokob-sk/Pi.Alert) and own extensions, the new maintenance page was added with various possibilities for maintenance and settings: - Status Infos (active scans, database size, backup counter) - Theme Selection (blue, red, green, yellow, black, purple) - - Language Selection (english, german) + - Language Selection (english, german, spanish) - Light/Dark-Mode Switch - Pause arp-scan - DB maintenance tools From 5d5c75dba72248841abcfa788040f773683f6e21 Mon Sep 17 00:00:00 2001 From: leiweibau <105860611+leiweibau@users.noreply.github.com> Date: Thu, 21 Jul 2022 21:22:39 +0200 Subject: [PATCH 4/8] improve pushsafer support Thanks to Final-Hawk https://github.com/Final-Hawk/Pi.Alert/commit/70b6ccc52382e18ac593b36cbfba92c2ce2486a8 --- back/pialert.py | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/back/pialert.py b/back/pialert.py index 7fc7ecef..150d340b 100644 --- a/back/pialert.py +++ b/back/pialert.py @@ -1229,15 +1229,15 @@ def email_reporting (): 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{}\t{}\t{}\n' + text_line_template = '{} \t{}\t{}\t{}\n' html_line_template = '\n'+ \ ' {} \n {} \n'+ \ ' {} \n'+ \ @@ -1264,7 +1264,7 @@ def email_reporting (): mail_section_new_devices = False mail_text_new_devices = '' mail_html_new_devices = '' - text_line_template = ' {}\t{}\t{}\t{}\t{}\n' + text_line_template = '{}\t{}\n\t{}\t{}\n\t{}\t{}\n\t{}\t{}\n\t{}\t{}\n\n' html_line_template = '\n'+ \ ' {} \n {} \n'+\ ' {} \n {} \n {} \n\n' @@ -1277,9 +1277,8 @@ def email_reporting (): for eventAlert in sql : mail_section_new_devices = True mail_text_new_devices += text_line_template.format ( - eventAlert['eve_MAC'], eventAlert['eve_DateTime'], - eventAlert['eve_IP'], eventAlert['dev_Name'], - eventAlert['eve_AdditionalInfo']) + 'Name: ', eventAlert['dev_Name'], 'MAC: ', eventAlert['eve_MAC'], 'IP: ', eventAlert['eve_IP'], + 'Time: ', eventAlert['eve_DateTime'], 'More Info: ', eventAlert['eve_AdditionalInfo']) mail_html_new_devices += html_line_template.format ( REPORT_DEVICE_URL, eventAlert['eve_MAC'], eventAlert['eve_MAC'], eventAlert['eve_DateTime'], eventAlert['eve_IP'], @@ -1292,7 +1291,7 @@ def email_reporting (): mail_section_devices_down = False mail_text_devices_down = '' mail_html_devices_down = '' - text_line_template = ' {}\t{}\t{}\t{}\n' + text_line_template = '{}\t{}\n\t{}\t{}\n\t{}\t{}\n\t{}\t{}\n\n' html_line_template = '\n'+ \ ' {} \n {} \n'+ \ ' {} \n {} \n\n' @@ -1305,8 +1304,8 @@ def email_reporting (): for eventAlert in sql : mail_section_devices_down = True mail_text_devices_down += text_line_template.format ( - eventAlert['eve_MAC'], eventAlert['eve_DateTime'], - eventAlert['eve_IP'], eventAlert['dev_Name']) + 'Name: ', eventAlert['dev_Name'], 'MAC: ', eventAlert['eve_MAC'], + 'Time: ', eventAlert['eve_DateTime'],'IP: ', eventAlert['eve_IP']) mail_html_devices_down += html_line_template.format ( REPORT_DEVICE_URL, eventAlert['eve_MAC'], eventAlert['eve_MAC'], eventAlert['eve_DateTime'], eventAlert['eve_IP'], @@ -1319,7 +1318,7 @@ def email_reporting (): mail_section_events = False mail_text_events = '' mail_html_events = '' - text_line_template = ' {}\t{}\t{}\t{}\t{}\t{}\n' + text_line_template = '{}\t{}\n\t{}\t{}\n\t{}\t{}\n\t{}\t{}\n\t{}\t{}\n\t{}\t{}\n\n' html_line_template = '\n '+ \ ' {} \n {} \n'+ \ ' {} \n {} \n {} \n'+ \ @@ -1334,9 +1333,9 @@ def email_reporting (): for eventAlert in sql : mail_section_events = True mail_text_events += text_line_template.format ( - eventAlert['eve_MAC'], eventAlert['eve_DateTime'], - eventAlert['eve_IP'], eventAlert['eve_EventType'], - eventAlert['dev_Name'], eventAlert['eve_AdditionalInfo']) + 'Name: ', eventAlert['dev_Name'], 'MAC: ', eventAlert['eve_MAC'], + 'IP: ', eventAlert['eve_IP'],'Time: ', eventAlert['eve_DateTime'], + 'Event: ', eventAlert['eve_EventType'],'More Info: ', eventAlert['eve_AdditionalInfo']) mail_html_events += html_line_template.format ( REPORT_DEVICE_URL, eventAlert['eve_MAC'], eventAlert['eve_MAC'], eventAlert['eve_DateTime'], eventAlert['eve_IP'], @@ -1359,13 +1358,14 @@ def email_reporting (): send_email (mail_text, mail_html) else : print (' Skip mail...') + if REPORT_PUSHSAFER : + print (' Sending report by PUSHSAFER...') + send_pushsafer (mail_text) + else : + print (' Skip PUSHSAFER...') else : print (' No changes to report...') - if REPORT_PUSHSAFER : - print (' Sending report by PUSHSAFER...') - send_pushsafer (mail_text) - else : - print (' Skip PUSHSAFER...') + # Clean Pending Alert Events @@ -1388,8 +1388,8 @@ def email_reporting (): def send_pushsafer (_Text): url = 'https://www.pushsafer.com/api' post_fields = { - "t" : 'Pi.Alert Message', - "m" : 'Something has changed', +# "t" : 'Pi.Alert Message', + "m" : _Text, "s" : 11, "v" : 3, "i" : 148, From b855fca9be0346a3f6d497cab2a33226f029b97e Mon Sep 17 00:00:00 2001 From: leiweibau <105860611+leiweibau@users.noreply.github.com> Date: Thu, 21 Jul 2022 22:31:46 +0200 Subject: [PATCH 5/8] improve pushsafer support - merged commit https://github.com/leiweibau/Pi.Alert/commit/7beec7f584600f13506f21d59154b3205e8b4551 - merged parts of commit https://github.com/Final-Hawk/Pi.Alert/commit/70b6ccc52382e18ac593b36cbfba92c2ce2486a8 - add headline/titel in pushsafer notification --- back/pialert.py | 2 +- back/report_template.html | 38 ++++++++++++++++++-------------------- back/report_template.txt | 20 +++++++------------- 3 files changed, 26 insertions(+), 34 deletions(-) diff --git a/back/pialert.py b/back/pialert.py index 150d340b..ebb1dcc5 100644 --- a/back/pialert.py +++ b/back/pialert.py @@ -1388,7 +1388,7 @@ def email_reporting (): def send_pushsafer (_Text): url = 'https://www.pushsafer.com/api' post_fields = { -# "t" : 'Pi.Alert Message', + "t" : 'Pi.Alert Message', "m" : _Text, "s" : 11, "v" : 3, diff --git a/back/report_template.html b/back/report_template.html index 0bc0ecc0..e6b340ad 100644 --- a/back/report_template.html +++ b/back/report_template.html @@ -14,20 +14,19 @@ - +
- @@ -36,9 +35,9 @@
+ Pi.Alert Report
- - - - - +
Report Date: Scan Cycle: Server:
+ + +
Report Date: Scan Cycle:
-

Internet:

+

Internet:

- +
@@ -53,11 +52,11 @@ -

New Devices:

+

New Devices:

-
Event Type Datetime
+
- + @@ -71,9 +70,9 @@ -

Devices Down:

+

Devices Down:

-
MAC MAC Datetime IP Device Name
+
@@ -88,9 +87,9 @@ -

Events:

+

Events:

-
MAC Datetime
+
@@ -108,11 +107,10 @@ @@ -120,4 +118,4 @@
MAC Datetime
- +
- + -
© Puche Pi.Alert - Pi.Alert     () GNU GPLv3
- + \ No newline at end of file diff --git a/back/report_template.txt b/back/report_template.txt index 0d777f57..9a2d72e3 100644 --- a/back/report_template.txt +++ b/back/report_template.txt @@ -1,27 +1,21 @@ -======================================== - Pi.Alert Report -======================================== - - Report Date: - Scan Cycle: - Server: +Report Date: +Scan Cycle: +Server: Internet ----------------------------------------------------------------------- +---------------------- New Devices ----------------------------------------------------------------------- +---------------------- Devices Down ----------------------------------------------------------------------- +---------------------- Events ----------------------------------------------------------------------- +---------------------- ----------------------------------------------------------------------- -(?) Puche Pi.Alert () GNU GPLv3 From fec58bf028b0fa07039e2eb732c2e925f1c57eff Mon Sep 17 00:00:00 2001 From: leiweibau <105860611+leiweibau@users.noreply.github.com> Date: Fri, 22 Jul 2022 21:21:43 +0200 Subject: [PATCH 6/8] Basic Login - Default password is "123456" - there is a warning on the login page, when the default password is active - to set ne new password, use the reset_password.sh in the config folder (./reset_password.sh newpassword) - the password is stored as a sha256 hash - the script creates a backup of the config file, just in case --- config/pialert.conf | 1 + config/reset_password.sh | 7 ++ front/deviceDetails.php | 8 ++ front/devices.php | 8 ++ front/events.php | 8 ++ front/index.php | 137 ++++++++++++++++++++++++++++++++- front/maintenance.php | 8 ++ front/php/templates/header.php | 28 ++----- front/presence.php | 8 ++ 9 files changed, 188 insertions(+), 25 deletions(-) create mode 100644 config/reset_password.sh diff --git a/config/pialert.conf b/config/pialert.conf index d58f0f3d..8b9628e0 100644 --- a/config/pialert.conf +++ b/config/pialert.conf @@ -12,6 +12,7 @@ DB_PATH = PIALERT_PATH + '/db/pialert.db' LOG_PATH = PIALERT_PATH + '/log' VENDORS_DB = '/usr/share/arp-scan/ieee-oui.txt' PRINT_LOG = False +PIALERT_WEB_PASSWORD = '8d969eef6ecad3c29a3a629280e686cf0c3f5d5a86aff3ca12020c923adc6c92' SMTP_SERVER = 'smtp.gmail.com' SMTP_PORT = 587 diff --git a/config/reset_password.sh b/config/reset_password.sh new file mode 100644 index 00000000..a7f933ee --- /dev/null +++ b/config/reset_password.sh @@ -0,0 +1,7 @@ +cp pialert.conf pialert.conf.bak +PIA_PASS=$1 +echo "The password '$1' is hashed" +PIA_PASS_HASH=$(echo -n $PIA_PASS | sha256sum | awk '{print $1}') +echo "The hashed password is: $PIA_PASS_HASH" +sed -i "/PIALERT_WEB_PASSWORD/c\PIALERT_WEB_PASSWORD = '$PIA_PASS_HASH'" pialert.conf +echo "The hash was saved in the configuration file" \ No newline at end of file diff --git a/front/deviceDetails.php b/front/deviceDetails.php index b5b11762..aefd7542 100644 --- a/front/deviceDetails.php +++ b/front/deviceDetails.php @@ -8,6 +8,14 @@ #--------------------------------------------------------------------------- --> diff --git a/front/devices.php b/front/devices.php index dcdea723..f0033d05 100644 --- a/front/devices.php +++ b/front/devices.php @@ -8,6 +8,14 @@ #--------------------------------------------------------------------------- --> diff --git a/front/events.php b/front/events.php index 0655c08a..597cca30 100644 --- a/front/events.php +++ b/front/events.php @@ -8,6 +8,14 @@ #--------------------------------------------------------------------------- --> diff --git a/front/index.php b/front/index.php index a1338922..6c4a1c74 100644 --- a/front/index.php +++ b/front/index.php @@ -1,5 +1,136 @@ + + + + + + + + + + Pi-Alert | Log in + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/front/maintenance.php b/front/maintenance.php index a78abd09..d65f5fad 100644 --- a/front/maintenance.php +++ b/front/maintenance.php @@ -1,4 +1,12 @@ diff --git a/front/presence.php b/front/presence.php index 5ab20310..0f2b61ab 100644 --- a/front/presence.php +++ b/front/presence.php @@ -8,6 +8,14 @@ #--------------------------------------------------------------------------- --> From f372529cdba9a7192f632721f3e4d89f5ace3109 Mon Sep 17 00:00:00 2001 From: leiweibau <105860611+leiweibau@users.noreply.github.com> Date: Fri, 22 Jul 2022 21:43:27 +0200 Subject: [PATCH 7/8] support for Gotify from https://github.com/Haecky/Pi.Alert-TLS.On-Off merge Commit https://github.com/Haecky/Pi.Alert-TLS.On-Off/commit/b5cd865a27541e0fcbcff9d4d72d7ae8b9ffe386 merge Commit https://github.com/Haecky/Pi.Alert-TLS.On-Off/commit/4e61e2ee45b2054375f884389f141b77853206dc --- back/pialert.py | 26 ++++++++++++++++++-------- config/pialert.conf | 2 ++ 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/back/pialert.py b/back/pialert.py index ebb1dcc5..7b8308f7 100644 --- a/back/pialert.py +++ b/back/pialert.py @@ -458,7 +458,7 @@ def execute_arpscan (pRetries): # arp-scan for larger Networks like /16 # otherwise the system starts multiple processes. the 15min cronjob isn't necessary. # the scan is about 4min on a /16 network - arpscan_args = ['sudo', 'arp-scan', '--ignoredups', '--bandwidth=512k', '--retry=2', SCAN_SUBNETS] + arpscan_args = ['sudo', 'arp-scan', '--ignoredups', '--bandwidth=512k', '--retry=3', SCAN_SUBNETS] # Default arp-scan # arpscan_args = ['sudo', 'arp-scan', SCAN_SUBNETS, '--ignoredups', '--retry=' + str(pRetries)] @@ -1223,11 +1223,11 @@ 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 ) @@ -1474,12 +1474,22 @@ def send_email (pText, pHTML): # Send mail smtp_connection = smtplib.SMTP (SMTP_SERVER, SMTP_PORT) smtp_connection.ehlo() - smtp_connection.starttls() - smtp_connection.ehlo() - smtp_connection.login (SMTP_USER, SMTP_PASS) +# smtp_connection.starttls() +# smtp_connection.ehlo() +# smtp_connection.login (SMTP_USER, SMTP_PASS) + if not SafeParseGlobalBool("SMTP_SKIP_TLS"): + smtp_connection.starttls() + smtp_connection.ehlo() + if not SafeParseGlobalBool("SMTP_SKIP_LOGIN"): + smtp_connection.login (SMTP_USER, SMTP_PASS) smtp_connection.sendmail (REPORT_FROM, REPORT_TO, msg.as_string()) smtp_connection.quit() +#------------------------------------------------------------------------------- +def SafeParseGlobalBool(boolVariable): + if boolVariable in globals(): + return eval(boolVariable) + return False #=============================================================================== # DB diff --git a/config/pialert.conf b/config/pialert.conf index 8b9628e0..7c6f8043 100644 --- a/config/pialert.conf +++ b/config/pialert.conf @@ -18,6 +18,8 @@ SMTP_SERVER = 'smtp.gmail.com' SMTP_PORT = 587 SMTP_USER = 'user@gmail.com' SMTP_PASS = 'password' +SMTP_SKIP_TLS = False +SMTP_SKIP_LOGIN = False REPORT_MAIL = False REPORT_FROM = 'Pi.Alert <' + SMTP_USER +'>' From 0b3ba217764edcc40a709fa7fa2d214a3113e7d3 Mon Sep 17 00:00:00 2001 From: leiweibau <105860611+leiweibau@users.noreply.github.com> Date: Fri, 22 Jul 2022 23:35:45 +0200 Subject: [PATCH 8/8] Translation work continued - maintenance page (tab titel) --- front/maintenance.php | 6 +++--- front/php/templates/language/de_de.php | 3 +++ front/php/templates/language/en_us.php | 3 +++ front/php/templates/language/es_es.php | 3 +++ 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/front/maintenance.php b/front/maintenance.php index d65f5fad..b43ffdfa 100644 --- a/front/maintenance.php +++ b/front/maintenance.php @@ -217,9 +217,9 @@ if (submit && isset($_POST['langselector_set'])) {