feat(config): add optional IMMICH_DB_URL for pgvector spike
Optional Postgres DSN field on Config (REST creds stay required), env.example entry, and a throwaway scripts/requirements-spike.txt (psycopg3 + pgvector) kept out of the app's runtime deps. Unblocks the M1.5 pgvector feasibility spike.
This commit is contained in:
@@ -17,6 +17,10 @@ class Config:
|
||||
immich_api_key: str
|
||||
anthropic_api_key: str
|
||||
data_dir: str
|
||||
# Postgres DSN for read-only access to Immich's pgvector embeddings.
|
||||
# Optional: only the pgvector spike / M1.5 visual-similarity work needs it;
|
||||
# REST creds (immich_url/api_key) stay required.
|
||||
immich_db_url: Optional[str] = None
|
||||
|
||||
@property
|
||||
def db_path(self) -> str:
|
||||
@@ -33,9 +37,11 @@ def load_config(env: Optional[Mapping] = None) -> Config:
|
||||
if missing:
|
||||
raise ConfigError(missing)
|
||||
data_dir = (env.get("DATA_DIR") or "").strip() or os.path.join(os.getcwd(), "data")
|
||||
immich_db_url = (env.get("IMMICH_DB_URL") or "").strip() or None
|
||||
return Config(
|
||||
immich_url=env["IMMICH_URL"].strip().rstrip("/"),
|
||||
immich_api_key=env["IMMICH_API_KEY"].strip(),
|
||||
anthropic_api_key=(env.get("ANTHROPIC_API_KEY") or "").strip(),
|
||||
data_dir=data_dir,
|
||||
immich_db_url=immich_db_url,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user