zayac-admin/continew-admin-webapi/src/main/resources/config/application-prod.yml

227 lines
6.9 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

--- ### 项目配置
project:
# URL
url: https://cnadmin.charles7c.top
# 是否为生产环境
production: true
--- ### 服务器配置
server:
# HTTP 端口(默认 8080
port: 18000
--- ### 数据源配置
spring.datasource:
type: com.zaxxer.hikari.HikariDataSource
## 动态数据源配置可配多主多从m1、s1...、纯粹多库mysql、oracle...、混合配置m1、s1、oracle...
dynamic:
# 是否启用 P6SpySQL 性能分析组件,该插件有性能损耗,不建议生产环境使用)
p6spy: false
# 设置默认的数据源或者数据源组(默认 master
primary: master
# 严格匹配数据源true未匹配到指定数据源时抛异常false使用默认数据源默认 false
strict: false
datasource:
# 主库配置(可配多个,构成多主)
master:
url: jdbc:mysql://${DB_HOST:localhost}:${DB_PORT:3306}/${DB_NAME:continew_admin}?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&useSSL=false&allowMultiQueries=true&rewriteBatchedStatements=true&autoReconnect=true&maxReconnects=10&failOverReadOnly=false
username: ${DB_USER:root}
password: ${DB_PWD:123456}
driver-class-name: com.mysql.cj.jdbc.Driver
# 从库配置(可配多个,构成多从)
slave_1:
url: jdbc:mysql://${DB_HOST:localhost}:${DB_PORT:3306}/${DB_NAME:continew_admin}?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&useSSL=false&allowMultiQueries=true&rewriteBatchedStatements=true&autoReconnect=true&maxReconnects=10&failOverReadOnly=false
username:
password:
lazy: true
driver-class-name: com.mysql.cj.jdbc.Driver
type: ${spring.datasource.type}
# Hikari 连接池配置完整配置请参阅https://github.com/brettwooldridge/HikariCP
hikari:
# 最大连接数量(默认 10根据实际环境调整
# 注意:当连接达到上限,并且没有空闲连接可用时,获取连接将在超时前阻塞最多 connectionTimeout 毫秒
max-pool-size: 20
# 获取连接超时时间(默认 30000 毫秒30 秒)
connection-timeout: 30000
# 空闲连接最大存活时间(默认 600000 毫秒10 分钟)
idle-timeout: 600000
# 保持连接活动的频率,以防止它被数据库或网络基础设施超时。该值必须小于 maxLifetime默认 0禁用
keepaliveTime: 30000
# 连接最大生存时间(默认 1800000 毫秒30 分钟)
max-lifetime: 1800000
--- ### Liquibase 配置
spring.liquibase:
# 是否启用
enabled: true
# 配置文件路径
change-log: classpath:/db/changelog/db.changelog-master.yaml
--- ### 缓存配置
spring:
## Spring Cache 配置
cache:
type: REDIS
data:
## Redis 配置(单机版)
redis:
# 地址
host: ${REDIS_HOST:127.0.0.1}
# 端口(默认 6379
port: ${REDIS_PORT:6379}
# 密码(未设置密码时可为空或注释掉)
password: ${REDIS_PWD:123456}
# 数据库索引
database: ${REDIS_DB:0}
# 连接超时时间
timeout: 10s
# 是否开启 SSL
ssl:
enabled: false
# Redisson 配置
redisson:
enabled: true
mode: SINGLE
--- ### 验证码配置
continew-starter.captcha:
## 行为验证码
behavior:
enabled: true
cache-type: REDIS
water-mark: ${project.app-name}
## 图形验证码
graphic:
enabled: true
# 类型
type: SPEC
# 内容长度
length: 4
# 过期时间
expirationInMinutes: 2
## 其他验证码配置
captcha:
## 邮箱验证码配置
mail:
# 内容长度
length: 6
# 过期时间
expirationInMinutes: 5
# 限制时间
limitInSeconds: 60
# 模板路径
templatePath: mail/captcha.ftl
## 短信验证码配置
sms:
# 内容长度
length: 4
# 过期时间
expirationInMinutes: 5
# 模板 ID
templateId: 1
--- ### 日志配置
continew-starter.log:
# 是否打印日志,开启后可打印访问日志(类似于 Nginx access log
is-print: false
## 项目日志配置(配置重叠部分,优先级高于 logback-spring.xml 中的配置)
logging:
level:
top.charles7c: INFO
file:
path: ../logs
--- ### 跨域配置
continew-starter.cors:
enabled: true
# 配置允许跨域的域名
allowed-origins:
- ${project.url}
# 配置允许跨域的请求方式
allowed-methods: '*'
# 配置允许跨域的请求头
allowed-headers: '*'
# 配置允许跨域的响应头
exposed-headers: '*'
--- ### 接口文档配置
springdoc:
swagger-ui:
enabled: false
## 接口文档增强配置
knife4j:
# 开启生产环境屏蔽
production: true
--- ### 短信配置
sms:
# 从 YAML 读取配置
config-type: YAML
is-print: false
blends:
cloopen:
# 短信厂商
supplier: cloopen
base-url: https://app.cloopen.com:8883/2013-12-26
access-key-id: 你的Access Key
access-key-secret: 你的Access Key Secret
sdk-app-id: 你的应用ID
--- ### 邮件配置
spring.mail:
# 根据需要更换
host: smtp.126.com
port: 465
username: 你的邮箱
password: 你的邮箱授权码
properties:
mail:
smtp:
auth: true
socketFactory:
class: javax.net.ssl.SSLSocketFactory
port: 465
--- ### Just Auth 配置
justauth:
enabled: true
type:
GITEE:
client-id: 5d271b7f638941812aaf8bfc2e2f08f06d6235ef934e0e39537e2364eb8452c4
client-secret: 1f7d08**********5b7**********29e
redirect-uri: ${project.url}/social/callback?source=gitee
GITHUB:
client-id: 38080dad08cfbdfacca9
client-secret: 1f7d08**********5b7**********29e
redirect-uri: ${project.url}/social/callback?source=github
cache:
type: REDIS
--- ### Sa-Token 扩展配置
sa-token.extension:
# 安全配置:排除(放行)路径配置
security.excludes:
- /error
# 静态资源
- /*.html
- /**/*.html
- /**/*.css
- /**/*.js
- /webSocket/**
# 本地存储资源
- /file/**
--- ### 文件上传配置
spring.servlet:
multipart:
enabled: true
# 单文件上传大小限制
max-file-size: 10MB
# 单次总上传文件大小限制
max-request-size: 20MB
--- ### 非对称加密配置(例如:密码加密传输,前端公钥加密,后端私钥解密;在线生成 RSA 密钥对http://web.chacuo.net/netrsakeypair
rsa:
# 私钥
privateKey: MIIBVQIBADANBgkqhkiG9w0BAQEFAASCAT8wggE7AgEAAkEAznV2Bi0zIX61NC3zSx8U6lJXbtru325pRV4Wt0aJXGxy6LMTsfxIye1ip+f2WnxrkYfk/X8YZ6FWNQPaAX/iRwIDAQABAkEAk/VcAusrpIqA5Ac2P5Tj0VX3cOuXmyouaVcXonr7f+6y2YTjLQuAnkcfKKocQI/juIRQBFQIqqW/m1nmz1wGeQIhAO8XaA/KxzOIgU0l/4lm0A2Wne6RokJ9HLs1YpOzIUmVAiEA3Q9DQrpAlIuiT1yWAGSxA9RxcjUM/1kdVLTkv0avXWsCIE0X8woEjK7lOSwzMG6RpEx9YHdopjViOj1zPVH61KTxAiBmv/dlhqkJ4rV46fIXELZur0pj6WC3N7a4brR8a+CLLQIhAMQyerWl2cPNVtE/8tkziHKbwW3ZUiBXU24wFxedT9iV