Skip to content

Commit

Permalink
Migrate Node-RED config out of Home Assistant config folder
Browse files Browse the repository at this point in the history
  • Loading branch information
frenck committed Nov 10, 2023
1 parent b5d82ef commit 480c913
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
3 changes: 2 additions & 1 deletion node-red/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ host_network: true
auth_api: true
uart: true
map:
- config:rw
- addon_config:rw
- homeassistant_config:rw
- media:rw
- share:rw
- ssl
Expand Down
8 changes: 8 additions & 0 deletions node-red/rootfs/etc/s6-overlay/s6-rc.d/init-nodered/run
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@ if bashio::config.is_empty 'credential_secret'; then
bashio::exit.nok
fi

# Migrate add-on data from the Home Assistant config folder,
# to the add-on configuration folder.
if ! bashio::fs.directory_exists '/config/node-red/' \
&& bashio::fs.file_exists '/homeassistant/node-red/settings.js'; then
mv /homeassistant/node-red /config/ \
|| bashio::exit.nok "Failed to migrate Node-RED configuration"
fi

# Ensure configuration exists
if ! bashio::fs.directory_exists '/config/node-red/'; then
mkdir -p /config/node-red/nodes \
Expand Down

0 comments on commit 480c913

Please sign in to comment.