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