Commit graph

4 commits

Author SHA1 Message Date
User
382cc97e98 Fix MCP transport for reverse-proxy deployment (Invalid Host header + http redirect)
Two bugs surfaced deploying behind Cloudflare+Caddy at a public domain:

1. MCP streamable-HTTP DNS-rebinding protection has empty allowed_hosts by
   default, so a proxied public Host returns 421 'Invalid Host header'. Added
   MCP_ALLOWED_HOSTS (comma-separated; '*' disables) wiring into the FastMCP
   transport_security settings; localhost added automatically.
2. The /mcp -> /mcp/ mount redirect downgraded to http:// because uvicorn
   ignored X-Forwarded-Proto. Run uvicorn with --proxy-headers
   --forwarded-allow-ips='*' so redirects stay https behind the proxy.

Verified locally: valid Host+token initializes (200 SSE), redirect Location is
https, spoofed Host still 421, missing token still 401.

Set MCP_ALLOWED_HOSTS=websearch.neilbantoc.dev on the deployment and redeploy.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-06 11:08:48 -07:00
User
e6c2cc1e8c Prepare for public release: AGPL license, curl installer, bearer-token auth
- LICENSE: AGPL-3.0
- install.sh: curl-pipeable bootstrap for Linux/macOS (VPS/LXC) — installs
  Docker if missing, clones, generates strong LWSS_API_KEY + SearXNG secret,
  compose up, prints the ready-to-run 'claude mcp add' command; idempotent and
  preserves .env on re-run
- auth: optional bearer token (LWSS_API_KEY) on all orchestrator MCP + REST
  requests via middleware; /health exempt; empty key disables auth (LAN only);
  constant-time compare
- compose: configurable bind address (ORCHESTRATOR_BIND, default 0.0.0.0) so
  the endpoint can stay localhost-only behind a tunnel; API key plumbed through
- docker-compose.override.yml pattern (gitignored) + .example for machine-local
  config like LAN SearXNG extra_hosts
- README: install one-liner, auth + security (SSRF/tunnel) notes, license
- PRD: auth documented in §8; multi-tenant non-goal clarified

Verified: auth rejects unauthenticated REST + MCP (401), passes with a valid
bearer token, /health stays open; full dockerized stack healthy; MCP client
connects only with the Authorization header.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-06 00:43:04 -07:00
User
56e7fa16dd M2: extraction quality — fallback extractors, thin-content detection, result cache
- extractor: trafilatura (precision) -> trafilatura (recall) -> readability-lxml
  fallback chain; longest result wins; 'thin' flag below 200 chars
- orchestrator: Redis-backed scrape-result cache keyed by URL (cache hit skips
  render entirely); thin/empty results are never cached
- /health reports orchestrator Redis reachability

Verified: HN + synthetic thin/empty/boilerplate pages; cache hit path via fakeredis.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-05 22:05:04 -07:00
User
e2b329b2bb M1: scrape spine — renderer, extractor, orchestrator /scrape, compose, health, render cache
- renderer: Node/Playwright, single browser + pooled contexts with concurrency
  cap and FIFO queue, Redis render cache (graceful no-op without Redis)
- extractor: FastAPI + Trafilatura, HTML -> {title, text, metadata}
- orchestrator: /scrape (render -> extract) with per-stage trace, aggregated
  /health, structured JSON logging on all services
- docker-compose for orchestrator/renderer/extractor/redis with healthchecks

Verified locally: end-to-end scrape of example.com and Wikipedia; error paths
for unreachable hosts and bad schemes.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-05 22:02:38 -07:00