diff --git a/front/php/templates/language/de_de.json b/front/php/templates/language/de_de.json old mode 100644 new mode 100755 diff --git a/front/php/templates/language/en_us.json b/front/php/templates/language/en_us.json old mode 100644 new mode 100755 diff --git a/front/php/templates/language/es_es.json b/front/php/templates/language/es_es.json old mode 100644 new mode 100755 diff --git a/front/php/templates/language/it_it.json b/front/php/templates/language/it_it.json old mode 100644 new mode 100755 diff --git a/front/php/templates/language/nb_no.json b/front/php/templates/language/nb_no.json old mode 100644 new mode 100755 diff --git a/front/php/templates/language/pl_pl.json b/front/php/templates/language/pl_pl.json old mode 100644 new mode 100755 diff --git a/front/php/templates/language/ru_ru.json b/front/php/templates/language/ru_ru.json old mode 100644 new mode 100755 diff --git a/front/plugins/README.md b/front/plugins/README.md index b58eeb01..3e858ab1 100755 --- a/front/plugins/README.md +++ b/front/plugins/README.md @@ -20,7 +20,7 @@ NetAlertX supports additional plugins to extend its functionality, each with its ## 📑 Available Plugins - + Device-detecting plugins insert values into the `CurrentScan` database table. The plugins that are not required are safe to ignore, however, it makes sense to have at least some device-detecting plugins enabled, such as `ARPSCAN` or `NMAPDEV`. diff --git a/front/plugins/__template/rename_me.py b/front/plugins/__template/rename_me.py index e996402e..0c6e2180 100755 --- a/front/plugins/__template/rename_me.py +++ b/front/plugins/__template/rename_me.py @@ -5,6 +5,7 @@ import pathlib import sys import json import sqlite3 +from pytz import timezone # Define the installation path and extend the system path for plugin imports INSTALL_PATH = "/app" @@ -16,6 +17,10 @@ from logger import mylog from const import pluginsPath, fullDbPath from helper import timeNowTZ, get_setting_value from notification import write_notification +import conf + +# Make sure the TIMEZONE for logging is correct +conf.tz = timezone(get_setting_value('TIMEZONE')) # Define the current path and log file paths CUR_PATH = str(pathlib.Path(__file__).parent.resolve()) diff --git a/front/plugins/_publisher_apprise/apprise.py b/front/plugins/_publisher_apprise/apprise.py index 8542c6df..1a360ce0 100755 --- a/front/plugins/_publisher_apprise/apprise.py +++ b/front/plugins/_publisher_apprise/apprise.py @@ -19,8 +19,10 @@ from logger import mylog, append_line_to_file from helper import timeNowTZ, get_setting_value from notification import Notification_obj from database import DB +from pytz import timezone - +# Make sure the TIMEZONE for logging is correct +conf.tz = timezone(get_setting_value('TIMEZONE')) CUR_PATH = str(pathlib.Path(__file__).parent.resolve()) RESULT_FILE = os.path.join(CUR_PATH, 'last_result.log') diff --git a/front/plugins/_publisher_email/email_smtp.py b/front/plugins/_publisher_email/email_smtp.py index 11e6e45f..1d881e38 100755 --- a/front/plugins/_publisher_email/email_smtp.py +++ b/front/plugins/_publisher_email/email_smtp.py @@ -27,7 +27,10 @@ from logger import mylog, append_line_to_file, print_log from helper import timeNowTZ, get_setting_value, hide_email from notification import Notification_obj from database import DB +from pytz import timezone +# Make sure the TIMEZONE for logging is correct +conf.tz = timezone(get_setting_value('TIMEZONE')) CUR_PATH = str(pathlib.Path(__file__).parent.resolve()) RESULT_FILE = os.path.join(CUR_PATH, 'last_result.log') diff --git a/front/plugins/_publisher_mqtt/mqtt.py b/front/plugins/_publisher_mqtt/mqtt.py index b562af36..7ff61e62 100755 --- a/front/plugins/_publisher_mqtt/mqtt.py +++ b/front/plugins/_publisher_mqtt/mqtt.py @@ -29,7 +29,10 @@ from logger import mylog, append_line_to_file from helper import timeNowTZ, get_setting_value, bytes_to_string, sanitize_string from notification import Notification_obj from database import DB, get_device_stats +from pytz import timezone +# Make sure the TIMEZONE for logging is correct +conf.tz = timezone(get_setting_value('TIMEZONE')) CUR_PATH = str(pathlib.Path(__file__).parent.resolve()) RESULT_FILE = os.path.join(CUR_PATH, 'last_result.log') diff --git a/front/plugins/_publisher_ntfy/ntfy.py b/front/plugins/_publisher_ntfy/ntfy.py index 263b4a0e..b20f594a 100755 --- a/front/plugins/_publisher_ntfy/ntfy.py +++ b/front/plugins/_publisher_ntfy/ntfy.py @@ -22,7 +22,10 @@ from logger import mylog, append_line_to_file from helper import timeNowTZ, get_setting_value from notification import Notification_obj from database import DB +from pytz import timezone +# Make sure the TIMEZONE for logging is correct +conf.tz = timezone(get_setting_value('TIMEZONE')) CUR_PATH = str(pathlib.Path(__file__).parent.resolve()) RESULT_FILE = os.path.join(CUR_PATH, 'last_result.log') diff --git a/front/plugins/_publisher_pushover/pushover.py b/front/plugins/_publisher_pushover/pushover.py index c03dd883..21898d73 100755 --- a/front/plugins/_publisher_pushover/pushover.py +++ b/front/plugins/_publisher_pushover/pushover.py @@ -16,6 +16,10 @@ from notification import Notification_obj # noqa: E402 from database import DB # noqa: E402 import conf from const import confFileName +from pytz import timezone + +# Make sure the TIMEZONE for logging is correct +conf.tz = timezone(get_setting_value('TIMEZONE')) CUR_PATH = str(pathlib.Path(__file__).parent.resolve()) RESULT_FILE = os.path.join(CUR_PATH, "last_result.log") diff --git a/front/plugins/_publisher_pushsafer/pushsafer.py b/front/plugins/_publisher_pushsafer/pushsafer.py index f99312f6..e55a9beb 100755 --- a/front/plugins/_publisher_pushsafer/pushsafer.py +++ b/front/plugins/_publisher_pushsafer/pushsafer.py @@ -22,6 +22,10 @@ from logger import mylog, append_line_to_file from helper import timeNowTZ, get_setting_value, hide_string from notification import Notification_obj from database import DB +from pytz import timezone + +# Make sure the TIMEZONE for logging is correct +conf.tz = timezone(get_setting_value('TIMEZONE')) CUR_PATH = str(pathlib.Path(__file__).parent.resolve()) RESULT_FILE = os.path.join(CUR_PATH, 'last_result.log') diff --git a/front/plugins/_publisher_webhook/webhook.py b/front/plugins/_publisher_webhook/webhook.py index 8b995ae7..bc298e15 100755 --- a/front/plugins/_publisher_webhook/webhook.py +++ b/front/plugins/_publisher_webhook/webhook.py @@ -25,6 +25,10 @@ from logger import mylog, append_line_to_file from helper import timeNowTZ, get_setting_value, hide_string, write_file from notification import Notification_obj from database import DB +from pytz import timezone + +# Make sure the TIMEZONE for logging is correct +conf.tz = timezone(get_setting_value('TIMEZONE')) CUR_PATH = str(pathlib.Path(__file__).parent.resolve()) RESULT_FILE = os.path.join(CUR_PATH, 'last_result.log') diff --git a/front/plugins/arp_scan/script.py b/front/plugins/arp_scan/script.py index ffea6cb4..b25fa216 100755 --- a/front/plugins/arp_scan/script.py +++ b/front/plugins/arp_scan/script.py @@ -18,6 +18,11 @@ from plugin_helper import Plugin_Object, Plugin_Objects, handleEmpty from logger import mylog, append_line_to_file from helper import timeNowTZ, get_setting_value from const import logPath, applicationPath +import conf +from pytz import timezone + +# Make sure the TIMEZONE for logging is correct +conf.tz = timezone(get_setting_value('TIMEZONE')) CUR_PATH = str(pathlib.Path(__file__).parent.resolve()) LOG_FILE = os.path.join(CUR_PATH, 'script.log') diff --git a/front/plugins/csv_backup/script.py b/front/plugins/csv_backup/script.py index a4b8be21..cc727a3e 100755 --- a/front/plugins/csv_backup/script.py +++ b/front/plugins/csv_backup/script.py @@ -18,7 +18,11 @@ from plugin_helper import Plugin_Object, Plugin_Objects, decodeBase64 from logger import mylog, append_line_to_file from helper import timeNowTZ from const import logPath, applicationPath, fullDbPath +import conf +from pytz import timezone +# Make sure the TIMEZONE for logging is correct +conf.tz = timezone(get_setting_value('TIMEZONE')) CUR_PATH = str(pathlib.Path(__file__).parent.resolve()) LOG_FILE = os.path.join(CUR_PATH, 'script.log') diff --git a/front/plugins/db_cleanup/script.py b/front/plugins/db_cleanup/script.py index 2979b0fb..0ef2c732 100755 --- a/front/plugins/db_cleanup/script.py +++ b/front/plugins/db_cleanup/script.py @@ -18,7 +18,11 @@ from plugin_helper import Plugin_Object, Plugin_Objects, decodeBase64 from logger import mylog, append_line_to_file from helper import timeNowTZ, get_setting_value from const import logPath, applicationPath, fullDbPath +import conf +from pytz import timezone +# Make sure the TIMEZONE for logging is correct +conf.tz = timezone(get_setting_value('TIMEZONE')) CUR_PATH = str(pathlib.Path(__file__).parent.resolve()) LOG_FILE = os.path.join(CUR_PATH, 'script.log') diff --git a/front/plugins/ddns_update/script.py b/front/plugins/ddns_update/script.py index f216a6bb..9afaec6c 100755 --- a/front/plugins/ddns_update/script.py +++ b/front/plugins/ddns_update/script.py @@ -21,7 +21,11 @@ from plugin_helper import Plugin_Object, Plugin_Objects, decodeBase64 from logger import mylog, append_line_to_file from helper import timeNowTZ, check_IP_format from const import logPath, applicationPath, fullDbPath +import conf +from pytz import timezone +# Make sure the TIMEZONE for logging is correct +conf.tz = timezone(get_setting_value('TIMEZONE')) CUR_PATH = str(pathlib.Path(__file__).parent.resolve()) LOG_FILE = os.path.join(CUR_PATH, 'script.log') diff --git a/front/plugins/dhcp_leases/script.py b/front/plugins/dhcp_leases/script.py index 60432166..12fd29f9 100755 --- a/front/plugins/dhcp_leases/script.py +++ b/front/plugins/dhcp_leases/script.py @@ -15,6 +15,11 @@ sys.path.extend([f"{INSTALL_PATH}/front/plugins", f"{INSTALL_PATH}/server"]) from plugin_helper import Plugin_Object, Plugin_Objects, handleEmpty, is_mac from logger import mylog from dhcp_leases import DhcpLeases +import conf +from pytz import timezone + +# Make sure the TIMEZONE for logging is correct +conf.tz = timezone(get_setting_value('TIMEZONE')) CUR_PATH = str(pathlib.Path(__file__).parent.resolve()) LOG_FILE = os.path.join(CUR_PATH, 'script.log') diff --git a/front/plugins/dhcp_servers/script.py b/front/plugins/dhcp_servers/script.py index e2bb29b1..4e1e4d3f 100755 --- a/front/plugins/dhcp_servers/script.py +++ b/front/plugins/dhcp_servers/script.py @@ -12,6 +12,11 @@ sys.path.extend([f"{INSTALL_PATH}/front/plugins", f"{INSTALL_PATH}/server"]) from plugin_helper import Plugin_Objects, Plugin_Object from logger import mylog +import conf +from pytz import timezone + +# Make sure the TIMEZONE for logging is correct +conf.tz = timezone(get_setting_value('TIMEZONE')) def main(): diff --git a/front/plugins/internet_ip/script.py b/front/plugins/internet_ip/script.py index 3c1ab38e..285bdef2 100755 --- a/front/plugins/internet_ip/script.py +++ b/front/plugins/internet_ip/script.py @@ -22,6 +22,11 @@ from plugin_helper import Plugin_Object, Plugin_Objects, decodeBase64 from logger import mylog, append_line_to_file from helper import timeNowTZ, check_IP_format, get_setting_value from const import logPath, applicationPath, fullDbPath +import conf +from pytz import timezone + +# Make sure the TIMEZONE for logging is correct +conf.tz = timezone(get_setting_value('TIMEZONE')) CUR_PATH = str(pathlib.Path(__file__).parent.resolve()) diff --git a/front/plugins/internet_speedtest/script.py b/front/plugins/internet_speedtest/script.py index 7029edde..ea948d66 100755 --- a/front/plugins/internet_speedtest/script.py +++ b/front/plugins/internet_speedtest/script.py @@ -14,6 +14,11 @@ sys.path.extend([f"{INSTALL_PATH}/front/plugins", f"{INSTALL_PATH}/server"]) from plugin_helper import Plugin_Objects from logger import mylog, append_line_to_file from helper import timeNowTZ +import conf +from pytz import timezone + +# Make sure the TIMEZONE for logging is correct +conf.tz = timezone(get_setting_value('TIMEZONE')) CUR_PATH = str(pathlib.Path(__file__).parent.resolve()) RESULT_FILE = os.path.join(CUR_PATH, 'last_result.log') diff --git a/front/plugins/maintenance/maintenance.py b/front/plugins/maintenance/maintenance.py index 24d7fe8a..3fe6d3e4 100755 --- a/front/plugins/maintenance/maintenance.py +++ b/front/plugins/maintenance/maintenance.py @@ -19,6 +19,11 @@ from plugin_helper import Plugin_Object, Plugin_Objects, decodeBase64 from logger import mylog, append_line_to_file from helper import timeNowTZ, get_setting_value from const import logPath, applicationPath +import conf +from pytz import timezone + +# Make sure the TIMEZONE for logging is correct +conf.tz = timezone(get_setting_value('TIMEZONE')) CUR_PATH = str(pathlib.Path(__file__).parent.resolve()) diff --git a/front/plugins/nbtscan_scan/nbtscan.py b/front/plugins/nbtscan_scan/nbtscan.py index 1ac29f9b..91e5fe5f 100755 --- a/front/plugins/nbtscan_scan/nbtscan.py +++ b/front/plugins/nbtscan_scan/nbtscan.py @@ -19,6 +19,11 @@ from helper import timeNowTZ, get_setting_value from notification import write_notification from database import DB from device import Device_obj +import conf +from pytz import timezone + +# Make sure the TIMEZONE for logging is correct +conf.tz = timezone(get_setting_value('TIMEZONE')) # Define the current path and log file paths CUR_PATH = str(pathlib.Path(__file__).parent.resolve()) diff --git a/front/plugins/nmap_dev_scan/nmap_dev.py b/front/plugins/nmap_dev_scan/nmap_dev.py index aad6f769..a2e2c6e6 100755 --- a/front/plugins/nmap_dev_scan/nmap_dev.py +++ b/front/plugins/nmap_dev_scan/nmap_dev.py @@ -25,6 +25,11 @@ from helper import timeNowTZ, get_setting_value, extract_between_strings, extrac from const import logPath, applicationPath, fullDbPath from database import DB from device import Device_obj +import conf +from pytz import timezone + +# Make sure the TIMEZONE for logging is correct +conf.tz = timezone(get_setting_value('TIMEZONE')) CUR_PATH = str(pathlib.Path(__file__).parent.resolve()) diff --git a/front/plugins/nmap_scan/script.py b/front/plugins/nmap_scan/script.py index 5db4306c..b93225cf 100755 --- a/front/plugins/nmap_scan/script.py +++ b/front/plugins/nmap_scan/script.py @@ -17,6 +17,11 @@ from plugin_helper import Plugin_Object, Plugin_Objects, decodeBase64 from logger import mylog, append_line_to_file from helper import timeNowTZ from const import logPath, applicationPath +import conf +from pytz import timezone + +# Make sure the TIMEZONE for logging is correct +conf.tz = timezone(get_setting_value('TIMEZONE')) CUR_PATH = str(pathlib.Path(__file__).parent.resolve()) LOG_FILE = os.path.join(CUR_PATH, 'script.log') diff --git a/front/plugins/nslookup_scan/nslookup.py b/front/plugins/nslookup_scan/nslookup.py index 68649cfc..ad1cd7ea 100755 --- a/front/plugins/nslookup_scan/nslookup.py +++ b/front/plugins/nslookup_scan/nslookup.py @@ -24,7 +24,11 @@ from helper import timeNowTZ, get_setting_value from const import logPath, applicationPath, fullDbPath from database import DB from device import Device_obj +import conf +from pytz import timezone +# Make sure the TIMEZONE for logging is correct +conf.tz = timezone(get_setting_value('TIMEZONE')) CUR_PATH = str(pathlib.Path(__file__).parent.resolve()) LOG_FILE = os.path.join(CUR_PATH, 'script.log') diff --git a/front/plugins/pholus_scan/script.py b/front/plugins/pholus_scan/script.py index 2c7d4171..dc0da874 100755 --- a/front/plugins/pholus_scan/script.py +++ b/front/plugins/pholus_scan/script.py @@ -18,6 +18,11 @@ from logger import mylog from plugin_helper import Plugin_Object, Plugin_Objects from helper import timeNowTZ from const import logPath, applicationPath +import conf +from pytz import timezone + +# Make sure the TIMEZONE for logging is correct +conf.tz = timezone(get_setting_value('TIMEZONE')) CUR_PATH = str(pathlib.Path(__file__).parent.resolve()) LOG_FILE = os.path.join(CUR_PATH, 'script.log') diff --git a/front/plugins/snmp_discovery/script.py b/front/plugins/snmp_discovery/script.py index f4bfa0c0..18c80bc1 100755 --- a/front/plugins/snmp_discovery/script.py +++ b/front/plugins/snmp_discovery/script.py @@ -15,6 +15,11 @@ from plugin_helper import Plugin_Object, Plugin_Objects, decodeBase64, handleEmp from logger import mylog from helper import timeNowTZ from const import logPath, applicationPath +import conf +from pytz import timezone + +# Make sure the TIMEZONE for logging is correct +conf.tz = timezone(get_setting_value('TIMEZONE')) CUR_PATH = str(pathlib.Path(__file__).parent.resolve()) RESULT_FILE = os.path.join(CUR_PATH, 'last_result.log') diff --git a/front/plugins/sync/sync.py b/front/plugins/sync/sync.py index dae53408..32440884 100755 --- a/front/plugins/sync/sync.py +++ b/front/plugins/sync/sync.py @@ -20,6 +20,11 @@ from const import pluginsPath, fullDbPath from helper import timeNowTZ, get_setting_value from cryptography import encrypt_data from notification import write_notification +import conf +from pytz import timezone + +# Make sure the TIMEZONE for logging is correct +conf.tz = timezone(get_setting_value('TIMEZONE')) # Define the current path and log file paths CUR_PATH = str(pathlib.Path(__file__).parent.resolve()) diff --git a/front/plugins/undiscoverables/script.py b/front/plugins/undiscoverables/script.py index cd6c6e46..abf22b7b 100755 --- a/front/plugins/undiscoverables/script.py +++ b/front/plugins/undiscoverables/script.py @@ -15,6 +15,11 @@ from plugin_helper import Plugin_Object, Plugin_Objects, decodeBase64 from logger import mylog, append_line_to_file from helper import timeNowTZ from const import logPath, applicationPath +import conf +from pytz import timezone + +# Make sure the TIMEZONE for logging is correct +conf.tz = timezone(get_setting_value('TIMEZONE')) CUR_PATH = str(pathlib.Path(__file__).parent.resolve()) LOG_FILE = os.path.join(CUR_PATH, 'script.log') diff --git a/front/plugins/unifi_import/script.py b/front/plugins/unifi_import/script.py index 7729a3be..fc469a00 100755 --- a/front/plugins/unifi_import/script.py +++ b/front/plugins/unifi_import/script.py @@ -14,12 +14,18 @@ from requests import Request, Session, packages from requests.packages.urllib3.exceptions import InsecureRequestWarning from pyunifi.controller import Controller + # Register NetAlertX directories INSTALL_PATH="/app" sys.path.extend([f"{INSTALL_PATH}/front/plugins", f"{INSTALL_PATH}/server"]) from plugin_helper import Plugin_Object, Plugin_Objects from logger import mylog +import conf +from pytz import timezone + +# Make sure the TIMEZONE for logging is correct +conf.tz = timezone(get_setting_value('TIMEZONE')) CUR_PATH = str(pathlib.Path(__file__).parent.resolve()) LOG_FILE = os.path.join(CUR_PATH, 'script.log') diff --git a/front/plugins/vendor_update/script.py b/front/plugins/vendor_update/script.py index 41d61d4f..31c429e3 100755 --- a/front/plugins/vendor_update/script.py +++ b/front/plugins/vendor_update/script.py @@ -20,6 +20,11 @@ from logger import mylog, append_line_to_file from helper import timeNowTZ from const import logPath, applicationPath, fullDbPath from device import query_MAC_vendor +import conf +from pytz import timezone + +# Make sure the TIMEZONE for logging is correct +conf.tz = timezone(get_setting_value('TIMEZONE')) CUR_PATH = str(pathlib.Path(__file__).parent.resolve()) diff --git a/front/plugins/website_monitor/script.py b/front/plugins/website_monitor/script.py index 5d809698..05d98117 100755 --- a/front/plugins/website_monitor/script.py +++ b/front/plugins/website_monitor/script.py @@ -15,6 +15,11 @@ sys.path.extend([f"{INSTALL_PATH}/front/plugins", f"{INSTALL_PATH}/server"]) from plugin_helper import Plugin_Objects from datetime import datetime from const import logPath +import conf +from pytz import timezone + +# Make sure the TIMEZONE for logging is correct +conf.tz = timezone(get_setting_value('TIMEZONE')) CUR_PATH = str(pathlib.Path(__file__).parent.resolve()) RESULT_FILE = os.path.join(CUR_PATH, 'last_result.log')