|
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-initialize: /initialize |
14 | | - server-model: /model/%s |
15 | | - server-request: /model/%s/request/ |
16 | | - server-router: /router/%s |
17 | | - server-service: /service/%s |
18 | | - web: /web/src |
19 | | - web-api: /api |
20 | | - web-form: /view |
21 | | - web-table: /view |
22 | | -aws-s3: |
23 | | - bucket: xxxxx-10005608 |
24 | | - region: ap-shanghai |
25 | | - endpoint: "" |
26 | | - s3-force-path-style: false |
27 | | - disable-ssl: false |
28 | | - secret-id: xxxxxxxx |
29 | | - secret-key: xxxxxxxx |
30 | | - base-url: https://gin.vue.admin |
31 | | - 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 | + |
| 29 | + port: 465 |
| 30 | + |
| 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 |
32 | 54 | captcha: |
33 | 55 | key-long: 6 |
34 | 56 | img-width: 240 |
35 | 57 | img-height: 80 |
36 | | -casbin: |
37 | | - model-path: ./resource/rbac_model.conf |
38 | | -cors: |
39 | | - mode: whitelist |
40 | | - whitelist: |
41 | | - - allow-origin: example1.com |
42 | | - allow-methods: GET, POST |
43 | | - allow-headers: content-type |
44 | | - expose-headers: Content-Length, Access-Control-Allow-Origin, Access-Control-Allow-Headers, |
45 | | - Content-Type |
46 | | - allow-credentials: true |
47 | | - - allow-origin: example2.com |
48 | | - allow-methods: GET, POST |
49 | | - allow-headers: content-type |
50 | | - expose-headers: Content-Length, Access-Control-Allow-Origin, Access-Control-Allow-Headers, |
51 | | - Content-Type |
52 | | - allow-credentials: true |
53 | | -db-list: |
54 | | -- disable: false |
55 | | - type: "" |
56 | | - alias-name: "" |
57 | | - path: "" |
58 | | - port: "" |
59 | | - config: "" |
60 | | - db-name: "" |
61 | | - username: "" |
62 | | - password: "" |
63 | | - max-idle-conns: 10 |
64 | | - max-open-conns: 100 |
65 | | - log-mode: "" |
66 | | - log-zap: false |
67 | | -email: |
68 | | - |
69 | | - port: 465 |
70 | | - |
71 | | - host: smtp.163.com |
72 | | - is-ssl: true |
73 | | - secret: xxx |
74 | | - nickname: test |
75 | | -excel: |
76 | | - dir: ./resource/excel/ |
77 | | -hua-wei-obs: |
78 | | - path: you-path |
79 | | - bucket: you-bucket |
80 | | - endpoint: you-endpoint |
81 | | - access-key: you-access-key |
82 | | - secret-key: you-secret-key |
83 | | -jwt: |
84 | | - buffer-time: 86400 |
85 | | - expires-time: 604800 |
86 | | - issuer: qmPlus |
87 | | - signing-key: 1cf23921-d562-4bad-99b2-e1425c888f96 |
88 | | -local: |
89 | | - path: uploads/file |
| 58 | + |
| 59 | +# mysql connect configuration |
| 60 | +# 未初始化之前请勿手动修改数据库信息!!!如果一定要手动初始化请看(https://www.github.com/flipped-aurora/gin-vue-admin/server.com/docs/first) |
90 | 61 | 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: '' |
97 | 68 | max-idle-conns: 10 |
98 | 69 | max-open-conns: 100 |
99 | | - log-mode: error |
| 70 | + log-mode: "" |
100 | 71 | log-zap: false |
| 72 | + |
| 73 | +# pgsql connect configuration |
| 74 | +# 未初始化之前请勿手动修改数据库信息!!!如果一定要手动初始化请看(https://www.github.com/flipped-aurora/gin-vue-admin/server.com/docs/first) |
101 | 75 | 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: '' |
108 | 82 | max-idle-conns: 10 |
109 | 83 | max-open-conns: 100 |
110 | 84 | log-mode: "" |
111 | 85 | 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/%s |
| 115 | + server-initialize: /initialize |
| 116 | + server-model: /model/%s |
| 117 | + server-request: /model/%s/request/ |
| 118 | + server-router: /router/%s |
| 119 | + server-service: /service/%s |
| 120 | + web: /web/src |
| 121 | + web-api: /api |
| 122 | + web-form: /view |
| 123 | + web-table: /view |
| 124 | + |
| 125 | +# qiniu configuration (请自行七牛申请对应的 公钥 私钥 bucket 和 域名地址) |
112 | 126 | qiniu: |
113 | | - zone: ZoneHuaDong |
114 | | - bucket: "" |
115 | | - img-path: "" |
| 127 | + zone: 'ZoneHuaDong' |
| 128 | + bucket: '' |
| 129 | + img-path: '' |
116 | 130 | use-https: false |
117 | | - access-key: "" |
118 | | - secret-key: "" |
| 131 | + access-key: '' |
| 132 | + secret-key: '' |
119 | 133 | 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 |
133 | 145 | 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: |
134 | 155 | bucket: xxxxx-10005608 |
135 | 156 | region: ap-shanghai |
| 157 | + endpoint: '' |
| 158 | + s3-force-path-style: false |
| 159 | + disable-ssl: false |
136 | 160 | secret-id: xxxxxxxx |
137 | 161 | secret-key: xxxxxxxx |
138 | 162 | base-url: https://gin.vue.admin |
139 | 163 | 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: |
141 | 179 | start: true |
142 | | - spec: '@daily' |
| 180 | + spec: "@daily" # 定时任务详细配置参考 https://pkg.go.dev/github.com/robfig/cron/v3 |
143 | 181 | detail: |
144 | | - - tableName: sys_operation_records |
145 | | - compareField: created_at |
146 | | - interval: 2160h |
147 | | - - tableName: jwt_blacklists |
148 | | - compareField: created_at |
149 | | - interval: 168h |
150 | | -zap: |
151 | | - level: info |
152 | | - format: console |
153 | | - prefix: '[github.com/flipped-aurora/gin-vue-admin/server]' |
154 | | - director: log |
155 | | - showLine: true |
156 | | - encode-level: LowercaseColorLevelEncoder |
157 | | - stacktrace-key: stacktrace |
158 | | - 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