mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-08-25 06:13:32 +02:00
Immich: address Copilot PR review findings
- Fix check_vchord_extension (and check_vector_extension) to query pg_available_extensions against the actual immich database instead of pg_extension on the default connection database. Immich creates the vchord extension itself on first startup, so checking pg_extension before Immich ever runs produced a false warning on every fresh install; checking pg_available_extensions reports whether the server CAN provide the extension, which is what the startup diagnostic actually needs. - Drop the vestigial `services: - mysql:want` Supervisor service-discovery hint from the four Immich config.yaml files: nothing in the add-on reads it, and the scripts are hard-coded to PostgreSQL via psql — Immich has never supported MySQL. Also fix the matching misleading line in the base README. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PcbbgB7A5LLbPuPRjLUouk
This commit is contained in:
@@ -46,7 +46,7 @@ See the official [v3 migration guide](https://immich.app/blog/v3-migration) for
|
|||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
|
|
||||||
Webui can be found at `<your-ip>:8080`. PostgreSQL/MySQL can be either internal or external.
|
Webui can be found at `<your-ip>:8080`. PostgreSQL can be either internal or external.
|
||||||
|
|
||||||
### Options
|
### Options
|
||||||
|
|
||||||
|
|||||||
@@ -137,8 +137,6 @@ schema:
|
|||||||
localdisks: str?
|
localdisks: str?
|
||||||
networkdisks: str?
|
networkdisks: str?
|
||||||
skip_permissions_check: bool?
|
skip_permissions_check: bool?
|
||||||
services:
|
|
||||||
- mysql:want
|
|
||||||
slug: immich
|
slug: immich
|
||||||
udev: true
|
udev: true
|
||||||
url: https://github.com/alexbelgium/hassio-addons
|
url: https://github.com/alexbelgium/hassio-addons
|
||||||
|
|||||||
@@ -144,28 +144,31 @@ EOF
|
|||||||
bashio::log.info "Database setup completed successfully."
|
bashio::log.info "Database setup completed successfully."
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to check if vectors extension is enabled
|
# Function to check if the vectors (pgvecto.rs) extension is available on the server
|
||||||
check_vector_extension() {
|
check_vector_extension() {
|
||||||
echo "Checking if 'vectors' extension is enabled..."
|
echo "Checking if 'vectors' extension is available for database '${DB_DATABASE_NAME}'..."
|
||||||
RESULT=$(psql "postgres://$DB_USERNAME:$DB_PASSWORD@$DB_HOSTNAME:$DB_PORT" -tAc "SELECT extname FROM pg_extension WHERE extname = 'vectors';")
|
RESULT=$(psql "postgres://$DB_USERNAME:$DB_PASSWORD@$DB_HOSTNAME:$DB_PORT/${DB_DATABASE_NAME}" -tAc "SELECT 1 FROM pg_available_extensions WHERE name = 'vectors';")
|
||||||
if [[ "$RESULT" == "vectors" ]]; then
|
if [[ "$RESULT" == "1" ]]; then
|
||||||
echo "✅ 'vectors' extension is enabled."
|
echo "✅ 'vectors' extension is available."
|
||||||
return 0
|
return 0
|
||||||
else
|
else
|
||||||
bashio::log.warning "❌ 'vectors' extension is NOT enabled."
|
bashio::log.warning "❌ 'vectors' extension is NOT available."
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to check if vchord extension is enabled
|
# Function to check if the VectorChord (vchord) extension is available on the server.
|
||||||
|
# Uses pg_available_extensions (whether the extension CAN be created) rather than
|
||||||
|
# pg_extension (whether it has already been created), since Immich creates the extension
|
||||||
|
# itself on first startup; checking pg_extension would false-warn on every fresh install.
|
||||||
check_vchord_extension() {
|
check_vchord_extension() {
|
||||||
echo "Checking if 'vchord' extension is enabled..."
|
echo "Checking if 'vchord' extension is available for database '${DB_DATABASE_NAME}'..."
|
||||||
RESULT=$(psql "postgres://$DB_USERNAME:$DB_PASSWORD@$DB_HOSTNAME:$DB_PORT" -tAc "SELECT extname FROM pg_extension WHERE extname = 'vchord';")
|
RESULT=$(psql "postgres://$DB_USERNAME:$DB_PASSWORD@$DB_HOSTNAME:$DB_PORT/${DB_DATABASE_NAME}" -tAc "SELECT 1 FROM pg_available_extensions WHERE name = 'vchord';")
|
||||||
if [[ "$RESULT" == "vchord" ]]; then
|
if [[ "$RESULT" == "1" ]]; then
|
||||||
echo "✅ 'vchord' extension is enabled."
|
echo "✅ 'vchord' extension is available."
|
||||||
return 0
|
return 0
|
||||||
else
|
else
|
||||||
bashio::log.warning "❌ 'vchord' extension is NOT enabled."
|
bashio::log.warning "❌ 'vchord' extension is NOT available."
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -135,8 +135,6 @@ schema:
|
|||||||
localdisks: str?
|
localdisks: str?
|
||||||
networkdisks: str?
|
networkdisks: str?
|
||||||
skip_permissions_check: bool?
|
skip_permissions_check: bool?
|
||||||
services:
|
|
||||||
- mysql:want
|
|
||||||
slug: immich_cuda
|
slug: immich_cuda
|
||||||
udev: true
|
udev: true
|
||||||
url: https://github.com/alexbelgium/hassio-addons
|
url: https://github.com/alexbelgium/hassio-addons
|
||||||
|
|||||||
@@ -136,8 +136,6 @@ schema:
|
|||||||
localdisks: str?
|
localdisks: str?
|
||||||
networkdisks: str?
|
networkdisks: str?
|
||||||
skip_permissions_check: bool?
|
skip_permissions_check: bool?
|
||||||
services:
|
|
||||||
- mysql:want
|
|
||||||
slug: immich_noml
|
slug: immich_noml
|
||||||
udev: true
|
udev: true
|
||||||
url: https://github.com/alexbelgium/hassio-addons
|
url: https://github.com/alexbelgium/hassio-addons
|
||||||
|
|||||||
@@ -136,8 +136,6 @@ schema:
|
|||||||
localdisks: str?
|
localdisks: str?
|
||||||
networkdisks: str?
|
networkdisks: str?
|
||||||
skip_permissions_check: bool?
|
skip_permissions_check: bool?
|
||||||
services:
|
|
||||||
- mysql:want
|
|
||||||
slug: immich_openvino
|
slug: immich_openvino
|
||||||
udev: true
|
udev: true
|
||||||
url: https://github.com/alexbelgium/hassio-addons
|
url: https://github.com/alexbelgium/hassio-addons
|
||||||
|
|||||||
Reference in New Issue
Block a user