You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

205 lines
5.4 KiB

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