Commit Graph
2090 Commits
Author SHA1 Message Date
Chris CoutinhoandClaude Opus 4.6 270ef82527 docs: optimize CLAUDE.md for db scripts, uv run, and deployment modes
- Discourage raw docker exec for database queries; use scripts/dbquery.py
  and scripts/sqlitequery.py exclusively
- Ensure all python commands use uv run prefix (mcp run, pytest, etc.)
- Replace Progressive Consent section with concise Deployment Modes
  overview (single-user, multi-user BasicAuth, Login Flow v2)
- Normalize docker-compose to docker compose throughout

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 15:52:51 +02:00
github-actions[bot] cbef665411 bump: version 0.58.22 → 0.58.23 2026-04-01 07:27:50 +00:00
github-actions[bot] 0c7384e52c bump: version 0.68.0 → 0.68.1 2026-04-01 07:27:50 +00:00
Chris CoutinhoandGitHub 7bfe3f0205 Merge pull request #673 from cbcoutinho/fix/672-bday-datetime-validation
fix: convert BDAY datetime.date to string before Pydantic validation
2026-04-01 09:27:31 +02:00
Chris CoutinhoandClaude Opus 4.6 da380a38c6 fix: convert BDAY datetime.date to string before Pydantic validation
pythonvCard4 parses vCard BDAY fields into datetime.date objects, but
the Contact model expects Optional[str]. This caused a validation error
that crashed the entire contact list. Convert at the client layer
(consistent with the calendar client pattern) with a defensive check
at the server mapping layer.

Closes #672

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 09:11:45 +02:00
github-actions[bot] 1812b5b0be bump: version 0.58.21 → 0.58.22 2026-04-01 07:03:04 +00:00
Chris CoutinhoandGitHub 0b89f5cdd7 Merge pull request #667 from cbcoutinho/renovate/tailscale-tailscale-replacement
chore(deps): replace tailscale/tailscale docker tag with docker.io/tailscale/tailscale v1.94.2
2026-04-01 09:02:48 +02:00
renovate-bot-cbcoutinho[bot]andGitHub 85e5ec1d60 chore(deps): replace tailscale/tailscale docker tag with docker.io/tailscale/tailscale v1.94.2 2026-03-31 22:08:37 +00:00
github-actions[bot] 97ae750916 bump: version 0.58.20 → 0.58.21 2026-03-31 17:06:01 +00:00
Chris CoutinhoandGitHub 2a3869d95f Merge pull request #670 from cbcoutinho/renovate/pin-dependencies
chore(deps): pin dependencies
2026-03-31 19:05:42 +02:00
renovate-bot-cbcoutinho[bot]andGitHub 2a0b3dde9f chore(deps): pin dependencies 2026-03-31 16:20:27 +00:00
github-actions[bot] f93366e60a bump: version 0.58.19 → 0.58.20 2026-03-31 15:24:43 +00:00
github-actions[bot] d3ced16ba9 bump: version 0.67.0 → 0.68.0 2026-03-31 15:24:43 +00:00
Chris CoutinhoandGitHub 0d5d1cff07 Merge pull request #669 from cbcoutinho/feat/login-flow-v2-web-provision
feat: add web-based Login Flow v2 provisioning endpoint
2026-03-31 17:24:16 +02:00
github-actions[bot] e3d712c97a bump: version 0.58.18 → 0.58.19 2026-03-31 15:23:20 +00:00
Chris CoutinhoandGitHub 8e73070d6a Merge pull request #666 from cbcoutinho/renovate/pin-dependencies
chore(deps): pin dependencies
2026-03-31 17:23:04 +02:00
Chris Coutinho 388ad404b4 chore: Update mariadb pin 2026-03-31 17:22:30 +02:00
Chris Coutinho cf09a71217 chore: Update image tags 2026-03-31 17:18:37 +02:00
Chris CoutinhoandClaude Opus 4.6 d06b862d24 fix: require bearer token on provision endpoints (open redirect mitigation)
Both /app/provision and /app/provision/status now require a valid
Nextcloud OIDC bearer token via the Authorization header, reusing the
existing validate_token_and_get_user pattern from the management API.

This eliminates the open redirect vulnerability (only authenticated
Astrolabe users can trigger the flow) and prevents unauthenticated
resource exhaustion via Login Flow v2 session creation.

The authenticated user_id from the token replaces the untrusted
user_id query parameter.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 17:09:37 +02:00
Chris CoutinhoandClaude Opus 4.6 775bee83e3 fix: address PR review round 3 — info disclosure, conditional routes, cleanup
- Replace exception details in user-facing error page with generic message
- Only register /app/provision routes when enable_login_flow is true
- Piggyback expired provision session cleanup on hourly cleanup loop
- Add multi-process limitation comment on in-memory session store
- Add comment explaining login_url vs poll_endpoint rewrite asymmetry
- Document curl dependency in Dockerfile (healthcheck probes)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 11:37:42 +02:00
Chris CoutinhoandClaude Opus 4.6 2508f36ebf fix: address PR review round 2 — expiry checks, race guards, poll tests
- Log warning if /app mount not found when sharing poll task group
- Add docstring explaining unconditional task group creation
- Check session expires_at in provision_status to catch stale sessions
- Guard _poll_and_store status writes against cleanup-while-polling race
- Use "error" status (not "expired") when app_password is missing
- Remove hardcoded "Astrolabe Background Sync" user_agent string
- Fix async mock pattern (new_callable=AsyncMock) in test
- Add autouse fixture to clear _provision_sessions between tests
- Add _poll_and_store unit tests: completed, expired, error, cleanup
- Document all status values in provision_status docstring

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 09:29:14 +02:00
Chris CoutinhoandClaude Opus 4.6 777a09c806 fix: address PR review — XSS escape, asyncio→anyio, URL rewrite dedup
- Escape HTML in _render_error to prevent XSS from exception messages
- Replace asyncio.create_task/sleep with anyio task group and sleep,
  tying poll task lifetime to the app lifespan for proper cleanup
- Extract rewrite_url_origin() utility to fix duplicated URL rewriting
  logic and replace urlparse._replace with stable urlunparse API
- Add warning log for insecure HTTP redirect URIs
- Add unit tests for validation, XSS escaping, route handlers, and
  URL rewriting (16 new tests in test_provision_routes.py)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 08:51:41 +02:00
Chris CoutinhoandClaude Opus 4.6 c21776948d fix: use app password auth for background sync in Login Flow mode
Login Flow v2 is a deployment-wide mode where all users authenticate
with app passwords (not OAuth refresh tokens). Set use_basic_auth=True
when enable_login_flow is true so the background sync user manager
queries the app_passwords table and scanners use app password
authentication for Nextcloud API calls.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 00:55:31 +02:00
Chris CoutinhoandClaude Opus 4.6 474cfe5e98 fix: discover Login Flow v2 users in OAuth mode user manager
When enable_login_flow is true, also check the app_passwords table
for provisioned users. Previously, OAuth mode only queried the
refresh_tokens table, missing users who were provisioned via
Login Flow v2 (which stores app passwords, not refresh tokens).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 00:48:02 +02:00
renovate-bot-cbcoutinho[bot]andGitHub 82ba662d13 chore(deps): pin dependencies 2026-03-29 22:18:40 +00:00
Chris CoutinhoandClaude Opus 4.6 eefede8c47 fix: rewrite Login Flow v2 poll endpoint URL to use configured host
Nextcloud returns poll/login URLs using its internal hostname (e.g.
http://localhost/login/v2/poll) which is unreachable from the MCP
server container in Docker networks. Rewrite the poll endpoint's
origin to use the configured NEXTCLOUD_HOST so server-side polling
works correctly.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 23:21:41 +02:00
Chris CoutinhoandClaude Opus 4.6 c2f23a566c fix: handle internal hostname without port in Login Flow v2 URL rewriting
Nextcloud may omit default ports in the login_url (e.g. http://app
instead of http://app:80). Extract just scheme+hostname from
NEXTCLOUD_HOST for the URL replacement check.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 23:11:42 +02:00
Chris CoutinhoandClaude Opus 4.6 1a51f5bbf5 refactor: use redirect-based Login Flow v2 provision instead of popup
Replace the popup-based approach with a direct redirect to Nextcloud's
login page. This is more compatible with Playwright E2E tests and
simpler for users. The background polling task still runs server-side
to store the app password when the user grants access.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 22:17:54 +02:00
Chris CoutinhoandClaude Opus 4.6 081ecbe401 feat: add web-based Login Flow v2 provisioning endpoint
Add /app/provision and /app/provision/status endpoints for browser-based
Login Flow v2 app password provisioning. Used by Astrolabe's "Enable
Semantic Search" to chain OAuth (bearer token) + Login Flow v2 (app
password) in a single user interaction.

The provision page initiates Login Flow v2, opens Nextcloud's login URL
in a popup, polls for completion via background task, and redirects back
to the caller's redirect_uri on success.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 21:56:16 +02:00
github-actions[bot] 2c5b4430b7 bump: version 0.58.17 → 0.58.18 2026-03-29 19:00:37 +00:00
github-actions[bot] 3e78510295 bump: version 0.66.2 → 0.67.0 2026-03-29 19:00:36 +00:00
Chris CoutinhoandGitHub d29408bacc Merge pull request #665 from cbcoutinho/feat/claude-funnel-config
feat: add Tailscale Funnel config for Claude AI connector testing
2026-03-29 21:00:16 +02:00
Chris CoutinhoandClaude Opus 4.6 b8dc1d7f52 feat: add Tailscale Funnel config for Claude AI connector testing
Add docker compose services (tailscale-mcp + nginx-claude-filter) behind
a claude-funnel profile that expose the login-flow MCP server via
Tailscale Funnel with IP-based access control:

- /mcp endpoint restricted to Claude AI outbound IPs (160.79.104.0/21)
- /oauth/*, /.well-known/*, /app paths open to all IPs (user login flow)
- All other paths return 404

Also add favicon.png served at /favicon.ico for connector directory
discovery (Google favicon service).

Usage:
  docker compose --profile login-flow --profile claude-funnel up -d

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 21:00:00 +02:00
github-actions[bot] 592fb8f5e2 bump: version 0.58.16 → 0.58.17 2026-03-29 18:58:13 +00:00
github-actions[bot] 39138ec117 bump: version 0.66.1 → 0.66.2 2026-03-29 18:58:12 +00:00
Chris CoutinhoandGitHub 8a501375bb Merge pull request #664 from cbcoutinho/fix/login-flow-oauth-compat
fix: resolve OAuth compatibility issues for login-flow deployment
2026-03-29 20:57:52 +02:00
Chris CoutinhoandClaude Opus 4.6 25788eecc7 fix: allow HTTPS redirect URIs for non-localhost OAuth clients
Relax redirect_uri validation to accept HTTPS for remote hosts (e.g.,
cloud-hosted MCP clients like Claude AI) while keeping HTTP allowed
for localhost per RFC 8252 loopback exception.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 19:03:25 +02:00
Chris CoutinhoandClaude Opus 4.6 f151eb10b3 fix: move Astrolabe OAuth hook to before-starting for reliable OIDC client creation
Move 26-configure-astrolabe-oauth.sh from post-installation (runs once
on first boot) to before-starting (runs on every start). This ensures
the Astrolabe OIDC client is created as soon as MCP_SERVER_URL is
available, even if it wasn't set during initial installation.

Also copy 25-configure-mcp-server-url.sh to before-starting so the
mcp_server_url config stays current across container recreations.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 18:39:49 +02:00
Chris CoutinhoandClaude Opus 4.6 fe8799a133 fix: resolve OAuth compatibility issues for login-flow deployment
- Drop OIDC fork: comment out third_party/oidc mount, use upstream
  v1.16.3 from app store (fixes consent redirect race, PR #631)
- Support client_secret_basic auth: add _extract_basic_auth() helper
  so TS MCP SDK can authenticate at token endpoint (RFC 6749 §2.3.1)
- Multi-issuer JWT validation: accept tokens with internal Docker
  issuer (http://app:80) or public URL (NEXTCLOUD_PUBLIC_ISSUER_URL)
  since AS proxy obtains tokens server-to-server
- Introspection fallback: try token introspection when JWT verification
  fails, supporting both JWT and opaque token types
- Register all tool scopes in DCR: add semantic:read, collectives:read,
  collectives:write to OIDC client allowed_scopes so tokens include
  them and semantic search tools are visible to authenticated clients
- Auto-create Astrolabe OAuth client: new app-hook creates OIDC client
  and stores credentials in config.php so the "Authorize via OAuth"
  button works without manual setup

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 15:05:26 +02:00
github-actions[bot] 3cf4c777ed bump: version 0.58.15 → 0.58.16 2026-03-28 14:59:22 +00:00
Chris CoutinhoandGitHub 78d3da6611 Merge pull request #662 from cbcoutinho/renovate/nextcloud-33-33.x
chore(deps): update nextcloud-33 docker tag to v33.0.1
2026-03-28 15:59:05 +01:00
renovate-bot-cbcoutinho[bot]andGitHub 4354ee7270 chore(deps): update nextcloud-33 docker tag to v33.0.1 2026-03-28 11:20:49 +00:00
github-actions[bot] bd81477295 bump: version 0.58.14 → 0.58.15 2026-03-28 09:53:31 +00:00
github-actions[bot] 1948360b83 bump: version 0.66.0 → 0.66.1 2026-03-28 09:53:31 +00:00
Chris CoutinhoandGitHub 89791a558b Merge pull request #657 from cbcoutinho/fix/renovate-nextcloud-version-pinning
fix: pin Renovate Nextcloud updates to matching major version
2026-03-28 10:53:11 +01:00
Chris CoutinhoandGitHub fd303dde36 Merge pull request #651 from cbcoutinho/renovate/docker.io-qdrant-qdrant-1.x
chore(deps): update docker.io/qdrant/qdrant docker tag to v1.17.1
2026-03-28 10:52:57 +01:00
github-actions[bot] 407203d020 bump: version 0.58.13 → 0.58.14 2026-03-28 09:52:52 +00:00
Chris CoutinhoandGitHub 8729b1dd1f Merge pull request #652 from cbcoutinho/renovate/qdrant-1.x
chore(deps): update helm release qdrant to v1.17.1
2026-03-28 10:52:37 +01:00
github-actions[bot] d5b9b2ed04 bump: version 0.58.12 → 0.58.13 2026-03-28 09:52:11 +00:00
Chris CoutinhoandGitHub a4d1e5f6a6 Merge pull request #654 from cbcoutinho/renovate/anthropics-claude-code-action-1.x
chore(deps): update anthropics/claude-code-action action to v1.0.81
2026-03-28 10:51:54 +01:00