fc1a2f5103
- Migrate database from SQLite to PostgreSQL 16 (dual-backend with SQLite fallback) - Add Streamable HTTP MCP transport (replaces SSE): /readonly/mcp, /write/mcp, /mcp - Add OAuth ctxd.write scope and public write MCP surface - Add ctxd.write token validation (write-scoped tokens only on /write/mcp) - Add env-driven configuration (.env file with env var precedence over ctxd.yaml) - Add PostgreSQL to docker-compose.yml with healthcheck - Add psycopg dependency, migration script (SQLite → PostgreSQL) - Add admin UI: projects tab with typed-confirm delete, user management (list/manage subtabs) - Add OAuth client management: create, list, revoke (UI, CLI, API) - Add user active/inactive lifecycle (PATCH/DELETE APIs) - Add public landing page with themed login form (cookie-based session) - Add get_client_guide MCP tool (locked LLM-CLIENT.MD in ctxd-docs project) - Add DELETE /projects/<id> endpoint with cascading deletes - Add project_delete to db.py with FK ON DELETE SET NULL for audit_log - Add cookie-based session auth (ctxd_session cookie on login) - Add landing.html (public host) vs ui.html (internal dashboard) - Add schema_sqlite.sql for SQLite fallback - Add auth_password.py (PBKDF2-SHA256 password hashing) - Add .env.example template with all documented env vars - Add README.md with full setup, config, API, CLI, and troubleshooting docs - Add SKILL.md (canonical LLM client guide, lives in project root) - Update Traefik template: route everything except /mcp - Update OAuth discovery: advertise ctxd.write scope, /readonly/mcp resource - Update Hermes MCP config: /mcp endpoint with Bearer header - Remove DB-level audit_log triggers (conflict with FK ON DELETE SET NULL) - Remove SSE transport code (replaced by Streamable HTTP) - Untrack __pycache__ and data/ctxd.db from git
64 lines
3.0 KiB
Bash
64 lines
3.0 KiB
Bash
# ════════════════════════════════════════════════════════════════════
|
|
# CTXD — Context Dossier Environment Configuration
|
|
# Copy to .env and fill in your values. All variables are optional
|
|
# unless running in Docker (DATABASE_URL, CTXD_API_KEY, OAUTH_* required).
|
|
#
|
|
# Precedence: env var > ctxd.yaml (in /data) > built-in defaults
|
|
# ════════════════════════════════════════════════════════════════════
|
|
|
|
# ── Database ────────────────────────────────────────────────────────
|
|
# Full PostgreSQL connection string. If empty, CTXD falls back to SQLite
|
|
# at /data/ctxd.db (or CTXD_HOME/ctxd.db).
|
|
DATABASE_URL=postgresql://ctxd:ctxd_local_dev@postgres:5432/ctxd
|
|
|
|
# Postgres container settings (only used when running the bundled PG)
|
|
POSTGRES_USER=ctxd
|
|
POSTGRES_PASSWORD=ctxd_local_dev
|
|
POSTGRES_DB=ctxd
|
|
|
|
# ── Server ──────────────────────────────────────────────────────────
|
|
# Bind address and port inside the container
|
|
CTXD_HOST=0.0.0.0
|
|
CTXD_PORT=9091
|
|
|
|
# Data directory (inside container)
|
|
CTXD_HOME=/data
|
|
|
|
# Uvicorn log level: debug, info, warning, error
|
|
LOG_LEVEL=info
|
|
|
|
# ── Auth ────────────────────────────────────────────────────────────
|
|
# Enable authentication globally
|
|
CTXD_AUTH_ENABLED=true
|
|
|
|
# Shared API key for Hermes/internal MCP + HTTP auth
|
|
CTXD_API_KEY=
|
|
|
|
# Legacy read-only key for /readonly/sse ?key= migration
|
|
CTXD_EXTERNAL_READONLY_KEY=
|
|
|
|
# ── OAuth ───────────────────────────────────────────────────────────
|
|
# Enable the OAuth authorization server
|
|
OAUTH_ENABLED=true
|
|
|
|
# Public URL of the server (used in OAuth discovery metadata)
|
|
OAUTH_ISSUER=https://ctxd.example.com
|
|
|
|
# Fallback approval key for /oauth/authorize
|
|
OAUTH_APPROVAL_KEY=
|
|
|
|
# Which user ID to attribute OAuth approvals to
|
|
OAUTH_APPROVAL_USER_ID=admin
|
|
|
|
# Token lifetimes in seconds
|
|
OAUTH_ACCESS_TOKEN_TTL=3600
|
|
OAUTH_REFRESH_TOKEN_TTL=2592000
|
|
|
|
# ── Web Sessions ────────────────────────────────────────────────────
|
|
# Session cookie lifetime in seconds (default: 7 days)
|
|
WEB_SESSION_TTL=604800
|
|
|
|
# ── Snapshots ───────────────────────────────────────────────────────
|
|
# Min/max snapshots retained per project before rotation
|
|
SNAPSHOT_MIN_KEEP=5
|
|
SNAPSHOT_MAX_KEEP=25 |