From 2c0df3a446ee25aa2c38e9c1347b1e811019fdc0 Mon Sep 17 00:00:00 2001 From: willem <18710090979@163.com> Date: Fri, 1 Dec 2023 11:19:46 +0800 Subject: [PATCH 1/2] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A0docker-compose=20?= =?UTF-8?q?config.yaml=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../iot-open/config/config.yaml | 108 ++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100644 manifest/docker-compose/iot-open/config/config.yaml diff --git a/manifest/docker-compose/iot-open/config/config.yaml b/manifest/docker-compose/iot-open/config/config.yaml new file mode 100644 index 0000000..299b232 --- /dev/null +++ b/manifest/docker-compose/iot-open/config/config.yaml @@ -0,0 +1,108 @@ +# 配置文件的键名命名方式统一使用小驼峰。 + +# HTTP Server. +server: + address: ":8200" + serverRoot: "resource/public" + dumpRouterMap: false + routeOverWrite: true + openapiPath: "/base-api/swagger/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" + https: false + httpsCertFile: "" + httpsKeyFile: "" + +# 数据库连接配置 +database: + logger: + path: "resource/log/sql" + level: "all" + stdout: true + ctxKeys: [ "RequestId" ] + + default: + link: "mysql:root:DbyTYGu3s4WuAF4TTq7@tcp(mysql:3306)/sagoo_iot_open?loc=Local&parseTime=true" + debug: false #开启调试模式 + charset: "utf8mb4" #数据库编码(如: utf8/gbk/gb2312),一般设置为utf8 + dryRun: false #ORM空跑(只读不写) + maxIdle: 10 #连接池最大闲置的连接数 + maxOpen: 10 #连接池最大打开的连接数 + maxLifetime: 30 #(单位秒)连接对象可重复使用的时间长度 + +# dataCenter: +# link: "mysql:zhgy_sagoo_cn:aRB75tn7NRpHDc6i@tcp(101.200.198.249:3306)/zhgy_sagoo_cn" +# debug: true +# charset: "utf8mb4" #数据库编码 +# dryRun: false #ORM空跑(只读不写) +# maxIdle: 10 #连接池最大闲置的连接数 +# maxOpen: 10 #连接池最大打开的连接数 +# maxLifetime: 30 #(单位秒)连接对象可重复使用的时间长度 + +# TDengine配置 +tdengine: + type: "taosRestful" #http连接方式,端口是6041 + dsn: "root:taosdata@http(tdengine:6041)/" + dbName: "sagoo_iot" + maxOpenConns: 10 + maxIdleConns: 5 + +# 采用原生的时候,需要将sagoo-admin/internal/logic/tdengine下的td_engine.go文件里import中的原生驱动打开 +# type: "taosSql" #原生连接方式,端口是6030 +# dsn: "zhgy_iot:zh5365a@tcp(101.200.198.249:6030)/" + +# 文件上传设置 +upload: + path: "upload" + +logger: + path: "resource/log/run" + file: "{Y-m-d}.log" + level: "all" + stdout: true + ctxKeys: [ "RequestId" ] + +#GFToken +gfToken: + timeOut: 10800 #token超时时间(秒) + maxRefresh: 5400 #token自动刷新时间(秒) + multiLogin: true #是否允许一个账号多人同时登录 + encryptKey: "49c54195e750b04e74a8429b17896586" #加密key (32位) + excludePaths: #排除不做登录验证的路由地址 + - "/api/v1/login" + +# Redis 配置示例 +redis: + # 单实例配置 + default: + address: redis:6379 + db: 0 + pass: FDXLK3LdGYYk9mut + idleTimeout: 600 + maxActive: 100 + +# 这个mqtt客户端主要是服务端内部处理消息使用的通道 +mqtt: + addr: emqx:1883 + # 最好带上服务名称,变成唯一id + clientId: sagoo-iot-open-001 + deviceLiveDuration: 30 + +system: + pluginsPath: "./plugins/built" + cache: + prefix: "SagooIOT_" #缓存前缀 + model: "redis" #存储引擎 (memory使用内存|redis使用redis) + +# 授权文件地址 +licFilePath: ./resource \ No newline at end of file From 3f9df7f6d8c4b4af20620e632b48e33bfb4eda0c Mon Sep 17 00:00:00 2001 From: willem <18710090979@163.com> Date: Fri, 1 Dec 2023 11:22:21 +0800 Subject: [PATCH 2/2] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A0docker-compose=20?= =?UTF-8?q?config.yaml=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 24dd65d..2c4352b 100644 --- a/.gitignore +++ b/.gitignore @@ -21,5 +21,8 @@ resource/log/ #resource/public/ logs/ upload/product_icon/ -config.yaml +manifest/config/config.yaml +manifest/docker-compose/emqx/ +manifest/docker-compose/mysql/data +manifest/docker-compose/redis/data extend/log/ \ No newline at end of file