-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapplication.yml
122 lines (117 loc) · 3.09 KB
/
application.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
server:
shutdown: graceful
tomcat:
uri-encoding: UTF-8
compression:
mime-types: application/json,application/xml,text/html,text/xml,text/plain
enabled: true
spring:
config:
import: optional:file:.env[.properties] # 加载 .env 文件
application:
name: less-url
datasource:
url: ${JDBC_URL:jdbc:mysql://localhost:3306/less_url?useUnicode=true&characterEncoding=utf-8}
username: ${MYSQL_USERNAME:root}
password: ${MYSQL_PASSWORD:123456}
jackson:
time-zone: GMT+8
default-property-inclusion: non_null
serialization:
write-dates-as-timestamps: true
data:
redis:
url: ${REDIS_URL:redis://localhost:6379}
password: ${REDIS_PASSWORD:default}
username: ${REDIS_USERNAME:}
cache:
type: redis
cache-names: emails, links, users
redis:
enable-statistics: true
mail:
host: ${MAIL_HOST:smtp.gmail.com}
port: ${MAIL_PORT:587}
username: ${MAIL_USERNAME:your_email}
password: ${MAIL_PASSWORD:your_password}
properties:
mail.smtp.auth: true
mail.smtp.starttls.enable: true
mybatis-plus:
configuration:
map-underscore-to-camel-case: true
lazy-loading-enabled: false
aggressive-lazy-loading: false
local-cache-scope: statement # 关闭一级缓存
cache-enabled: false # 关闭二级缓存
global-config:
db-config:
id-type: auto
table-prefix: lu_
banner: false
mapper-locations: classpath:mapper/**.xml
type-aliases-package: com.github.xioshe.less.url.entity
lu:
short-url-domain: ${SHORT_URL_DOMAIN:http://localhost:8080/}
link:
# max-length: 6
default-time-to-live-seconds: 86400 # 24h
user-agent-parser: uap
ip-geo:
provider: geoip2
database-path: ${GEO_IP2_DB_PATH:classpath:geo/GeoLite2-City.mmdb}
mock-email: false
rate-limit:
enabled: true
default-rate: 60
time-unit: minutes
default-capacity: 10
security:
jwt:
access-expiration-seconds: 43200 # 12h
refresh-expiration-seconds: 86400 # 24h
key:
secret: ${JWT_SECRET:0123456789abcdefghijklmnopqrstuv}
rotation:
cron: 0 0 0 * * ?
# 打印 SQL 详情,不要在生产环境使用
decorator:
datasource:
enabled: false
# springdoc-openapi项目配置
springdoc:
swagger-ui:
tags-sorter: alpha
operations-sorter: method
display-request-duration: true
path: doc.html
use-root-path: true
enabled: false # 在生产环境要禁用
group-configs:
- group: 'default'
paths-to-match: '/**'
api-docs:
enabled: false # 在生产环境要禁用
# 可观测性配置
management:
endpoint:
health:
show-details: always
enabled: false
info:
enabled: false
loggers:
enabled: false
metrics:
enabled: false
prometheus:
enabled: false
endpoints:
web:
exposure:
include: health,info,loggers,metrics,prometheus
# include: "*" # 重新导入 pom 后就能正常显示 prometheus endpoint
metrics:
tags:
application: ${spring.application.name}
version: @project.version@ # 获取 maven 中配置的项目版本信息