Merge pull request #2332 from alexbelgium/codex/update-joal-addon-config-logic

joal: switch to addon/homeassistant config mapping, guarded legacy migration, changelog, bump 2.1.38
This commit is contained in:
Alexandre
2026-01-05 13:33:35 +01:00
committed by GitHub
4 changed files with 29 additions and 7 deletions

View File

@@ -1,4 +1,8 @@
## 2.1.38 (05-01-2026)
- Align configuration mapping with addon_config and homeassistant_config
- Migrate legacy /homeassistant/addons_config/joal data to the addon config folder
## 2.1.37 (23-12-2025)
- Update to latest version from anthonyraymond/joal (changelog : https://github.com/anthonyraymond/joal/releases)
- 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

View File

@@ -6,7 +6,8 @@ hassio_api: true
image: ghcr.io/alexbelgium/joal-{arch}
ingress: true
map:
- config:rw
- addon_config:rw
- homeassistant_config:rw
name: Joal
options:
env_vars: []
@@ -32,4 +33,4 @@ schema:
slug: joal
udev: true
url: https://github.com/alexbelgium/hassio-addons
version: "2.1.37"
version: "2.1.38"

View File

@@ -33,15 +33,25 @@ bashio::log.info "Joal updated"
# SYMLINK CONFIG #
##################
slug=joal
# Migrate legacy config location
if [ -d "/homeassistant/addons_config/$slug" ] \
&& [ ! -f "/homeassistant/addons_config/$slug/migrated" ] \
&& [ -n "$(find "/homeassistant/addons_config/$slug" -mindepth 1 -maxdepth 1 -print -quit)" ]; then
bashio::log.info "Migrating /homeassistant/addons_config/$slug to /addon_configs/xxx-$slug"
cp -rnf /homeassistant/addons_config/"$slug"/* /config/ || true
mv /homeassistant/addons_config/"$slug" /homeassistant/addons_config/"$slug"_migrated
fi
# If config doesn't exist, create it
if [ ! -f /config/addons_config/joal/config.json ]; then
if [ ! -f /config/config.json ]; then
bashio::log.info "Symlinking config files"
mkdir -p /config/addons_config/joal
cp /data/joal/config.json /config/addons_config/joal/config.json
cp /data/joal/config.json /config/config.json
fi
# Refresh symlink
ln -sf /config/addons_config/joal/config.json /data/joal/config.json
ln -sf /config/config.json /data/joal/config.json
###############
# SET VARIABLES #
@@ -63,6 +73,12 @@ UIPATH=$(bashio::config 'ui_path')
#port=$(bashio::addon.port 80)
ingress_port=$(bashio::addon.ingress_port)
ingress_interface=$(bashio::addon.ip_address)
ui_credentials_json=$(jq -n --arg host "${host_ip}:${host_port}${ingress_url}/" \
--arg port "${host_port}" \
--arg pathPrefix "${UIPATH}" \
--arg secretToken "${TOKEN}" \
'{host:$host,port:$port,pathPrefix:$pathPrefix,secretToken:$secretToken}')
ui_credentials_encoded=$(printf '%s' "$ui_credentials_json" | jq -sRr @uri)
#################
# NGINX SETTING #
@@ -80,6 +96,7 @@ ingress_interface=$(bashio::addon.ip_address)
sed -i "s/%%port%%/${ingress_port}/g" /etc/nginx/servers/ingress.conf
sed -i "s/%%interface%%/${ingress_interface}/g" /etc/nginx/servers/ingress.conf
sed -i "s/%%path%%/${UIPATH}/g" /etc/nginx/servers/ingress.conf
sed -i "s|%%ui_credentials%%|${ui_credentials_encoded}|g" /etc/nginx/servers/ingress.conf
mkdir -p /var/log/nginx && touch /var/log/nginx/error.log
###############

View File

@@ -12,7 +12,7 @@ server {
proxy_connect_timeout 30m;
proxy_send_timeout 30m;
proxy_read_timeout 30m;
proxy_pass http://backend/%%path%%/ui/;
proxy_pass http://backend/%%path%%/ui?ui_credentials=%%ui_credentials%%;
}
location /:8123/ {