diff --git a/Dockerfile b/Dockerfile index e2daca3..73f274d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,8 +10,7 @@ COPY timezone/Shanghai /usr/share/zoneinfo/Asia/Shanghai # 复制预构建的二进制文件和配置文件 COPY admin-go_binary ./main -COPY manifest/config/config.yaml ./manifest/config/config.yaml -COPY resource ./resource +COPY config.yml ./ # 创建日志目录 RUN mkdir -p /logs /app/resource/log/run /app/resource/log/server diff --git a/manifest/config/config-dev.yaml b/manifest/config/config-dev.yaml new file mode 100644 index 0000000..c65ef9c --- /dev/null +++ b/manifest/config/config-dev.yaml @@ -0,0 +1,115 @@ +server: + name: "admin-go" + address: ":8808" + serverRoot: "resource/public" + dumpRouterMap: false + routeOverWrite: true + openapiPath: "/api.json" + swaggerPath: "/swagger" + NameToUriType: 3 + maxHeaderBytes: "20KB" + clientMaxBodySize: "50MB" + # Logging配置 + logPath: "resource/log/server" # 日志文件存储目录路径,建议使用绝对路径。默认为空,表示关闭 + logStdout: true # 日志是否输出到终端。默认为true + errorStack: true # 当Server捕获到异常时是否记录堆栈信息到日志中。默认为true + errorLogEnabled: true # 是否记录异常日志信息到日志中。默认为true + errorLogPattern: "error-{Ymd}.log" # 异常错误日志文件格式。默认为"error-{Ymd}.log" + accessLogEnabled: true # 是否记录访问日志。默认为false + accessLogPattern: "access-{Ymd}.log" # 访问日志文件格式。默认为"access-{Ymd}.log" + +logger: + path: "resource/log/run" + file: "{Y-m-d}.log" + level: "all" + stdout: true + +# Database. +database: + default: + - type: "pgsql" + host: "116.204.74.41" + port: "15432" + user: "postgres" + pass: "Bjang09@686^*^" + name: "admin" + role: "master" + maxIdle: "5" + maxOpen: "20" + maxLifetime: "60s" + charset : "utf8mb4" #数据库编码 + debug : true + dryRun : false #空跑 + - type: "pgsql" + host: "116.204.74.41" + port: "15432" + user: "postgres" + pass: "Bjang09@686^*^" + name: "admin" + role: "slave" + maxIdle: "5" + maxOpen: "20" + maxLifetime: "60s" + charset: "utf8mb4" #数据库编码 + debug: true + dryRun: false #空跑 +gfToken: + cacheKey: "gfToken:" + timeOut: 10800 + maxRefresh: 5400 + multiLogin: true + encryptKey: "49c54195e750b04e74a8429b17896586" + cacheModel: "redis" #缓存模式 memory OR redis OR dist + distPath: "./resource/data/distTokenDb" #使用磁盘缓存时配置数据缓存的目录 + excludePaths: + - "/api/v1/system/login" + + +# Redis 配置示例 +redis: + # 单实例配置 + default: + address: 116.204.74.41:6379 + db: 1 + idleTimeout: "60s" #连接最大空闲时间,使用时间字符串例如30s/1m/1d + maxConnLifetime: "90s" #连接最长存活时间,使用时间字符串例如30s/1m/1d + waitTimeout: "60s" #等待连接池连接的超时时间,使用时间字符串例如30s/1m/1d + dialTimeout: "30s" #TCP连接的超时时间,使用时间字符串例如30s/1m/1d + readTimeout: "30s" #TCP的Read操作超时时间,使用时间字符串例如30s/1m/1d + writeTimeout: "30s" #TCP的Write操作超时时间,使用时间字符串例如30s/1m/1d + maxActive: 100 + pass: "Bjang09@686^*^" + +system: + notCheckAuthAdminIds: [1] #无需验证后台权限的用户id + dataDir: "./resource/data" + cache: + model: "redis" #缓存模式 memory OR redis OR dist + distPath: "./resource/data/distCacheDb" #使用磁盘缓存时配置数据缓存的目录 + prefix: "gFastV3Cache:" #缓存前缀 + +#casbin配置 +casbin: + modelFile: "./resource/casbin/rbac_model.conf" + policyFile: "./resource/casbin/rbac_policy.csv" + + +# CLI. +gfcli: + gen: + dao: + - link: "mysql:gfast3:gfast333@tcp(192.168.0.212:3306)/gfast-v32" + tables: "tools_gen_table,tools_gen_table_column" + removePrefix: "gf_" + descriptionTag: true + noModelComment: true + path: "./internal/app/system" + +# 文件上传服务地址,与oss模块minio中的endpoint(filePrefix需要加http://)一致 +filePrefix: "http://116.204.74.41:9000" + +consul: + address: 116.204.74.41:8500 + +jaeger: #链路追踪 + addr: 116.204.74.41:4318 \ No newline at end of file diff --git a/manifest/config/config-master.yaml b/manifest/config/config-master.yaml new file mode 100644 index 0000000..babe635 --- /dev/null +++ b/manifest/config/config-master.yaml @@ -0,0 +1,115 @@ +server: + name: "admin-go" + address: ":8808" + serverRoot: "resource/public" + dumpRouterMap: false + routeOverWrite: true + openapiPath: "/api.json" + swaggerPath: "/swagger" + NameToUriType: 3 + maxHeaderBytes: "20KB" + clientMaxBodySize: "50MB" + # Logging配置 + logPath: "resource/log/server" # 日志文件存储目录路径,建议使用绝对路径。默认为空,表示关闭 + logStdout: true # 日志是否输出到终端。默认为true + errorStack: true # 当Server捕获到异常时是否记录堆栈信息到日志中。默认为true + errorLogEnabled: true # 是否记录异常日志信息到日志中。默认为true + errorLogPattern: "error-{Ymd}.log" # 异常错误日志文件格式。默认为"error-{Ymd}.log" + accessLogEnabled: true # 是否记录访问日志。默认为false + accessLogPattern: "access-{Ymd}.log" # 访问日志文件格式。默认为"access-{Ymd}.log" + +logger: + path: "resource/log/run" + file: "{Y-m-d}.log" + level: "all" + stdout: true + +# Database. +database: + default: + - type: "pgsql" + host: "192.168.0.169" + port: "15432" + user: "postgres" + pass: "Bjang09@686^*^" + name: "admin" + role: "master" + maxIdle: "5" + maxOpen: "20" + maxLifetime: "60s" + charset : "utf8mb4" #数据库编码 + debug : true + dryRun : false #空跑 + - type: "pgsql" + host: "192.168.0.169" + port: "15432" + user: "postgres" + pass: "Bjang09@686^*^" + name: "admin" + role: "slave" + maxIdle: "5" + maxOpen: "20" + maxLifetime: "60s" + charset: "utf8mb4" #数据库编码 + debug: true + dryRun: false #空跑 +gfToken: + cacheKey: "gfToken:" + timeOut: 10800 + maxRefresh: 5400 + multiLogin: true + encryptKey: "49c54195e750b04e74a8429b17896586" + cacheModel: "redis" #缓存模式 memory OR redis OR dist + distPath: "./resource/data/distTokenDb" #使用磁盘缓存时配置数据缓存的目录 + excludePaths: + - "/api/v1/system/login" + + +# Redis 配置示例 +redis: + # 单实例配置 + default: + address: 192.168.0.169:6379 + db: 1 + idleTimeout: "60s" #连接最大空闲时间,使用时间字符串例如30s/1m/1d + maxConnLifetime: "90s" #连接最长存活时间,使用时间字符串例如30s/1m/1d + waitTimeout: "60s" #等待连接池连接的超时时间,使用时间字符串例如30s/1m/1d + dialTimeout: "30s" #TCP连接的超时时间,使用时间字符串例如30s/1m/1d + readTimeout: "30s" #TCP的Read操作超时时间,使用时间字符串例如30s/1m/1d + writeTimeout: "30s" #TCP的Write操作超时时间,使用时间字符串例如30s/1m/1d + maxActive: 100 + pass: "Bjang09@686^*^" + +system: + notCheckAuthAdminIds: [1] #无需验证后台权限的用户id + dataDir: "./resource/data" + cache: + model: "redis" #缓存模式 memory OR redis OR dist + distPath: "./resource/data/distCacheDb" #使用磁盘缓存时配置数据缓存的目录 + prefix: "gFastV3Cache:" #缓存前缀 + +#casbin配置 +casbin: + modelFile: "./resource/casbin/rbac_model.conf" + policyFile: "./resource/casbin/rbac_policy.csv" + + +# CLI. +gfcli: + gen: + dao: + - link: "mysql:gfast3:gfast333@tcp(192.168.0.212:3306)/gfast-v32" + tables: "tools_gen_table,tools_gen_table_column" + removePrefix: "gf_" + descriptionTag: true + noModelComment: true + path: "./internal/app/system" + +# 文件上传服务地址,与oss模块minio中的endpoint(filePrefix需要加http://)一致 +filePrefix: "http://192.168.0.169:9000" + +consul: + address: 192.168.0.169:8500 + +jaeger: #链路追踪 + addr: 192.168.0.169:4318 \ No newline at end of file diff --git a/manifest/config/config.yaml b/manifest/config/config.yaml index 3d35469..76516da 100644 --- a/manifest/config/config.yaml +++ b/manifest/config/config.yaml @@ -28,7 +28,7 @@ logger: database: default: - type: "pgsql" - host: "192.168.0.169" + host: "116.204.74.41" port: "15432" user: "postgres" pass: "Bjang09@686^*^" @@ -41,7 +41,7 @@ database: debug : true dryRun : false #空跑 - type: "pgsql" - host: "192.168.0.169" + host: "116.204.74.41" port: "15432" user: "postgres" pass: "Bjang09@686^*^" @@ -69,7 +69,7 @@ gfToken: redis: # 单实例配置 default: - address: 192.168.0.169:6379 + address: 116.204.74.41:6379 db: 1 idleTimeout: "60s" #连接最大空闲时间,使用时间字符串例如30s/1m/1d maxConnLifetime: "90s" #连接最长存活时间,使用时间字符串例如30s/1m/1d @@ -105,10 +105,10 @@ gfcli: path: "./internal/app/system" # 文件上传服务地址,与oss模块minio中的endpoint(filePrefix需要加http://)一致 -filePrefix: "http://192.168.0.169:9000" +filePrefix: "http://116.204.74.41:9000" consul: - address: 192.168.0.169:8500 + address: 116.204.74.41:8500 jaeger: #链路追踪 - addr: 192.168.0.169:4318 \ No newline at end of file + addr: 116.204.74.41:4318 \ No newline at end of file