diff --git a/README.md b/README.md index 0a60f44..ae9001b 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,8 @@ pgvector is included in the official PostgreSQL's APT repository: sudo apt install postgresql(-17)-pgvector ``` + * [VectorChord](https://docs.vectorchord.ai/vectorchord/getting-started/installation.html) + * [FFmpeg](https://github.com/FFmpeg/FFmpeg) Immich uses FFmpeg to process media. @@ -114,6 +116,7 @@ postgres=# create user immich with encrypted password 'YOUR_STRONG_RANDOM_PW'; postgres=# grant all privileges on database immich to immich; postgres=# ALTER USER immich WITH SUPERUSER; postgres=# CREATE EXTENSION IF NOT EXISTS vector; +postgres=# CREATE EXTENSION IF NOT EXISTS vchord CASCADE; postgres=# \q ``` diff --git a/env b/env index d621b50..529bf78 100644 --- a/env +++ b/env @@ -9,7 +9,6 @@ NODE_ENV=production DB_USERNAME=immich DB_DATABASE_NAME=immich -DB_VECTOR_EXTENSION=pgvector # The location where your uploaded files are stored UPLOAD_LOCATION=./library diff --git a/install.sh b/install.sh index 9c195c2..4d074d2 100755 --- a/install.sh +++ b/install.sh @@ -37,6 +37,22 @@ if [[ "$USER" != "immich" ]]; then exit 0 fi +# Sanity check, users should have VectorChord enabled +if psql -U immich -c "SELECT 1;" > /dev/null 2>&1; then + # Immich is installed, check VectorChord + if ! psql -U immich -c "SELECT * FROM pg_extension;" | grep "vchord" > /dev/null 2>&1; then + echo "VectorChord is not enabled for Immich." + echo "Please read https://github.com/immich-app/immich/blob/main/docs/docs/administration/postgres-standalone.md" + exit 1 + fi +fi +if [ -e "$IMMICH_PATH/env" ]; then + if grep -q DB_VECTOR_EXTENSION "$IMMICH_PATH/env"; then + echo "Please remove DB_VECTOR_EXTENSION from your env file" + exit 1 + fi +fi + BASEDIR=$(dirname "$0") umask 077