mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-05-22 00:31:51 +02:00
GitHub bot : README updated
This commit is contained in:
@@ -1,147 +0,0 @@
|
||||
## 26.3.16-5 (19-03-2026)
|
||||
- Use embedded ingress system
|
||||
|
||||
## 26.3.16-1 (17-03-2026)
|
||||
- Minor bugs fixed
|
||||
## 26.3.7-3 (07-03-2026)
|
||||
- Minor bugs fixed
|
||||
## 26.3.7-2 (07-03-2026)
|
||||
- Minor bugs fixed
|
||||
|
||||
## 26.3.7 (2026-03-07)
|
||||
- Update to latest version from jokob-sk/NetAlertX (changelog : https://github.com/jokob-sk/NetAlertX/releases)
|
||||
## 26.2.6-4 (18-02-2026)
|
||||
- Minor bugs fixed
|
||||
## 26.2.6-3 (17-02-2026)
|
||||
- Minor bugs fixed
|
||||
## 26.2.6-2 (17-02-2026)
|
||||
- Minor bugs fixed
|
||||
## 26.2.6 (16-02-2026)
|
||||
- Minor bugs fixed
|
||||
## 26.2.4 (04-02-2026)
|
||||
- Minor bugs fixed
|
||||
|
||||
## 26.1.17 (2026-01-17)
|
||||
- Update to latest version from jokob-sk/NetAlertX (changelog : https://github.com/jokob-sk/NetAlertX/releases)
|
||||
|
||||
## 25.11.29-7 (2026-01-10)
|
||||
- Minor bugs fixed
|
||||
## 25.11.29-6 (2026-01-10)
|
||||
- Minor bugs fixed
|
||||
## 25.11.29-5 (2026-01-10)
|
||||
- Minor bugs fixed
|
||||
## 25.11.29-4 (2026-01-10)
|
||||
- Minor bugs fixed
|
||||
## 25.11.29-3 (2026-01-07)
|
||||
- Minor bugs fixed
|
||||
## 25.11.29-2 (2026-01-06)
|
||||
- Minor bugs fixed
|
||||
## 25.11.29 (2025-12-20)
|
||||
- Minor bugs fixed
|
||||
## 25.10.1-4 (2025-12-01)
|
||||
- Minor bugs fixed
|
||||
## 25.10.1-3 (2025-11-29)
|
||||
- Breaking change: data directories now use /data symlinks to /config; back up your installation before updating. Migration is supported only from version v25.5.24.
|
||||
- Added tmpfs support for temporary storage.
|
||||
- The Home Assistant project has deprecated support for the armv7, armhf and i386 architectures. Support wil be fully dropped in the upcoming Home Assistant 2025.12 release
|
||||
- Added support for configuring extra environment variables via the `env_vars` add-on option alongside config.yaml. See https://github.com/alexbelgium/hassio-addons/wiki/Add-Environment-variables-to-your-Addon-2 for details.
|
||||
|
||||
## 25.10.1 (2025-10-04)
|
||||
- Update to latest version from jokob-sk/NetAlertX (changelog : https://github.com/jokob-sk/NetAlertX/releases)
|
||||
|
||||
## 25.8.6 (2025-08-09)
|
||||
- Update to latest version from jokob-sk/NetAlertX (changelog : https://github.com/jokob-sk/NetAlertX/releases)
|
||||
|
||||
## 25.7.30 (2025-08-01)
|
||||
- Update to latest version from jokob-sk/NetAlertX (changelog : https://github.com/jokob-sk/NetAlertX/releases)
|
||||
## 25.7.4 (2025-07-05)
|
||||
|
||||
- Update to latest version from jokob-sk/NetAlertX (changelog : https://github.com/jokob-sk/NetAlertX/releases)
|
||||
|
||||
## 25.6.7-2 (2025-06-16)
|
||||
|
||||
- IPv6 Fix
|
||||
|
||||
## 25.6.7 (2025-06-07)
|
||||
|
||||
- Update to latest version from jokob-sk/NetAlertX (changelog : https://github.com/jokob-sk/NetAlertX/releases)
|
||||
|
||||
## 25.5.24 (2025-05-24)
|
||||
|
||||
- Update to latest version from jokob-sk/NetAlertX (changelog : https://github.com/jokob-sk/NetAlertX/releases)
|
||||
|
||||
## 25.4.14 (2025-04-19)
|
||||
|
||||
- Update to latest version from jokob-sk/NetAlertX (changelog : https://github.com/jokob-sk/NetAlertX/releases)
|
||||
|
||||
## 25.4.1 (2025-04-05)
|
||||
|
||||
- Update to latest version from jokob-sk/NetAlertX (changelog : https://github.com/jokob-sk/NetAlertX/releases)
|
||||
|
||||
## 25.3.1 (2025-03-01)
|
||||
|
||||
- Move to GitHub Container Registry (GHCR)
|
||||
- Update to latest version from jokob-sk/NetAlertX (changelog : https://github.com/jokob-sk/NetAlertX/releases)
|
||||
|
||||
## 25.2.8-3 (2025-02-09)
|
||||
|
||||
- Minor bugs fixed
|
||||
|
||||
## 25.2.8-2 (2025-02-09)
|
||||
|
||||
- Minor bugs fixed
|
||||
|
||||
## 25.2.8 (2025-02-08)
|
||||
|
||||
- Update to latest version from jokob-sk/NetAlertX (changelog : https://github.com/jokob-sk/NetAlertX/releases)
|
||||
|
||||
## 25.1.19 (2025-01-25)
|
||||
|
||||
- Update to latest version from jokob-sk/NetAlertX (changelog : https://github.com/jokob-sk/NetAlertX/releases)
|
||||
- Update to latest version from jokob-sk/NetAlertX (changelog : https://github.com/jokob-sk/NetAlertX/releases/tag/v24.1.19)
|
||||
|
||||
## 25.1.14 (2025-01-16)
|
||||
|
||||
- Improve ingress parameters
|
||||
|
||||
## 25.1.13 (2025-01-14)
|
||||
|
||||
- Automatic configuration of homeassistant local environment
|
||||
- Add APP_CONF_OVERRIDE option
|
||||
|
||||
## 25.1.12 (2025-01-14)
|
||||
|
||||
- Addition of ingress
|
||||
|
||||
## 25.1.11 (2025-01-12)
|
||||
|
||||
- Moving 99-run.sh to cont-init.d
|
||||
- Docs, symlink test
|
||||
|
||||
## 0.0.7
|
||||
|
||||
- re-add oneshot type
|
||||
|
||||
## 0.0.6
|
||||
|
||||
- test symlinks
|
||||
|
||||
## 0.0.5
|
||||
|
||||
- attempt at starting start.sh, back to prod image
|
||||
|
||||
## 0.0.4
|
||||
|
||||
- removal of unnecessary files WARNING: dev image
|
||||
|
||||
## 0.0.3
|
||||
|
||||
- removal of app_conf_override
|
||||
|
||||
## 0.0.2
|
||||
|
||||
- armv6 removal, host network
|
||||
|
||||
## 0.0.1
|
||||
|
||||
- Initial commit
|
||||
@@ -1,142 +0,0 @@
|
||||
#============================#
|
||||
# ALEXBELGIUM'S DOCKERFILE #
|
||||
#============================#
|
||||
# _.------.
|
||||
# _.-` ('>.-`"""-.
|
||||
# '.--'` _'` _ .--.)
|
||||
# -' '-.-';` `
|
||||
# ' - _.' ``'--.
|
||||
# '---` .-'""`
|
||||
# /`
|
||||
#=== Home Assistant Addon ===#
|
||||
|
||||
############################
|
||||
# 0) Tools stage (apk OK) #
|
||||
############################
|
||||
# We build a tiny payload in /out containing:
|
||||
# - jq + its shared libs (libjq, libonig, etc.)
|
||||
# - gosu + its shared libs
|
||||
# IMPORTANT: we do NOT bring sudo to avoid breaking NetAlertX hardened behavior.
|
||||
FROM alpine:3.22 AS ha_tools
|
||||
|
||||
RUN apk add --no-cache \
|
||||
gosu \
|
||||
pax-utils
|
||||
|
||||
RUN set -eux; \
|
||||
mkdir -p /out; \
|
||||
for bin in /usr/bin/gosu; do \
|
||||
mkdir -p "/out$(dirname "$bin")"; \
|
||||
cp -a "$bin" "/out$bin"; \
|
||||
# Copy runtime deps. Skip musl loader to avoid clobbering base image libc/loader.
|
||||
lddtree -l "$bin" | while read -r dep; do \
|
||||
case "$dep" in \
|
||||
/lib/ld-musl-*.so.1) \
|
||||
continue ;; \
|
||||
/*) \
|
||||
mkdir -p "/out$(dirname "$dep")"; \
|
||||
cp -a "$dep" "/out$(dirname "$dep")/"; \
|
||||
;; \
|
||||
esac; \
|
||||
done; \
|
||||
done
|
||||
|
||||
##################
|
||||
# 1) Final image #
|
||||
##################
|
||||
ARG BUILD_FROM
|
||||
FROM ghcr.io/jokob-sk/netalertx:latest
|
||||
|
||||
# S6 settings (keep yours)
|
||||
ENV S6_CMD_WAIT_FOR_SERVICES=1 \
|
||||
S6_CMD_WAIT_FOR_SERVICES_MAXTIME=0 \
|
||||
S6_SERVICES_GRACETIME=0
|
||||
|
||||
USER 0
|
||||
|
||||
# Add rootfs
|
||||
COPY rootfs/ /
|
||||
RUN find . -type f \( -name "*.sh" -o -name "run" -o -name "finish" \) -print -exec chmod +x {} \;
|
||||
|
||||
# Bring in jq + gosu (and their libs). NO apk in final stage.
|
||||
COPY --from=ha_tools /out/ /
|
||||
|
||||
RUN BASHIO_VERSION="0.14.3" && \
|
||||
mkdir -p /tmp/bashio && \
|
||||
curl -f -L -s -S "https://github.com/hassio-addons/bashio/archive/v${BASHIO_VERSION}.tar.gz" | tar -xzf - --strip 1 -C /tmp/bashio && \
|
||||
mv /tmp/bashio/lib /usr/lib/bashio && \
|
||||
ln -s /usr/lib/bashio/bashio /usr/bin/bashio && \
|
||||
rm -rf /tmp/bashio
|
||||
|
||||
ARG TARGETARCH
|
||||
RUN curl -L -o /usr/local/bin/jq "https://github.com/jqlang/jq/releases/download/jq-1.7.1/jq-linux-$TARGETARCH" && \
|
||||
chmod +x /usr/local/bin/jq
|
||||
|
||||
###########
|
||||
# Modules #
|
||||
###########
|
||||
ARG MODULES="00-banner.sh"
|
||||
|
||||
# Automatic modules download
|
||||
ADD "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/ha_automodules.sh" "/ha_automodules.sh"
|
||||
RUN chmod 744 /ha_automodules.sh \
|
||||
&& /ha_automodules.sh "$MODULES" \
|
||||
&& rm /ha_automodules.sh
|
||||
|
||||
#################
|
||||
# Manual apps #
|
||||
#################
|
||||
ENV PACKAGES=""
|
||||
|
||||
# Automatic apps & bashio
|
||||
ADD "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/ha_autoapps.sh" "/ha_autoapps.sh"
|
||||
RUN chmod 744 /ha_autoapps.sh \
|
||||
&& /ha_autoapps.sh "$PACKAGES" \
|
||||
&& rm /ha_autoapps.sh
|
||||
|
||||
################
|
||||
# 4 Entrypoint #
|
||||
################
|
||||
ENV S6_STAGE2_HOOK=/ha_entrypoint.sh
|
||||
ADD "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/ha_entrypoint.sh" "/ha_entrypoint.sh"
|
||||
RUN chmod 777 /ha_entrypoint.sh
|
||||
|
||||
ADD "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/bashio-standalone.sh" "/.bashio-standalone.sh"
|
||||
RUN chmod 0644 /.bashio-standalone.sh
|
||||
|
||||
#WORKDIR /
|
||||
ENTRYPOINT [ "/usr/bin/env" ]
|
||||
CMD [ "/ha_entrypoint.sh" ]
|
||||
|
||||
# Your preferred shell
|
||||
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
||||
|
||||
############
|
||||
# 5 Labels #
|
||||
############
|
||||
ARG BUILD_ARCH
|
||||
ARG BUILD_DATE
|
||||
ARG BUILD_DESCRIPTION
|
||||
ARG BUILD_NAME
|
||||
ARG BUILD_REF
|
||||
ARG BUILD_REPOSITORY
|
||||
ARG BUILD_VERSION
|
||||
ENV BUILD_VERSION="${BUILD_VERSION}"
|
||||
LABEL \
|
||||
io.hass.name="${BUILD_NAME}" \
|
||||
io.hass.description="${BUILD_DESCRIPTION}" \
|
||||
io.hass.arch="${BUILD_ARCH}" \
|
||||
io.hass.type="addon" \
|
||||
io.hass.version=${BUILD_VERSION} \
|
||||
maintainer="alexbelgium (https://github.com/alexbelgium)" \
|
||||
org.opencontainers.image.title="${BUILD_NAME}" \
|
||||
org.opencontainers.image.description="${BUILD_DESCRIPTION}" \
|
||||
org.opencontainers.image.vendor="Home Assistant Add-ons" \
|
||||
org.opencontainers.image.authors="alexbelgium (https://github.com/alexbelgium)" \
|
||||
org.opencontainers.image.licenses="MIT" \
|
||||
org.opencontainers.image.url="https://github.com/alexbelgium" \
|
||||
org.opencontainers.image.source="https://github.com/${BUILD_REPOSITORY}" \
|
||||
org.opencontainers.image.documentation="https://github.com/${BUILD_REPOSITORY}/blob/main/README.md" \
|
||||
org.opencontainers.image.created=${BUILD_DATE} \
|
||||
org.opencontainers.image.revision=${BUILD_REF} \
|
||||
org.opencontainers.image.version=${BUILD_VERSION}
|
||||
@@ -1,75 +0,0 @@
|
||||
# Home assistant add-on: NetAlertX
|
||||
|
||||
|
||||
I maintain this and other Home Assistant add-ons in my free time: keeping up with upstream changes, HA changes, and testing on real hardware takes a lot of time (and some money). I use around 5-10 of my >110 addons so regularly I install test machines (and purchase some test services such as vpn) that I don't use myself to troubleshoot and improve the addons
|
||||
|
||||
If this add-on saves you time or makes your setup easier, I would be very grateful for your support!
|
||||
|
||||
[![Buy me a coffee][donation-badge]](https://www.buymeacoffee.com/alexbelgium)
|
||||
[![Donate via PayPal][paypal-badge]](https://www.paypal.com/donate/?hosted_button_id=DZFULJZTP3UQA)
|
||||
|
||||
## Addon informations
|
||||
|
||||

|
||||

|
||||

|
||||

|
||||
|
||||
[](https://www.codacy.com/gh/alexbelgium/hassio-addons/dashboard?utm_source=github.com&utm_medium=referral&utm_content=alexbelgium/hassio-addons&utm_campaign=Badge_Grade)
|
||||
[](https://github.com/alexbelgium/hassio-addons/actions/workflows/weekly-supelinter.yaml)
|
||||
[](https://github.com/alexbelgium/hassio-addons/actions/workflows/onpush_builder.yaml)
|
||||
|
||||
[donation-badge]: https://img.shields.io/badge/Buy%20me%20a%20coffee-%23d32f2f?logo=buy-me-a-coffee&style=flat&logoColor=white
|
||||
[paypal-badge]: https://img.shields.io/badge/Donate%20via%20PayPal-0070BA?logo=paypal&style=flat&logoColor=white
|
||||
|
||||
_Thanks to everyone having starred my repo! To star it click on the image below, then it will be on top right. Thanks!_
|
||||
|
||||
[](https://github.com/alexbelgium/hassio-addons/stargazers)
|
||||
|
||||

|
||||
|
||||
## About
|
||||
|
||||
Network presence and intruder detector. Scans for devices connected to your network and alerts you if new and unknown devices are found.
|
||||
This addon is based on the [docker image](https://github.com/jokob-sk/NetAlertX/tree/main/dockerfiles) from jokob-sk.
|
||||
|
||||
## Installation
|
||||
|
||||
The installation of this add-on is pretty straightforward and not different in
|
||||
comparison to installing any other Hass.io add-on.
|
||||
|
||||
1. Add my add-ons repository to your home assistant instance (in supervisor addons store at top right, or click button below if you have configured my HA)
|
||||
[](https://my.home-assistant.io/redirect/supervisor_add_addon_repository/?repository_url=https%3A%2F%2Fgithub.com%2Falexbelgium%2Fhassio-addons)
|
||||
1. Install this add-on.
|
||||
1. Click the `Save` button to store your configuration.
|
||||
1. Start the add-on.
|
||||
1. Check the logs of the add-on to see if everything went well.
|
||||
1. Carefully configure the add-on to your preferences, see the official documentation for that.
|
||||
|
||||
## Configuration
|
||||
|
||||
1. If unavailable, the app generates a default `app.conf` and `app.db` file on the first run.
|
||||
1. The preferred way is to manage the configuration via the Settings section in the UI, if UI is inaccessible you can modify `app.conf` in the `/config/config/` folder directly.
|
||||
1. You have to specify which network(s) should be scanned. This is done by entering subnets that are accessible from the host. If you use the default `ARPSCAN` plugin, you have to specify at least one valid subnet and interface in the `SCAN_SUBNETS` setting. See the [documentation on How to set up multiple SUBNETS, VLANs and what are limitations](https://github.com/jokob-sk/NetAlertX/blob/main/docs/SUBNETS.md) and for troubleshooting and more advanced scenarios.
|
||||
1. Read how to get devices into your [Home Assistant instance via the MQTT plugin](https://github.com/jokob-sk/NetAlertX/blob/main/docs/HOME_ASSISTANT.md)
|
||||
1. Back everything up by following the [Backups documentation](https://github.com/jokob-sk/NetAlertX/blob/main/docs/BACKUPS.md).
|
||||
|
||||
Webui can be found at <http://homeassistant.local:20211> or using HA ingress
|
||||
|
||||
<img width="500" alt="image" src="https://github.com/user-attachments/assets/fd74af43-091a-4f38-9879-037ca64cfab9" />
|
||||
|
||||
```yaml
|
||||
PGID: user
|
||||
GPID: user
|
||||
```
|
||||
|
||||
### Custom Scripts and Environment Variables
|
||||
|
||||
This addon supports custom scripts and environment variables through the `addon_config` mapping:
|
||||
|
||||
- **Custom scripts**: See [Running Custom Scripts in Addons](https://github.com/alexbelgium/hassio-addons/wiki/Running-custom-scripts-in-Addons)
|
||||
- **env_vars option**: Use the add-on `env_vars` option to pass extra environment variables (uppercase or lowercase names). See https://github.com/alexbelgium/hassio-addons/wiki/Add-Environment-variables-to-your-Addon-2 for details.
|
||||
|
||||
[repository]: https://github.com/alexbelgium/hassio-addons
|
||||
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
#include <tunables/global>
|
||||
|
||||
profile netalertx_addon flags=(attach_disconnected,mediate_deleted) {
|
||||
#include <abstractions/base>
|
||||
|
||||
capability chown,
|
||||
capability dac_override,
|
||||
capability fowner,
|
||||
capability net_admin,
|
||||
capability net_raw,
|
||||
capability setgid,
|
||||
capability setuid,
|
||||
file,
|
||||
signal,
|
||||
mount,
|
||||
remount,
|
||||
umount,
|
||||
network,
|
||||
ptrace,
|
||||
|
||||
/init ix,
|
||||
/run/{s6,s6-rc*,service}/** ix,
|
||||
/package/** ix,
|
||||
/command/** ix,
|
||||
/bin/** ix,
|
||||
/usr/bin/** ix,
|
||||
/usr/lib/bashio/** ix,
|
||||
/etc/s6/** rix,
|
||||
/run/s6/** rix,
|
||||
/etc/services.d/** rwix,
|
||||
/etc/cont-init.d/** rwix,
|
||||
/etc/cont-finish.d/** rwix,
|
||||
}
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"build_from": {
|
||||
"aarch64": "ghcr.io/jokob-sk/netalertx:latest",
|
||||
"amd64": "ghcr.io/jokob-sk/netalertx:latest"
|
||||
}
|
||||
}
|
||||
@@ -1,45 +0,0 @@
|
||||
arch:
|
||||
- aarch64
|
||||
- amd64
|
||||
description: "\U0001F5A7\U0001F50D Centralized network visibility and continuous asset discovery."
|
||||
hassio_api: true
|
||||
host_network: true
|
||||
image: ghcr.io/alexbelgium/netalertx-{arch}
|
||||
ingress: true
|
||||
ingress_entry: devices.php
|
||||
ingress_port: 20211
|
||||
ingress_stream: true
|
||||
init: false
|
||||
map:
|
||||
- addon_config:rw
|
||||
name: NetAlertX
|
||||
panel_icon: mdi:wifi-check
|
||||
ports:
|
||||
20211/tcp: 20211
|
||||
20212/tcp: 20212
|
||||
ports_description:
|
||||
20211/tcp: NetAlertX WebUI port
|
||||
20212/tcp: GraphQL & MCP port
|
||||
privileged:
|
||||
- NET_ADMIN
|
||||
- NET_RAW
|
||||
environment:
|
||||
PUID: "20211"
|
||||
PGID: "20211"
|
||||
TZ: Europe/Berlin
|
||||
NETALERTX_DATA: /config
|
||||
NETALERTX_CONFIG: /config/config
|
||||
NETALERTX_CONFIG_FILE: /config/config/app.conf
|
||||
NETALERTX_DB: /config/db
|
||||
NETALERTX_DB_FILE: /config/db/app.db
|
||||
TMP_DIR: /tmp/tmp
|
||||
SKIP_STARTUP_CHECKS: excessive capabilities.sh,appliance integrity.sh
|
||||
schema:
|
||||
TZ: str?
|
||||
services:
|
||||
- mqtt:want
|
||||
slug: netalertx
|
||||
tmpfs: true
|
||||
udev: true
|
||||
url: https://github.com/alexbelgium/hassio-addons
|
||||
version: "26.3.16-5"
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.7 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 1.7 KiB |
@@ -1,118 +0,0 @@
|
||||
#!/usr/bin/with-contenv bashio
|
||||
# shellcheck shell=bash
|
||||
set -e
|
||||
|
||||
####################
|
||||
# Update structure #
|
||||
####################
|
||||
|
||||
|
||||
# 1. Fix the directories
|
||||
for folder in /tmp/run/tmp /tmp/api /tmp/log /tmp/run /tmp/nginx/active-config "${TMP_DIR:-/tmp}" "${NETALERTX_DATA:-/data}" "${NETALERTX_DB:-/data/db}" "${NETALERTX_CONFIG:-/data/config}"; do
|
||||
mkdir -p "$folder"
|
||||
chown -R "${PUID}":"${PGID}" "$folder"
|
||||
chmod -R 755 "$folder"
|
||||
done
|
||||
|
||||
# 2. Fix /tmp and Standard Streams (CRITICAL)
|
||||
chmod -R 1777 /tmp
|
||||
# This allows the non-root user to write to the container logs
|
||||
chmod 666 /dev/stdout /dev/stderr
|
||||
|
||||
# 3. Pre-create and chown log files
|
||||
touch /tmp/log/app.php_errors.log /tmp/log/cron.log /tmp/log/stdout.log /tmp/log/stderr.log
|
||||
chown "${PUID}":"${PGID}" /tmp/log/*.log
|
||||
|
||||
# 4. Create Symlinks
|
||||
for item in db config; do
|
||||
# ADD THESE TWO LINES: Ensure the target exists and is owned by 20211
|
||||
mkdir -p "/config/$item"
|
||||
chown -R "${PUID}":"${PGID}" "/config/$item"
|
||||
|
||||
rm -rf "/data/$item"
|
||||
ln -sf "/config/$item" "/data/$item"
|
||||
chown -R "${PUID}":"${PGID}" "/data/$item"
|
||||
chmod -R 755 "/data/$item"
|
||||
done
|
||||
|
||||
# Fix php
|
||||
sed -i 's|>>"\?/tmp/log/app\.php_errors\.log"\? 2>/dev/stderr|>>"/tmp/log/app.php_errors.log"|g' /services/start-php-fpm.sh
|
||||
sed -i 's|TEMP_CONFIG_FILE=$(mktemp "${TMP_DIR}/netalertx\.conf\.XXXXXX")|TEMP_CONFIG_FILE=$(mktemp -p "${TMP_DIR:-/tmp}" netalertx.conf.XXXXXX)|' /services/start-php-fpm.sh
|
||||
|
||||
#####################
|
||||
# Configure network #
|
||||
#####################
|
||||
|
||||
# Configuration file path
|
||||
config_file="/config/config/app.conf"
|
||||
|
||||
if [ -f /config/db/app.db ]; then
|
||||
chmod a+rwx /config/db/app.db
|
||||
fi
|
||||
|
||||
# Function to execute the main logic
|
||||
execute_main_logic() {
|
||||
bashio::log.info "Initiating scan of Home Assistant network configuration..."
|
||||
|
||||
# Get the local IPv4 address
|
||||
local_ip="$(bashio::network.ipv4_address)"
|
||||
local_ip="${local_ip%/*}" # Remove CIDR notation
|
||||
echo "... Detected local IP: $local_ip"
|
||||
echo "... Scanning network for changes"
|
||||
|
||||
# Ensure arp-scan is installed
|
||||
if ! command -v arp-scan &> /dev/null; then
|
||||
bashio::log.error "arp-scan command not found. Please install arp-scan to proceed."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Get current settings
|
||||
if ! grep -q "^SCAN_SUBNETS" "$config_file"; then
|
||||
bashio::log.fatal "SCAN_SUBNETS is not found in your $config_file, please correct your file first"
|
||||
fi
|
||||
|
||||
# Iterate over network interfaces
|
||||
for interface in $(bashio::network.interfaces); do
|
||||
echo "Scanning interface: $interface"
|
||||
|
||||
# Check if the interface is already configured
|
||||
if grep -q "$interface" "$config_file"; then
|
||||
echo "... $interface is already configured in app.conf"
|
||||
else
|
||||
# Update SCAN_SUBNETS in app.conf
|
||||
SCAN_SUBNETS="$(grep "^SCAN_SUBNETS" "$config_file" | head -1)"
|
||||
if [[ "$SCAN_SUBNETS" != *"$local_ip"*"$interface"* ]]; then
|
||||
# Add to the app.conf
|
||||
NEW_SCAN_SUBNETS="${SCAN_SUBNETS%]}, '${local_ip}/24 --interface=${interface}']"
|
||||
sed -i "/^SCAN_SUBNETS/c\\$NEW_SCAN_SUBNETS" "$config_file"
|
||||
# Check availability of hosts
|
||||
VALUE="$(arp-scan --interface="$interface" "${local_ip}/24" 2> /dev/null \
|
||||
| grep "responded" \
|
||||
| awk -F'.' '{print $NF}' \
|
||||
| awk '{print $1}' || true)"
|
||||
echo "... $interface is available in Home Assistant (with $VALUE devices), added to app.conf"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
bashio::log.info "Network scan completed."
|
||||
|
||||
}
|
||||
|
||||
# Function to wait for the config file
|
||||
wait_for_config_file() {
|
||||
echo "Waiting for $config_file to become available..."
|
||||
while [ ! -f "$config_file" ]; do
|
||||
sleep 1
|
||||
done
|
||||
echo "$config_file is now available. Rebooting the addon."
|
||||
bashio::addon.restart
|
||||
}
|
||||
|
||||
# Main script logic
|
||||
if [ -f "$config_file" ]; then
|
||||
execute_main_logic
|
||||
else
|
||||
wait_for_config_file &
|
||||
true
|
||||
fi
|
||||
@@ -1,6 +0,0 @@
|
||||
#!/usr/bin/with-contenv bashio
|
||||
# shellcheck shell=bash
|
||||
set -e
|
||||
|
||||
bashio::log.info "Starting upstream app"
|
||||
/root-entrypoint.sh
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.4 KiB |
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"last_update": "2026-03-07",
|
||||
"paused": "false",
|
||||
"repository": "alexbelgium/hassio-addons",
|
||||
"slug": "netalertx",
|
||||
"source": "github",
|
||||
"upstream_repo": "jokob-sk/NetAlertX",
|
||||
"upstream_version": "26.3.7"
|
||||
}
|
||||
Reference in New Issue
Block a user