Files
mcp-nextcloud/env.sample.oauth-multi-user
T
Chris CoutinhoandClaude Opus 4.8 407d0d765b docs(env): mark token storage required for login_flow
Round-6 review: in env.sample.oauth-multi-user, TOKEN_ENCRYPTION_KEY and
TOKEN_STORAGE_DB sat under "OPTIONAL: SEMANTIC SEARCH", but they're required for
any login_flow deployment (per-user app passwords must be persisted). Move them
into a dedicated "REQUIRED: APP-PASSWORD STORAGE" block with a pointer to
docs/login-flow-v2.md#setup so a login_flow-without-semantic-search user copying
the template doesn't miss them.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-14 12:50:21 +02:00

86 lines
3.4 KiB
Plaintext

# ============================================
# LOGIN FLOW v2 MULTI-USER QUICK START (Recommended)
# ============================================
# Multi-user deployment with OAuth/OIDC authentication (ADR-022).
# Use for: Multi-user production deployments, enhanced security.
# The MCP server authenticates clients via OIDC and holds per-user
# Nextcloud app passwords (encrypted) obtained via Login Flow v2.
#
# See docs/login-flow-v2.md for the full guide.
# Copy this file to .env and configure
# ===== REQUIRED SETTINGS =====
# Your Nextcloud instance URL (without trailing slash)
NEXTCLOUD_HOST=https://nextcloud.example.com
# ===== REQUIRED: LEAVE USERNAME/PASSWORD EMPTY =====
# OAuth mode activates when these are NOT set
NEXTCLOUD_USERNAME=
NEXTCLOUD_PASSWORD=
# ===== REQUIRED: DEPLOYMENT MODE =====
MCP_DEPLOYMENT_MODE=login_flow
# ===== STRONGLY RECOMMENDED: STATIC OIDC CLIENT =====
# Register a static client for the MCP server in your IdP and set these.
# With Nextcloud's built-in `oidc` app you MUST do this: the DCR fallback
# registers an ephemeral client that the app deletes after ~1h, which breaks
# auth permanently ("Access forbidden" on reconnect — see issue #907).
# Create one under Administration settings -> OpenID Connect provider.
NEXTCLOUD_OIDC_CLIENT_ID=<your-client-id>
NEXTCLOUD_OIDC_CLIENT_SECRET=<your-client-secret>
# MCP Server URL (for OAuth redirects)
NEXTCLOUD_MCP_SERVER_URL=http://localhost:8000
# ===== REQUIRED: APP-PASSWORD STORAGE =====
# Required for login_flow — per-user Nextcloud app passwords are stored here
# (encrypted) so they survive restarts. See docs/login-flow-v2.md#setup.
# Generate encryption key: python -c "from cryptography.fernet import Fernet; print(Fernet.generate_key().decode())"
TOKEN_ENCRYPTION_KEY=<your-encryption-key>
TOKEN_STORAGE_DB=/app/data/tokens.db
# ===== OPTIONAL: SEMANTIC SEARCH (Recommended) =====
# AI-powered semantic search with automatic background operation setup
#
# When you enable semantic search in multi-user mode:
# 1. ENABLE_SEMANTIC_SEARCH automatically enables background operations
# 2. Server requests refresh tokens for offline indexing
# 3. Tokens are stored encrypted in TOKEN_STORAGE_DB
# 4. No need to set ENABLE_BACKGROUND_OPERATIONS separately!
#
ENABLE_SEMANTIC_SEARCH=true
# Vector Database (required for semantic search)
QDRANT_URL=http://qdrant:6333
# OR for in-memory mode:
#QDRANT_LOCATION=:memory:
# Embedding Provider (required for semantic search)
# Option 1: Ollama (recommended for local deployment)
OLLAMA_BASE_URL=http://ollama:11434
OLLAMA_EMBEDDING_MODEL=nomic-embed-text
# Option 2: Amazon Bedrock (for AWS deployments)
#AWS_REGION=us-east-1
#BEDROCK_EMBEDDING_MODEL=amazon.titan-embed-text-v2:0
# ===== OPTIONAL: DOCUMENT PROCESSING =====
# Extract text from PDFs, images, DOCX for semantic search
#ENABLE_DOCUMENT_PROCESSING=true
#ENABLE_UNSTRUCTURED=true
#UNSTRUCTURED_API_URL=http://unstructured:8000
# ===== SUMMARY OF AUTO-ENABLEMENT =====
# With ENABLE_SEMANTIC_SEARCH=true in OAuth mode:
# ✅ Background operations enabled automatically
# ✅ Refresh token storage enabled automatically
# ✅ Static OIDC client credentials required (see above)
# ✅ Encryption key required for token storage
#
# You only need to set ENABLE_SEMANTIC_SEARCH and provide the required
# infrastructure (static OIDC client, Qdrant, Ollama, encryption key).
# The rest is automatic!
# For more advanced configuration, see env.sample