From b670e3a8b185faed866df0604a10ec87e339e709 Mon Sep 17 00:00:00 2001 From: Jokob-sk Date: Fri, 5 Jan 2024 08:18:52 +1100 Subject: [PATCH] renamed DIG_GET_IP_ARG to INTRNT_DIG_GET_IP_ARG --- front/php/templates/language/de_de.json | 2 -- front/php/templates/language/en_us.json | 4 --- front/php/templates/language/es_es.json | 2 -- front/plugins/db_cleanup/config.json | 19 ++++++++++++ front/plugins/internet_ip/config.json | 40 ++++++++++++++++++++++++- pialert/conf.py | 1 - pialert/initialise.py | 7 ++--- 7 files changed, 61 insertions(+), 14 deletions(-) diff --git a/front/php/templates/language/de_de.json b/front/php/templates/language/de_de.json index 9d637680..68f0d667 100755 --- a/front/php/templates/language/de_de.json +++ b/front/php/templates/language/de_de.json @@ -565,8 +565,6 @@ "HRS_TO_KEEP_NEWDEV_description": "Dies ist eine Wartungseinstellung. Geräte markiert als Neues Gerät werden gelöscht, wenn ihre Erste Sitzung länger her ist als die angegebenen Stunden in dieser Einstellung. 0 deaktiviert diese Funktion. Nutzen Sie diese Einstellung, um Neue Geräte automatisch nach X Stunden zu löschen.", "REPORT_DASHBOARD_URL_name": "Pi.Alert URL", "REPORT_DASHBOARD_URL_description": "Diese URL wird als Basis fürs Erstellen von Links in E-Mails genutzt. Geben Sie die gesamte URL startend mit http:// inklusive der genutzten Portnummer ein (keinen nachfolgenden Schrägstrich / nutzen).", - "DIG_GET_IP_ARG_name": "Erkennung externer IP (\"Internet IP\")", - "DIG_GET_IP_ARG_description": "Ändere die Argumente des dig Dienstprogramms, wenn Probleme beim Auflösen der externen IP auftreten. Argumente werden an das Ende des folgenden Befehls angehängt: dig +short .", "NETWORK_DEVICE_TYPES_name": "Netzwerkgeräte-Typen", "NETWORK_DEVICE_TYPES_description": "Welche Gerätetypen als Netzwerkgeräte in der Netzwerkansicht verwendet werden können. Der Gerätetyp muss genau der Typ-Einstellung eines spezifischen Geräts in den Gerätedetails übereinstimmen. Entfernen Sie keine existierenden Typen, sondern fügen Sie nur neue ein.", "UI_LANG_name": "UI Sprache", diff --git a/front/php/templates/language/en_us.json b/front/php/templates/language/en_us.json index 4a0a8e52..92c50f77 100755 --- a/front/php/templates/language/en_us.json +++ b/front/php/templates/language/en_us.json @@ -499,8 +499,6 @@ "ENABLE_PLUGINS_description" : "Enables the plugins functionality. Loading plugins requires more hardware resources so you might want to disable them on low-powered system.", "PLUGINS_KEEP_HIST_name" : "Plugins History", "PLUGINS_KEEP_HIST_description" : "How many entries of Plugins History scan results should be kept (per Plugin, and not device specific).", - "DBCLNP_NOTIFI_HIST_name" : "Notifications History", - "DBCLNP_NOTIFI_HIST_description" : "How many historical entries of Notifications should be kept.", "PIALERT_WEB_PROTECTION_name" : "Enable login", "PIALERT_WEB_PROTECTION_description" : "When enabled a login dialog is displayed. Read below carefully if you get locked out of your instance.", "PIALERT_WEB_PASSWORD_name" : "Login password", @@ -511,8 +509,6 @@ "HRS_TO_KEEP_NEWDEV_description" : "This is a maintenance setting. If enabled (0 is disabled), devices marked as New Device will be deleted if their First Session time was older than the specified hours in this setting. Use this setting if you want to auto-delete New Devices after X hours.", "REPORT_DASHBOARD_URL_name" : "Pi.Alert URL", "REPORT_DASHBOARD_URL_description" : "This URL is used as the base for generating links in HTML reports (e.g.: emails). Enter full URL starting with http:// including the port number (no trailing slash /).", - "DIG_GET_IP_ARG_name" : "Internet IP discovery", - "DIG_GET_IP_ARG_description" : "Change the dig utility arguments if you have issues resolving your Internet IP. Arguments are added at the end of the following command: dig +short .", "NETWORK_DEVICE_TYPES_name" : "Network device types", "NETWORK_DEVICE_TYPES_description" : "Which device types are allowed to be used as network devices in the Network view. The device type has to match exactly the Type setting on a specific device in Device details. Do not remove existing types, only add new ones.", "UI_LANG_name" : "UI Language", diff --git a/front/php/templates/language/es_es.json b/front/php/templates/language/es_es.json index 6950d57a..69a13a39 100755 --- a/front/php/templates/language/es_es.json +++ b/front/php/templates/language/es_es.json @@ -477,8 +477,6 @@ "HRS_TO_KEEP_NEWDEV_description": "Esta es una configuración de mantenimiento. Si está habilitado (0 está deshabilitado), los dispositivos marcados como Nuevo dispositivo se eliminarán si su Primera sesión el tiempo era anterior a las horas especificadas en esta configuración. Utilice esta configuración si desea eliminar automáticamente Nuevos dispositivos después de X horas.", "REPORT_DASHBOARD_URL_name" : "URL de Pi.Alert", "REPORT_DASHBOARD_URL_description" : "Esta URL se utiliza como base para generar enlaces en los correos electrónicos. Ingrese la URL completa que comienza con http://, incluido el número de puerto (sin barra inclinada al final /).", - "DIG_GET_IP_ARG_name" : "Descubrir de IP de Internet", - "DIG_GET_IP_ARG_description" : "Cambie los argumentos de la utilidad de dig si tiene problemas para resolver su IP de Internet. Los argumentos se agregan al final del siguiente comando: dig +short .", "UI_LANG_name" : "Idioma de interfaz", "UI_LANG_description" : "Seleccione el idioma de interfaz de usuario preferido.", "UI_PRESENCE_name" : "Mostrar en el gráfico de presencia", diff --git a/front/plugins/db_cleanup/config.json b/front/plugins/db_cleanup/config.json index 77dd4b4c..cc4cfc3e 100755 --- a/front/plugins/db_cleanup/config.json +++ b/front/plugins/db_cleanup/config.json @@ -172,6 +172,25 @@ "string": "Maximale Zeit in Sekunden, die auf den Abschluss des Skripts gewartet werden soll. Bei Überschreitung dieser Zeit wird das Skript abgebrochen." } ] + }, + { + "function": "NOTIFI_HIST", + "type": "integer", + "default_value": 100, + "options": [], + "localized": ["name", "description"], + "name": [ + { + "language_code": "en_us", + "string": "Notifications History" + } + ], + "description": [ + { + "language_code": "en_us", + "string": "How many historical entries of Notifications should be kept. This influences how mane entries are also available in the Report section in the UI" + } + ] } ], diff --git a/front/plugins/internet_ip/config.json b/front/plugins/internet_ip/config.json index 08d40d12..751b1468 100755 --- a/front/plugins/internet_ip/config.json +++ b/front/plugins/internet_ip/config.json @@ -59,7 +59,7 @@ { "name": "DIG_GET_IP_ARG", "type": "setting", - "value": "DIG_GET_IP_ARG", + "value": "INTRNT_DIG_GET_IP_ARG", "base64": true } ], @@ -144,6 +144,44 @@ } ] }, + { + "function": "DIG_GET_IP_ARG", + "type": "text", + "default_value": "-4 myip.opendns.com @resolver1.opendns.com", + "options": [], + "localized": [ + "name", + "description" + ], + "name": [ + { + "language_code": "en_us", + "string": "Internet IP discovery" + }, + { + "language_code": "es_es", + "string": "Descubrir de IP de Internet" + }, + { + "language_code": "de_de", + "string": "Erkennung externer IP (\"Internet IP\")" + } + ], + "description": [ + { + "language_code": "en_us", + "string": "Change the dig utility arguments if you have issues resolving your Internet IP. Arguments are added at the end of the following command: dig +short ." + }, + { + "language_code": "es_es", + "string": "Cambie los argumentos de la utilidad de dig si tiene problemas para resolver su IP de Internet. Los argumentos se agregan al final del siguiente comando: dig +short ." + }, + { + "language_code": "de_de", + "string": "Ändere die Argumente des dig Dienstprogramms, wenn Probleme beim Auflösen der externen IP auftreten. Argumente werden an das Ende des folgenden Befehls angehängt: dig +short ." + } + ] + }, { "function": "RUN_SCHD", "type": "text", diff --git a/pialert/conf.py b/pialert/conf.py index 9c693d02..cebe8fc3 100755 --- a/pialert/conf.py +++ b/pialert/conf.py @@ -32,7 +32,6 @@ arpscan_devices = [] SCAN_SUBNETS = ['192.168.1.0/24 --interface=eth1', '192.168.1.0/24 --interface=eth0'] LOG_LEVEL = 'verbose' TIMEZONE = 'Europe/Berlin' -DIG_GET_IP_ARG = '-4 myip.opendns.com @resolver1.opendns.com' UI_LANG = 'English' UI_PRESENCE = ['online', 'offline', 'archived'] PIALERT_WEB_PROTECTION = False diff --git a/pialert/initialise.py b/pialert/initialise.py index 20fac082..9bde256d 100755 --- a/pialert/initialise.py +++ b/pialert/initialise.py @@ -105,12 +105,10 @@ def importConfigs (db): conf.PIALERT_WEB_PROTECTION = ccd('PIALERT_WEB_PROTECTION', False , c_d, 'Enable logon', 'boolean', '', 'General') conf.PIALERT_WEB_PASSWORD = ccd('PIALERT_WEB_PASSWORD', '8d969eef6ecad3c29a3a629280e686cf0c3f5d5a86aff3ca12020c923adc6c92' , c_d, 'Logon password', 'readonly', '', 'General') conf.REPORT_DASHBOARD_URL = ccd('REPORT_DASHBOARD_URL', 'http://pi.alert/' , c_d, 'PiAlert URL', 'text', '', 'General') - conf.DIG_GET_IP_ARG = ccd('DIG_GET_IP_ARG', '-4 myip.opendns.com @resolver1.opendns.com' , c_d, 'DIG arguments', 'text', '', 'General') conf.UI_LANG = ccd('UI_LANG', 'English' , c_d, 'Language Interface', 'text.select', "['English', 'German', 'Spanish']", 'General') conf.UI_PRESENCE = ccd('UI_PRESENCE', ['online', 'offline', 'archived'] , c_d, 'Include in presence', 'text.multiselect', "['online', 'offline', 'archived']", 'General') conf.DAYS_TO_KEEP_EVENTS = ccd('DAYS_TO_KEEP_EVENTS', 90 , c_d, 'Delete events days', 'integer', '', 'General') - conf.HRS_TO_KEEP_NEWDEV = ccd('HRS_TO_KEEP_NEWDEV', 0 , c_d, 'Keep new devices for', 'integer', "0", 'General') - conf.DBCLNP_NOTIFI_HIST = ccd('DBCLNP_NOTIFI_HIST', 100 , c_d, 'Keep notification', 'integer', "0", 'General') + conf.HRS_TO_KEEP_NEWDEV = ccd('HRS_TO_KEEP_NEWDEV', 0 , c_d, 'Keep new devices for', 'integer', "0", 'General') conf.API_CUSTOM_SQL = ccd('API_CUSTOM_SQL', 'SELECT * FROM Devices WHERE dev_PresentLastScan = 0' , c_d, 'Custom endpoint', 'text', '', 'General') conf.NETWORK_DEVICE_TYPES = ccd('NETWORK_DEVICE_TYPES', ['AP', 'Gateway', 'Firewall', 'Hypervisor', 'Powerline', 'Switch', 'WLAN', 'PLC', 'Router','USB LAN Adapter', 'USB WIFI Adapter', 'Internet'] , c_d, 'Network device types', 'list', '', 'General') @@ -260,7 +258,8 @@ replacements = { r'REPORT_PUSHSAFER=True': 'PUSHSAFER_RUN=\'on_notification\'', r'REPORT_MQTT=True': 'MQTT_RUN=\'on_notification\'', r'PIHOLE_CMD=': 'PIHOLE_CMD_OLD=', - r'\bINCLUDED_SECTIONS\b': 'NTFPRCS_INCLUDED_SECTIONS' + r'\bINCLUDED_SECTIONS\b': 'NTFPRCS_INCLUDED_SECTIONS', + r'\bDIG_GET_IP_ARG\b': 'INTRNT_DIG_GET_IP_ARG' } def renameSettings(config_file):