Files
tyapi-server/config.yaml

109 lines
2.2 KiB
YAML
Raw Normal View History

# TYAPI Server Configuration
2025-07-02 16:17:59 +08:00
# 🎯 统一配置文件,包含所有默认配置值
app:
name: "TYAPI Server"
version: "1.0.0"
env: "development"
server:
host: "0.0.0.0"
port: "8080"
mode: "debug"
read_timeout: 30s
write_timeout: 30s
idle_timeout: 120s
database:
host: "localhost"
port: "5432"
user: "postgres"
password: "Pg9mX4kL8nW2rT5y"
name: "tyapi_dev"
sslmode: "disable"
timezone: "Asia/Shanghai"
max_open_conns: 25
max_idle_conns: 10
conn_max_lifetime: 300s
2025-07-02 16:17:59 +08:00
auto_migrate: true
redis:
host: "localhost"
port: "6379"
password: ""
db: 0
pool_size: 10
min_idle_conns: 3
max_retries: 3
dial_timeout: 5s
read_timeout: 3s
write_timeout: 3s
cache:
default_ttl: 3600s
cleanup_interval: 600s
max_size: 1000
logger:
level: "info"
2025-07-02 16:17:59 +08:00
format: "console"
output: "stdout"
file_path: "logs/app.log"
max_size: 100
max_backups: 3
max_age: 7
compress: true
2025-07-02 16:17:59 +08:00
use_color: true
jwt:
2025-07-02 16:17:59 +08:00
secret: "default-jwt-secret-key-change-in-env-config"
expires_in: 24h
2025-07-02 16:17:59 +08:00
refresh_expires_in: 168h
sms:
access_key_id: "LTAI5tKGB3TVJbMHSoZN3yr9"
access_key_secret: "OCQ30GWp4yENMjmfOAaagksE18bp65"
endpoint_url: "dysmsapi.aliyuncs.com"
sign_name: "天远数据"
template_code: "SMS_474525324"
code_length: 6
expire_time: 5m
mock_enabled: false
rate_limit:
daily_limit: 10
hourly_limit: 5
min_interval: 60s
ratelimit:
2025-07-02 16:17:59 +08:00
requests: 5000
window: 60s
2025-07-02 16:17:59 +08:00
burst: 100
monitoring:
metrics_enabled: true
metrics_port: "9090"
2025-07-02 16:17:59 +08:00
tracing_enabled: true
tracing_endpoint: "http://localhost:4317"
sample_rate: 0.1
health:
enabled: true
interval: 30s
timeout: 10s
resilience:
circuit_breaker_enabled: true
circuit_breaker_threshold: 5
circuit_breaker_timeout: 60s
retry_max_attempts: 3
retry_initial_delay: 100ms
retry_max_delay: 5s
development:
debug: true
enable_profiler: true
enable_cors: true
cors_allowed_origins: "http://localhost:3000,http://localhost:3001"
cors_allowed_methods: "GET,POST,PUT,PATCH,DELETE,OPTIONS"
cors_allowed_headers: "Origin,Content-Type,Accept,Authorization,X-Requested-With"