mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-09-07 18:29:10 +02:00
The addon builds every psql connection as a postgres:// URI with the raw username and password interpolated in. libpq percent-decodes the userinfo part of a URI, so a password containing '%' (or '@', '/', '?', '#') is decoded into different bytes before it reaches the server, and every connection fails with "password authentication failed for user". Encode the credentials with jq's @uri once and use the encoded copies in the URIs only; the raw password is still what gets handed to Immich via export_db_env and what is written by CREATE/ALTER USER. Those SQL statements now double single quotes so a password containing a single quote no longer breaks the statement either. This is the same approach already used by the postgres_15 and postgres_17 addons in this repo. Closes #1614 Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com> Co-authored-by: Claude Opus 5 <noreply@anthropic.com>