184 lines
5.6 KiB
Plaintext
184 lines
5.6 KiB
Plaintext
|
|
# ============================================================================
|
||
|
|
# WebDAV Server Configuration
|
||
|
|
# Copy this file to .env and modify as needed
|
||
|
|
# ============================================================================
|
||
|
|
|
||
|
|
# ----------------------------------------------------------------------------
|
||
|
|
# Server Configuration
|
||
|
|
# ----------------------------------------------------------------------------
|
||
|
|
HOST=0.0.0.0
|
||
|
|
PORT=8080
|
||
|
|
|
||
|
|
# SSL/TLS Configuration (recommended for production)
|
||
|
|
SSL_ENABLED=false
|
||
|
|
SSL_CERT_PATH=/path/to/cert.pem
|
||
|
|
SSL_KEY_PATH=/path/to/key.pem
|
||
|
|
|
||
|
|
# ----------------------------------------------------------------------------
|
||
|
|
# Database Configuration
|
||
|
|
# ----------------------------------------------------------------------------
|
||
|
|
DB_PATH=./webdav.db
|
||
|
|
DB_BACKUP_INTERVAL=3600
|
||
|
|
DB_VACUUM_INTERVAL=86400
|
||
|
|
|
||
|
|
# ----------------------------------------------------------------------------
|
||
|
|
# Authentication Configuration
|
||
|
|
# ----------------------------------------------------------------------------
|
||
|
|
# Supported methods: basic, digest, token (comma-separated)
|
||
|
|
AUTH_METHODS=basic,digest
|
||
|
|
|
||
|
|
# Secret key for JWT and session encryption (generate with: python -c "import secrets; print(secrets.token_hex(32))")
|
||
|
|
JWT_SECRET_KEY=your-secret-key-here-change-this-in-production
|
||
|
|
|
||
|
|
# Session timeout in seconds (1 hour default)
|
||
|
|
SESSION_TIMEOUT=3600
|
||
|
|
|
||
|
|
# Password requirements
|
||
|
|
PASSWORD_MIN_LENGTH=8
|
||
|
|
PASSWORD_REQUIRE_UPPERCASE=true
|
||
|
|
PASSWORD_REQUIRE_NUMBERS=true
|
||
|
|
PASSWORD_REQUIRE_SPECIAL=true
|
||
|
|
|
||
|
|
# ----------------------------------------------------------------------------
|
||
|
|
# WebDAV Configuration
|
||
|
|
# ----------------------------------------------------------------------------
|
||
|
|
# WebDAV root directory (where user files are stored)
|
||
|
|
WEBDAV_ROOT=./webdav
|
||
|
|
|
||
|
|
# Maximum file size in bytes (100MB default)
|
||
|
|
MAX_FILE_SIZE=104857600
|
||
|
|
|
||
|
|
# Maximum PROPFIND depth (3 default, use lower value for better performance)
|
||
|
|
MAX_PROPFIND_DEPTH=3
|
||
|
|
|
||
|
|
# Default lock timeout in seconds (1 hour default)
|
||
|
|
LOCK_TIMEOUT_DEFAULT=3600
|
||
|
|
|
||
|
|
# Windows compatibility mode (recommended: true)
|
||
|
|
ENABLE_WINDOWS_COMPATIBILITY=true
|
||
|
|
|
||
|
|
# ----------------------------------------------------------------------------
|
||
|
|
# Performance Configuration
|
||
|
|
# ----------------------------------------------------------------------------
|
||
|
|
# Maximum concurrent connections
|
||
|
|
MAX_CONNECTIONS=1000
|
||
|
|
|
||
|
|
# Keep-alive timeout in seconds
|
||
|
|
KEEPALIVE_TIMEOUT=30
|
||
|
|
|
||
|
|
# Client timeout in seconds
|
||
|
|
CLIENT_TIMEOUT=60
|
||
|
|
|
||
|
|
# Worker connections (for production deployment)
|
||
|
|
WORKER_CONNECTIONS=1024
|
||
|
|
|
||
|
|
# Number of worker processes (for gunicorn)
|
||
|
|
WORKERS=4
|
||
|
|
|
||
|
|
# ----------------------------------------------------------------------------
|
||
|
|
# Logging Configuration
|
||
|
|
# ----------------------------------------------------------------------------
|
||
|
|
# Log level: DEBUG, INFO, WARNING, ERROR, CRITICAL
|
||
|
|
LOG_LEVEL=INFO
|
||
|
|
|
||
|
|
# Log file paths
|
||
|
|
LOG_FILE=./logs/webdav.log
|
||
|
|
ACCESS_LOG_FILE=./logs/access.log
|
||
|
|
ERROR_LOG_FILE=./logs/error.log
|
||
|
|
|
||
|
|
# Enable/disable specific logs
|
||
|
|
ACCESS_LOG_ENABLED=true
|
||
|
|
ERROR_LOG_ENABLED=true
|
||
|
|
DEBUG_LOG_ENABLED=false
|
||
|
|
|
||
|
|
# ----------------------------------------------------------------------------
|
||
|
|
# Security Configuration
|
||
|
|
# ----------------------------------------------------------------------------
|
||
|
|
# CORS settings
|
||
|
|
CORS_ENABLED=false
|
||
|
|
CORS_ORIGINS=*
|
||
|
|
CORS_METHODS=GET,POST,PUT,DELETE,OPTIONS,PROPFIND,PROPPATCH,MKCOL,COPY,MOVE,LOCK,UNLOCK
|
||
|
|
|
||
|
|
# Rate limiting
|
||
|
|
RATE_LIMIT_ENABLED=true
|
||
|
|
RATE_LIMIT_REQUESTS=100
|
||
|
|
RATE_LIMIT_WINDOW=60
|
||
|
|
|
||
|
|
# Brute force protection
|
||
|
|
MAX_LOGIN_ATTEMPTS=5
|
||
|
|
LOGIN_ATTEMPT_WINDOW=300
|
||
|
|
ACCOUNT_LOCKOUT_DURATION=900
|
||
|
|
|
||
|
|
# IP whitelist/blacklist (comma-separated)
|
||
|
|
IP_WHITELIST=
|
||
|
|
IP_BLACKLIST=
|
||
|
|
|
||
|
|
# ----------------------------------------------------------------------------
|
||
|
|
# Storage Configuration
|
||
|
|
# ----------------------------------------------------------------------------
|
||
|
|
# User storage quotas in bytes (0 = unlimited)
|
||
|
|
DEFAULT_USER_QUOTA=10737418240 # 10GB
|
||
|
|
|
||
|
|
# Shared folder configuration
|
||
|
|
SHARED_FOLDER_ENABLED=true
|
||
|
|
PUBLIC_FOLDER_ENABLED=false
|
||
|
|
|
||
|
|
# File versioning
|
||
|
|
ENABLE_FILE_VERSIONING=false
|
||
|
|
MAX_FILE_VERSIONS=5
|
||
|
|
|
||
|
|
# ----------------------------------------------------------------------------
|
||
|
|
# Cache Configuration (Optional - requires Redis)
|
||
|
|
# ----------------------------------------------------------------------------
|
||
|
|
CACHE_ENABLED=false
|
||
|
|
REDIS_HOST=localhost
|
||
|
|
REDIS_PORT=6379
|
||
|
|
REDIS_DB=0
|
||
|
|
REDIS_PASSWORD=
|
||
|
|
|
||
|
|
# Cache TTL in seconds
|
||
|
|
CACHE_TTL_SESSION=3600
|
||
|
|
CACHE_TTL_LOCKS=1800
|
||
|
|
CACHE_TTL_PROPERTIES=300
|
||
|
|
|
||
|
|
# ----------------------------------------------------------------------------
|
||
|
|
# Monitoring and Metrics (Optional)
|
||
|
|
# ----------------------------------------------------------------------------
|
||
|
|
METRICS_ENABLED=false
|
||
|
|
PROMETHEUS_PORT=9090
|
||
|
|
|
||
|
|
# Health check endpoint
|
||
|
|
HEALTHCHECK_ENABLED=true
|
||
|
|
HEALTHCHECK_PATH=/health
|
||
|
|
|
||
|
|
# ----------------------------------------------------------------------------
|
||
|
|
# Email Configuration (for notifications)
|
||
|
|
# ----------------------------------------------------------------------------
|
||
|
|
EMAIL_ENABLED=false
|
||
|
|
SMTP_HOST=smtp.gmail.com
|
||
|
|
SMTP_PORT=587
|
||
|
|
SMTP_USER=your-email@gmail.com
|
||
|
|
SMTP_PASSWORD=your-app-password
|
||
|
|
SMTP_FROM=webdav@example.com
|
||
|
|
SMTP_USE_TLS=true
|
||
|
|
|
||
|
|
# ----------------------------------------------------------------------------
|
||
|
|
# Backup Configuration
|
||
|
|
# ----------------------------------------------------------------------------
|
||
|
|
BACKUP_ENABLED=true
|
||
|
|
BACKUP_PATH=./backups
|
||
|
|
BACKUP_SCHEDULE=0 2 * * * # Daily at 2 AM (cron format)
|
||
|
|
BACKUP_RETENTION_DAYS=30
|
||
|
|
|
||
|
|
# ----------------------------------------------------------------------------
|
||
|
|
# Development Settings
|
||
|
|
# ----------------------------------------------------------------------------
|
||
|
|
# Enable debug mode (DO NOT use in production)
|
||
|
|
DEBUG=false
|
||
|
|
|
||
|
|
# Auto-reload on code changes (development only)
|
||
|
|
AUTO_RELOAD=false
|
||
|
|
|
||
|
|
# Enable detailed error messages
|
||
|
|
DETAILED_ERRORS=false
|