diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml index 660f0420..2c75db1a 100755 --- a/.github/ISSUE_TEMPLATE/feature_request.yml +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -1,5 +1,5 @@ name: Feature Request -description: 'Suggest an idea for PiAlert' +description: 'Suggest an idea for NetAlertX' labels: ['Feature request➕'] body: - type: checkboxes diff --git a/.github/workflows/docker_dev.yml b/.github/workflows/docker_dev.yml index 295314c7..d5d19223 100755 --- a/.github/workflows/docker_dev.yml +++ b/.github/workflows/docker_dev.yml @@ -50,7 +50,6 @@ jobs: images: | jokobsk/pi.alert_dev jokobsk/netalertx-dev - jokobsk/netalertx # generate Docker tags based on the following events/attributes tags: | type=raw,value=latest @@ -89,5 +88,5 @@ jobs: tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} # # ⚠ disable cache if build is failing to download debian packages - # cache-from: type=registry,ref=ghcr.io/jokob-sk/pi.alert:buildcache - # cache-to: type=registry,ref=ghcr.io/jokob-sk/pi.alert:buildcache,mode=max + # cache-from: type=registry,ref=ghcr.io/jokob-sk/netalertx:buildcache + # cache-to: type=registry,ref=ghcr.io/jokob-sk/netalertx:buildcache,mode=max diff --git a/.github/workflows/docker_prod.yml b/.github/workflows/docker_prod.yml index cb9036d0..3a45c9c4 100755 --- a/.github/workflows/docker_prod.yml +++ b/.github/workflows/docker_prod.yml @@ -82,5 +82,5 @@ jobs: tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} # # ⚠ disable cache if build is failing to download debian packages - # cache-from: type=registry,ref=ghcr.io/jokob-sk/pi.alert:buildcache - # cache-to: type=registry,ref=ghcr.io/jokob-sk/pi.alert:buildcache,mode=max + # cache-from: type=registry,ref=ghcr.io/jokob-sk/netalertx:buildcache + # cache-to: type=registry,ref=ghcr.io/jokob-sk/netalertx:buildcache,mode=max diff --git a/README.md b/README.md index ba4ba353..20b8ec83 100755 --- a/README.md +++ b/README.md @@ -3,12 +3,12 @@ Get visibility of what's going on on your WIFI/LAN network. Schedule scans for devices, port changes and get alerts if unknown devices or changes are found. Write your own [Plugins](https://github.com/jokob-sk/NetAlertX/tree/main/front/plugins#readme) with auto-generated UI and in-build notification system. Build out and easily maintain your network source of truth (NSoT). [![GitHub Committed](https://img.shields.io/github/last-commit/jokob-sk/NetAlertX?color=40ba12&label=Committed&logo=GitHub&logoColor=fff)](https://github.com/jokob-sk/NetAlertX) -[![Docker Size](https://img.shields.io/docker/image-size/jokobsk/pi.alert?label=Size&logo=Docker&color=0aa8d2&logoColor=fff)](https://hub.docker.com/r/jokobsk/pi.alert) -[![Docker Pulls](https://img.shields.io/docker/pulls/jokobsk/pi.alert?label=Pulls&logo=docker&color=0aa8d2&logoColor=fff)](https://hub.docker.com/r/jokobsk/pi.alert) +[![Docker Size](https://img.shields.io/docker/image-size/jokobsk/netalertx?label=Size&logo=Docker&color=0aa8d2&logoColor=fff)](https://hub.docker.com/r/jokobsk/netalertx) +[![Docker Pulls](https://img.shields.io/docker/pulls/jokobsk/netalertx?label=Pulls&logo=docker&color=0aa8d2&logoColor=fff)](https://hub.docker.com/r/jokobsk/netalertx) [![GitHub Release](https://img.shields.io/github/v/release/jokob-sk/NetAlertX?color=0aa8d2&logoColor=fff&logo=GitHub)](https://github.com/jokob-sk/NetAlertX/releases) [![GitHub Sponsors](https://img.shields.io/github/sponsors/jokob-sk?style=social)](https://github.com/sponsors/jokob-sk) - | 🐳 [Docker hub](https://registry.hub.docker.com/r/jokobsk/pi.alert) | 📑 [Docker guide](https://github.com/jokob-sk/NetAlertX/blob/main/dockerfiles/README.md) |🆕 [Release notes](https://github.com/jokob-sk/NetAlertX/releases) | 📚 [All Docs](https://github.com/jokob-sk/NetAlertX/tree/main/docs) | + | 🐳 [Docker hub](https://registry.hub.docker.com/r/jokobsk/netalertx) | 📑 [Docker guide](https://github.com/jokob-sk/NetAlertX/blob/main/dockerfiles/README.md) |🆕 [Release notes](https://github.com/jokob-sk/NetAlertX/releases) | 📚 [All Docs](https://github.com/jokob-sk/NetAlertX/tree/main/docs) | |----------------------|----------------------| ----------------------| ----------------------| @@ -25,19 +25,19 @@ Get visibility of what's going on on your WIFI/LAN network. Schedule scans for d
- ❓ Why use PiAlert? + ❓ Why use Net Alertx?
Most of us don't know what's going on on our home network, but we want our family and data to be safe. _Command-line tools_ are great, but the output can be _hard to understand_ and action if you are not a network specialist. - PiAlert gives you peace of mind. _Visualize and immediately report 📬_ what is going on in your network - this is the first step to enhance your _network security 🔐_. + Net Alertx gives you peace of mind. _Visualize and immediately report 📬_ what is going on in your network - this is the first step to enhance your _network security 🔐_. - PiAlert combines several network and other scanning tools 🔍 with notifications 📧 into one user-friendly package 📦. + Net Alertx combines several network and other scanning tools 🔍 with notifications 📧 into one user-friendly package 📦. Set up a _kill switch ☠_ for your network via a smart plug with the available [Home Assistant](https://github.com/jokob-sk/NetAlertX/blob/main/docs/HOME_ASSISTANT.md) integration. Implement custom automations with the [CSV device Exports 📤](https://github.com/jokob-sk/NetAlertX/tree/main/front/plugins/csv_backup), [Webhooks](https://github.com/jokob-sk/NetAlertX/blob/main/docs/WEBHOOK_N8N.md), or [API endpoints](https://github.com/jokob-sk/NetAlertX/blob/main/docs/API.md) features. - Extend the app if you want to create your own scanner [Plugin](https://github.com/jokob-sk/NetAlertX/tree/main/front/plugins#readme) and handle the results and notifications in PiAlert. + Extend the app if you want to create your own scanner [Plugin](https://github.com/jokob-sk/NetAlertX/tree/main/front/plugins#readme) and handle the results and notifications in Net Alertx. Looking forward to your contributions if you decide to share your work with the community ❤. @@ -94,7 +94,7 @@ Thank you to all the wonderful people who are sponsoring this project (=preventi - Bitcoin: `1N8tupjeCK12qRVU2XrV17WvKK7LCawyZM` - Ethereum: `0x6e2749Cb42F4411bc98501406BdcD82244e3f9C7` - 📧 Email me at [jokob@duck.com](mailto:jokob@duck.com?subject=PiAlert) if you want to get in touch or if I should add other sponsorship platforms. + 📧 Email me at [jokob@duck.com](mailto:jokob@duck.com?subject=NetAlertX) if you want to get in touch or if I should add other sponsorship platforms.
@@ -106,8 +106,8 @@ This project would be nothing without the amazing work of the community, with sp Here is everyone that helped and contributed to this project: - - + + ## Everything else diff --git a/back/pialert-cli b/back/pialert-cli index 59a790ff..d7d2b720 100755 --- a/back/pialert-cli +++ b/back/pialert-cli @@ -1,7 +1,8 @@ #!/bin/bash SCRIPT=$(readlink -f $0) SCRIPTPATH=`dirname $SCRIPT` -PIA_CONF_FILE=${SCRIPTPATH}'/../config/pialert.conf' +CONFFILENAME="pialert.conf" +PIA_CONF_FILE=${SCRIPTPATH}'/../config/${CONFFILENAME}' case $1 in diff --git a/back/pialert.conf b/back/pialert.conf index d33e5daf..681da8cb 100755 --- a/back/pialert.conf +++ b/back/pialert.conf @@ -25,7 +25,7 @@ PIALERT_WEB_PROTECTION=False PIALERT_WEB_PASSWORD='8d969eef6ecad3c29a3a629280e686cf0c3f5d5a86aff3ca12020c923adc6c92' DAYS_TO_KEEP_EVENTS=90 # Used for generating links in emails. Make sure not to add a trailing slash! -REPORT_DASHBOARD_URL='http://pi.alert' +REPORT_DASHBOARD_URL='http://netalertx' # Email diff --git a/back/report_template.html b/back/report_template.html index ba96bce0..8a78b5f9 100755 --- a/back/report_template.html +++ b/back/report_template.html @@ -55,7 +55,7 @@ NetAlertX ()
©2020 Puche (2022+ - jokob-sk) | Built on: | Version: | + jokob-sk) | Built on: | Version: | Docs diff --git a/back/report_template_new_version.html b/back/report_template_new_version.html index 9a27417a..8576c3b9 100755 --- a/back/report_template_new_version.html +++ b/back/report_template_new_version.html @@ -59,7 +59,7 @@ NetAlertX ()
©2020 Puche (2022+ - jokob-sk) | Built on: | Version: | + jokob-sk) | Built on: | Version: | Docs diff --git a/docker-compose.yml b/docker-compose.yml index 8fc3b983..243c219c 100755 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -11,22 +11,22 @@ services: network_mode: host # restart: unless-stopped volumes: - # - ${APP_DATA_LOCATION}/pialert_dev/config:/home/pi/pialert/config - - ${APP_DATA_LOCATION}/pialert/config:/home/pi/pialert/config - # - ${APP_DATA_LOCATION}/pialert_dev/db:/home/pi/pialert/db - - ${APP_DATA_LOCATION}/pialert/db:/home/pi/pialert/db + # - ${APP_DATA_LOCATION}/netalertx_dev/config:/home/pi/pialert/config + - ${APP_DATA_LOCATION}/netalertx/config:/home/pi/pialert/config + # - ${APP_DATA_LOCATION}/netalertx_dev/db:/home/pi/pialert/db + - ${APP_DATA_LOCATION}/netalertx/db:/home/pi/pialert/db # (optional) useful for debugging if you have issues setting up the container # - ${LOGS_LOCATION}:/home/pi/pialert/front/log # --------------------------------------------------------------------------- # DELETE START anyone trying to use this file: comment out / delete BELOW lines, they are only for development purposes - - ${APP_DATA_LOCATION}/pialert/dhcp_samples/dhcp1.leases:/mnt/dhcp1.leases - - ${APP_DATA_LOCATION}/pialert/dhcp_samples/dhcp2.leases:/mnt/dhcp2.leases - - ${APP_DATA_LOCATION}/pialert/dhcp_samples/pihole_dhcp_full.leases:/etc/pihole/dhcp.leases - - ${APP_DATA_LOCATION}/pialert/dhcp_samples/pihole_dhcp_2.leases:/etc/pihole/dhcp2.leases + - ${APP_DATA_LOCATION}/netalertx/dhcp_samples/dhcp1.leases:/mnt/dhcp1.leases + - ${APP_DATA_LOCATION}/netalertx/dhcp_samples/dhcp2.leases:/mnt/dhcp2.leases + - ${APP_DATA_LOCATION}/netalertx/dhcp_samples/pihole_dhcp_full.leases:/etc/pihole/dhcp.leases + - ${APP_DATA_LOCATION}/netalertx/dhcp_samples/pihole_dhcp_2.leases:/etc/pihole/dhcp2.leases - ${APP_DATA_LOCATION}/pihole/etc-pihole/pihole-FTL.db:/etc/pihole/pihole-FTL.db - - ${DEV_LOCATION}/pialert:/home/pi/pialert/pialert + - ${DEV_LOCATION}/netalertx:/home/pi/pialert/netalertx - ${DEV_LOCATION}/dockerfiles:/home/pi/pialert/dockerfiles - - ${APP_DATA_LOCATION}/pialert/php.ini:/etc/php/8.2/fpm/php.ini + - ${APP_DATA_LOCATION}/netalertx/php.ini:/etc/php/8.2/fpm/php.ini - ${DEV_LOCATION}/install:/home/pi/pialert/install - ${DEV_LOCATION}/front/css:/home/pi/pialert/front/css - ${DEV_LOCATION}/back/update_vendors.sh:/home/pi/pialert/back/update_vendors.sh diff --git a/dockerfiles/README.md b/dockerfiles/README.md index a88fbe70..aa2b5a95 100755 --- a/dockerfiles/README.md +++ b/dockerfiles/README.md @@ -1,12 +1,12 @@ [![GitHub Committed](https://img.shields.io/github/last-commit/jokob-sk/NetAlertX?color=40ba12&label=Committed&logo=GitHub&logoColor=fff)](https://github.com/jokob-sk/NetAlertX) -[![Docker Size](https://img.shields.io/docker/image-size/jokobsk/pi.alert?label=Size&logo=Docker&color=0aa8d2&logoColor=fff)](https://hub.docker.com/r/jokobsk/pi.alert) -[![Docker Pulls](https://img.shields.io/docker/pulls/jokobsk/pi.alert?label=Pulls&logo=docker&color=0aa8d2&logoColor=fff)](https://hub.docker.com/r/jokobsk/pi.alert) +[![Docker Size](https://img.shields.io/docker/image-size/jokobsk/netalertx?label=Size&logo=Docker&color=0aa8d2&logoColor=fff)](https://hub.docker.com/r/jokobsk/netalertx) +[![Docker Pulls](https://img.shields.io/docker/pulls/jokobsk/netalertx?label=Pulls&logo=docker&color=0aa8d2&logoColor=fff)](https://hub.docker.com/r/jokobsk/netalertx) ![GitHub Release](https://img.shields.io/github/v/release/jokob-sk/NetAlertX?color=0aa8d2&logoColor=fff&logo=GitHub) [![GitHub Sponsors](https://img.shields.io/github/sponsors/jokob-sk?style=social)](https://github.com/sponsors/jokob-sk) -# PiAlert 💻🔍 Network security scanner & notification framework +# NetAlertX 💻🔍 Network security scanner & notification framework - | 🐳 [Docker hub](https://registry.hub.docker.com/r/jokobsk/pi.alert) | 📑 [Docker guide](https://github.com/jokob-sk/NetAlertX/blob/main/dockerfiles/README.md) |🆕 [Release notes](https://github.com/jokob-sk/NetAlertX/releases) | 📚 [All Docs](https://github.com/jokob-sk/NetAlertX/tree/main/docs) | + | 🐳 [Docker hub](https://registry.hub.docker.com/r/jokobsk/netalertx) | 📑 [Docker guide](https://github.com/jokob-sk/NetAlertX/blob/main/dockerfiles/README.md) |🆕 [Release notes](https://github.com/jokob-sk/NetAlertX/releases) | 📚 [All Docs](https://github.com/jokob-sk/NetAlertX/tree/main/docs) | |----------------------|----------------------| ----------------------| ----------------------| @@ -29,7 +29,7 @@ docker run -d --rm --network=host \ -v local/path/pialert/db:/home/pi/pialert/db \ -e TZ=Europe/Berlin \ -e PORT=20211 \ - jokobsk/pi.alert:latest + jokobsk/netalertx: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. @@ -40,7 +40,7 @@ docker run -d --rm --network=host \ | `PORT` |Port of the web interface | `20211` | | `LISTEN_ADDR` |Set the specific IP Address for the listener address for the nginx webserver (web interface). This could be useful when using multiple subnets to hide the web interface from all untrusted networks. | `0.0.0.0` | |`TZ` |Time zone to display stats correctly. Find your time zone [here](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) | `Europe/Berlin` | -|`ALWAYS_FRESH_INSTALL` | Setting `ALWAYS_FRESH_INSTALL=true` will delete the content of the `/db` & `/config` folders. For testing purposes. Can be coupled with [watchtower](https://github.com/containrrr/watchtower) to have an always freshly installed `pi.alert`/`_dev` image. | `N/A` | +|`ALWAYS_FRESH_INSTALL` | Setting `ALWAYS_FRESH_INSTALL=true` will delete the content of the `/db` & `/config` folders. For testing purposes. Can be coupled with [watchtower](https://github.com/containrrr/watchtower) to have an always freshly installed `netalertx`/`-dev` image. | `N/A` | ### Docker paths @@ -122,11 +122,11 @@ Use the official installation guides at first and use community content as suple ```yaml version: "3" services: - pialert: - container_name: pialert + netalertx: + container_name: netalertx # use the below line if you want to test the latest dev image - # image: "jokobsk/pi.alert_dev:latest" - image: "jokobsk/pi.alert:latest" + # image: "jokobsk/netalertx-dev:latest" + image: "jokobsk/netalertx:latest" network_mode: "host" restart: unless-stopped volumes: @@ -146,13 +146,13 @@ To run the container execute: `sudo docker-compose up -d` Example by [SeimuS](https://github.com/SeimusS). ```yaml - pialert: - container_name: PiAlert - hostname: PiAlert + netalertx: + container_name: NetAlertX + hostname: NetAlertX privileged: true # use the below line if you want to test the latest dev image - # image: "jokobsk/pi.alert_dev:latest" - image: jokobsk/pi.alert:latest + # image: "jokobsk/netalertx-dev:latest" + image: jokobsk/netalertx:latest environment: - TZ=Europe/Bratislava restart: always @@ -171,16 +171,16 @@ To run the container execute: `sudo docker-compose up -d` ```yaml version: "3" services: - pialert: - container_name: pialert + netalertx: + container_name: netalertx # use the below line if you want to test the latest dev image - # image: "jokobsk/pi.alert_dev:latest" - image: "jokobsk/pi.alert:latest" + # image: "jokobsk/netalertx-dev:latest" + image: "jokobsk/netalertx:latest" network_mode: "host" restart: unless-stopped volumes: - - ${APP_DATA_LOCATION}/pialert/config:/home/pi/pialert/config - - ${APP_DATA_LOCATION}/pialert/db/pialert.db:/home/pi/pialert/db/pialert.db + - ${APP_DATA_LOCATION}/netalertx/config:/home/pi/pialert/config + - ${APP_DATA_LOCATION}/netalertx/db/pialert.db:/home/pi/pialert/db/pialert.db # (optional) useful for debugging if you have issues setting up the container - ${LOGS_LOCATION}:/home/pi/pialert/front/log environment: @@ -214,10 +214,10 @@ To run the container execute: `sudo docker-compose --env-file /path/to/.env up` Courtesy of [pbek](https://github.com/pbek). The volume `pialert_db` is used by the db directory. The two config files are mounted directly from a local folder to their places in the config folder. You can backup the `docker-compose.yaml` folder and the docker volumes folder. ```yaml - pialert: + netalertx: # use the below line if you want to test the latest dev image - # image: "jokobsk/pi.alert_dev:latest" - image: jokobsk/pi.alert + # image: "jokobsk/netalertx-dev:latest" + image: jokobsk/netalertx ports: - "80:20211/tcp" environment: @@ -243,4 +243,4 @@ Big thanks to @Macleykun & for help a - Bitcoin: `1N8tupjeCK12qRVU2XrV17WvKK7LCawyZM` - Ethereum: `0x6e2749Cb42F4411bc98501406BdcD82244e3f9C7` -> 📧 Email me at [jokob@duck.com](mailto:jokob@duck.com?subject=PiAlert) if you want to get in touch or if I should add other sponsorship platforms. \ No newline at end of file +> 📧 Email me at [jokob@duck.com](mailto:jokob@duck.com?subject=NetAlertX) if you want to get in touch or if I should add other sponsorship platforms. \ No newline at end of file diff --git a/dockerfiles/README_ES.md b/dockerfiles/README_ES.md deleted file mode 100755 index ada31edf..00000000 --- a/dockerfiles/README_ES.md +++ /dev/null @@ -1,232 +0,0 @@ -[![Docker](https://img.shields.io/github/actions/workflow/status/jokob-sk/NetAlertX/docker_prod.yml?label=Build&logo=GitHub)](https://github.com/jokob-sk/NetAlertX/actions/workflows/docker_prod.yml) -[![GitHub Committed](https://img.shields.io/github/last-commit/jokob-sk/NetAlertX?color=40ba12&label=Committed&logo=GitHub&logoColor=fff)](https://github.com/jokob-sk/NetAlertX) -[![Docker Size](https://img.shields.io/docker/image-size/jokobsk/pi.alert?label=Tamaño&logo=Docker&color=0aa8d2&logoColor=fff)](https://hub.docker.com/r/jokobsk/pi.alert) -[![Docker Pulls](https://img.shields.io/docker/pulls/jokobsk/pi.alert?label=Pulls&logo=docker&color=0aa8d2&logoColor=fff)](https://hub.docker.com/r/jokobsk/pi.alert) -[![Docker Pushed](https://img.shields.io/badge/dynamic/json?color=0aa8d2&logoColor=fff&label=Pushed&query=last_updated&url=https%3A%2F%2Fhub.docker.com%2Fv2%2Frepositories%2Fjokobsk%2Fpi.alert%2F&logo=docker&link=http://left&link=https://hub.docker.com/repository/docker/jokobsk/pi.alert)](https://hub.docker.com/r/jokobsk/pi.alert) - -# 🐳 Una imagen docker para NetAlertX - -🐳 [Docker hub](https://registry.hub.docker.com/r/jokobsk/pi.alert) | 📑 [Instrucciones para Docker](https://github.com/jokob-sk/NetAlertX/blob/main/dockerfiles/README.md) | 🆕 [Release notes](https://github.com/jokob-sk/NetAlertX/releases) | 📚 [Todos los Docs](https://github.com/jokob-sk/NetAlertX/tree/main/docs) - - - - - - - - - -## 📕 Uso básico - -- Tendrás que ejecutar el contenedor en la red del host, por ejemplo: - -```yaml -docker run -d --rm --network=host \ - -v local/path/pialert/config:/home/pi/pialert/config \ - -v local/path/pialert/db:/home/pi/pialert/db \ - -e TZ=Europe/Berlin \ - -e PORT=20211 \ - jokobsk/pi.alert:latest - ``` -- El escaneo inicial puede tardar hasta 15 minutos (con 50 dispositivos y MQTT). Los siguientes pueden durar entre 3 y 5 minutos, así que espere a que se ejecuten todos los escaneos. - -### Variables de entorno Docker - -| Variable | Descripción | Predeterminado | -| :------------- |:-------------| -----:| -| `PORT` |Puerto de la interfaz web | `20211` | -|`TZ` |Zona horaria para mostrar correctamente las estadísticas. Encuentre su zona horaria [aquí](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) | `Europe/Berlin` | -|`HOST_USER_GID` |ID de usuario (UID) para asignar el usuario del contenedor a un usuario del servidor con suficientes permisos de lectura y escritura en los archivos asignados | `1000` | -|`HOST_USER_ID` |ID de grupo de usuarios (GID) para asignar el grupo de usuarios del contenedor a un grupo de usuarios del servidor con suficientes permisos de lectura y escritura en los archivos asignados | `1000` | - -### Rutas Docker - -| | Ruta | Descripción | -| :------------- | :------------- |:-------------| -| **Obligatorio** | `:/home/pi/pialert/config` | Carpeta que contendrá el archivo `pialert.conf` (para más detalles, véase más abajo) | -| **Obligatorio** | `:/home/pi/pialert/db` | Carpeta que contendrá el archivo `pialert.db` | -|Opcional| `:/home/pi/pialert/front/log` | Carpeta de registros útil para depurar si tiene problemas al configurar el contenedor | -|Opcional| `:/etc/pihole/pihole-FTL.db` | Archivo de base de datos `pihole-FTL.db` de PiHole. Necesario si desea utilizar PiHole | -|Opcional| `:/etc/pihole/dhcp.leases` | Archivo `dhcp.leases` de PiHole. Obligatorio si desea utilizar el archivo `dhcp.leases` de PiHole. Tiene que coincidir con la correspondiente entrada de configuración `DHCPLSS_paths_to_check`. (La ruta en el contenedor debe contener `pihole`)| -|Opcional| `:/home/pi/pialert/front/api` | Una simple [API endpoint](https://github.com/jokob-sk/NetAlertX/blob/main/docs/API.md) que contiene archivos json estáticos (pero actualizados regularmente) y otros archivos. | - - -### Configurar (`pialert.conf`) - -- Si no está disponible, la aplicación genera un archivo `pialert.conf` y `pialert.db` por defecto en la primera ejecución. -- La forma preferida es gestionar la configuración a través de la sección "Configuración" de la interfaz de usuario. -- Puede modificar [pialert.conf](https://github.com/jokob-sk/NetAlertX/tree/main/config) directamente, si es necesario. - -#### Ajustes importantes - -Estos son los ajustes más importantes para obtener al menos alguna salida en la pantalla de tus Dispositivos. Por lo general, sólo se utiliza un enfoque, pero usted debe ser capaz de combinar estos enfoques. - -##### Para arp-scan: ARPSCAN_RUN, SCAN_SUBNETS - -- ❗ Para usar el método arp-scan, necesitas configurar la variable `SCAN_SUBNETS`. Consulte la documentación sobre cómo [configurar SUBNETS, VLANs y limitaciones](https://github.com/jokob-sk/NetAlertX/blob/main/docs/SUBNETS.md) - -##### Para pihole: PIHOLE_RUN, DHCPLSS_RUN - -Hay dos maneras de importar dispositivos PiHole. A través del plugin de importación PiHole (PIHOLE) o del plugin DHCP leases (DHCPLSS). - -**PiHole (Sincronización de dispositivos)** - -* `PIHOLE_RUN`: Necesitas mapear `:/etc/pihole/pihole-FTL.db` en el fichero `docker-compose.yml` si activas esta opción. - -**DHCP Leases (Importación de dispositivos)** - -* `DHCPLSS_RUN`: Es necesario mapear `:/etc/pihole/dhcp.leases` en el fichero `docker-compose.yml` si se activa esta opción. -* La configuración anterior tiene que coincidir con una entrada de configuración correspondiente `DHCPLSS_paths_to_check` (la ruta en el contenedor debe contener `pihole` ya que PiHole utiliza un formato diferente del archivo `dhcp.leases`). - -> Se recomienda utilizar el mismo intervalo de programación para todos los plugins responsables de descubrir nuevos dispositivos. - -### **Problemas comunes** - -💡 Antes de crear una nueva incidencia, comprueba si ya se ha resuelto una [incidencia similar](https://github.com/jokob-sk/NetAlertX/issues?q=is%3Aissue+is%3Aclosed). - -⚠ Compruebe también los problemas comunes y los [consejos de depuración](https://github.com/jokob-sk/NetAlertX/blob/main/docs/DEBUG_TIPS.md). - -## 📄 Ejemplos - -### Ejemplo 1 - -```yaml -version: "3" -services: - pialert: - container_name: pialert - # Utilice la siguiente línea si desea probar la última imagen de desarrollo - # image: "jokobsk/pi.alert_dev:latest" - image: "jokobsk/pi.alert:latest" - network_mode: "host" - restart: unless-stopped - volumes: - - local/path/pialert/config:/home/pi/pialert/config - - local/path/pialert/db:/home/pi/pialert/db - # (optional) useful for debugging if you have issues setting up the container - - local/path/logs:/home/pi/pialert/front/log - environment: - - TZ=Europe/Berlin - - HOST_USER_ID=1000 - - HOST_USER_GID=1000 - - PORT=20211 -``` - -Para ejecutar el contenedor ejecute: `sudo docker-compose up -d` - -### Ejemplo 2 - -Ejemplo de [SeimuS](https://github.com/SeimusS). - -```yaml - pialert: - container_name: PiAlert - hostname: PiAlert - privileged: true - # Utilice la siguiente línea si desea probar la última imagen de desarrollo - # image: "jokobsk/pi.alert_dev:latest" - image: jokobsk/pi.alert:latest - environment: - - TZ=Europe/Bratislava - restart: always - volumes: - - ./pialert/pialert_db:/home/pi/pialert/db - - ./pialert/pialert_config:/home/pi/pialert/config - network_mode: host -``` - -Para ejecutar el contenedor ejecute: `sudo docker-compose up -d` - -### Ejemplo 3 - -`docker-compose.yml` - -```yaml -version: "3" -services: - pialert: - container_name: pialert - # Utilice la siguiente línea si desea probar la última imagen de desarrollo - # image: "jokobsk/pi.alert_dev:latest" - image: "jokobsk/pi.alert:latest" - network_mode: "host" - restart: unless-stopped - volumes: - - ${APP_DATA_LOCATION}/pialert/config:/home/pi/pialert/config - - ${APP_DATA_LOCATION}/pialert/db/pialert.db:/home/pi/pialert/db/pialert.db - # (optional) useful for debugging if you have issues setting up the container - - ${LOGS_LOCATION}:/home/pi/pialert/front/log - environment: - - TZ=${TZ} - - HOST_USER_ID=${HOST_USER_ID} - - HOST_USER_GID=${HOST_USER_GID} - - PORT=${PORT} -``` - -`.env` file - -```yaml -#VARIABLES DE RUTA GLOBAL - -APP_DATA_LOCATION=/path/to/docker_appdata -APP_CONFIG_LOCATION=/path/to/docker_config -LOGS_LOCATION=/path/to/docker_logs - -#VARIABLES DE ENTORNO - -TZ=Europe/Paris -HOST_USER_ID=1000 -HOST_USER_GID=1000 -PORT=20211 - -#VARIABLES DE DESARROLLO - -DEV_LOCATION=/path/to/local/source/code -``` - -Para ejecutar el contenedor ejecute: `sudo docker-compose --env-file /path/to/.env up` - -### Example 4 - -Por cortesía de [pbek](https://github.com/pbek). El volumen `pialert_db` es utilizado por el directorio db. Los dos archivos de configuración se montan directamente desde una carpeta local a sus lugares en la carpeta config. Puedes hacer una copia de seguridad de la carpeta `docker-compose.yaml` y de la carpeta docker volumes. - - -```yaml - pialert: - # Utilice la siguiente línea si desea probar la última imagen de desarrollo - # image: "jokobsk/pi.alert_dev:latest" - image: jokobsk/pi.alert - ports: - - "80:20211/tcp" - environment: - - TZ=Europe/Vienna - networks: - local: - ipv4_address: 192.168.1.2 - restart: unless-stopped - volumes: - - pialert_db:/home/pi/pialert/db - - ./pialert/pialert.conf:/home/pi/pialert/config/pialert.conf -``` - -## 🏅 Reconocimientos - -Muchas gracias a @Macleykun por ayudarme en consejos y trucos para Dockerfile(s): - - - - - -Muchas gracias a @cvc90 por ayudarme y realizar esta traduccion: - - - - - -## ☕ Apóyame - -Sponsor Me on GitHub -Buy Me A Coffee -Support me on patreon - -BTC: 1N8tupjeCK12qRVU2XrV17WvKK7LCawyZM diff --git a/dockerfiles/pre-setup.sh b/dockerfiles/pre-setup.sh index 092271a0..0f815dd8 100755 --- a/dockerfiles/pre-setup.sh +++ b/dockerfiles/pre-setup.sh @@ -31,7 +31,7 @@ echo -e '#!/bin/execlineb -P [INSTALL] 🚀 Starting app (:${PORT}) " }' > /etc/s6-overlay/s6-rc.d/pialert/run -echo -e "python ${INSTALL_DIR}/pialert/pialert" >> /etc/s6-overlay/s6-rc.d/pialert/run +echo -e "python ${INSTALL_DIR}/pialert/netalertx" >> /etc/s6-overlay/s6-rc.d/pialert/run touch /etc/s6-overlay/s6-rc.d/user/contents.d/{SetupOneshot,php-fpm,nginx} /etc/s6-overlay/s6-rc.d/{php-fpm,nginx}/dependencies.d/SetupOneshot touch /etc/s6-overlay/s6-rc.d/user/contents.d/{SetupOneshot,php-fpm,nginx,pialert} /etc/s6-overlay/s6-rc.d/{php-fpm,nginx,pialert}/dependencies.d/SetupOneshot touch /etc/s6-overlay/s6-rc.d/nginx/dependencies.d/php-fpm diff --git a/dockerfiles/setup.sh b/dockerfiles/setup.sh index d2978898..c92ed48d 100755 --- a/dockerfiles/setup.sh +++ b/dockerfiles/setup.sh @@ -7,9 +7,12 @@ echo "---------------------------------------------------------" export INSTALL_DIR=/home/pi # Specify the installation directory here # DO NOT CHANGE ANYTHING BELOW THIS LINE! -NGINX_CONFIG_FILE=/etc/nginx/http.d/pialert.conf +CONFFILENAME="pialert.conf" +NGINX_CONFIG_FILE="/etc/nginx/http.d/${CONFFILENAME}" +DBFILENAME="pialert.db" OUI_FILE="/usr/share/arp-scan/ieee-oui.txt" # Define the path to ieee-oui.txt and ieee-iab.txt -FILEDB="${INSTALL_DIR}/pialert/db/pialert.db" +FILEDB="${INSTALL_DIR}/pialert/db/${DBFILENAME}" + # DO NOT CHANGE ANYTHING ABOVE THIS LINE! # Check if script is run as root @@ -18,7 +21,7 @@ if [[ $EUID -ne 0 ]]; then exit 1 fi -echo "[INSTALL] Copy starter pialert.db and pialert.conf if they don't exist" +echo "[INSTALL] Copy starter ${DBFILENAME} and ${CONFFILENAME} if they don't exist" # DANGER ZONE: ALWAYS_FRESH_INSTALL if [ "$ALWAYS_FRESH_INSTALL" = true ]; then @@ -30,13 +33,13 @@ if [ "$ALWAYS_FRESH_INSTALL" = true ]; then rm -rf "$INSTALL_DIR/pialert/db/"* fi -# Copy starter pialert.db and pialert.conf if they don't exist -cp -na "${INSTALL_DIR}/pialert/back/pialert.conf" "${INSTALL_DIR}/pialert/config/pialert.conf" -cp -na "${INSTALL_DIR}/pialert/back/pialert.db" "${FILEDB}" +# Copy starter .db and .conf if they don't exist +cp -na "${INSTALL_DIR}/pialert/back/${CONFFILENAME}" "${INSTALL_DIR}/pialert/config/${CONFFILENAME}" +cp -na "${INSTALL_DIR}/pialert/back/${DBFILENAME}" "${FILEDB}" # if custom variables not set we do not need to do anything if [ -n "${TZ}" ]; then - FILECONF="${INSTALL_DIR}/pialert/config/pialert.conf" + FILECONF="${INSTALL_DIR}/pialert/config/${CONFFILENAME}" echo "[INSTALL] Setup timezone" sed -i "\#^TIMEZONE=#c\TIMEZONE='${TZ}'" "${FILECONF}" @@ -47,7 +50,7 @@ fi echo "[INSTALL] Setup NGINX" echo "Setting webserver to address ($LISTEN_ADDR) and port ($PORT)" -envsubst '$INSTALL_DIR $LISTEN_ADDR $PORT' < "${INSTALL_DIR}/pialert/install/pialert.template.conf" > "${NGINX_CONFIG_FILE}" +envsubst '$INSTALL_DIR $LISTEN_ADDR $PORT' < "${INSTALL_DIR}/pialert/install/netalertx.template.conf" > "${NGINX_CONFIG_FILE}" # Run the hardware vendors update at least once echo "[INSTALL] Run the hardware vendors update" diff --git a/docs/API.md b/docs/API.md index b98b7558..7a3718b9 100755 --- a/docs/API.md +++ b/docs/API.md @@ -1,6 +1,6 @@ ## API endpoints -PiAlert comes with a simple API. These API endpoints are static files, that are periodically updated based on your settings. +NetAlertX comes with a simple API. These API endpoints are static files, that are periodically updated based on your settings. ### When are the endpoints updated @@ -9,7 +9,7 @@ The endpoints are updated when objects in the API endpoints are changed. ### Location of the endpoints -In the container, these files are located under the `/home/pi/pialert/front/api/` folder and thus on the `/api/` url. +In the container, these files are located under the `/home/pi/pialert/front/api/` folder and thus on the `/api/` url. ### Available endpoints diff --git a/docs/DEBUG_INVALID_JSON.md b/docs/DEBUG_INVALID_JSON.md index 990bac4f..785609ff 100755 --- a/docs/DEBUG_INVALID_JSON.md +++ b/docs/DEBUG_INVALID_JSON.md @@ -8,9 +8,9 @@ Check the the HTTP response of the failing backend call by following these steps ![F12DeveloperConsole][F12DeveloperConsole] - Copy the URL causing the error and enter it in the address bar of your browser directly and hit enter. The copied URLs could look something like this (notice the query strings at the end): - - `http://:20211/api/table_devices.json?nocache=1704141103121` - - `http://:20211/php/server/devices.php?action=getDevicesTotals` - - `http://:20211/php/server/devices.php?action=getDevicesList&status=all` + - `http://:20211/api/table_devices.json?nocache=1704141103121` + - `http://:20211/php/server/devices.php?action=getDevicesTotals` + - `http://:20211/php/server/devices.php?action=getDevicesList&status=all` - Post the error response in the existing issue thread on GitHub or create a new issue and include the redacted response of the failing query. diff --git a/docs/DEBUG_TIPS.md b/docs/DEBUG_TIPS.md index 6882387f..f2712862 100755 --- a/docs/DEBUG_TIPS.md +++ b/docs/DEBUG_TIPS.md @@ -19,7 +19,7 @@ docker run --rm --network=host \ -v local/path/pialert/db:/home/pi/pialert/db \ -e TZ=Europe/Berlin \ -e PORT=20211 \ - jokobsk/pi.alert:latest + jokobsk/netalertx:latest ``` @@ -29,7 +29,7 @@ docker run --rm --network=host \ If possible, check if your issue got fixed in the `_dev` image before opening a new issue. The container is: -`jokobsk/pi.alert_dev:latest` +`jokobsk/netalertx-dev:latest` > ⚠ Please backup your DB and config beforehand! @@ -54,7 +54,7 @@ services: ### Permissions * If facing issues (AJAX errors, can't write to DB, empty screen, etc,) make sure permissions are set correctly, and check the logs under `/home/pi/pialert/front/log`. -* To solve permission issues you can try setting the owner and group of the `pialert.db` by executing the following on the host system: `docker exec pialert chown -R www-data:www-data /home/pi/pialert/db/pialert.db`. +* To solve permission issues you can try setting the owner and group of the `pialert.db` by executing the following on the host system: `docker exec netalertx chown -R www-data:www-data /home/pi/pialert/db/pialert.db`. * If still facing issues, try to map the pialert.db file (⚠ not folder) to `:/home/pi/pialert/db/pialert.db` (see [docker-compose Examples](https://github.com/jokob-sk/NetAlertX/blob/main/dockerfiles/README.md#-docker-composeyml-examples) for details) ### Container restarts / crashes diff --git a/docs/DEVICES_BULK_EDITING.md b/docs/DEVICES_BULK_EDITING.md index dfd3bcd4..b64c350a 100755 --- a/docs/DEVICES_BULK_EDITING.md +++ b/docs/DEVICES_BULK_EDITING.md @@ -20,7 +20,7 @@ You can select devices in the _Devices_ view by selecting devices to edit and th ![Maintenance > CSV Export](/docs/img/DEVICES_BULK_EDITING/MAINTENANCE_CSV_EXPORT.png) > [!NOTE] -> The file containing a list of Devices including the Network relationships between Network Nodes and connected devices. You can also trigger this by acessing this URL: `/php/server/devices.php?action=ExportCSV` or via the `CSV Backup` plugin. (💡 You can schedule this) +> The file containing a list of Devices including the Network relationships between Network Nodes and connected devices. You can also trigger this by acessing this URL: `/php/server/devices.php?action=ExportCSV` or via the `CSV Backup` plugin. (💡 You can schedule this) ![Settings > CSV Backup](/docs/img/DEVICES_BULK_EDITING/CSV_BACKUP_SETTINGS.png) diff --git a/docs/FRONTEND_DEVELOPMENT.md b/docs/FRONTEND_DEVELOPMENT.md index a88aa71d..92125b1c 100755 --- a/docs/FRONTEND_DEVELOPMENT.md +++ b/docs/FRONTEND_DEVELOPMENT.md @@ -43,4 +43,4 @@ Some useful frontend JavaScript functions: - `getSetting(string stringKey)` - method to retrieve settings in the frontend -Check the [pialert_common.js](https://github.com/jokob-sk/NetAlertX/blob/main-2023-06-10/front/js/pialert_common.js) file for more frontend functions. \ No newline at end of file +Check the [common.js](https://github.com/jokob-sk/NetAlertX/blob/main-2023-06-10/front/js/common.js) file for more frontend functions. \ No newline at end of file diff --git a/docs/HOME_ASSISTANT.md b/docs/HOME_ASSISTANT.md index 46769b96..44c83182 100755 --- a/docs/HOME_ASSISTANT.md +++ b/docs/HOME_ASSISTANT.md @@ -1,6 +1,6 @@ # Overview -PiAlert comes with MQTT support, allowing you to show all detected devices as devices in Home Assistant. It also supplies a collection of stats, such as number of online devices. +NetAlertX comes with MQTT support, allowing you to show all detected devices as devices in Home Assistant. It also supplies a collection of stats, such as number of online devices. ## ⚠ Note @@ -16,13 +16,13 @@ PiAlert comes with MQTT support, allowing you to show all detected devices as de 2. Configure a user name and password on your broker. -3. Note down the following details that you will need to configure PiAlert: +3. Note down the following details that you will need to configure NetAlertX: - MQTT host url (usually your Home Assistant IP) - MQTT broker port - User - Password -4. Open the _PiAlert_ > _Settings_ > _MQTT_ settings group +4. Open the _NetAlertX_ > _Settings_ > _MQTT_ settings group - Enable MQTT - Fill in the details from above - Fill in remaining settings as per description diff --git a/docs/HW_INSTALL.md b/docs/HW_INSTALL.md index da48e75a..b973981c 100755 --- a/docs/HW_INSTALL.md +++ b/docs/HW_INSTALL.md @@ -1,12 +1,12 @@ -# How to install PiAlert on the server hardware +# How to install NetAlertX on the server hardware -To download and install PiAlert on the hardware/server directly use the `curl` or `wget` commands at the bottom of this page. +To download and install NetAlertX on the hardware/server directly use the `curl` or `wget` commands at the bottom of this page. > [!NOTE] > This is an Experimental feature 🧪 and it relies on community support. > > There is no guarantee that the install script or any other script will gracefully handle other installed software. -> Data loss is a possibility, **it is recommended to install PiAlert using the supplied Docker image**. +> Data loss is a possibility, **it is recommended to install NetAlertX using the supplied Docker image**. A warning to the installation method below: Piping to bash is [controversial](https://pi-hole.net/2016/07/25/curling-and-piping-to-bash) and may be dangerous, as you cannot see the code that's about to be executed on your system. @@ -14,7 +14,7 @@ be dangerous, as you cannot see the code that's about to be executed on your sys Alternatively you can download the installation script `install/install.debian.sh` from the repository and check the code yourself (beware other scripts are downloaded too - only from this repo). -PiAlert will be installed in `home/pi/pialert/` and run on port number `20211`. +NetAlertX will be installed in `home/pi/pialert/` and run on port number `20211`. Some facts about what and where something will be changed/installed by the HW install setup (may not contain everything!): @@ -22,15 +22,15 @@ Some facts about what and where something will be changed/installed by the HW in - `/home/pi/pialert` will contain the whole repository (downloaded by `install/install.debian.sh`) - The default NGINX site `/etc/nginx/sites-enabled/default` will be disabled (sym-link deleted or backed up to `sites-available`) - `/var/www/html/pialert` directory will be deleted and newly created -- `/etc/nginx/conf.d/pialert.conf` will be sym-linked to `/home/pi/pialert/install/pialert.debian.conf` +- `/etc/nginx/conf.d/pialert.conf` will be sym-linked to `/home/pi/pialert/install/netalertx.debian.conf` - Some files (IEEE device vendors info, ...) will be created in the directory where the installation script is executed ## Limitations -- No system service is provided. PiAlert must be started using `/home/pi/pialert/install/start.debian.sh`. +- No system service is provided. NetAlertX must be started using `/home/pi/pialert/install/start.debian.sh`. - No checks for other running software is done. - Only tested to work on Debian Bookworm (Debian 12). -- **EXPERIMENTAL** and not recommended way to install PiAlert. +- **EXPERIMENTAL** and not recommended way to install NetAlertX. ## 📥 Installation via CURL diff --git a/docs/README.md b/docs/README.md index 5ff3df4e..2e7b058f 100755 --- a/docs/README.md +++ b/docs/README.md @@ -63,7 +63,7 @@ There is also an in-app Help / FAQ section that should be answering frequently a #### 👩‍💻For Developers👨‍💻 -- [APP code structure](/pialert/README.md) +- [APP code structure](/netalertx/README.md) - [Database structure](/docs/DATABASE.md) - [API endpoints details](/docs/API.md) - [Plugin system details and how to develop your own](/front/plugins/README.md) @@ -83,7 +83,7 @@ Priorities from highest to lowest: * 🔵 Refactoring enabling faster implementation of future functionality * 🔽 (low) UI functionality & improvements (PRs welcome 😉) -Design philosophy: Focus on core functionality and leverage existing apps and tools to make PiAlert integrate into other workflows. +Design philosophy: Focus on core functionality and leverage existing apps and tools to make NetAlertX integrate into other workflows. Examples: diff --git a/docs/REVERSE_DNS.md b/docs/REVERSE_DNS.md index eb3e2010..d7bc1aad 100755 --- a/docs/REVERSE_DNS.md +++ b/docs/REVERSE_DNS.md @@ -1,6 +1,6 @@ ## Setting up better name discovery with Reverse DNS -If you are running a DNS server, such as **AdGuard**, set up **Private reverse DNS servers** for a better name resolution on your network. Enabling this setting will enable PiAlert to execute dig and nslookup commands to automatically resolve device names based on their IP addresses. +If you are running a DNS server, such as **AdGuard**, set up **Private reverse DNS servers** for a better name resolution on your network. Enabling this setting will enable NetAlertX to execute dig and nslookup commands to automatically resolve device names based on their IP addresses. > Example 1: Reverse DNS `disabled` @@ -36,9 +36,9 @@ You can configure a custom **/etc/resolv.conf** file in **docker-compose.yml** a ```yaml version: "3" services: - pialert: - container_name: pialert - image: "jokobsk/pi.alert:latest" + netalertx: + container_name: netalertx + image: "jokobsk/netalertx:latest" restart: unless-stopped volumes: - ./config/pialert.conf:/home/pi/pialert/config/pialert.conf diff --git a/docs/REVERSE_PROXY.md b/docs/REVERSE_PROXY.md index 674ab469..1233cbe6 100755 --- a/docs/REVERSE_PROXY.md +++ b/docs/REVERSE_PROXY.md @@ -4,18 +4,18 @@ > [!NOTE] -> There are 2 NGINX files for PiAlert, one for the bare-metal Debian install (`pialert.debian.conf`), and one for the docker container (`pialert.template.conf`). Both can be found in the [install](https://github.com/jokob-sk/NetAlertX/tree/main/install) folder. Map, or use, the one appropriate for your setup. +> There are 2 NGINX files for NetAlertX, one for the bare-metal Debian install (`netalertx.debian.conf`), and one for the docker container (`netalertx.template.conf`). Both can be found in the [install](https://github.com/jokob-sk/NetAlertX/tree/main/install) folder. Map, or use, the one appropriate for your setup. ## NGINX HTTP Configuration (Direct Path) -1. On your NGINX server, create a new file called /etc/nginx/sites-available/pialert +1. On your NGINX server, create a new file called /etc/nginx/sites-available/netalertx 2. In this file, paste the following code: ``` server { listen 80; - server_name pi.alert; + server_name netalertx; proxy_preserve_host on; proxy_pass http://localhost:20211/; proxy_pass_reverse http://localhost:20211/; @@ -26,26 +26,26 @@ `nginx -s reload` or `systemctl restart nginx` -4. Once NGINX restarts, you should be able to access the proxy website at http://pi.alert/ +4. Once NGINX restarts, you should be able to access the proxy website at http://netalertx/
## NGINX HTTP Configuration (Sub Path) -1. On your NGINX server, create a new file called /etc/nginx/sites-available/pialert +1. On your NGINX server, create a new file called /etc/nginx/sites-available/netalertx 2. In this file, paste the following code: ``` server { listen 80; - server_name pi.alert; + server_name netalertx; proxy_preserve_host on; - location ^~ /pi.alert/ { + location ^~ /netalertx/ { proxy_pass http://localhost:20211/; proxy_pass_reverse http://localhost:20211/; - proxy_redirect ~^/(.*)$ /pi.alert/$1; - rewrite ^/pi.alert/?(.*)$ /$1 break; + proxy_redirect ~^/(.*)$ /netalertx/$1; + rewrite ^/netalertx/?(.*)$ /$1 break; } } ``` @@ -54,34 +54,34 @@ `nginx -s reload` or `systemctl restart nginx` -4. Once NGINX restarts, you should be able to access the proxy website at http://pi.alert/pi.alert/ +4. Once NGINX restarts, you should be able to access the proxy website at http://netalertx/netalertx/
## NGINX HTTP Configuration (Sub Path) with module ngx_http_sub_module -1. On your NGINX server, create a new file called /etc/nginx/sites-available/pialert +1. On your NGINX server, create a new file called /etc/nginx/sites-available/netalertx 2. In this file, paste the following code: ``` server { listen 80; - server_name pi.alert; + server_name netalertx; proxy_preserve_host on; - location ^~ /pi.alert/ { + location ^~ /netalertx/ { proxy_pass http://localhost:20211/; proxy_pass_reverse http://localhost:20211/; - proxy_redirect ~^/(.*)$ /pi.alert/$1; - rewrite ^/pi.alert/?(.*)$ /$1 break; + proxy_redirect ~^/(.*)$ /netalertx/$1; + rewrite ^/netalertx/?(.*)$ /$1 break; sub_filter_once off; sub_filter_types *; - sub_filter 'href="/' 'href="/pi.alert/'; - sub_filter '(?>$host)/css' '/pi.alert/css'; - sub_filter '(?>$host)/js' '/pi.alert/js'; - sub_filter '/img' '/pi.alert/img'; - sub_filter '/lib' '/pi.alert/lib'; - sub_filter '/php' '/pi.alert/php'; + sub_filter 'href="/' 'href="/netalertx/'; + sub_filter '(?>$host)/css' '/netalertx/css'; + sub_filter '(?>$host)/js' '/netalertx/js'; + sub_filter '/img' '/netalertx/img'; + sub_filter '/lib' '/netalertx/lib'; + sub_filter '/php' '/netalertx/php'; } } ``` @@ -90,23 +90,23 @@ `nginx -s reload` or `systemctl restart nginx` -4. Once NGINX restarts, you should be able to access the proxy website at http://pi.alert/pi.alert/ +4. Once NGINX restarts, you should be able to access the proxy website at http://netalertx/netalertx/
**NGINX HTTPS Configuration (Direct Path)** -1. On your NGINX server, create a new file called /etc/nginx/sites-available/pialert +1. On your NGINX server, create a new file called /etc/nginx/sites-available/netalertx 2. In this file, paste the following code: ``` server { listen 443; - server_name pi.alert; + server_name netalertx; SSLEngine On; - SSLCertificateFile /etc/ssl/certs/pi.alert.pem; - SSLCertificateKeyFile /etc/ssl/private/pi.alert.key; + SSLCertificateFile /etc/ssl/certs/netalertx.pem; + SSLCertificateKeyFile /etc/ssl/private/netalertx.key; proxy_preserve_host on; proxy_pass http://localhost:20211/; proxy_pass_reverse http://localhost:20211/; @@ -117,28 +117,28 @@ `nginx -s reload` or `systemctl restart nginx` -4. Once NGINX restarts, you should be able to access the proxy website at https://pi.alert/ +4. Once NGINX restarts, you should be able to access the proxy website at https://netalertx/
**NGINX HTTPS Configuration (Sub Path)** -1. On your NGINX server, create a new file called /etc/nginx/sites-available/pialert +1. On your NGINX server, create a new file called /etc/nginx/sites-available/netalertx 2. In this file, paste the following code: ``` server { listen 443; - server_name pi.alert; + server_name netalertx; SSLEngine On; - SSLCertificateFile /etc/ssl/certs/pi.alert.pem; - SSLCertificateKeyFile /etc/ssl/private/pi.alert.key; - location ^~ /pi.alert/ { + SSLCertificateFile /etc/ssl/certs/netalertx.pem; + SSLCertificateKeyFile /etc/ssl/private/netalertx.key; + location ^~ /netalertx/ { proxy_pass http://localhost:20211/; proxy_pass_reverse http://localhost:20211/; - proxy_redirect ~^/(.*)$ /pi.alert/$1; - rewrite ^/pi.alert/?(.*)$ /$1 break; + proxy_redirect ~^/(.*)$ /netalertx/$1; + rewrite ^/netalertx/?(.*)$ /$1 break; } } ``` @@ -147,36 +147,36 @@ `nginx -s reload` or `systemctl restart nginx` -4. Once NGINX restarts, you should be able to access the proxy website at https://pi.alert/pi.alert/ +4. Once NGINX restarts, you should be able to access the proxy website at https://netalertx/netalertx/
## NGINX HTTPS Configuration (Sub Path) with module ngx_http_sub_module -1. On your NGINX server, create a new file called /etc/nginx/sites-available/pialert +1. On your NGINX server, create a new file called /etc/nginx/sites-available/netalertx 2. In this file, paste the following code: ``` server { listen 443; - server_name pi.alert; + server_name netalertx; SSLEngine On; - SSLCertificateFile /etc/ssl/certs/pi.alert.pem; - SSLCertificateKeyFile /etc/ssl/private/pi.alert.key; - location ^~ /pi.alert/ { + SSLCertificateFile /etc/ssl/certs/netalertx.pem; + SSLCertificateKeyFile /etc/ssl/private/netalertx.key; + location ^~ /netalertx/ { proxy_pass http://localhost:20211/; proxy_pass_reverse http://localhost:20211/; - proxy_redirect ~^/(.*)$ /pi.alert/$1; - rewrite ^/pi.alert/?(.*)$ /$1 break; + proxy_redirect ~^/(.*)$ /netalertx/$1; + rewrite ^/netalertx/?(.*)$ /$1 break; sub_filter_once off; sub_filter_types *; - sub_filter 'href="/' 'href="/pi.alert/'; - sub_filter '(?>$host)/css' '/pi.alert/css'; - sub_filter '(?>$host)/js' '/pi.alert/js'; - sub_filter '/img' '/pi.alert/img'; - sub_filter '/lib' '/pi.alert/lib'; - sub_filter '/php' '/pi.alert/php'; + sub_filter 'href="/' 'href="/netalertx/'; + sub_filter '(?>$host)/css' '/netalertx/css'; + sub_filter '(?>$host)/js' '/netalertx/js'; + sub_filter '/img' '/netalertx/img'; + sub_filter '/lib' '/netalertx/lib'; + sub_filter '/php' '/netalertx/php'; } } ``` @@ -185,19 +185,19 @@ `nginx -s reload` or `systemctl restart nginx` -4. Once NGINX restarts, you should be able to access the proxy website at https://pi.alert/pi.alert/ +4. Once NGINX restarts, you should be able to access the proxy website at https://netalertx/netalertx/
## Apache HTTP Configuration (Direct Path) -1. On your Apache server, create a new file called /etc/apache2/sites-available/pialert.conf. +1. On your Apache server, create a new file called /etc/apache2/sites-available/netalertx.conf. 2. In this file, paste the following code: ``` - ServerName pi.alert + ServerName netalertx ProxyPreserveHost On ProxyPass / http://localhost:20211/ ProxyPassReverse / http://localhost:20211/ @@ -206,22 +206,22 @@ 3. Activate the new website by running the following command: - `a2ensite pialert` or `service apache2 reload` + `a2ensite netalertx` or `service apache2 reload` -4. Once Apache restarts, you should be able to access the proxy website at http://pi.alert/ +4. Once Apache restarts, you should be able to access the proxy website at http://netalertx/
## Apache HTTP Configuration (Sub Path) -1. On your Apache server, create a new file called /etc/apache2/sites-available/pialert.conf. +1. On your Apache server, create a new file called /etc/apache2/sites-available/netalertx.conf. 2. In this file, paste the following code: ``` - ServerName pi.alert - location ^~ /pi.alert/ { + ServerName netalertx + location ^~ /netalertx/ { ProxyPreserveHost On ProxyPass / http://localhost:20211/ ProxyPassReverse / http://localhost:20211/ @@ -231,24 +231,24 @@ 3. Activate the new website by running the following command: - `a2ensite pialert` or `service apache2 reload` + `a2ensite netalertx` or `service apache2 reload` -4. Once Apache restarts, you should be able to access the proxy website at http://pi.alert/ +4. Once Apache restarts, you should be able to access the proxy website at http://netalertx/
## Apache HTTPS Configuration (Direct Path) -1. On your Apache server, create a new file called /etc/apache2/sites-available/pialert.conf. +1. On your Apache server, create a new file called /etc/apache2/sites-available/netalertx.conf. 2. In this file, paste the following code: ``` - ServerName pi.alert + ServerName netalertx SSLEngine On - SSLCertificateFile /etc/ssl/certs/pi.alert.pem - SSLCertificateKeyFile /etc/ssl/private/pi.alert.key + SSLCertificateFile /etc/ssl/certs/netalertx.pem + SSLCertificateKeyFile /etc/ssl/private/netalertx.key ProxyPreserveHost On ProxyPass / http://localhost:20211/ ProxyPassReverse / http://localhost:20211/ @@ -257,25 +257,25 @@ 3. Activate the new website by running the following command: - `a2ensite pialert` or `service apache2 reload` + `a2ensite netalertx` or `service apache2 reload` -4. Once Apache restarts, you should be able to access the proxy website at https://pi.alert/ +4. Once Apache restarts, you should be able to access the proxy website at https://netalertx/
## Apache HTTPS Configuration (Sub Path) -1. On your Apache server, create a new file called /etc/apache2/sites-available/pialert.conf. +1. On your Apache server, create a new file called /etc/apache2/sites-available/netalertx.conf. 2. In this file, paste the following code: ``` - ServerName pi.alert + ServerName netalertx SSLEngine On - SSLCertificateFile /etc/ssl/certs/pi.alert.pem - SSLCertificateKeyFile /etc/ssl/private/pi.alert.key - location ^~ /pi.alert/ { + SSLCertificateFile /etc/ssl/certs/netalertx.pem + SSLCertificateKeyFile /etc/ssl/private/netalertx.key + location ^~ /netalertx/ { ProxyPreserveHost On ProxyPass / http://localhost:20211/ ProxyPassReverse / http://localhost:20211/ @@ -285,9 +285,9 @@ 3. Activate the new website by running the following command: - `a2ensite pialert` or `service apache2 reload` + `a2ensite netalertx` or `service apache2 reload` -4. Once Apache restarts, you should be able to access the proxy website at https://pi.alert/pi.alert/ +4. Once Apache restarts, you should be able to access the proxy website at https://netalertx/netalertx/ ## Reverse proxy example by using LinuxServer's SWAG container. @@ -295,20 +295,20 @@ ## [linuxserver/swag](https://github.com/linuxserver/docker-swag) -In the SWAG container create `/config/nginx/proxy-confs/pialert.subfolder.conf` with the following contents: +In the SWAG container create `/config/nginx/proxy-confs/netalertx.subfolder.conf` with the following contents: ``` nginx ## Version 2023/02/05 -# make sure that your pialert container is named pialert -# pialert does not require a base url setting +# make sure that your netalertx container is named netalertx +# netalertx does not require a base url setting # Since NetAlertX uses a Host network, you may need to use the IP address of the system running NetAlertX for $upstream_app. -location /pialert { - return 301 $scheme://$host/pialert/; +location /netalertx { + return 301 $scheme://$host/netalertx/; } -location ^~ /pialert/ { +location ^~ /netalertx/ { # enable the next two lines for http auth #auth_basic "Restricted"; #auth_basic_user_file /config/nginx/.htpasswd; @@ -325,27 +325,27 @@ location ^~ /pialert/ { include /config/nginx/proxy.conf; include /config/nginx/resolver.conf; - set $upstream_app pialert; + set $upstream_app netalertx; set $upstream_port 20211; set $upstream_proto http; proxy_pass $upstream_proto://$upstream_app:$upstream_port; proxy_set_header Accept-Encoding ""; - proxy_redirect ~^/(.*)$ /pialert/$1; - rewrite ^/pialert/?(.*)$ /$1 break; + proxy_redirect ~^/(.*)$ /netalertx/$1; + rewrite ^/netalertx/?(.*)$ /$1 break; sub_filter_once off; sub_filter_types *; - sub_filter 'href="/' 'href="/pialert/'; + sub_filter 'href="/' 'href="/netalertx/'; - sub_filter '(?>$host)/css' '/pialert/css'; - sub_filter '(?>$host)/js' '/pialert/js'; + sub_filter '(?>$host)/css' '/netalertx/css'; + sub_filter '(?>$host)/js' '/netalertx/js'; - sub_filter '/img' '/pialert/img'; - sub_filter '/lib' '/pialert/lib'; - sub_filter '/php' '/pialert/php'; + sub_filter '/img' '/netalertx/img'; + sub_filter '/lib' '/netalertx/lib'; + sub_filter '/php' '/netalertx/php'; } ``` @@ -354,11 +354,11 @@ location ^~ /pialert/ { > Submitted by [Isegrimm](https://github.com/Isegrimm) 🙏 (based on this [discussion](https://github.com/jokob-sk/NetAlertX/discussions/449#discussioncomment-7281442)) -Asuming the user already has a working Traefik setup, this is what's needed to make NetAlertX work at a URL like www.domain.com/pialert/. +Asuming the user already has a working Traefik setup, this is what's needed to make NetAlertX work at a URL like www.domain.com/netalertx/. Note: Everything in these configs assumes '**www.domain.com**' as your domainname and '**section31**' as an arbitrary name for your certificate setup. You will have to substitute these with your own. -Also, I use the prefix '**pialert**'. If you want to use another prefix, change it in these files: dynamic.toml and default. +Also, I use the prefix '**netalertx**'. If you want to use another prefix, change it in these files: dynamic.toml and default. Content of my yaml-file (this is the generic Traefik config, which defines which ports to listen on, redirect http to https and sets up the certificate process). It also contains Authelia, which I use for authentication. @@ -408,27 +408,27 @@ services: ``` Snippet of the dynamic.toml file (referenced in the yml-file above) that defines the config for NetAlertX: The following are self-defined keywords, everything else is traefik keywords: -- pialert-router -- pialert-service +- netalertx-router +- netalertx-service - auth -- pialert-stripprefix +- netalertx-stripprefix ```toml [http.routers] - [http.routers.pialert-router] + [http.routers.netalertx-router] entryPoints = ["websecure"] - rule = "Host(`www.domain.com`) && PathPrefix(`/pialert`)" - service = "pialert-service" - middlewares = "auth,pialert-stripprefix" - [http.routers.pialert-router.tls] + rule = "Host(`www.domain.com`) && PathPrefix(`/netalertx`)" + service = "netalertx-service" + middlewares = "auth,netalertx-stripprefix" + [http.routers.netalertx-router.tls] certResolver = "section31" - [[http.routers.pialert-router.tls.domains]] + [[http.routers.netalertx-router.tls.domains]] main = "www.domain.com" [http.services] - [http.services.pialert-service] - [[http.services.pialert-service.loadBalancer.servers]] + [http.services.netalertx-service] + [[http.services.netalertx-service.loadBalancer.servers]] url = "http://internal-ip-address:20211/" [http.middlewares] @@ -436,8 +436,8 @@ The following are self-defined keywords, everything else is traefik keywords: address = "http://authelia:9091/api/verify?rd=https://www.domain.com/authelia/" trustForwardHeader = true authResponseHeaders = ["Remote-User", "Remote-Groups", "Remote-Name", "Remote-Email"] - [http.middlewares.pialert-stripprefix.stripprefix] - prefixes = "/pialert" + [http.middlewares.netalertx-stripprefix.stripprefix] + prefixes = "/netalertx" forceSlash = false ``` @@ -450,9 +450,9 @@ server { listen 80 default_server; root /var/www/html; index index.php; - #rewrite /pialert/(.*) / permanent; - add_header X-Forwarded-Prefix "/pialert" always; - proxy_set_header X-Forwarded-Prefix "/pialert"; + #rewrite /netalertx/(.*) / permanent; + add_header X-Forwarded-Prefix "/netalertx" always; + proxy_set_header X-Forwarded-Prefix "/netalertx"; location ~* \.php$ { fastcgi_pass unix:/run/php/php8.2-fpm.sock; @@ -466,18 +466,18 @@ server { } ``` -Mapping the updated file (on the local filesystem at `/appl/docker/pialert/default`) into the docker container: +Mapping the updated file (on the local filesystem at `/appl/docker/netalertx/default`) into the docker container: ```bash docker run -d --rm --network=host \ - --name=pi.alert \ + --name=netalertx \ -v /appl/docker/pialert/config:/home/pi/pialert/config \ -v /appl/docker/pialert/db:/home/pi/pialert/db \ -v /appl/docker/pialert/default:/etc/nginx/sites-available/default \ -e TZ=Europe/Amsterdam \ -e PORT=20211 \ - jokobsk/pi.alert:latest + jokobsk/netalertx:latest ``` diff --git a/docs/SMTP.md b/docs/SMTP.md index 1faa53fc..750da48c 100755 --- a/docs/SMTP.md +++ b/docs/SMTP.md @@ -6,7 +6,7 @@ 2. Under Security Options enable 2FA (Two-factor authentication) 3. Under Security Options generate an Application-specific password 4. Home -> Email Settings -> POP3 & IMAP -> Enable access to this account via POP3 and IMAP -5. In PiAlert specify these settings: +5. In NetAlertX specify these settings: ```python SMTP_RUN='on_notification' diff --git a/docs/WEBHOOK_N8N.md b/docs/WEBHOOK_N8N.md index b4536267..7c633e5a 100755 --- a/docs/WEBHOOK_N8N.md +++ b/docs/WEBHOOK_N8N.md @@ -16,5 +16,5 @@ New devices count: {{ $json["body"]["attachments"][0]["text"]["new_devices"].len ### Get your webhook in n8n ![n8n webhook URL](/docs/img/WEBHOOK_N8N/n8n_webhook_settings.png) -### Configure PiAlert to point to the above URL -![PiAlert config](/docs/img/WEBHOOK_N8N/Webhook_settings.png) +### Configure NetAlertX to point to the above URL +![NetAlertX config](/docs/img/WEBHOOK_N8N/Webhook_settings.png) diff --git a/front/index.php b/front/index.php index 634f0c40..01b62eff 100755 --- a/front/index.php +++ b/front/index.php @@ -105,7 +105,7 @@ if ($ENABLED_DARKMODE === True) {