# rs3gw Environment Configuration Example
# Copy this file to .env and customize for your environment
# Note: .env files override rs3gw.toml settings
# ============================================================================
# BASIC CONFIGURATION
# ============================================================================
# Server bind address
RS3GW_BIND_ADDR=0.0.0.0:9000
# Storage root directory (use fast SSD/NVMe for production)
RS3GW_STORAGE_ROOT=./data
# Default bucket name
RS3GW_DEFAULT_BUCKET=default
# ============================================================================
# AUTHENTICATION & SECURITY
# ============================================================================
# AWS-compatible access credentials
# Leave empty to disable authentication (development only!)
RS3GW_ACCESS_KEY=
RS3GW_SECRET_KEY=
# TLS/HTTPS Configuration
# Paths to TLS certificate and private key (PEM format)
RS3GW_TLS_CERT=
RS3GW_TLS_KEY=
# ============================================================================
# COMPRESSION
# ============================================================================
# Compression algorithm: none, zstd, zstd:LEVEL (1-22), lz4
# Recommended: zstd:3 for balanced performance and compression ratio
RS3GW_COMPRESSION=none
# ============================================================================
# NETWORK & TIMEOUTS
# ============================================================================
# Request timeout in seconds (0 = no timeout)
# Increase for large file uploads/downloads
RS3GW_REQUEST_TIMEOUT=300
# Maximum concurrent requests (0 = no limit)
# Tune based on available CPU cores and memory
RS3GW_MAX_CONCURRENT=0
# Connection pool settings
RS3GW_POOL_MAX_IDLE=32
RS3GW_POOL_IDLE_TIMEOUT=90
RS3GW_CONNECT_TIMEOUT=30
RS3GW_CLIENT_TIMEOUT=300
# ============================================================================
# CACHING
# ============================================================================
# Enable object caching
RS3GW_CACHE_ENABLED=true
# Maximum cache size in MB
RS3GW_CACHE_MAX_SIZE_MB=256
# Maximum number of cached objects
RS3GW_CACHE_MAX_OBJECTS=10000
# Cache TTL in seconds
RS3GW_CACHE_TTL=300
# ============================================================================
# DEDUPLICATION
# ============================================================================
# Enable data deduplication (30-70% storage savings)
RS3GW_DEDUP_ENABLED=true
# Block size for deduplication in bytes (4096-1048576)
# 65536 (64KB) is recommended for most workloads
RS3GW_DEDUP_BLOCK_SIZE=65536
# Chunking algorithm: fixed-size or content-defined
# content-defined provides better dedup ratio but slightly slower
RS3GW_DEDUP_ALGORITHM=fixed-size
# Minimum object size for deduplication in bytes
# Objects smaller than this are not deduplicated
RS3GW_DEDUP_MIN_SIZE=131072
# ============================================================================
# ZERO-COPY OPTIMIZATIONS (Linux)
# ============================================================================
# Enable direct I/O for large objects
RS3GW_ZEROCOPY_DIRECT_IO=true
# Minimum size for direct I/O in bytes (1MB default)
RS3GW_ZEROCOPY_DIRECT_IO_THRESHOLD=1048576
# Enable splice/sendfile for zero-copy operations (Linux only)
RS3GW_ZEROCOPY_SPLICE=true
# Enable memory-mapped metadata files
RS3GW_ZEROCOPY_MMAP=true
# ============================================================================
# CLUSTER MODE
# ============================================================================
# Enable cluster mode for high availability
RS3GW_CLUSTER_ENABLED=false
# Unique node identifier (auto-generated if not specified)
# RS3GW_CLUSTER_NODE_ID=node-1
# Address for cluster communication
RS3GW_CLUSTER_ADVERTISE_ADDR=127.0.0.1:9001
# Port for cluster gossip/replication
RS3GW_CLUSTER_PORT=9001
# Comma-separated list of seed nodes
# RS3GW_CLUSTER_SEED_NODES=node1:9001,node2:9001,node3:9001
# Replication mode: sync, async, or quorum
RS3GW_REPLICATION_MODE=async
# Number of replicas (including primary)
RS3GW_REPLICATION_FACTOR=2
# ============================================================================
# THROTTLING & QUOTAS
# ============================================================================
# Enable bandwidth/rate throttling
RS3GW_THROTTLE_ENABLED=false
# Max requests per second (0 = unlimited)
RS3GW_THROTTLE_RPS=0
# Upload bandwidth limit in MB/s (0 = unlimited)
RS3GW_THROTTLE_UPLOAD_MBPS=0
# Download bandwidth limit in MB/s (0 = unlimited)
RS3GW_THROTTLE_DOWNLOAD_MBPS=0
# Enable storage quotas
RS3GW_QUOTA_ENABLED=false
# Default max storage per bucket in GB (0 = unlimited)
RS3GW_QUOTA_MAX_STORAGE_GB=0
# Default max objects per bucket (0 = unlimited)
RS3GW_QUOTA_MAX_OBJECTS=0
# ============================================================================
# OBSERVABILITY & MONITORING
# ============================================================================
# OpenTelemetry OTLP endpoint for distributed tracing
# OTEL_EXPORTER_OTLP_ENDPOINT=http://jaeger:4317
# Trace sampling ratio (0.0-1.0)
# OTEL_TRACES_SAMPLER=traceidratio
# OTEL_TRACES_SAMPLER_ARG=0.1
# Service identification
# RS3GW_SERVICE_NAME=rs3gw-production
# RS3GW_SERVICE_VERSION=1.0.0
# RS3GW_ENVIRONMENT=production
# Profiling settings
# RS3GW_PROFILING_ENABLED=true
# RS3GW_PROFILING_INTERVAL_SECS=60
# RS3GW_PROFILING_MAX_SNAPSHOTS=100
# Resource management
# RS3GW_MIN_THREADS=4
# RS3GW_MAX_THREADS=32
# RS3GW_TARGET_CPU=0.75
# RS3GW_MEMORY_THRESHOLD=0.85
# RS3GW_ADJUSTMENT_INTERVAL=60
# Adaptive rate limiting
# RS3GW_ADAPTIVE_RATE_LIMIT=true
# RS3GW_INITIAL_RATE_LIMIT=1000
# RS3GW_MIN_RATE_LIMIT=100
# RS3GW_MAX_RATE_LIMIT=10000
# Load shedding threshold (0.0-1.0)
# RS3GW_LOAD_SHEDDING_THRESHOLD=0.95
# ============================================================================
# AUDIT LOGGING
# ============================================================================
# Enable comprehensive audit logging
# RS3GW_AUDIT_ENABLED=true
# RS3GW_AUDIT_LOG_PATH=/var/log/rs3gw/audit.log
# RS3GW_AUDIT_ROTATION_SIZE=100MB
# Syslog forwarding (RFC 5424)
# RS3GW_AUDIT_SYSLOG_ENABLED=false
# RS3GW_AUDIT_SYSLOG_ENDPOINT=syslog.example.com:514
# RS3GW_AUDIT_SYSLOG_PROTOCOL=udp
# S3 log forwarding
# RS3GW_AUDIT_S3_ENABLED=false
# RS3GW_AUDIT_S3_BUCKET=audit-logs
# RS3GW_AUDIT_S3_PREFIX=rs3gw/
# ============================================================================
# ADVANCED FEATURES
# ============================================================================
# Self-healing configuration
# RS3GW_SELFHEAL_CHECK_INTERVAL=3600
# RS3GW_SELFHEAL_REPAIR_ENABLED=true
# RS3GW_SELFHEAL_MAX_CONCURRENT_REPAIRS=5
# RS3GW_SELFHEAL_CORRUPTION_THRESHOLD=0.01
# RS3GW_SELFHEAL_AUTO_CLEANUP=false
# RS3GW_SELFHEAL_RETENTION_DAYS=30
# Encryption settings
# RS3GW_ENCRYPTION_ENABLED=true
# RS3GW_ENCRYPTION_ALGORITHM=aes-256-gcm
# ============================================================================
# LOGGING
# ============================================================================
# Rust log level: error, warn, info, debug, trace
# You can also set per-module levels: rs3gw=debug,tower=info
RUST_LOG=info
# ============================================================================
# DEVELOPMENT & TESTING
# ============================================================================
# Enable backtrace on panic
# RUST_BACKTRACE=1
# Enable full backtrace
# RUST_BACKTRACE=full