Clarify migration preserves existing config data

This commit is contained in:
Alexandre
2025-11-29 19:48:58 +01:00
parent 6bf71492eb
commit 14fa5e08c3
5 changed files with 25 additions and 11 deletions

View File

@@ -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. - 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) ## 25.10.1 (04-10-2025)
- 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)

View File

@@ -49,7 +49,7 @@ comparison to installing any other Hass.io add-on.
## Configuration ## Configuration
1. If unavailable, the app generates a default `app.conf` and `app.db` file on the first run. 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. 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. 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). 1. Back everything up by following the [Backups documentation](https://github.com/jokob-sk/NetAlertX/blob/main/docs/BACKUPS.md).

View File

@@ -43,6 +43,7 @@ schema:
services: services:
- mqtt:want - mqtt:want
slug: netalertx slug: netalertx
tmpfs: true
udev: true udev: true
url: https://github.com/alexbelgium/hassio-addons url: https://github.com/alexbelgium/hassio-addons
version: 25.10.1 version: 25.10.1-2

View File

@@ -12,13 +12,22 @@ bashio::log.info "Update structure"
echo "Creating symlinks" echo "Creating symlinks"
for folder in config db; do for folder in config db; do
echo "Creating for $folder" echo "Creating for $folder"
# Create symlinks target="/config/${folder}"
mkdir -p /config/"$folder" mkdir -p "$target"
if [ -d /app/"$folder" ] && [ "$(ls -A /app/"$folder")" ]; then
cp -rn /app/"$folder"/* /config/"$folder"/ # Migrate existing data from previous locations while avoiding self-copies
fi for legacy_path in "/app/${folder}" "/data/${folder}"; do
rm -r /app/"$folder" if [ -d "$legacy_path" ]; then
ln -sf /config/"$folder" /app/"$folder" 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 done
sudo chown -R nginx:www-data /config/db/ sudo chown -R nginx:www-data /config/db/

View File

@@ -1,8 +1,8 @@
{ {
"last_update": "04-10-2025", "last_update": "29-11-2025",
"repository": "alexbelgium/hassio-addons", "repository": "alexbelgium/hassio-addons",
"slug": "netalertx", "slug": "netalertx",
"source": "github", "source": "github",
"upstream_repo": "jokob-sk/NetAlertX", "upstream_repo": "jokob-sk/NetAlertX",
"upstream_version": "25.10.1" "upstream_version": "25.10.1-2"
} }