From 14fa5e08c39e1735c64ed7fcbf166971073544b8 Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Sat, 29 Nov 2025 19:48:58 +0100 Subject: [PATCH] Clarify migration preserves existing config data --- netalertx/CHANGELOG.md | 4 ++++ netalertx/README.md | 2 +- netalertx/config.yaml | 3 ++- netalertx/rootfs/etc/cont-init.d/99-run.sh | 23 +++++++++++++++------- netalertx/updater.json | 4 ++-- 5 files changed, 25 insertions(+), 11 deletions(-) diff --git a/netalertx/CHANGELOG.md b/netalertx/CHANGELOG.md index e2f25d77e..c34312419 100644 --- a/netalertx/CHANGELOG.md +++ b/netalertx/CHANGELOG.md @@ -2,6 +2,10 @@ - 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-2 (29-11-2025) +- 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. + ## 25.10.1 (04-10-2025) - Update to latest version from jokob-sk/NetAlertX (changelog : https://github.com/jokob-sk/NetAlertX/releases) diff --git a/netalertx/README.md b/netalertx/README.md index 7df696036..5ad9dad1f 100644 --- a/netalertx/README.md +++ b/netalertx/README.md @@ -49,7 +49,7 @@ comparison to installing any other Hass.io add-on. ## 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 `/app/config/` folder directly. +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 `/data/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). diff --git a/netalertx/config.yaml b/netalertx/config.yaml index 0cb3ae857..f13199959 100644 --- a/netalertx/config.yaml +++ b/netalertx/config.yaml @@ -43,6 +43,7 @@ schema: services: - mqtt:want slug: netalertx +tmpfs: true udev: true url: https://github.com/alexbelgium/hassio-addons -version: 25.10.1 +version: 25.10.1-2 diff --git a/netalertx/rootfs/etc/cont-init.d/99-run.sh b/netalertx/rootfs/etc/cont-init.d/99-run.sh index 9fe4153f0..697d8cea8 100755 --- a/netalertx/rootfs/etc/cont-init.d/99-run.sh +++ b/netalertx/rootfs/etc/cont-init.d/99-run.sh @@ -12,13 +12,22 @@ bashio::log.info "Update structure" echo "Creating symlinks" for folder in config db; do echo "Creating for $folder" - # Create symlinks - mkdir -p /config/"$folder" - if [ -d /app/"$folder" ] && [ "$(ls -A /app/"$folder")" ]; then - cp -rn /app/"$folder"/* /config/"$folder"/ - fi - rm -r /app/"$folder" - ln -sf /config/"$folder" /app/"$folder" + target="/config/${folder}" + mkdir -p "$target" + + # Migrate existing data from previous locations while avoiding self-copies + for legacy_path in "/app/${folder}" "/data/${folder}"; do + if [ -d "$legacy_path" ]; then + legacy_target="$(readlink -f "$legacy_path" || true)" + if [ "$legacy_target" != "$target" ] && [ "$(ls -A "$legacy_path")" ]; then + # -n prevents clobbering anything already present in /config + cp -rn "$legacy_path"/* "$target"/ + fi + fi + done + + rm -rf /data/"$folder" + ln -sf "$target" /data/"$folder" done sudo chown -R nginx:www-data /config/db/ diff --git a/netalertx/updater.json b/netalertx/updater.json index fce159912..da900f52a 100644 --- a/netalertx/updater.json +++ b/netalertx/updater.json @@ -1,8 +1,8 @@ { - "last_update": "04-10-2025", + "last_update": "29-11-2025", "repository": "alexbelgium/hassio-addons", "slug": "netalertx", "source": "github", "upstream_repo": "jokob-sk/NetAlertX", - "upstream_version": "25.10.1" + "upstream_version": "25.10.1-2" }