fix: sanitize ChromaDB URL and update docker-compose CORS config
- src/semantic-cache.ts: Add robust URL sanitization in initialize(). Trim whitespace and reject malformed URLs (e.g. empty host like 'http://:8666') before passing to ChromaClient. - src/main.ts: Validate ChromaDB URL in the settings tab onChange. Fall back to 'http://localhost:8000' if the value is empty or lacks '://'. - docker-compose.yml: Add CHROMA_SERVER_CORS_ALLOW_ORIGINS=["*"] to allow cross-origin requests from Obsidian's app://obsidian.md origin.
This commit is contained in:
+2
-1
@@ -2,10 +2,11 @@ services:
|
||||
chroma:
|
||||
image: chromadb/chroma:latest
|
||||
ports:
|
||||
- "8666:8000"
|
||||
- '8666:8000'
|
||||
environment:
|
||||
- CHROMA_SERVER_HOST=0.0.0.0
|
||||
- CHROMA_SERVER_HTTP_PORT=8000
|
||||
- CHROMA_SERVER_CORS_ALLOW_ORIGINS=["*"]
|
||||
volumes:
|
||||
- chroma_data:/chroma/chroma
|
||||
restart: unless-stopped
|
||||
|
||||
Reference in New Issue
Block a user