Skip to content

Commit 33ce137

Browse files
author
piexlmax
committed
调整误提的config
1 parent 92b7b90 commit 33ce137

File tree

1 file changed

+178
-135
lines changed

1 file changed

+178
-135
lines changed

server/config.yaml

Lines changed: 178 additions & 135 deletions
Original file line numberDiff line numberDiff line change
@@ -1,160 +1,203 @@
1-
aliyun-oss:
2-
endpoint: yourEndpoint
3-
access-key-id: yourAccessKeyId
4-
access-key-secret: yourAccessKeySecret
5-
bucket-name: yourBucketName
6-
bucket-url: yourBucketUrl
7-
base-path: yourBasePath
8-
autocode:
9-
transfer-restart: true
10-
root: E:\gin-vue-admin
11-
server: /server
12-
server-api: /api/v1/%s
13-
server-plug: /plugin/%s
14-
server-initialize: /initialize
15-
server-model: /model/%s
16-
server-request: /model/%s/request/
17-
server-router: /router/%s
18-
server-service: /service/%s
19-
web: /web/src
20-
web-api: /api
21-
web-form: /view
22-
web-table: /view
23-
aws-s3:
24-
bucket: xxxxx-10005608
25-
region: ap-shanghai
26-
endpoint: ""
27-
s3-force-path-style: false
28-
disable-ssl: false
29-
secret-id: xxxxxxxx
30-
secret-key: xxxxxxxx
31-
base-url: https://gin.vue.admin
32-
path-prefix: github.com/flipped-aurora/gin-vue-admin/server
1+
# github.com/flipped-aurora/gin-vue-admin/server Global Configuration
2+
3+
# jwt configuration
4+
jwt:
5+
signing-key: 'qmPlus'
6+
expires-time: 604800
7+
buffer-time: 86400
8+
issuer: 'qmPlus'
9+
# zap logger configuration
10+
zap:
11+
level: 'info'
12+
format: 'console'
13+
prefix: '[github.com/flipped-aurora/gin-vue-admin/server]'
14+
director: 'log'
15+
show-line: true
16+
encode-level: 'LowercaseColorLevelEncoder'
17+
stacktrace-key: 'stacktrace'
18+
log-in-console: true
19+
20+
# redis configuration
21+
redis:
22+
db: 0
23+
addr: '127.0.0.1:6379'
24+
password: ''
25+
26+
# email configuration
27+
email:
28+
to: 'xxx@qq.com'
29+
port: 465
30+
from: 'xxx@163.com'
31+
host: 'smtp.163.com'
32+
is-ssl: true
33+
secret: 'xxx'
34+
nickname: 'test'
35+
36+
# casbin configuration
37+
casbin:
38+
model-path: './resource/rbac_model.conf'
39+
40+
# system configuration
41+
system:
42+
env: 'public' # Change to "develop" to skip authentication for development mode
43+
addr: 8888
44+
db-type: 'mysql'
45+
oss-type: 'local' # 控制oss选择走本地还是 七牛等其他仓 自行增加其他oss仓可以在 server/utils/upload/upload.go 中 NewOss函数配置
46+
use-redis: false # 使用redis
47+
use-multipoint: false
48+
# IP限制次数 一个小时15000次
49+
iplimit-count: 15000
50+
# IP限制一个小时
51+
iplimit-time: 3600
52+
53+
# captcha configuration
3354
captcha:
3455
key-long: 6
3556
img-width: 240
3657
img-height: 80
37-
cors:
38-
mode: whitelist
39-
whitelist:
40-
- allow-origin: example1.com
41-
allow-methods: GET, POST
42-
allow-headers: content-type
43-
expose-headers: Content-Length, Access-Control-Allow-Origin, Access-Control-Allow-Headers,
44-
Content-Type
45-
allow-credentials: true
46-
- allow-origin: example2.com
47-
allow-methods: GET, POST
48-
allow-headers: content-type
49-
expose-headers: Content-Length, Access-Control-Allow-Origin, Access-Control-Allow-Headers,
50-
Content-Type
51-
allow-credentials: true
52-
db-list:
53-
- disable: false
54-
type: ""
55-
alias-name: ""
56-
path: ""
57-
port: ""
58-
config: ""
59-
db-name: ""
60-
username: ""
61-
password: ""
62-
max-idle-conns: 10
63-
max-open-conns: 100
64-
log-mode: ""
65-
log-zap: false
66-
email:
67-
to: xxx@qq.com
68-
port: 465
69-
from: xxx@163.com
70-
host: smtp.163.com
71-
is-ssl: true
72-
secret: xxx
73-
nickname: test
74-
excel:
75-
dir: ./resource/excel/
76-
hua-wei-obs:
77-
path: you-path
78-
bucket: you-bucket
79-
endpoint: you-endpoint
80-
access-key: you-access-key
81-
secret-key: you-secret-key
82-
jwt:
83-
signing-key: 8a60885b-caa4-4832-85e8-b4dcd9524778
84-
expires-time: 604800
85-
buffer-time: 86400
86-
issuer: qmPlus
87-
local:
88-
path: uploads/file
89-
store-path: uploads/file
58+
59+
# mysql connect configuration
60+
# 未初始化之前请勿手动修改数据库信息!!!如果一定要手动初始化请看(https://www.github.com/flipped-aurora/gin-vue-admin/server.com/docs/first)
9061
mysql:
91-
path: 127.0.0.1
92-
port: "3306"
93-
config: charset=utf8mb4&parseTime=True&loc=Local
94-
db-name: gva
95-
username: root
96-
password: Aa@6447985
62+
path: ''
63+
port: ''
64+
config: ''
65+
db-name: ''
66+
username: ''
67+
password: ''
9768
max-idle-conns: 10
9869
max-open-conns: 100
99-
log-mode: error
70+
log-mode: ""
10071
log-zap: false
72+
73+
# pgsql connect configuration
74+
# 未初始化之前请勿手动修改数据库信息!!!如果一定要手动初始化请看(https://www.github.com/flipped-aurora/gin-vue-admin/server.com/docs/first)
10175
pgsql:
102-
path: ""
103-
port: ""
104-
config: ""
105-
db-name: ""
106-
username: ""
107-
password: ""
76+
path: ''
77+
port: ''
78+
config: ''
79+
db-name: ''
80+
username: ''
81+
password: ''
10882
max-idle-conns: 10
10983
max-open-conns: 100
11084
log-mode: ""
11185
log-zap: false
86+
87+
db-list:
88+
- disabled: true # 是否启用
89+
type: "" # 数据库的类型,目前支持mysql、pgsql
90+
alias-name: "" # 数据库的名称,注意: alias-name 需要在db-list中唯一
91+
path: ''
92+
port: ''
93+
config: ''
94+
db-name: ''
95+
username: ''
96+
password: ''
97+
max-idle-conns: 10
98+
max-open-conns: 100
99+
log-mode: ""
100+
log-zap: false
101+
102+
103+
# local configuration
104+
local:
105+
path: 'uploads/file'
106+
107+
# autocode configuration
108+
autocode:
109+
transfer-restart: true
110+
# root 自动适配项目根目录
111+
# 请不要手动配置,他会在项目加载的时候识别出根路径
112+
root: ""
113+
server: /server
114+
server-api: /api/v1/autocode
115+
server-initialize: /initialize
116+
server-model: /model/autocode
117+
server-request: /model/autocode/request/
118+
server-router: /router/autocode
119+
server-service: /service/autocode
120+
web: /web/src
121+
web-api: /api
122+
web-form: /view
123+
web-table: /view
124+
125+
# qiniu configuration (请自行七牛申请对应的 公钥 私钥 bucket 和 域名地址)
112126
qiniu:
113-
zone: ZoneHuaDong
114-
bucket: ""
115-
img-path: ""
127+
zone: 'ZoneHuaDong'
128+
bucket: ''
129+
img-path: ''
116130
use-https: false
117-
access-key: ""
118-
secret-key: ""
131+
access-key: ''
132+
secret-key: ''
119133
use-cdn-domains: false
120-
redis:
121-
db: 0
122-
addr: 127.0.0.1:6379
123-
password: ""
124-
system:
125-
env: public
126-
addr: 8888
127-
db-type: mysql
128-
oss-type: local
129-
use-multipoint: false
130-
use-redis: false
131-
iplimit-count: 15000
132-
iplimit-time: 3600
134+
135+
# aliyun oss configuration
136+
aliyun-oss:
137+
endpoint: 'yourEndpoint'
138+
access-key-id: 'yourAccessKeyId'
139+
access-key-secret: 'yourAccessKeySecret'
140+
bucket-name: 'yourBucketName'
141+
bucket-url: 'yourBucketUrl'
142+
base-path: 'yourBasePath'
143+
144+
# tencent cos configuration
133145
tencent-cos:
146+
bucket: 'xxxxx-10005608'
147+
region: 'ap-shanghai'
148+
secret-id: 'xxxxxxxx'
149+
secret-key: 'xxxxxxxx'
150+
base-url: 'https://gin.vue.admin'
151+
path-prefix: 'github.com/flipped-aurora/gin-vue-admin/server'
152+
153+
# aws s3 configuration (minio compatible)
154+
aws-s3:
134155
bucket: xxxxx-10005608
135156
region: ap-shanghai
157+
endpoint: ''
158+
s3-force-path-style: false
159+
disable-ssl: false
136160
secret-id: xxxxxxxx
137161
secret-key: xxxxxxxx
138162
base-url: https://gin.vue.admin
139163
path-prefix: github.com/flipped-aurora/gin-vue-admin/server
140-
timer:
164+
165+
# huawei obs configuration
166+
hua-wei-obs:
167+
path: 'you-path'
168+
bucket: 'you-bucket'
169+
endpoint: 'you-endpoint'
170+
access-key: 'you-access-key'
171+
secret-key: 'you-secret-key'
172+
173+
# excel configuration
174+
excel:
175+
dir: './resource/excel/'
176+
177+
# timer task db clear table
178+
Timer:
141179
start: true
142-
spec: '@daily'
143-
with_seconds: false
180+
spec: "@daily" # 定时任务详细配置参考 https://pkg.go.dev/github.com/robfig/cron/v3
144181
detail:
145-
- tableName: sys_operation_records
146-
compareField: created_at
147-
interval: 2160h
148-
- tableName: jwt_blacklists
149-
compareField: created_at
150-
interval: 168h
151-
zap:
152-
level: info
153-
prefix: '[github.com/flipped-aurora/gin-vue-admin/server]'
154-
format: console
155-
director: log
156-
encode-level: LowercaseColorLevelEncoder
157-
stacktrace-key: stacktrace
158-
max-age: 30
159-
show-line: true
160-
log-in-console: true
182+
- tableName: "sys_operation_records"
183+
compareField: "created_at"
184+
interval: "2160h"
185+
- tableName: "jwt_blacklists"
186+
compareField: "created_at"
187+
interval: "168h"
188+
189+
# 跨域配置
190+
# 需要配合 server/initialize/router.go#L32 使用
191+
cors:
192+
mode: whitelist # 放行模式: allow-all, 放行全部; whitelist, 白名单模式, 来自白名单内域名的请求添加 cors 头; strict-whitelist 严格白名单模式, 白名单外的请求一律拒绝
193+
whitelist:
194+
- allow-origin: example1.com
195+
allow-headers: content-type
196+
allow-methods: GET, POST
197+
expose-headers: Content-Length, Access-Control-Allow-Origin, Access-Control-Allow-Headers, Content-Type
198+
allow-credentials: true # 布尔值
199+
- allow-origin: example2.com
200+
allow-headers: content-type
201+
allow-methods: GET, POST
202+
expose-headers: Content-Length, Access-Control-Allow-Origin, Access-Control-Allow-Headers, Content-Type
203+
allow-credentials: true # 布尔值

0 commit comments

Comments
 (0)