refactor(config): 更新配置文件格式并添加新配置项
This commit is contained in:
@@ -16,12 +16,32 @@ zap:
|
|||||||
encode-level: LowercaseColorLevelEncoder
|
encode-level: LowercaseColorLevelEncoder
|
||||||
stacktrace-key: stacktrace
|
stacktrace-key: stacktrace
|
||||||
log-in-console: true
|
log-in-console: true
|
||||||
|
retention-day: -1
|
||||||
|
|
||||||
# redis configuration
|
# redis configuration
|
||||||
redis:
|
redis:
|
||||||
db: 0
|
#是否使用redis集群模式
|
||||||
|
useCluster: false
|
||||||
|
#使用集群模式addr和db默认无效
|
||||||
addr: 177.7.0.14:6379
|
addr: 177.7.0.14:6379
|
||||||
password: ""
|
password: ""
|
||||||
|
db: 0
|
||||||
|
clusterAddrs:
|
||||||
|
- "177.7.0.14:7000"
|
||||||
|
- "177.7.0.15:7001"
|
||||||
|
- "177.7.0.13:7002"
|
||||||
|
|
||||||
|
# redis-list configuration
|
||||||
|
redis-list:
|
||||||
|
- name: cache # 数据库的名称,注意: name 需要在 redis-list 中唯一
|
||||||
|
useCluster: false # 是否使用redis集群模式
|
||||||
|
addr: 177.7.0.14:6379 # 使用集群模式addr和db默认无效
|
||||||
|
password: ""
|
||||||
|
db: 0
|
||||||
|
clusterAddrs:
|
||||||
|
- "177.7.0.14:7000"
|
||||||
|
- "177.7.0.15:7001"
|
||||||
|
- "177.7.0.13:7002"
|
||||||
|
|
||||||
# mongo configuration
|
# mongo configuration
|
||||||
mongo:
|
mongo:
|
||||||
@@ -30,6 +50,7 @@ mongo:
|
|||||||
database: ''
|
database: ''
|
||||||
username: ''
|
username: ''
|
||||||
password: ''
|
password: ''
|
||||||
|
auth-source: ''
|
||||||
min-pool-size: 0
|
min-pool-size: 0
|
||||||
max-pool-size: 100
|
max-pool-size: 100
|
||||||
socket-timeout-ms: 0
|
socket-timeout-ms: 0
|
||||||
@@ -51,7 +72,7 @@ email:
|
|||||||
|
|
||||||
# system configuration
|
# system configuration
|
||||||
system:
|
system:
|
||||||
env: public # Change to "develop" to skip authentication for development mode
|
env: local # 修改为public可以关闭路由日志输出
|
||||||
addr: 8888
|
addr: 8888
|
||||||
db-type: mysql
|
db-type: mysql
|
||||||
oss-type: local # 控制oss选择走本地还是 七牛等其他仓 自行增加其他oss仓可以在 server/utils/upload/upload.go 中 NewOss函数配置
|
oss-type: local # 控制oss选择走本地还是 七牛等其他仓 自行增加其他oss仓可以在 server/utils/upload/upload.go 中 NewOss函数配置
|
||||||
@@ -62,6 +83,10 @@ system:
|
|||||||
iplimit-count: 15000
|
iplimit-count: 15000
|
||||||
# IP限制一个小时
|
# IP限制一个小时
|
||||||
iplimit-time: 3600
|
iplimit-time: 3600
|
||||||
|
# 路由全局前缀
|
||||||
|
router-prefix: ""
|
||||||
|
# 严格角色模式 打开后权限将会存在上下级关系
|
||||||
|
use-strict-auth: false
|
||||||
|
|
||||||
# captcha configuration
|
# captcha configuration
|
||||||
captcha:
|
captcha:
|
||||||
@@ -98,10 +123,42 @@ pgsql:
|
|||||||
max-open-conns: 100
|
max-open-conns: 100
|
||||||
log-mode: ""
|
log-mode: ""
|
||||||
log-zap: false
|
log-zap: false
|
||||||
|
oracle:
|
||||||
|
path: ""
|
||||||
|
port: ""
|
||||||
|
config: ""
|
||||||
|
db-name: ""
|
||||||
|
username: ""
|
||||||
|
password: ""
|
||||||
|
max-idle-conns: 10
|
||||||
|
max-open-conns: 100
|
||||||
|
log-mode: ""
|
||||||
|
log-zap: false
|
||||||
|
mssql:
|
||||||
|
path: ""
|
||||||
|
port: ""
|
||||||
|
config: ""
|
||||||
|
db-name: ""
|
||||||
|
username: ""
|
||||||
|
password: ""
|
||||||
|
max-idle-conns: 10
|
||||||
|
max-open-conns: 100
|
||||||
|
log-mode: ""
|
||||||
|
log-zap: false
|
||||||
|
sqlite:
|
||||||
|
path: ""
|
||||||
|
port: ""
|
||||||
|
config: ""
|
||||||
|
db-name: ""
|
||||||
|
username: ""
|
||||||
|
password: ""
|
||||||
|
max-idle-conns: 10
|
||||||
|
max-open-conns: 100
|
||||||
|
log-mode: ""
|
||||||
|
log-zap: false
|
||||||
db-list:
|
db-list:
|
||||||
- disable: true # 是否禁用
|
- disable: true # 是否禁用
|
||||||
type: "" # 数据库的类型,目前支持mysql、pgsql
|
type: "" # 数据库的类型,目前支持mysql、pgsql、mssql、oracle
|
||||||
alias-name: "" # 数据库的名称,注意: alias-name 需要在db-list中唯一
|
alias-name: "" # 数据库的名称,注意: alias-name 需要在db-list中唯一
|
||||||
path: ""
|
path: ""
|
||||||
port: ""
|
port: ""
|
||||||
@@ -114,7 +171,6 @@ db-list:
|
|||||||
log-mode: ""
|
log-mode: ""
|
||||||
log-zap: false
|
log-zap: false
|
||||||
|
|
||||||
|
|
||||||
# local configuration
|
# local configuration
|
||||||
local:
|
local:
|
||||||
path: uploads/file
|
path: uploads/file
|
||||||
@@ -122,22 +178,11 @@ local:
|
|||||||
|
|
||||||
# autocode configuration
|
# autocode configuration
|
||||||
autocode:
|
autocode:
|
||||||
transfer-restart: true
|
web: web/src
|
||||||
# root 自动适配项目根目录
|
root: "" # root 自动适配项目根目录, 请不要手动配置,他会在项目加载的时候识别出根路径
|
||||||
# 请不要手动配置,他会在项目加载的时候识别出根路径
|
server: server
|
||||||
root: ""
|
module: 'github.com/flipped-aurora/gin-vue-admin/server'
|
||||||
server: /server
|
ai-path: "" # AI服务路径
|
||||||
server-plug: /plugin/%s
|
|
||||||
server-api: /api/v1/%s
|
|
||||||
server-initialize: /initialize
|
|
||||||
server-model: /model/%s
|
|
||||||
server-request: /model/%s/request/
|
|
||||||
server-router: /router/%s
|
|
||||||
server-service: /service/%s
|
|
||||||
web: /web/src
|
|
||||||
web-api: /api
|
|
||||||
web-form: /view
|
|
||||||
web-table: /view
|
|
||||||
|
|
||||||
# qiniu configuration (请自行七牛申请对应的 公钥 私钥 bucket 和 域名地址)
|
# qiniu configuration (请自行七牛申请对应的 公钥 私钥 bucket 和 域名地址)
|
||||||
qiniu:
|
qiniu:
|
||||||
@@ -149,6 +194,16 @@ qiniu:
|
|||||||
secret-key: ""
|
secret-key: ""
|
||||||
use-cdn-domains: false
|
use-cdn-domains: false
|
||||||
|
|
||||||
|
# minio oss configuration
|
||||||
|
minio:
|
||||||
|
endpoint: yourEndpoint
|
||||||
|
access-key-id: yourAccessKeyId
|
||||||
|
access-key-secret: yourAccessKeySecret
|
||||||
|
bucket-name: yourBucketName
|
||||||
|
use-ssl: false
|
||||||
|
base-path: ""
|
||||||
|
bucket-url: "http://host:9000/yourBucketName"
|
||||||
|
|
||||||
# aliyun oss configuration
|
# aliyun oss configuration
|
||||||
aliyun-oss:
|
aliyun-oss:
|
||||||
endpoint: yourEndpoint
|
endpoint: yourEndpoint
|
||||||
@@ -179,6 +234,15 @@ aws-s3:
|
|||||||
base-url: https://gin.vue.admin
|
base-url: https://gin.vue.admin
|
||||||
path-prefix: github.com/flipped-aurora/gin-vue-admin/server
|
path-prefix: github.com/flipped-aurora/gin-vue-admin/server
|
||||||
|
|
||||||
|
# cloudflare r2 configuration
|
||||||
|
cloudflare-r2:
|
||||||
|
bucket: xxxx0bucket
|
||||||
|
base-url: https://gin.vue.admin.com
|
||||||
|
path: uploads
|
||||||
|
account-id: xxx_account_id
|
||||||
|
access-key-id: xxx_key_id
|
||||||
|
secret-access-key: xxx_secret_key
|
||||||
|
|
||||||
# huawei obs configuration
|
# huawei obs configuration
|
||||||
hua-wei-obs:
|
hua-wei-obs:
|
||||||
path: you-path
|
path: you-path
|
||||||
@@ -191,30 +255,29 @@ hua-wei-obs:
|
|||||||
excel:
|
excel:
|
||||||
dir: ./resource/excel/
|
dir: ./resource/excel/
|
||||||
|
|
||||||
# timer task db clear table
|
# disk usage configuration
|
||||||
Timer:
|
disk-list:
|
||||||
start: true
|
- mount-point: "/"
|
||||||
spec: "@daily" # 定时任务详细配置参考 https://pkg.go.dev/github.com/robfig/cron/v3
|
|
||||||
detail:
|
|
||||||
- tableName: sys_operation_records
|
|
||||||
compareField: created_at
|
|
||||||
interval: 2160h
|
|
||||||
- tableName: jwt_blacklists
|
|
||||||
compareField: created_at
|
|
||||||
interval: 168h
|
|
||||||
|
|
||||||
# 跨域配置
|
# 跨域配置
|
||||||
# 需要配合 server/initialize/router.go -> `Router.Use(middleware.CorsByRules())` 使用
|
# 需要配合 server/initialize/router.go -> `Router.Use(middleware.CorsByRules())` 使用
|
||||||
cors:
|
cors:
|
||||||
mode: whitelist # 放行模式: allow-all, 放行全部; whitelist, 白名单模式, 来自白名单内域名的请求添加 cors 头; strict-whitelist 严格白名单模式, 白名单外的请求一律拒绝
|
mode: strict-whitelist # 放行模式: allow-all, 放行全部; whitelist, 白名单模式, 来自白名单内域名的请求添加 cors 头; strict-whitelist 严格白名单模式, 白名单外的请求一律拒绝
|
||||||
whitelist:
|
whitelist:
|
||||||
- allow-origin: example1.com
|
- allow-origin: example1.com
|
||||||
allow-headers: content-type
|
allow-headers: Content-Type,AccessToken,X-CSRF-Token, Authorization, Token,X-Token,X-User-Id
|
||||||
allow-methods: GET, POST
|
allow-methods: POST, GET
|
||||||
expose-headers: Content-Length, Access-Control-Allow-Origin, Access-Control-Allow-Headers, Content-Type
|
expose-headers: Content-Length, Access-Control-Allow-Origin, Access-Control-Allow-Headers, Content-Type
|
||||||
|
|
||||||
allow-credentials: true # 布尔值
|
allow-credentials: true # 布尔值
|
||||||
- allow-origin: example2.com
|
- allow-origin: example2.com
|
||||||
allow-headers: content-type
|
allow-headers: content-type
|
||||||
allow-methods: GET, POST
|
allow-methods: GET, POST
|
||||||
expose-headers: Content-Length, Access-Control-Allow-Origin, Access-Control-Allow-Headers, Content-Type
|
expose-headers: Content-Length, Access-Control-Allow-Origin, Access-Control-Allow-Headers, Content-Type
|
||||||
allow-credentials: true # 布尔值
|
allow-credentials: true # 布尔值
|
||||||
|
mcp:
|
||||||
|
name: GVA_MCP
|
||||||
|
version: v1.0.0
|
||||||
|
sse_path: /sse
|
||||||
|
message_path: /message
|
||||||
|
url_prefix: ''
|
Reference in New Issue
Block a user