From 5cfe0bf713218aa0e7e8a3893b31033331261905 Mon Sep 17 00:00:00 2001 From: Jokob-sk Date: Sat, 27 Jan 2024 11:11:19 +1100 Subject: [PATCH] NSLOOKUP v0.1.1 + docs --- docs/SETTINGS_SYSTEM.md | 4 ++-- front/plugins/README.md | 4 ++-- front/plugins/README_DE.md | 2 +- front/plugins/nslookup_scan/nslookup.py | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/SETTINGS_SYSTEM.md b/docs/SETTINGS_SYSTEM.md index 427fd782..61cc414b 100755 --- a/docs/SETTINGS_SYSTEM.md +++ b/docs/SETTINGS_SYSTEM.md @@ -25,14 +25,14 @@ The json file is also cached on the client-side local storage of the browser. > [!NOTE] > This is the source of truth for settings. User-defined values in this files always override default values specified in the Plugin definition. -The App generates two `pialert.conf` entries for every setting (Since version 23.8+). One entry is the setting value, the second is the `__metadata` associated with the setting. This `__metadata` entry contains the full setting definition in JSON format. This should helps the future extensibility of the Settings system. +The App generates two `pialert.conf` entries for every setting (Since version 23.8+). One entry is the setting value, the second is the `__metadata` associated with the setting. This `__metadata` entry contains the full setting definition in JSON format. Currently unused, but intended to be used in future to extend the Settings system. #### Plugin settings > [!NOTE] > This is the preferred way adding settings going forward. I'll be likely migrating all app settings into plugin-based settings. -Plugin settings are loaded dynamically from the `config.json` of individual plugins. If a setting isn't defined in the `pialert.conf` file, it is initialized via the `default_value` property of a setting from the `config.json` file. Check the [Plugins documentation](/front/plugins/README.md), section `⚙ Setting object structure` for details on the structure of the setting. +Plugin settings are loaded dynamically from the `config.json` of individual plugins. If a setting isn't defined in the `pialert.conf` file, it is initialized via the `default_value` property of a setting from the `config.json` file. Check the [Plugins documentation](https://github.com/jokob-sk/Pi.Alert/blob/main/front/plugins/README.md#-setting-object-structure), section `⚙ Setting object structure` for details on the structure of the setting. ![Screen 1][screen1] diff --git a/front/plugins/README.md b/front/plugins/README.md index 350e1c02..63c14184 100755 --- a/front/plugins/README.md +++ b/front/plugins/README.md @@ -565,9 +565,9 @@ You can have any `"function": "my_custom_name"` custom name, however, the ones l | | - "always_after_scan" - run always after a scan is finished | | | - "on_new_device" - run when a new device is detected | | | - "before_config_save" - run before the config is marked as saved. Useful if your plugin needs to modify the `pialert.conf` file. | -| `RUN_SCHD` | (required if you include the above `RUN` function) Cron-like scheduling is used if the `RUN` setting is set to `schedule`. | +| `RUN_SCHD` | (required if you include "schedule" in the above `RUN` function) Cron-like scheduling is used if the `RUN` setting is set to `schedule`. | | `CMD` | (required) Specifies the command that should be executed. | -| `API_SQL` | (optional) Generates a `table_` + `code_name` + `.json` file as per [API docs](https://github.com/jokob-sk/Pi.Alert/blob/main/docs/API.md). | +| `API_SQL` | (not implemented) Generates a `table_` + `code_name` + `.json` file as per [API docs](https://github.com/jokob-sk/Pi.Alert/blob/main/docs/API.md). | | `RUN_TIMEOUT` | (optional) Specifies the maximum execution time of the script. If not specified, a default value of 10 seconds is used to prevent hanging. | | `WATCH` | (optional) Specifies which database columns are watched for changes for this particular plugin. If not specified, no notifications are sent. | | `REPORT_ON` | (optional) Specifies when to send a notification. Supported options are: | diff --git a/front/plugins/README_DE.md b/front/plugins/README_DE.md index 2559e409..05d3eaf7 100755 --- a/front/plugins/README_DE.md +++ b/front/plugins/README_DE.md @@ -554,7 +554,7 @@ You can have any `"function": "my_custom_name"` custom name, however, the ones l | | - "before_config_save" - run before the config is marked as saved. Useful if your plugin needs to modify the `pialert.conf` file. | | `RUN_SCHD` | (required if you include the above `RUN` function) Cron-like scheduling is used if the `RUN` setting is set to `schedule`. | | `CMD` | (required) Specifies the command that should be executed. | -| `API_SQL` | (optional) Generates a `table_` + `code_name` + `.json` file as per [API docs](https://github.com/jokob-sk/Pi.Alert/blob/main/docs/API.md). | +| `API_SQL` | (not implemented) Generates a `table_` + `code_name` + `.json` file as per [API docs](https://github.com/jokob-sk/Pi.Alert/blob/main/docs/API.md). | | `RUN_TIMEOUT` | (optional) Specifies the maximum execution time of the script. If not specified, a default value of 10 seconds is used to prevent hanging. | | `WATCH` | (optional) Specifies which database columns are watched for changes for this particular plugin. If not specified, no notifications are sent. | | `REPORT_ON` | (optional) Specifies when to send a notification. Supported options are: | diff --git a/front/plugins/nslookup_scan/nslookup.py b/front/plugins/nslookup_scan/nslookup.py index 834e9c6a..10fb22ab 100755 --- a/front/plugins/nslookup_scan/nslookup.py +++ b/front/plugins/nslookup_scan/nslookup.py @@ -97,8 +97,8 @@ def execute_nslookup (ip, timeout): domain_pattern = re.compile(r'Name:\s+(.+)') server_pattern = re.compile(r'Server:\s+(.+)') - domain_match = domain_pattern.search(output.stdout) - server_match = server_pattern.search(output.stdout) + domain_match = domain_pattern.search(output) + server_match = server_pattern.search(output) if domain_match: domain_name = domain_match.group(1)