mirror of
https://github.com/201206030/novel.git
synced 2025-04-27 07:30:50 +00:00
274 lines
7.4 KiB
YAML
274 lines
7.4 KiB
YAML
#--------------------------通用配置-------------------------
|
||
spring:
|
||
application:
|
||
# 应用名
|
||
name: novel
|
||
profiles:
|
||
# 激活特定配置
|
||
active: dev
|
||
jackson:
|
||
generator:
|
||
# JSON 序列化时,将所有 Number 类型的属性都转为 String 类型返回,避免前端数据精度丢失的问题。
|
||
# 由于 Javascript 标准规定所有数字处理都应使用 64 位 IEEE 754 浮点值完成,
|
||
# 结果是某些 64 位整数值无法准确表示(尾数只有 51 位宽)
|
||
write-numbers-as-strings: true
|
||
servlet:
|
||
multipart:
|
||
# 上传文件最大大小
|
||
max-file-size: 5MB
|
||
server:
|
||
# 端口号
|
||
port: 8888
|
||
|
||
--- #---------------------数据库配置---------------------------
|
||
spring:
|
||
datasource:
|
||
url: jdbc:mysql://localhost:3306/novel_test?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai
|
||
username: root
|
||
password: test123456
|
||
# ShardingSphere-JDBC 配置
|
||
# 配置是 ShardingSphere-JDBC 中唯一与应用开发者交互的模块,
|
||
# 通过它可以快速清晰的理解 ShardingSphere-JDBC 所提供的功能。
|
||
shardingsphere:
|
||
# 是否开启分库分表
|
||
enabled: false
|
||
props:
|
||
# 是否在日志中打印 SQL
|
||
sql-show: true
|
||
# 模式配置
|
||
mode:
|
||
# 单机模式
|
||
type: Standalone
|
||
repository:
|
||
# 文件持久化
|
||
type: File
|
||
props:
|
||
# 元数据存储路径
|
||
path: .shardingsphere
|
||
# 使用本地配置覆盖持久化配置
|
||
overwrite: true
|
||
# 数据源配置
|
||
datasource:
|
||
names: ds_0
|
||
ds_0:
|
||
type: com.zaxxer.hikari.HikariDataSource
|
||
driverClassName: com.mysql.cj.jdbc.Driver
|
||
jdbcUrl: jdbc:mysql://localhost:3306/novel_test?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai
|
||
username: root
|
||
password: test123456
|
||
# 规则配置
|
||
rules:
|
||
# 数据分片
|
||
sharding:
|
||
tables:
|
||
# book_content 表
|
||
book_content:
|
||
# 数据节点
|
||
actual-data-nodes: ds_$->{0}.book_content$->{0..9}
|
||
# 分表策略
|
||
table-strategy:
|
||
standard:
|
||
# 分片列名称
|
||
sharding-column: chapter_id
|
||
# 分片算法名称
|
||
sharding-algorithm-name: bookContentSharding
|
||
sharding-algorithms:
|
||
bookContentSharding:
|
||
# 行表达式分片算法,使用 Groovy 的表达式,提供对 SQL 语句中的 = 和 IN 的分片操作支持
|
||
type: INLINE
|
||
props:
|
||
# 分片算法的行表达式
|
||
algorithm-expression: book_content$->{chapter_id % 10}
|
||
|
||
--- #---------------------中间件配置---------------------------
|
||
spring:
|
||
data:
|
||
# Redis 配置
|
||
redis:
|
||
host: 127.0.0.1
|
||
port: 6379
|
||
password: 123456
|
||
|
||
# Elasticsearch 配置
|
||
elasticsearch:
|
||
# 是否开启 Elasticsearch 搜索引擎功能:true-开启 false-不开启
|
||
enabled: false
|
||
uris:
|
||
- https://my-deployment-ce7ca3.es.us-central1.gcp.cloud.es.io:9243
|
||
username: elastic
|
||
password: qTjgYVKSuExX6tWAsDuvuvwl
|
||
|
||
# Spring AMQP 配置
|
||
amqp:
|
||
# 是否开启 Spring AMQP:true-开启 false-不开启
|
||
enabled: false
|
||
# RabbitMQ 配置
|
||
rabbitmq:
|
||
addresses: "amqp://guest:guest@47.106.243.172"
|
||
virtual-host: novel
|
||
template:
|
||
retry:
|
||
# 开启重试
|
||
enabled: true
|
||
# 最大重试次数
|
||
max-attempts: 3
|
||
# 第一次和第二次重试之间的持续时间
|
||
initial-interval: "3s"
|
||
|
||
# XXL-JOB 配置
|
||
xxl:
|
||
job:
|
||
# 是否开启 XXL-JOB:true-开启 false-不开启
|
||
enabled: false
|
||
admin:
|
||
### 调度中心部署根地址 [选填]:如调度中心集群部署存在多个地址则用逗号分隔。执行器将会使用该地址进行"执行器心跳注册"和"任务结果回调";为空则关闭自动注册;
|
||
addresses: http://127.0.0.1:8080/xxl-job-admin
|
||
executor:
|
||
### 执行器AppName [选填]:执行器心跳注册分组依据;为空则关闭自动注册
|
||
appname: xxl-job-executor-novel
|
||
### 执行器运行日志文件存储磁盘路径 [选填] :需要对该路径拥有读写权限;为空则使用默认路径;
|
||
logpath: logs/xxl-job/jobhandler
|
||
### xxl-job, access token
|
||
accessToken: 123
|
||
|
||
--- #----------------------安全配置----------------------------
|
||
spring:
|
||
# Spring Boot 应用管理和监控
|
||
boot:
|
||
admin:
|
||
client:
|
||
# 是否开启 Spring Boot Admin 客户端
|
||
enabled: false
|
||
# Spring Boot Admin 服务端注册地址
|
||
url: http://localhost:8080
|
||
# Spring Boot Admin 服务端认证用户名
|
||
username: novel
|
||
# Spring Boot Admin 服务端认证密码
|
||
password: novel
|
||
instance:
|
||
metadata:
|
||
# SBA Client
|
||
user.name: ${spring.security.user.name}
|
||
user.password: ${spring.security.user.password}
|
||
security:
|
||
user:
|
||
name: ENDPOINT_ADMIN
|
||
password: ENDPOINT_ADMIN
|
||
roles: ENDPOINT_ADMIN
|
||
|
||
# Actuator 端点管理
|
||
management:
|
||
# 端点公开配置
|
||
endpoints:
|
||
# 通过 HTTP 公开的 Web 端点
|
||
web:
|
||
exposure:
|
||
# 公开所有的 Web 端点
|
||
include: "*"
|
||
# 端点启用配置
|
||
endpoint:
|
||
logfile:
|
||
# 启用返回日志文件内容的端点
|
||
enabled: true
|
||
# 外部日志文件路径
|
||
external-file: logs/novel.log
|
||
info:
|
||
env:
|
||
# 公开所有以 info. 开头的环境属性
|
||
enabled: true
|
||
health:
|
||
rabbit:
|
||
# 关闭 rabbitmq 的健康检查
|
||
enabled: false
|
||
elasticsearch:
|
||
# 关闭 elasticsearch 的健康检查
|
||
enabled: false
|
||
mail:
|
||
# 关闭 mail 的健康检查
|
||
enabled: false
|
||
|
||
--- #--------------------接口文档配置---------------------------
|
||
springdoc:
|
||
api-docs:
|
||
enabled: false
|
||
|
||
--- #----------------------邮箱配置-----------------------------
|
||
#邮箱服务器
|
||
spring:
|
||
mail:
|
||
host: smtp.163.com
|
||
#发件人昵称
|
||
nickname: xxyopen
|
||
#邮箱账户
|
||
username: xxx@163.com
|
||
#邮箱第三方授权码
|
||
password: xxx
|
||
#编码类型
|
||
default-encoding: UTF-8
|
||
port: 465
|
||
properties:
|
||
mail:
|
||
smtp:
|
||
auth: true
|
||
starttls:
|
||
enable: true
|
||
required: rue
|
||
socketFactory:
|
||
port: 465
|
||
class: javax.net.ssl.SSLSocketFactory
|
||
fallback: false
|
||
|
||
--- #---------------------自定义配置----------------------------
|
||
novel:
|
||
# 跨域配置
|
||
cors:
|
||
# 允许跨域的域名
|
||
allow-origins:
|
||
- http://localhost:1024
|
||
- http://localhost:8080
|
||
# JWT密钥
|
||
jwt:
|
||
secret: E66559580A1ADF48CDD928516062F12E
|
||
# XSS 过滤配置
|
||
xss:
|
||
# 过滤开关
|
||
enabled: true
|
||
# 排除链接
|
||
excludes:
|
||
- /system/notice/*
|
||
file:
|
||
# 文件上传配置
|
||
upload:
|
||
# 上传路径
|
||
path: /Users/xiongxiaoyang/upload
|
||
|
||
|
||
--- #------------------- dev 特定配置---------------------------
|
||
spring:
|
||
config:
|
||
activate:
|
||
on-profile: dev
|
||
springdoc:
|
||
api-docs:
|
||
enabled: true
|
||
|
||
--- #------------------- test 特定配置--------------------------
|
||
spring:
|
||
config:
|
||
activate:
|
||
on-profile: test
|
||
|
||
--- #-------------------- prod 特定配置-------------------------
|
||
spring:
|
||
config:
|
||
activate:
|
||
on-profile: prod
|
||
data:
|
||
# Redis 配置
|
||
redis:
|
||
host: 127.0.0.1
|
||
port: 6379
|
||
password:
|
||
|
||
|