mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-08-02 11:20:32 +02:00
fix: force IPv4 for MariaDB connections in photoprism to resolve HAOS 17.3 IPv6 issue
Agent-Logs-Url: https://github.com/alexbelgium/hassio-addons/sessions/4d98e9f3-cdc8-4e3e-b631-1bbd56309cb8 Co-authored-by: alexbelgium <44178713+alexbelgium@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
86babf734d
commit
785269c1c2
@@ -1,4 +1,8 @@
|
|||||||
|
|
||||||
|
## ubuntu-2026-03-05-1 (2026-05-10)
|
||||||
|
|
||||||
|
- Fix: Force IPv4 for MariaDB connections to resolve access denied errors after HAOS 17.3 (IPv6 networking change)
|
||||||
|
|
||||||
## ubuntu-2026-03-05 (2026-03-05)
|
## ubuntu-2026-03-05 (2026-03-05)
|
||||||
- Update to latest version from photoprism/photoprism
|
- Update to latest version from photoprism/photoprism
|
||||||
## ubuntu-2025-11-30-4 (26-02-2026)
|
## ubuntu-2025-11-30-4 (26-02-2026)
|
||||||
|
|||||||
@@ -131,5 +131,5 @@ services:
|
|||||||
slug: photoprism
|
slug: photoprism
|
||||||
udev: true
|
udev: true
|
||||||
url: https://github.com/alexbelgium/hassio-addons
|
url: https://github.com/alexbelgium/hassio-addons
|
||||||
version: "ubuntu-2026-03-05"
|
version: "ubuntu-2026-03-05-1"
|
||||||
video: true
|
video: true
|
||||||
|
|||||||
@@ -30,7 +30,16 @@ case $(bashio::config 'DB_TYPE') in
|
|||||||
|
|
||||||
# Use values
|
# Use values
|
||||||
PHOTOPRISM_DATABASE_DRIVER="mysql"
|
PHOTOPRISM_DATABASE_DRIVER="mysql"
|
||||||
PHOTOPRISM_DATABASE_SERVER="$(bashio::services 'mysql' 'host'):$(bashio::services 'mysql' 'port')"
|
MYSQL_HOST="$(bashio::services 'mysql' 'host')"
|
||||||
|
MYSQL_PORT="$(bashio::services 'mysql' 'port')"
|
||||||
|
|
||||||
|
# Force IPv4 to avoid access denied errors when the container network uses IPv6 (HAOS 17.3+)
|
||||||
|
if MYSQL_HOST_V4=$(getent ahostsv4 "$MYSQL_HOST" 2>/dev/null | awk 'NR==1{print $1}') && [ -n "$MYSQL_HOST_V4" ]; then
|
||||||
|
bashio::log.info "Resolved MariaDB host to IPv4: $MYSQL_HOST_V4"
|
||||||
|
MYSQL_HOST="$MYSQL_HOST_V4"
|
||||||
|
fi
|
||||||
|
|
||||||
|
PHOTOPRISM_DATABASE_SERVER="${MYSQL_HOST}:${MYSQL_PORT}"
|
||||||
PHOTOPRISM_DATABASE_NAME="photoprism"
|
PHOTOPRISM_DATABASE_NAME="photoprism"
|
||||||
PHOTOPRISM_DATABASE_USER="$(bashio::services 'mysql' 'username')"
|
PHOTOPRISM_DATABASE_USER="$(bashio::services 'mysql' 'username')"
|
||||||
PHOTOPRISM_DATABASE_PASSWORD="$(bashio::services 'mysql' 'password')"
|
PHOTOPRISM_DATABASE_PASSWORD="$(bashio::services 'mysql' 'password')"
|
||||||
@@ -58,9 +67,9 @@ case $(bashio::config 'DB_TYPE') in
|
|||||||
bashio::log.warning "Uninstalling the MariaDB addon will remove any data"
|
bashio::log.warning "Uninstalling the MariaDB addon will remove any data"
|
||||||
|
|
||||||
# Create database
|
# Create database
|
||||||
mysql --skip-ssl --host="$(bashio::services 'mysql' 'host')" --port="$(bashio::services 'mysql' 'port')" --user="$PHOTOPRISM_DATABASE_USER" --password="$PHOTOPRISM_DATABASE_PASSWORD" -e"CREATE DATABASE IF NOT EXISTS $PHOTOPRISM_DATABASE_NAME;"
|
mysql --skip-ssl --host="$MYSQL_HOST" --port="$MYSQL_PORT" --user="$PHOTOPRISM_DATABASE_USER" --password="$PHOTOPRISM_DATABASE_PASSWORD" -e"CREATE DATABASE IF NOT EXISTS $PHOTOPRISM_DATABASE_NAME;"
|
||||||
# Force character set
|
# Force character set
|
||||||
mysql --skip-ssl --host="$(bashio::services 'mysql' 'host')" --port="$(bashio::services 'mysql' 'port')" --user="$PHOTOPRISM_DATABASE_USER" --password="$PHOTOPRISM_DATABASE_PASSWORD" -e"ALTER DATABASE $PHOTOPRISM_DATABASE_NAME CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci;" || true
|
mysql --skip-ssl --host="$MYSQL_HOST" --port="$MYSQL_PORT" --user="$PHOTOPRISM_DATABASE_USER" --password="$PHOTOPRISM_DATABASE_PASSWORD" -e"ALTER DATABASE $PHOTOPRISM_DATABASE_NAME CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci;" || true
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user