claw-code/.guardrails/.env.example

102 lines
3.3 KiB
Plaintext

# Guardrail MCP Server - Environment Configuration
# Copy this file to .env and fill in sensitive values
# .env is gitignored and should NEVER be committed
# =============================================================================
# REQUIRED: Security Keys
# =============================================================================
# API key for MCP protocol clients (Claude Code, OpenCode, etc.)
# Generate with: openssl rand -hex 32
MCP_API_KEY=
# API key for IDE extensions (VS Code, JetBrains, Vim)
# Web UI runs in same container - no key needed
# Generate with: openssl rand -hex 32
IDE_API_KEY=
# =============================================================================
# REQUIRED: PostgreSQL Database
# =============================================================================
# Database password (generate strong password)
# Example: DB_PASSWORD=$(openssl rand -base64 32)
DB_PASSWORD=
# =============================================================================
# Optional: Server Configuration
# =============================================================================
# MCP Server port (default: 8080)
MCP_PORT=8080
# Web UI port (default: 8081)
WEB_PORT=8081
# Enable web UI (default: true)
WEB_ENABLED=true
# Log level: debug, info, warn, error (default: info)
LOG_LEVEL=info
# Request timeout (default: 30s)
REQUEST_TIMEOUT=30s
# =============================================================================
# Optional: Database Configuration
# =============================================================================
# Database host (default: localhost, use 'postgres' for container network)
DB_HOST=postgres
# Database port (default: 5432)
DB_PORT=5432
# Database name (default: guardrails)
DB_NAME=guardrails
# Database user (default: guardrails)
DB_USER=guardrails
# SSL mode: disable, prefer, require (default: prefer, use 'disable' for internal)
DB_SSLMODE=disable
# =============================================================================
# Optional: Ingest Configuration (for initial data load)
# =============================================================================
# Path to guardrails repository (mounted into container)
REPO_PATH=/data/repo
# Failure registry file path
REGISTRY_PATH=/data/repo/.guardrails/failure-registry.jsonl
# Prevention rules directory
RULES_PATH=/data/repo/.guardrails/prevention-rules
# =============================================================================
# Optional: Feature Flags
# =============================================================================
# Enable guardrail validation (default: true)
ENABLE_VALIDATION=true
# =============================================================================
# Deployment Examples
# =============================================================================
# For production deployment via podman-compose:
#
# 1. Create .env file on target server:
# MCP_API_KEY=$(openssl rand -hex 32)
# WEB_API_KEY=$(openssl rand -hex 32)
# DB_PASSWORD=$(openssl rand -base64 32)
#
# 2. Source and deploy:
# set -a && source .env && set +a
# podman-compose -f deploy/podman-compose.yml up -d
#
# 3. Verify:
# curl -H "Authorization: Bearer $MCP_API_KEY" http://localhost:8080/health
# curl -H "Authorization: Bearer $WEB_API_KEY" http://localhost:8081/api/health