[server]
host = "127.0.0.1"
port = 3000
max_connections = 10000
request_timeout_secs = 30
keep_alive_timeout_secs = 60
max_body_size = 16777216
worker_threads = 4
enable_http2 = true
enable_tls = false
tls_cert_path = "/path/to/cert.pem"
tls_key_path = "/path/to/key.pem"
graceful_shutdown_timeout_secs = 30
[security]
enable_cors = true
cors_allowed_origins = ["*"]
cors_allowed_methods = ["GET", "POST", "PUT", "DELETE", "OPTIONS", "PATCH"]
cors_allowed_headers = ["Content-Type", "Authorization", "X-Requested-With", "X-API-Key"]
enable_security_headers = true
content_security_policy = "default-src 'self'; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline'; img-src 'self' data: https:; font-src 'self' https:; connect-src 'self'; frame-ancestors 'none';"
enable_request_signing = false
signing_secret = "your-secret-key-here"
enable_ip_whitelist = false
ip_whitelist = ["192.168.1.0/24", "10.0.0.0/8"]
enable_request_id = true
max_request_size = 16777216
enable_input_validation = true
enable_sql_injection_protection = true
enable_xss_protection = true
[monitoring]
enable_request_logging = true
log_level = "info"
log_format = "json"
log_file = "/var/log/torch/app.log"
enable_metrics = true
metrics_endpoint = "/metrics"
enable_health_check = true
health_check_endpoint = "/health"
enable_performance_monitoring = true
slow_request_threshold_ms = 1000
enable_error_tracking = true
error_tracking_url = "https://your-error-tracking-service.com/api"
enable_distributed_tracing = false
tracing_endpoint = "http://jaeger:14268/api/traces"
[performance]
enable_compression = true
compression_level = 6
enable_caching = true
cache_ttl_secs = 300
max_cache_size_mb = 100
enable_connection_pooling = true
connection_pool_size = 100
connection_pool_timeout_secs = 30
enable_keep_alive = true
keep_alive_timeout_secs = 60
[rate_limiting]
enable_rate_limiting = true
global_rps_limit = 10000
per_ip_rps_limit = 100
per_user_rps_limit = 1000
window_secs = 60
enable_burst = true
burst_size = 10
storage_backend = "memory"
redis_url = "redis://localhost:6379"
[database]
url = "postgresql://user:password@localhost:5432/myapp"
max_connections = 32
min_connections = 5
connect_timeout_secs = 30
query_timeout_secs = 60
enable_pooling = true
enable_query_logging = false
enable_migrations = true
migrations_dir = "migrations"
[custom]
app_name = "My Torch Application"
version = "1.0.0"
environment = "development"
debug_mode = true
api_version = "v1"
default_page_size = 20
max_page_size = 100
[custom.features]
enable_user_registration = true
enable_email_verification = true
enable_two_factor_auth = false
enable_social_login = true
enable_file_uploads = true
max_file_size_mb = 10
[custom.services]
email_service_url = "https://api.sendgrid.com"
payment_service_url = "https://api.stripe.com"
storage_service_url = "https://s3.amazonaws.com"
notification_service_url = "https://api.pusher.com"
[custom.secrets]
jwt_secret = "your-jwt-secret-here"
encryption_key = "your-encryption-key-here"
api_key = "your-api-key-here"
webhook_secret = "your-webhook-secret-here"
[custom.deployment]
cluster_name = "torch-cluster"
namespace = "default"
replica_count = 3
auto_scaling_enabled = true
min_replicas = 2
max_replicas = 10
cpu_threshold = 70
memory_threshold = 80