4 Commits

Author SHA1 Message Date
fegger ce109cf6fb fix: prevent race conditions during vault index rebuild and rate-limit embeddings
- Add AbortController to cancel ongoing indexing before clear/rebuild
- Track currentIndexingPromise to await cancellation before clearing collection
- Batch background indexing (5 files at a time) with 100ms delays between batches
- Skip incremental event-based indexing while a full rebuild is in progress
- Cancel indexing on plugin unload
- Fix nginx CORS headers on OPTIONS preflight responses
2026-05-19 23:29:34 +02:00
fegger 4f3472a49c fix: move all CORS headers into nginx location block
Server-level add_header does not reliably attach to proxied upstream
responses. Moving all CORS directives inside location / ensures they
are present on every response ChromaDB sends back, including 4xx/5xx.

Also removes the redundant CHROMA_SERVER_CORS_ALLOW_ORIGINS from the
chroma service so only Nginx manages CORS, avoiding conflicting
duplicate headers.
2026-05-19 22:21:44 +02:00
fegger b62ad15be8 fix: move CORS OPTIONS handling into nginx location block
Nginx does not allow add_header inside if blocks at the server level.
Moving the OPTIONS preflight response into the location / block fixes the
emerg directive error and allows nginx to start correctly.
2026-05-19 22:15:04 +02:00
fegger 76887ea8ca feat: add Nginx reverse proxy for robust CORS handling
Replace direct host port mapping with an Nginx reverse proxy that properly
handles CORS for any origin, including Obsidian's app://obsidian.md.

- docker-compose.yml: Add nginx service on port 8666, route to internal
  chroma:8000. Remove CORS env var from ChromaDB (handled by proxy now).

- nginx.conf (new): Minimal alpine config with permissive CORS headers,
  preflight OPTIONS handling, and streaming support (proxy_buffering off).

This fixes cross-origin access from remote Obsidian clients connecting over
Tailscale or VPN.
2026-05-19 22:08:11 +02:00