Files
iotlcm/deploy/config/app-server/config.yaml

267 lines
7.0 KiB
YAML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# ============================================================
# iotlcm-app-server 配置
#
# 本文件随部署仓分发,已带可运行默认值,无需复制或改名。
# 正式上线前请修改口令等敏感项;修改时需与 docker-compose.yml、
# schema/init.sql 及 config/ 下其他文件保持一致(详见 README)。
# ============================================================
system:
name: "IotLCM"
version: "1.0"
description: "IotLCM App Server"
gfmode: "prod"
upload:
local:
path: "resource/upload"
server:
address: ":8010"
openapiPath: "/api.json"
swaggerPath: "/swagger"
indexFiles: ["index.html", "index.htm"]
indexFolder: false
serverRoot: "resource/public"
searchPaths: ["/resource/public"]
fileServerEnabled: true
initLoadMemoryDB: false
maxHeaderBytes: "20KB"
clientMaxBodySize: "200MB"
readTimeout: "20m"
writeTimeout: "20m"
allowedDomains: []
enabledDBOperationLog: false
logger:
path: "/app/resource/log/server"
file: "{Y-m-d-H}.log"
prefix: ""
level: "info"
timeFormat: "2006-01-02T15:04:05"
ctxKeys: []
header: true
stdout: true
rotateSize: 0
rotateExpire: 0
rotateBackupLimit: 0
rotateBackupExpire: 0
rotateBackupCompress: 0
rotateCheckInterval: "1h"
stdoutColorDisabled: false
writerColorEnable: false
# ---------- JWT ----------
# 必改:必须与 admin-svr、openapi 完全一致。
jwt:
signingKey: "1f8b3c5d7e9a2b4c6d8e0f1a3b5c7d9e1f8b3c5d7e9a2b4c6d8e0f1a3b5c7d9e"
expiresTime: "7d"
bufferTime: "1d"
issuer: "iotlcm"
captcha:
keyLong: 6
imgWidth: 240
imgHeight: 80
openCaptcha: 0
openCaptchaTimeout: 3600
# ---------- 注册验证码:走短信服务 ----------
register:
sms:
url: "http://iotlcm-sms:11190/api/v1/sms/send"
method: "POST"
headers: {}
bodyTemplate: '{"config":{"scene":"{scene}"},"params":{"phoneNumber":"{contact}","msgContent":"{code}"}}'
successStatus: 200
# ---------- 数据库 ----------
database:
# 旧平台库(历史数据对接)。不使用时空 link 即可。
legacyCard:
link: ""
debug: false
maxOpen: 5
maxIdle: 2
logger:
path: "/app/resource/log/server/sql"
level: "all"
stdout: true
default:
# 必改:连接串
link: "mysql:u_iotlcm:Iotlcm2026Default@tcp(mysql:3306)/db_iotlcm?charset=utf8mb4&parseTime=True&loc=Asia%2FShanghai"
debug: false
charset: "utf8mb4"
dryRun: false
maxIdle: 30
maxOpen: 100
maxLifetime: 120
memorydb:
link: "sqlite::@file(:memory:)"
debug: false
maxIdle: 1
maxOpen: 1
maxLifetime: 30
cache:
adapter: "redis"
fileDir: "/app/resource/cache"
# ---------- Redis ----------
redis:
default:
mode: "single"
sentinelMasterName: ""
address: "redis:6379"
db: 0
pass: "Iotlcm2026Default"
minIdle: 5
maxIdle: 30
maxActive: 5000
idleTimeout: "60s"
ClientName: "AppServerCache"
# ---------- RabbitMQ ----------
rabbitmq:
enabled: true
dsn: "amqp://iotlcm:Iotlcm2026Default@rabbitmq:5672/"
# ---------- 异步业务 ----------
workerBatchAsync:
enabled: true
exchange: "iotlcm.batch"
queueName: "iotlcm.batch.execute"
failOnPublish: false
appBusinessAsync:
enabled: true
exchange: "iotlcm.app"
queueName: "iotlcm.app.business"
failOnPublish: false
# ---------- 支付(可选) ----------
# 不使用支付功能时把 enabled 全部改 false。
payment:
balanceRecharge:
enabled: false
mock:
enabled: false
wechat:
enabled: false
envFile: ""
apiBase: "https://api.mch.weixin.qq.com"
mchId: ""
mchSerialNo: ""
apiV3Key: ""
# 微信支付证书需单独放入 data/certs 目录,不随仓库分发
privateKeyPath: "resource/certs/wechatpay_apiclient_key.pem"
notifyUrl: "https://your-domain.example.com/app/api/v1/app/payment/wechat/notify"
notifyBaseUrl: "https://your-domain.example.com/app"
refundNotifyUrl: "https://your-domain.example.com/app/api/v1/app/payment/wechat/refund-notify"
timeoutMinutes: 5
platformPublicKeyId: ""
platformPublicKeyPath: "resource/certs/wechatpay_platform_public_key.pem"
h5:
enabled: false
appId: ""
appName: ""
appUrl: "https://your-domain.example.com/app"
payerClientIp: ""
mini:
enabled: false
appId: ""
appSecret: ""
# ---------- 卡号识别(拍照查卡) ----------
# 走 OpenAI 兼容接口的视觉模型。不需要该功能时 enabled 改 false。
appCardRecognition:
enabled: false
provider: "openai-compatible"
baseUrl: ""
endpoint: ""
model: ""
apiKey: ""
timeout: "25s"
maxImageBytes: 8388608
maxTokens: 256
rateLimit:
enabled: true
count: 20
period: "1m"
# 微信订阅消息模板
appWarning:
wechatSubscribeTemplateId: ""
# ---------- TDengine(流量历史) ----------
tsdb:
database: "TdEngine"
tdengine:
type: "taosWS"
# TDengine 3.x WebSocket 地址(容器内服务名 tdengine,端口 6041)
# 口令为 TDengine 默认 root/taosdata;改过口令需同步改这里
dsn: "root:taosdata@ws(tdengine:6041)/"
# dbName 只是连接池键名与兜底值,不决定实际访问哪个库
dbName: "iotlcm_daily"
dailyDbName: "iotlcm_daily"
monthlyDbName: "iotlcm_monthly"
maxOpenConns: 100
maxIdleConns: 10
# ---------- 免登录白名单 ----------
router:
exceptLogin:
- /api/v1/auth/captcha
- /api/v1/auth/side-captcha
- /api/v1/auth/check-side-captcha
- /api/v1/auth/sms
- /api/v1/auth/register
- /api/v1/auth/login
- /api/v1/auth/wechat-login
- /api/v1/auth/wechat-bind-phone
- /api/v1/auth/forgot-password
- /api/v1/card/public-query
- /api/v1/card/recognize
- /api/v1/card/public-package-detail
- /api/v1/open/diagnosis/info
- /api/v1/open/diagnosis/flow
- /api/v1/payment/wechat/notify
- /api/v1/payment/wechat/refund-notify
- /api/v1/app/auth/captcha
- /api/v1/app/auth/side-captcha
- /api/v1/app/auth/check-side-captcha
- /api/v1/app/auth/sms
- /api/v1/app/auth/register
- /api/v1/app/auth/login
- /api/v1/app/auth/wechat-login
- /api/v1/app/auth/wechat-bind-phone
- /api/v1/app/auth/forgot-password
- /api/v1/app/card/public-query
- /api/v1/app/card/recognize
- /api/v1/app/card/public-package-detail
- /api/v1/app/open/diagnosis/info
- /api/v1/app/open/diagnosis/flow
- /api/v1/app/payment/wechat/notify
- /api/v1/app/payment/wechat/refund-notify
- /openapi/v3/query/token
# ---------- 上游服务地址 ----------
upstream:
# 控制台智能诊断内部凭据,须与 admin-svr 一致
appDiagnosisToken: "iotlcm_diagnosis_2026"
provider: "onelink_mock"
default:
clientName: "http://upstream-proxy:8510"
timeout: "10s"
gateway:
clientName: "http://upstream-chan:8110"
timeout: "10s"
# 移动 OneLink 挡板(联调用)。对接真实运营商时 enabled 改 false。
onelinkMock:
enabled: false
baseUrl: "http://onelink-mock:8080/v5"
appid: ""
password: ""
timeout: "10s"
tokenTTL: 3600
accounts: []