diff --git a/.env.example b/.env.example index 0c93b0d..4861ce6 100644 --- a/.env.example +++ b/.env.example @@ -1,23 +1,3 @@ -# ── Syncthing MCP — environment variables ────────────────────────── -# -# Copy this file to .env and fill in real values before deployment. - -# Domain used by Traefik for the ACME certificate and Host() rule. DOMAIN=example.com - -# Bearer token that clients must send as "Authorization: Bearer ". -# Generate one with: openssl rand -hex 32 MCP_AUTH_TOKEN=CHANGEME - -# ── Syncthing instances ───────────────────────────────────────────── -# JSON object keyed by friendly name. Each entry needs url + api_key. -# -# NOTE: From inside the Docker network, use the Docker hostname or -# host-gateway IP for instances running on the same machine. -# For remote instances, use their LAN / Tailscale / WireGuard address. -SYNCTHING_INSTANCES='{ - "mini": {"url": "http://mini.local:8384", "api_key": "MINI_API_KEY"}, - "tn-sb": {"url": "http://host.docker.internal:8384", "api_key": "SB_API_KEY"}, - "tn-mr2": {"url": "http://tn-mr2.local:8384", "api_key": "MR2_API_KEY"}, - "p-mba": {"url": "http://p-mba.local:8384", "api_key": "MBA_API_KEY"} -}' +SYNCTHING_INSTANCES={"tn-sb":{"url":"http://tn-sb.gen4.cc:8384","api_key":"CHANGEME"},"tn-mr2":{"url":"http://tn-mr2.gen4.cc:8384","api_key":"CHANGEME"},"p-mba":{"url":"http://p-mba.gen4.cc:8384","api_key":"CHANGEME"},"p-mbp":{"url":"http://p-mbp.gen4.cc:8384","api_key":"CHANGEME"},"mini":{"url":"http://mini.gen4.cc:8384","api_key":"CHANGEME"}} diff --git a/.gitignore b/.gitignore index aea4ba1..4370bf1 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ dist/ *.old .pytest_cache/ .env +.env diff --git a/docker-compose.yml b/docker-compose.yml index 273ae33..8d13d22 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -14,21 +14,16 @@ services: MCP_TRANSPORT: streamable-http MCP_HOST: "0.0.0.0" MCP_PORT: "8000" - # MCP_AUTH_TOKEN is set in .env - # SYNCTHING_INSTANCES is set in .env expose: - "8000" networks: - traefik labels: - # --- Traefik v2 / v3 labels --- traefik.enable: "true" traefik.http.routers.syncthing-mcp.rule: Host(`syncthing-mcp.${DOMAIN:?set DOMAIN in .env}`) traefik.http.routers.syncthing-mcp.entrypoints: websecure traefik.http.routers.syncthing-mcp.tls.certresolver: letsencrypt traefik.http.services.syncthing-mcp.loadbalancer.server.port: "8000" - - # Health check route (Traefik can use this for backends). traefik.http.services.syncthing-mcp.loadbalancer.healthcheck.path: /health traefik.http.services.syncthing-mcp.loadbalancer.healthcheck.interval: 30s diff --git a/pyproject.toml b/pyproject.toml index 2b578ab..64af123 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,6 +9,8 @@ dependencies = [ "pydantic>=2.0.0", "uvicorn>=0.30.0", "starlette>=0.37.0", + "uvicorn>=0.30.0", + "starlette>=0.37.0", ] [project.scripts] diff --git a/src/syncthing_mcp/__main__.py b/src/syncthing_mcp/__main__.py index e894736..7b9cc97 100644 --- a/src/syncthing_mcp/__main__.py +++ b/src/syncthing_mcp/__main__.py @@ -24,8 +24,6 @@ def _run_http() -> None: token = os.environ.get("MCP_AUTH_TOKEN", "").strip() if token: - # Wrap the ASGI app with bearer-token middleware and run via - # uvicorn directly so we keep the session-manager lifespan intact. import uvicorn from syncthing_mcp.auth import BearerAuthMiddleware