diff --git a/dockerfiles/README.md b/dockerfiles/README.md index f77e0878..c6f48ffd 100755 --- a/dockerfiles/README.md +++ b/dockerfiles/README.md @@ -18,7 +18,7 @@ ## 📕 Basic Usage -- You will have to run the container on the host network, e.g: +- You will have to run the container on the `host` network, e.g: ```yaml docker run -d --rm --network=host \ @@ -27,8 +27,8 @@ docker run -d --rm --network=host \ -e TZ=Europe/Berlin \ -e PORT=20211 \ jokobsk/pi.alert:latest - ``` -- The initial scan can take up-to 15min (with 50 devices and MQTT). Subsequent ones 3 and 5 minutes so wait that long for all of the scans to run. +``` +- The initial scan can take up to 15min (with 50 devices and MQTT). Subsequent ones 3 and 5 minutes so wait that long for all of the scans to run. ### Docker environment variables @@ -42,22 +42,22 @@ docker run -d --rm --network=host \ ### Docker paths -| | Path | Description | +| Required | Path | Description | | :------------- | :------------- |:-------------| -| ⚠ **Required** | `:/home/pi/pialert/config` | Folder which will contain the `pialert.conf` file (see below for details) | -| ⚠ **Required** | `:/home/pi/pialert/db` | Folder which will contain the `pialert.db` file | -|Optional| `:/home/pi/pialert/front/log` | Logs folder useful for debugging if you have issues setting up the container | -|Optional| `:/etc/pihole/pihole-FTL.db` | PiHole's `pihole-FTL.db` database file. Required if you want to use PiHole | -|Optional| `:/etc/pihole/dhcp.leases` | PiHole's `dhcp.leases` file. Required if you want to use PiHole `dhcp.leases` file. This has to be matched with a corresponding `DHCPLSS_paths_to_check` setting entry. (the path in the container must contain `pihole`)| -|Optional| `:/home/pi/pialert/front/api` | A simple [API endpoint](https://github.com/jokob-sk/Pi.Alert/blob/main/docs/API.md) containing static (but regularly updated) json and other files. | -|Optional| `:/home/pi/pialert/front/plugins//ignore_plugin` | Map a file `ignore_plugin` to ignore a plugin. Plugins can be soft-disabled via settings. More in the [Plugin docs](/front/plugins/README.md). | +| ✅ | `:/home/pi/pialert/config` | Folder which will contain the `pialert.conf` file (see below for details) | +| ✅ | `:/home/pi/pialert/db` | Folder which will contain the `pialert.db` file | +| | `:/home/pi/pialert/front/log` | Logs folder useful for debugging if you have issues setting up the container | +| | `:/etc/pihole/pihole-FTL.db` | PiHole's `pihole-FTL.db` database file. Required if you want to use PiHole | +| | `:/etc/pihole/dhcp.leases` | PiHole's `dhcp.leases` file. Required if you want to use PiHole `dhcp.leases` file. This has to be matched with a corresponding `DHCPLSS_paths_to_check` setting entry. (the path in the container must contain `pihole`)| +| | `:/home/pi/pialert/front/api` | A simple [API endpoint](https://github.com/jokob-sk/Pi.Alert/blob/main/docs/API.md) containing static (but regularly updated) json and other files. | +| | `:/home/pi/pialert/front/plugins//ignore_plugin` | Map a file `ignore_plugin` to ignore a plugin. Plugins can be soft-disabled via settings. More in the [Plugin docs](/front/plugins/README.md). | -### Config (`pialert.conf`) +### Modify the config (`pialert.conf`) only if UI is not available -- If unavailable, the app generates a default `pialert.conf` and `pialert.db` file on the first run. - The preferred way is to manage the configuration via the Settings section in the UI. - You can modify [pialert.conf](https://github.com/jokob-sk/Pi.Alert/tree/main/config) directly, if needed. +- If unavailable, the app generates a default `pialert.conf` and `pialert.db` file on the first run. #### Important settings @@ -230,11 +230,7 @@ Courtesy of [pbek](https://github.com/pbek). The volume `pialert_db` is used by ## 🏅 Recognitions -Big thanks to @Macleykun for help and tips&tricks for Dockerfile(s): - - - - +Big thanks to @Macleykun for help and tips&tricks for Dockerfile(s). ## ❤ Support me diff --git a/docs/SUBNETS.md b/docs/SUBNETS.md index 877f3319..df2b4606 100755 --- a/docs/SUBNETS.md +++ b/docs/SUBNETS.md @@ -6,6 +6,7 @@ You need to specify the network interface and the network mask. You can also con > [!NOTE] > Please use the UI to configure settings as that ensures that the config file is in the correct format. Edit `pialert.conf` directly only when really necessary. +> ![settings](/front/plugins/arp_scan/arp-scan-settings.png) * Examples for one and two subnets (❗ Note the `['...', '...']` format): * One subnet: `SCAN_SUBNETS = ['192.168.1.0/24 --interface=eth0']` diff --git a/front/js/settings_utils.js b/front/js/settings_utils.js index 9f7d0fdb..f98298b1 100755 --- a/front/js/settings_utils.js +++ b/front/js/settings_utils.js @@ -19,6 +19,25 @@ return result; } + // ------------------------------------------------------------------- + // Get plugin type base on prefix + function getPluginCodeName(pluginsData, prefix) + { + var result = "" + + pluginsData.forEach((plug) => { + + if (plug.unique_prefix == prefix ) { + id = plug.code_name; + + // console.log(id) + result = plug.code_name; + } + }); + + return result; + } + // ------------------------------------------------------------------- // Get plugin type base on prefix diff --git a/front/php/templates/language/en_us.json b/front/php/templates/language/en_us.json index 92c50f77..84bf68f5 100755 --- a/front/php/templates/language/en_us.json +++ b/front/php/templates/language/en_us.json @@ -490,7 +490,7 @@ "Setting_Override_Description" : "Enabling this option will override an App supplied default value with the value specified above.", "General_display_name" : "General", "General_icon" : "", - "SCAN_SUBNETS_description" : "Arp-scan is a command-line tool that uses the ARP protocol to discover and fingerprint IP hosts on the local network. An alternative to ARP scan is to enable the PIHOLE_RUNPiHole integration settings. The arp-scan time itself depends on the number of IP addresses to check so set this up carefully with the appropriate network mask and interface. Check the subnets documentation for help on setting up VLANs, what VLANs are supported, or how to figure out the network mask and your interface.", + "SCAN_SUBNETS_description" : "Arp-scan is a command-line tool that uses the ARP protocol to discover and fingerprint IP hosts on the local network. An alternative to ARP scan is to enable some other Device scanners. The arp-scan time itself depends on the number of IP addresses to check so set this up carefully with the appropriate network mask and interface. Check the subnets documentation for help on setting up VLANs, what VLANs are supported, or how to figure out the network mask and your interface.", "LOG_LEVEL_name" : "Print additional logging", "LOG_LEVEL_description" : "This setting will enable more verbose logging. Useful for debugging events writing into the database.", "TIMEZONE_name" : "Time zone", diff --git a/front/plugins/README.md b/front/plugins/README.md index aff14110..350e1c02 100755 --- a/front/plugins/README.md +++ b/front/plugins/README.md @@ -1,18 +1,11 @@ -## 📚 Docs for individual plugins +> Community translations of this file (might be out-of-date): Spanish(README_ES.md), German(README_DE.md) -### 🏴 Community translations of this file +# 📚 Docs for individual plugins -> Please note there might be a delay between English and community translations. +>[!NOTE] +> Please check this [Plugins debugging guide](https://github.com/jokob-sk/Pi.Alert/blob/main/docs/DEBUG_PLUGINS.md) and the corresponding Plugin documentation in the below table if you are facing issues. -* - README_ES.md Spanish (Spain) - - -* - README_DE.md German (Germany) - - -### 🔌 Plugins & 📚 Docs +## 🔌 Plugins & 📚 Docs | Required | CurrentScan | Unique Prefix | Data source | Type | Link + Docs | |----------|-------------|---------------|--------------------|----------------|---------------------------------------------------------------------| diff --git a/front/plugins/arp_scan/README.md b/front/plugins/arp_scan/README.md index 26673cbc..fdcbde0d 100755 --- a/front/plugins/arp_scan/README.md +++ b/front/plugins/arp_scan/README.md @@ -12,3 +12,9 @@ Arp-scan is a command-line tool that uses the ARP protocol to discover and finge - SAVE - Wait for the next scan to finish +#### Examples + +Settings: + +![settings](/front/plugins/arp_scan/arp-scan-settings.png) + diff --git a/front/plugins/arp_scan/arp-scan-settings.png b/front/plugins/arp_scan/arp-scan-settings.png new file mode 100755 index 00000000..d069aa9e Binary files /dev/null and b/front/plugins/arp_scan/arp-scan-settings.png differ diff --git a/front/plugins/arp_scan/config.json b/front/plugins/arp_scan/config.json index 515652b0..5829b9f0 100755 --- a/front/plugins/arp_scan/config.json +++ b/front/plugins/arp_scan/config.json @@ -106,7 +106,7 @@ "description": [ { "language_code": "en_us", - "string": "Specify when your Network-discovery scan will run. Typical setting would be schedule and then you specify a cron-like schedule in the ARPSCAN_RUN_SCHDsetting " + "string": "Specify when your Network-discovery scan will run. Typical setting would be schedule and then you specify a cron-like schedule in the ARPSCAN_RUN_SCHDsetting. ⚠ Use the same schedule if you have multiple Device scanners enabled." }, { "language_code": "es_es", diff --git a/front/plugins/csv_backup/README.md b/front/plugins/csv_backup/README.md index 4405ccb8..ef2dc287 100755 --- a/front/plugins/csv_backup/README.md +++ b/front/plugins/csv_backup/README.md @@ -16,4 +16,4 @@ Plugin generating CSV backups of your Devices database table, including the netw ### Usage -- If the devices.csv file can be overwritten or the date and time timestamp added to the name. This is toggled with the `CSVBCKP_overwrite` setting. +- The `devices.csv` file can be overwritten or the date and time timestamp added to the name. This is toggled with the `CSVBCKP_overwrite` setting. diff --git a/front/plugins/dhcp_leases/config.json b/front/plugins/dhcp_leases/config.json index a2585d66..d67d451b 100755 --- a/front/plugins/dhcp_leases/config.json +++ b/front/plugins/dhcp_leases/config.json @@ -478,7 +478,7 @@ "description": [ { "language_code": "en_us", - "string": "Enable import of devices from dhcp.leases files. If you select schedule the scheduling settings from below are applied. If you select once the scan is run only once on start of the application (container) or after you update your settings." + "string": "Enable import of devices from dhcp.leases files. If you select schedule the scheduling settings from below are applied. If you select once the scan is run only once on start of the application (container) or after you update your settings. ⚠ Use the same schedule if you have multiple Device scanners enabled." }, { "language_code": "es_es", diff --git a/front/plugins/dhcp_servers/config.json b/front/plugins/dhcp_servers/config.json index a87f9e67..759f256b 100755 --- a/front/plugins/dhcp_servers/config.json +++ b/front/plugins/dhcp_servers/config.json @@ -290,7 +290,7 @@ }], "description": [{ "language_code":"en_us", - "string" : "Enable a regular scan of rogue DHCP servers. If you select schedule the scheduling settings from below are applied. If you select once the scan is run only once on start of the application (container) or after you update your settings." + "string" : "Enable a regular scan of rogue DHCP servers. If you select schedule the scheduling settings from below are applied. If you select once the scan is run only once on start of the application (container) or after you update your settings. ⚠ Use the same schedule if you have multiple Device scanners enabled." }, { "language_code":"es_es", diff --git a/front/plugins/pihole_scan/config.json b/front/plugins/pihole_scan/config.json index 4425f49c..2bc5b886 100755 --- a/front/plugins/pihole_scan/config.json +++ b/front/plugins/pihole_scan/config.json @@ -73,7 +73,7 @@ }], "description": [{ "language_code":"en_us", - "string" : "Specify when your PiHole device import from the PiHole database will run. The typical setting would be schedule and then you specify a cron-like schedule in the PIHOLE_RUN_SCHDsetting. If enabled, you must map the pihole db into your container to the :/etc/pihole/pihole-FTL.db mount path as specified in the DB_PATH setting." + "string" : "Specify when your PiHole device import from the PiHole database will run. The typical setting would be schedule and then you specify a cron-like schedule in the PIHOLE_RUN_SCHDsetting. If enabled, you must map the pihole db into your container to the :/etc/pihole/pihole-FTL.db mount path as specified in the DB_PATH setting. ⚠ Use the same schedule if you have multiple Device scanners enabled." }, { "language_code":"es_es", diff --git a/front/plugins/set_password/config.json b/front/plugins/set_password/config.json index a1369b36..c0c8361f 100755 --- a/front/plugins/set_password/config.json +++ b/front/plugins/set_password/config.json @@ -67,7 +67,7 @@ }, { "function": "CMD", - "type": "text", + "type": "readonly", "default_value":"/home/pi/pialert/back/pialert-cli set_password {password}", "options": [], "localized": ["name", "description"], @@ -108,7 +108,7 @@ "description": [ { "language_code": "en_us", - "string": "The default password is 123456. To change the password run /home/pi/pialert/back/pialert-cli set_password {password} in the container" + "string": "The default password is 123456. To change it, you can either use this plugin (follow the instructions in the SETPWD_RUN setting) or run /home/pi/pialert/back/pialert-cli set_password {password} in the container." }, { "language_code": "es_es", diff --git a/front/plugins/snmp_discovery/config.json b/front/plugins/snmp_discovery/config.json index fcf14071..50cb44d1 100755 --- a/front/plugins/snmp_discovery/config.json +++ b/front/plugins/snmp_discovery/config.json @@ -322,7 +322,7 @@ }], "description": [{ "language_code":"en_us", - "string" : "Enable import of devices from a SNMP enabled device. If you select schedule the scheduling settings from below are applied. If you select once the scan is run only once on start of the application (container) or after you update your settings." + "string" : "Enable import of devices from a SNMP enabled device. If you select schedule the scheduling settings from below are applied. If you select once the scan is run only once on start of the application (container) or after you update your settings. ⚠ Use the same schedule if you have multiple Device scanners enabled." }, { "language_code":"es_es", diff --git a/front/plugins/unifi_import/config.json b/front/plugins/unifi_import/config.json index 21d5ba7d..b60fc7cf 100755 --- a/front/plugins/unifi_import/config.json +++ b/front/plugins/unifi_import/config.json @@ -479,7 +479,7 @@ "description": [ { "language_code": "en_us", - "string": "Enable import of devices from a UNIFI controller. If you select schedule the scheduling settings from below are applied. If you select once the scan is run only once on start of the application (container) or after you update your settings." + "string": "Enable import of devices from a UNIFI controller. If you select schedule the scheduling settings from below are applied. If you select once the scan is run only once on start of the application (container) or after you update your settings. ⚠ Use the same schedule if you have multiple Device scanners enabled." }, { "language_code": "es_es", diff --git a/front/settings.php b/front/settings.php index 4f26e9e0..0f126195 100755 --- a/front/settings.php +++ b/front/settings.php @@ -245,21 +245,11 @@ while ($row = $result -> fetchArray (SQLITE3_ASSOC)) { `) } - // Start constructing the main settings HTML - let pluginHtml = ` - - `; + let isIn = ' in '; // to open the active panel in AdminLTE - for (const group of settingGroups) { + for (const group of settingGroups) { // enabled / disabled icons enabledHtml = '' @@ -277,6 +267,18 @@ while ($row = $result -> fetchArray (SQLITE3_ASSOC)) { ` } + // Start constructing the main settings HTML + let pluginHtml = ` + + `; + headerHtml = `