101 lines
1.9 KiB
YAML
101 lines
1.9 KiB
YAML
# 生产环境配置
|
|
app:
|
|
name: "Photography Portfolio"
|
|
version: "1.0.0"
|
|
environment: "production"
|
|
port: 8080
|
|
debug: false
|
|
|
|
# 数据库配置
|
|
database:
|
|
host: "localhost"
|
|
port: 5432
|
|
username: "postgres"
|
|
password: "${DB_PASSWORD}"
|
|
database: "photography"
|
|
ssl_mode: "require"
|
|
max_open_conns: 200
|
|
max_idle_conns: 20
|
|
conn_max_lifetime: 3600
|
|
|
|
# Redis配置
|
|
redis:
|
|
host: "localhost"
|
|
port: 6379
|
|
password: "${REDIS_PASSWORD}"
|
|
database: 0
|
|
pool_size: 50
|
|
min_idle_conns: 10
|
|
|
|
# JWT配置
|
|
jwt:
|
|
secret: "${JWT_SECRET}"
|
|
expires_in: "24h"
|
|
refresh_expires_in: "168h"
|
|
|
|
# 存储配置
|
|
storage:
|
|
type: "local" # 生产环境建议使用 s3 或 oss
|
|
local:
|
|
base_path: "/var/www/photography/uploads"
|
|
base_url: "https://photography.iriver.top/uploads"
|
|
s3:
|
|
region: "${AWS_REGION}"
|
|
bucket: "${AWS_BUCKET}"
|
|
access_key: "${AWS_ACCESS_KEY_ID}"
|
|
secret_key: "${AWS_SECRET_ACCESS_KEY}"
|
|
endpoint: "${AWS_ENDPOINT}"
|
|
|
|
# 上传配置
|
|
upload:
|
|
max_file_size: 104857600 # 100MB
|
|
allowed_types:
|
|
- "image/jpeg"
|
|
- "image/jpg"
|
|
- "image/png"
|
|
- "image/gif"
|
|
- "image/webp"
|
|
- "image/tiff"
|
|
thumbnail_sizes:
|
|
- name: "thumbnail"
|
|
width: 200
|
|
height: 200
|
|
- name: "medium"
|
|
width: 800
|
|
height: 600
|
|
- name: "large"
|
|
width: 1920
|
|
height: 1080
|
|
|
|
# 日志配置
|
|
logger:
|
|
level: "info"
|
|
format: "json"
|
|
output: "file"
|
|
filename: "/var/log/photography/app.log"
|
|
max_size: 100
|
|
max_age: 30
|
|
compress: true
|
|
|
|
# CORS配置
|
|
cors:
|
|
allowed_origins:
|
|
- "https://photography.iriver.top"
|
|
- "https://admin.photography.iriver.top"
|
|
allowed_methods:
|
|
- "GET"
|
|
- "POST"
|
|
- "PUT"
|
|
- "DELETE"
|
|
- "OPTIONS"
|
|
allowed_headers:
|
|
- "Content-Type"
|
|
- "Authorization"
|
|
- "X-Requested-With"
|
|
allow_credentials: true
|
|
|
|
# 限流配置
|
|
rate_limit:
|
|
enabled: true
|
|
requests_per_minute: 60
|
|
burst: 120 |