Files
iotlcm/config.example/app-server/config.example.yaml
T
MiFaZhan bc2c7bcc6b init: IotLCM 开源版部署仓
内容:
- docker-compose.yml:14 个基础/业务服务 + 3 个可选 profile(with-mock 挡板、with-bot、with-nginx)
- .env.example:集中管理镜像仓库、口令、端口;必填项缺失时 compose 直接报错退出
- config.example/:10 份配置模板,全部为占位值与注释说明
- schema/:12 个初始化脚本,按文件名顺序由 MySQL initdb 自动执行

脱敏处理:
- 生产/内网 IP、镜像仓库地址、公司名、真实域名全部清除
- 演示账号保留 18 个(出库与划拨依赖账号与部门树的关联),
  昵称/邮箱/手机号/登录IP/头像改为占位或编造值
- 数据库账号与 admin 口令改为初始化时按 .env 注入计算
- 通道模板与 Mock 通道的上游密钥置空
- Mock 通道地址指向 compose 内 onelink-mock 服务

部署时用 --profile with-mock 启动运营商接口挡板,即可在无真实运营商环境时跑通全链路。
2026-10-28 13:40:12 +08:00

264 lines
6.7 KiB
YAML

# ============================================================
# iotlcm-app-server 配置示例
#
# cp config.example.yaml config.yaml
#
# 小程序 / H5 端的后端服务。
# ============================================================
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: "${JWT_SIGNING_KEY}"
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:${MYSQL_APP_PASSWORD}@tcp(mysql:3306)/${MYSQL_DATABASE}?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: "${REDIS_PASSWORD}"
minIdle: 5
maxIdle: 30
maxActive: 5000
idleTimeout: "60s"
ClientName: "AppServerCache"
# ---------- RabbitMQ ----------
rabbitmq:
enabled: true
dsn: "amqp://${RABBITMQ_USER}:${RABBITMQ_PASSWORD}@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"
dsn: "${TDENGINE_USER}:${TDENGINE_PASSWORD}@ws(${TDENGINE_HOST}:${TDENGINE_PORT})/"
dbName: "${TDENGINE_DAILY_DB}"
dailyDbName: "${TDENGINE_DAILY_DB}"
monthlyDbName: "${TDENGINE_MONTHLY_DB}"
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: "${DIAGNOSIS_INTERNAL_TOKEN}"
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: []