92 lines
1.8 KiB
YAML
92 lines
1.8 KiB
YAML
# TYAPI Server Production Configuration
|
|
|
|
app:
|
|
name: "TYAPI Server"
|
|
version: "1.0.0"
|
|
env: "production"
|
|
|
|
server:
|
|
host: "0.0.0.0"
|
|
port: "8080"
|
|
mode: "release"
|
|
read_timeout: 60s
|
|
write_timeout: 60s
|
|
idle_timeout: 300s
|
|
|
|
database:
|
|
host: "${DB_HOST}"
|
|
port: "${DB_PORT}"
|
|
user: "${DB_USER}"
|
|
password: "Pg9mX4kL8nW2rT5y"
|
|
name: "${DB_NAME}"
|
|
sslmode: "require"
|
|
timezone: "UTC"
|
|
max_open_conns: 50
|
|
max_idle_conns: 25
|
|
conn_max_lifetime: 600s
|
|
|
|
redis:
|
|
host: "${REDIS_HOST}"
|
|
port: "${REDIS_PORT}"
|
|
password: "${REDIS_PASSWORD}"
|
|
db: 0
|
|
pool_size: 20
|
|
min_idle_conns: 5
|
|
max_retries: 3
|
|
dial_timeout: 10s
|
|
read_timeout: 5s
|
|
write_timeout: 5s
|
|
|
|
cache:
|
|
default_ttl: 7200s
|
|
cleanup_interval: 300s
|
|
max_size: 10000
|
|
|
|
logger:
|
|
level: "warn"
|
|
format: "json"
|
|
output: "stdout"
|
|
file_path: "/var/log/tyapi/app.log"
|
|
max_size: 500
|
|
max_backups: 10
|
|
max_age: 30
|
|
compress: true
|
|
|
|
jwt:
|
|
secret: "JwT8xR4mN9vP2sL7kH3oB6yC1zA5uF0qE9tW"
|
|
expires_in: 6h
|
|
refresh_expires_in: 72h # 3 days
|
|
|
|
ratelimit:
|
|
requests: 1000
|
|
window: 60s
|
|
burst: 200
|
|
|
|
monitoring:
|
|
metrics_enabled: true
|
|
metrics_port: "9090"
|
|
tracing_enabled: true
|
|
tracing_endpoint: "${JAEGER_ENDPOINT}"
|
|
sample_rate: 0.01
|
|
|
|
health:
|
|
enabled: true
|
|
interval: 60s
|
|
timeout: 30s
|
|
|
|
resilience:
|
|
circuit_breaker_enabled: true
|
|
circuit_breaker_threshold: 10
|
|
circuit_breaker_timeout: 300s
|
|
retry_max_attempts: 5
|
|
retry_initial_delay: 200ms
|
|
retry_max_delay: 30s
|
|
|
|
development:
|
|
debug: false
|
|
enable_profiler: false
|
|
enable_cors: true
|
|
cors_allowed_origins: "${CORS_ALLOWED_ORIGINS}"
|
|
cors_allowed_methods: "GET,POST,PUT,PATCH,DELETE,OPTIONS"
|
|
cors_allowed_headers: "Origin,Content-Type,Accept,Authorization,X-Requested-With"
|