config.yaml 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277
  1. # github.com/flipped-aurora/gin-vue-admin/server Global Configuration
  2. # jwt configuration
  3. jwt:
  4. signing-key: qmPlus
  5. expires-time: 7d
  6. buffer-time: 1d
  7. issuer: qmPlus
  8. # zap logger configuration
  9. zap:
  10. level: info
  11. format: console
  12. prefix: "[github.com/flipped-aurora/gin-vue-admin/server]"
  13. director: log
  14. show-line: true
  15. encode-level: LowercaseColorLevelEncoder
  16. stacktrace-key: stacktrace
  17. log-in-console: true
  18. retention-day: -1
  19. # redis configuration
  20. redis:
  21. #是否使用redis集群模式
  22. useCluster: false
  23. #使用集群模式addr和db默认无效
  24. addr: 103.40.114.82:6379
  25. password: ""
  26. db: 0
  27. clusterAddrs:
  28. - "172.21.0.3:7000"
  29. - "172.21.0.4:7001"
  30. - "172.21.0.2:7002"
  31. # redis-list configuration
  32. redis-list:
  33. - name: cache # 数据库的名称,注意: name 需要在 redis-list 中唯一
  34. useCluster: false # 是否使用redis集群模式
  35. addr: 127.0.0.1:6379 # 使用集群模式addr和db默认无效
  36. password: ""
  37. db: 0
  38. clusterAddrs:
  39. - "172.21.0.3:7000"
  40. - "172.21.0.4:7001"
  41. - "172.21.0.2:7002"
  42. # mongo configuration
  43. mongo:
  44. coll: ''
  45. options: ''
  46. database: ''
  47. username: ''
  48. password: ''
  49. auth-source: ''
  50. min-pool-size: 0
  51. max-pool-size: 100
  52. socket-timeout-ms: 0
  53. connect-timeout-ms: 0
  54. is-zap: false
  55. hosts:
  56. - host: ''
  57. port: ''
  58. # email configuration
  59. email:
  60. to: [email protected]
  61. port: 465
  62. from: [email protected]
  63. host: smtp.163.com
  64. is-ssl: true
  65. secret: xxx
  66. nickname: test
  67. # system configuration
  68. system:
  69. env: local # 修改为public可以关闭路由日志输出
  70. addr: 8888
  71. db-type: mysql
  72. oss-type: local # 控制oss选择走本地还是 七牛等其他仓 自行增加其他oss仓可以在 server/utils/upload/upload.go 中 NewOss函数配置
  73. use-redis: false # 使用redis
  74. use-mongo: false # 使用mongo
  75. use-multipoint: false
  76. # IP限制次数 一个小时15000次
  77. iplimit-count: 15000
  78. # IP限制一个小时
  79. iplimit-time: 3600
  80. # 路由全局前缀
  81. router-prefix: ""
  82. # 严格角色模式 打开后权限将会存在上下级关系
  83. use-strict-auth: false
  84. # captcha configuration
  85. captcha:
  86. key-long: 6
  87. img-width: 240
  88. img-height: 80
  89. open-captcha: 0 # 0代表一直开启,大于0代表限制次数
  90. open-captcha-timeout: 3600 # open-captcha大于0时才生效
  91. # mysql connect configuration
  92. # 未初始化之前请勿手动修改数据库信息!!!如果一定要手动初始化请看(https://gin-vue-admin.com/docs/first_master)
  93. mysql:
  94. path: ""
  95. port: ""
  96. config: ""
  97. db-name: ""
  98. username: "root"
  99. password: "xl@admin250323"
  100. max-idle-conns: 10
  101. max-open-conns: 100
  102. log-mode: ""
  103. log-zap: false
  104. # pgsql connect configuration
  105. # 未初始化之前请勿手动修改数据库信息!!!如果一定要手动初始化请看(https://gin-vue-admin.com/docs/first_master)
  106. pgsql:
  107. path: ""
  108. port: ""
  109. config: ""
  110. db-name: ""
  111. username: ""
  112. password: ""
  113. max-idle-conns: 10
  114. max-open-conns: 100
  115. log-mode: ""
  116. log-zap: false
  117. oracle:
  118. path: ""
  119. port: ""
  120. config: ""
  121. db-name: ""
  122. username: ""
  123. password: ""
  124. max-idle-conns: 10
  125. max-open-conns: 100
  126. log-mode: ""
  127. log-zap: false
  128. mssql:
  129. path: ""
  130. port: ""
  131. config: ""
  132. db-name: ""
  133. username: ""
  134. password: ""
  135. max-idle-conns: 10
  136. max-open-conns: 100
  137. log-mode: ""
  138. log-zap: false
  139. sqlite:
  140. path: ""
  141. port: ""
  142. config: ""
  143. db-name: ""
  144. username: ""
  145. password: ""
  146. max-idle-conns: 10
  147. max-open-conns: 100
  148. log-mode: ""
  149. log-zap: false
  150. db-list:
  151. - disable: true # 是否禁用
  152. type: "" # 数据库的类型,目前支持mysql、pgsql、mssql、oracle
  153. alias-name: "" # 数据库的名称,注意: alias-name 需要在db-list中唯一
  154. path: ""
  155. port: ""
  156. config: ""
  157. db-name: ""
  158. username: ""
  159. password: ""
  160. max-idle-conns: 10
  161. max-open-conns: 100
  162. log-mode: ""
  163. log-zap: false
  164. # local configuration
  165. local:
  166. path: uploads/file
  167. store-path: uploads/file
  168. # autocode configuration
  169. autocode:
  170. web: web/src
  171. root: "" # root 自动适配项目根目录, 请不要手动配置,他会在项目加载的时候识别出根路径
  172. server: server
  173. module: 'github.com/flipped-aurora/gin-vue-admin/server'
  174. ai-path: "" # AI服务路径
  175. # qiniu configuration (请自行七牛申请对应的 公钥 私钥 bucket 和 域名地址)
  176. qiniu:
  177. zone: ZoneHuaDong
  178. bucket: ""
  179. img-path: ""
  180. use-https: false
  181. access-key: ""
  182. secret-key: ""
  183. use-cdn-domains: false
  184. # minio oss configuration
  185. minio:
  186. endpoint: yourEndpoint
  187. access-key-id: yourAccessKeyId
  188. access-key-secret: yourAccessKeySecret
  189. bucket-name: yourBucketName
  190. use-ssl: false
  191. base-path: ""
  192. bucket-url: "http://host:9000/yourBucketName"
  193. # aliyun oss configuration
  194. aliyun-oss:
  195. endpoint: yourEndpoint
  196. access-key-id: yourAccessKeyId
  197. access-key-secret: yourAccessKeySecret
  198. bucket-name: yourBucketName
  199. bucket-url: yourBucketUrl
  200. base-path: yourBasePath
  201. # tencent cos configuration
  202. tencent-cos:
  203. bucket: xxxxx-10005608
  204. region: ap-shanghai
  205. secret-id: your-secret-id
  206. secret-key: your-secret-key
  207. base-url: https://gin.vue.admin
  208. path-prefix: github.com/flipped-aurora/gin-vue-admin/server
  209. # aws s3 configuration (minio compatible)
  210. aws-s3:
  211. bucket: xxxxx-10005608
  212. region: ap-shanghai
  213. endpoint: ""
  214. s3-force-path-style: false
  215. disable-ssl: false
  216. secret-id: your-secret-id
  217. secret-key: your-secret-key
  218. base-url: https://gin.vue.admin
  219. path-prefix: github.com/flipped-aurora/gin-vue-admin/server
  220. # cloudflare r2 configuration
  221. cloudflare-r2:
  222. bucket: xxxx0bucket
  223. base-url: https://gin.vue.admin.com
  224. path: uploads
  225. account-id: xxx_account_id
  226. access-key-id: xxx_key_id
  227. secret-access-key: xxx_secret_key
  228. # huawei obs configuration
  229. hua-wei-obs:
  230. path: you-path
  231. bucket: you-bucket
  232. endpoint: you-endpoint
  233. access-key: you-access-key
  234. secret-key: you-secret-key
  235. # excel configuration
  236. excel:
  237. dir: ./resource/excel/
  238. # disk usage configuration
  239. disk-list:
  240. - mount-point: "/"
  241. # 跨域配置
  242. # 需要配合 server/initialize/router.go -> `Router.Use(middleware.CorsByRules())` 使用
  243. cors:
  244. mode: strict-whitelist # 放行模式: allow-all, 放行全部; whitelist, 白名单模式, 来自白名单内域名的请求添加 cors 头; strict-whitelist 严格白名单模式, 白名单外的请求一律拒绝
  245. whitelist:
  246. - allow-origin: example1.com
  247. allow-headers: Content-Type,AccessToken,X-CSRF-Token, Authorization, Token,X-Token,X-User-Id
  248. allow-methods: POST, GET
  249. expose-headers: Content-Length, Access-Control-Allow-Origin, Access-Control-Allow-Headers, Content-Type
  250. allow-credentials: true # 布尔值
  251. - allow-origin: example2.com
  252. allow-headers: content-type
  253. allow-methods: GET, POST
  254. expose-headers: Content-Length, Access-Control-Allow-Origin, Access-Control-Allow-Headers, Content-Type
  255. allow-credentials: true # 布尔值