fix
Some checks failed
部署后端服务 / 🧪 测试后端 (push) Failing after 5m8s
部署后端服务 / 🚀 构建并部署 (push) Has been skipped
部署后端服务 / 🔄 回滚部署 (push) Has been skipped

This commit is contained in:
xujiang
2025-07-10 18:09:11 +08:00
parent 35004f224e
commit 010fe2a8c7
96 changed files with 23709 additions and 19 deletions

View File

@ -0,0 +1,105 @@
# 开发环境配置
app:
name: "Photography Portfolio Dev"
version: "1.0.0"
environment: "development"
port: 8080
debug: true
# 数据库配置
database:
host: "localhost"
port: 5432
username: "postgres"
password: "password"
database: "photography_dev"
ssl_mode: "disable"
max_open_conns: 50
max_idle_conns: 5
conn_max_lifetime: 300
# Redis配置
redis:
host: "localhost"
port: 6379
password: ""
database: 1
pool_size: 10
min_idle_conns: 2
# JWT配置
jwt:
secret: "dev-secret-key-not-for-production"
expires_in: "24h"
refresh_expires_in: "168h"
# 存储配置
storage:
type: "local"
local:
base_path: "./uploads"
base_url: "http://localhost:8080/uploads"
s3:
region: "us-east-1"
bucket: "photography-dev-bucket"
access_key: ""
secret_key: ""
endpoint: ""
# 上传配置
upload:
max_file_size: 104857600 # 100MB
allowed_types:
- "image/jpeg"
- "image/jpg"
- "image/png"
- "image/gif"
- "image/webp"
- "image/tiff"
- "image/bmp"
thumbnail_sizes:
- name: "thumbnail"
width: 200
height: 200
- name: "medium"
width: 800
height: 600
- name: "large"
width: 1920
height: 1080
# 日志配置
logger:
level: "debug"
format: "text"
output: "stdout"
filename: "logs/dev.log"
max_size: 50
max_age: 7
compress: false
# CORS配置
cors:
allowed_origins:
- "http://localhost:3000"
- "http://localhost:3001"
- "http://localhost:5173"
allowed_methods:
- "GET"
- "POST"
- "PUT"
- "DELETE"
- "PATCH"
- "OPTIONS"
allowed_headers:
- "Content-Type"
- "Authorization"
- "X-Requested-With"
- "Origin"
allow_credentials: true
# 限流配置
rate_limit:
enabled: false
requests_per_minute: 1000
burst: 2000

View File

@ -0,0 +1,101 @@
# 生产环境配置
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

View File

@ -0,0 +1,76 @@
app:
name: "photography-backend"
version: "1.0.0"
environment: "development"
port: 8080
debug: true
database:
host: "localhost"
port: 5432
username: "postgres"
password: "password"
database: "photography"
ssl_mode: "disable"
max_open_conns: 100
max_idle_conns: 10
conn_max_lifetime: 300
redis:
host: "localhost"
port: 6379
password: ""
database: 0
pool_size: 100
min_idle_conns: 10
jwt:
secret: "your-secret-key-change-in-production"
expires_in: "24h"
refresh_expires_in: "168h"
storage:
type: "local" # local, s3, minio
local:
base_path: "./uploads"
base_url: "http://localhost:8080/uploads"
s3:
region: "us-east-1"
bucket: "photography-uploads"
access_key: ""
secret_key: ""
endpoint: ""
upload:
max_file_size: 52428800 # 50MB
allowed_types: ["image/jpeg", "image/png", "image/gif", "image/webp", "image/tiff"]
thumbnail_sizes:
- name: "small"
width: 300
height: 300
- name: "medium"
width: 800
height: 600
- name: "large"
width: 1200
height: 900
logger:
level: "debug"
format: "json"
output: "file"
filename: "logs/app.log"
max_size: 100
max_age: 7
compress: true
cors:
allowed_origins: ["http://localhost:3000", "https://photography.iriver.top"]
allowed_methods: ["GET", "POST", "PUT", "DELETE", "PATCH", "OPTIONS"]
allowed_headers: ["Origin", "Content-Length", "Content-Type", "Authorization"]
allow_credentials: true
rate_limit:
enabled: true
requests_per_minute: 100
burst: 50