111 lines
2.7 KiB
YAML
111 lines
2.7 KiB
YAML
# ================================
|
|
# 生产环境配置
|
|
# ================================
|
|
|
|
spring:
|
|
# 数据源配置
|
|
datasource:
|
|
url: jdbc:mysql://localhost:3306/designhub?useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai&useSSL=false&allowPublicKeyRetrieval=true
|
|
username: designhub
|
|
password: DesignHub@2025_DB # 生产环境数据库密码(建议修改)
|
|
driver-class-name: com.mysql.cj.jdbc.Driver
|
|
|
|
# 连接池配置(生产环境优化)
|
|
hikari:
|
|
minimum-idle: 10
|
|
maximum-pool-size: 50
|
|
connection-timeout: 30000
|
|
idle-timeout: 600000
|
|
max-lifetime: 1800000
|
|
|
|
# Redis 配置
|
|
redis:
|
|
host: localhost
|
|
port: 6379
|
|
password: DesignHub@2025_Redis # Redis 密码
|
|
database: 0
|
|
timeout: 3000
|
|
lettuce:
|
|
pool:
|
|
max-active: 20
|
|
max-wait: -1
|
|
max-idle: 10
|
|
min-idle: 5
|
|
|
|
# 文件上传配置
|
|
servlet:
|
|
multipart:
|
|
enabled: true
|
|
max-file-size: 500MB
|
|
max-request-size: 500MB
|
|
|
|
# JWT 配置
|
|
jwt:
|
|
# ⚠️ 重要:生产环境必须修改为强密钥
|
|
secret: DesignHub_Prod_Secret_Key_2025_Very_Strong_Change_This_In_Production
|
|
access-token-expiration: 7200000 # 2小时
|
|
refresh-token-expiration: 604800000 # 7天
|
|
|
|
# 服务器配置
|
|
server:
|
|
port: 5123
|
|
servlet:
|
|
context-path: /
|
|
encoding:
|
|
charset: UTF-8
|
|
enabled: true
|
|
force: true
|
|
# Tomcat 配置(支持大文件上传)
|
|
tomcat:
|
|
max-http-form-post-size: 524288000 # 500MB
|
|
max-swallow-size: 524288000 # 500MB
|
|
connection-timeout: 600000 # 10分钟超时
|
|
# 生产环境压缩
|
|
compression:
|
|
enabled: true
|
|
mime-types: text/html,text/xml,text/plain,text/css,text/javascript,application/javascript,application/json
|
|
|
|
# 日志配置
|
|
logging:
|
|
level:
|
|
root: INFO
|
|
com.designhub: INFO # 生产环境只显示 INFO 级别
|
|
file:
|
|
name: /opt/designhub/logs/application.log
|
|
max-size: 10MB
|
|
max-history: 30
|
|
pattern:
|
|
file: '%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n'
|
|
|
|
# 文件存储配置
|
|
file:
|
|
upload:
|
|
# 生产环境路径
|
|
path: /opt/designhub/uploads
|
|
max-size: 524288000 # 500MB
|
|
allowed-extensions: .xls,.xlsx,.doc,.docx,.pdf,.zip
|
|
|
|
# MyBatis Plus 配置
|
|
mybatis-plus:
|
|
configuration:
|
|
log-impl: # 生产环境不打印 SQL
|
|
map-underscore-to-camel-case: true # 开启下划线转驼峰映射
|
|
global-config:
|
|
db-config:
|
|
# 禁用逻辑删除功能
|
|
logic-delete-field: ""
|
|
logic-delete-value: 1
|
|
logic-not-delete-value: 0
|
|
|
|
# Swagger 配置(生产环境禁用)
|
|
springdoc:
|
|
swagger-ui:
|
|
enabled: false
|
|
api-docs:
|
|
enabled: false
|
|
|
|
analytics:
|
|
task-progress:
|
|
snapshot:
|
|
enabled: true
|