Files
iotlcm/config.example/admin-svr/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

229 lines
5.6 KiB
YAML
Raw 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-admin-svr 配置示例
#
# cp config.example.yaml config.yaml
#
# 标注「必改」的项需要按实际环境填写;
# 其余为可运行默认值,按需调整。
# 支持 ${VAR} 与 ${VAR:default} 环境变量占位(由 compose 注入)。
# ============================================================
system:
name: "IotLCM"
version: "1.0"
description: "IotLCM Server"
gfmode: "prod" # prod / dev
upload:
local:
path: "resource/upload"
workerDiagnostic:
enabled: true
server:
address: ":8008"
openapiPath: "/api.json"
swaggerPath: "/swagger"
indexFiles: ["index.html", "index.htm"]
indexFolder: false
fileServerEnabled: true
initLoadMemoryDB: false
maxHeaderBytes: "20KB"
clientMaxBodySize: "200MB"
logger:
path: "/app/logs"
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 ----------
# 必改:signingKey 必须与 openapi、app-server 完全一致。
jwt:
signingKey: "${JWT_SIGNING_KEY}"
expiresTime: 7d
bufferTime: 1d
issuer: iotlcm
captcha:
keyLong: 6
imgWidth: 240
imgHeight: 80
openCaptcha: 0
openCaptchaTimeout: 3600
# ---------- 数据库 ----------
database:
# 旧平台库(历史数据对接)。不使用时空 link 即可。
legacyCard:
link: ""
debug: false
maxOpen: 5
maxIdle: 2
logger:
path: "/app/logs"
level: "all"
stdout: true
default:
# 必改:连接串格式为 mysql:用户名:口令 再接 tcp(主机:端口)/库名?参数
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/cache"
batch:
allocate:
chunkSize: 5000
maxFileSize: 52428800 # 50MB
# ---------- 流量预警 ----------
warning:
expire:
firstWarnDays: 30
secondWarnDays: 15
thirdWarnDays: 7
# 短信通道:指向 iotlcm-sms 服务。不用短信时 enabled 改 false。
sms:
enabled: true
url: "http://iotlcm-sms:11190/api/v1/sms/send"
grpcAddr: "iotlcm-sms:11200"
timeout: "5s"
# 以下为短信服务商参数,一般留空(由 sms 服务统一持有)
routerId: 0
serviceType: ""
regionId: ""
accessKeyId: ""
accessKeySecret: ""
sdkAppId: ""
signName: ""
templateId: ""
msgContentTemplate: ""
# 微信小程序订阅消息。不用时 enabled 改 false。
wechat:
enabled: false
appId: ""
appSecret: ""
templateId: ""
page: "pages/message/index"
timeout: "5s"
# ---------- 注册验证码 ----------
register:
# 走 HTTP 短信网关
sms:
url: ""
method: "POST"
headers: {}
bodyTemplate: '{"phone":"{contact}","code":"{code}"}'
successStatus: 200
# 走 SMTP 邮件
email:
host: "" # 如 smtp.example.com
port: 465
username: ""
password: ""
from: ""
fromName: "物联网卡管理平台"
subject: "注册验证码"
bodyTemplate: "您的注册验证码是:{code},6小时内有效。"
ssl: true
# ---------- Redis ----------
redis:
default:
mode: "single" # single / cluster / sentinel
sentinelMasterName: ""
address: "redis:6379"
db: 0
pass: "${REDIS_PASSWORD}"
minIdle: 5
maxIdle: 30
maxActive: 5000
idleTimeout: "60s"
ClientName: "SystemCache"
# ---------- RabbitMQ ----------
rabbitmq:
enabled: true
dsn: "amqp://${RABBITMQ_USER}:${RABBITMQ_PASSWORD}@rabbitmq:5672/"
# ---------- TDengine(流量历史) ----------
# 需要 TDengine 3.x 的 WebSocket 接口(6041)。
# 不启用时序库时 link 留空,历史流量相关功能不可用。
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/system/auth/login
- /api/v1/system/auth/refresh
- /api/v1/system/captcha
- /api/v1/system/auth/getTenantList
- /openapi/v3/query/token
- /api/v1/system/tTplatformSetting/view
- /api/v1/pay/alipay/notify
- /api/v1/pay/alipay/return
# ---------- 支付宝(可选) ----------
# 不使用支付功能时整段删掉。
alipay:
appId: ""
privateKey: ""
alipayPublicKey: ""
notifyUrl: "https://your-domain.example.com/api/v1/pay/alipay/notify"
returnUrl: "https://your-domain.example.com/#/enterpriseManagement/tBalanceDetail/tAgentBalance"
isProduction: false
pay:
expireTime: 60
balanceRecharge:
timeoutDelay: "30m"
# ---------- 上游服务地址 ----------
# 指向同 compose 内的服务名,一般无需修改。
upstream:
# 控制台智能诊断内部凭据,须与 upstream-proxy 的 appDiagnosis.internalToken 一致
appDiagnosisToken: "${DIAGNOSIS_INTERNAL_TOKEN}"
proxy:
address: "upstream-proxy:8510"
timeout: 10s
gateway:
address: "upstream-chan:8110"
timeout: 10s