feat: 一键部署——配置内置默认值,去掉示例复制与环境变量
目标:git clone 后 docker compose up -d 直接可用,无需任何手工准备。
变更:
- config.example/ → config/,config.example.yaml → config.yaml
不再需要 cp -r 与逐份修改
- 删除 .env / .env.example,值全部内置到 docker-compose.yml
(GoFrame 不展开配置文件中的 ${VAR},环境变量方案在 Go 侧不可用)
- 配置文件里的 ${VAR} 全部替换为字面默认值
- schema/04-users.sh 与 05-reset-passwords.sh 改为脚本内字面口令,
不再读取环境变量
- 新增 schema/13-seed-flow-package.sql 占位文件,说明套餐表为空的原因与补齐方式
- .gitignore 不再排除 config/ 与 .env(已无 .env)
- README 改为「一键启动」+「上线前必改」两张表
已验证:docker compose config 通过;compose 口令、各配置文件 DSN、
初始化脚本三处口令哈希一致;库名与 schema 中一致。
This commit is contained in:
@@ -0,0 +1,110 @@
|
||||
# ============================================================
|
||||
# iotlcm-upstream-proxy 配置示例
|
||||
#
|
||||
# cp config.example.yaml config.yaml
|
||||
#
|
||||
# 本服务是通道侧的缓存与转发层,通常不需要改业务参数。
|
||||
# ============================================================
|
||||
|
||||
system:
|
||||
name: "IotLCM-Upstream-Proxy"
|
||||
version: "1.0"
|
||||
description: "IotLCM Upstream Proxy Service"
|
||||
gfmode: "prod"
|
||||
upload:
|
||||
local:
|
||||
path: "/app/upload"
|
||||
|
||||
# ---------- 智能诊断内部凭据 ----------
|
||||
# 控制台「智能诊断」调用本服务的内部凭据,
|
||||
# 必须与 admin-svr 的 upstream.appDiagnosisToken 一致。
|
||||
# 生成:openssl rand -hex 16
|
||||
appDiagnosis:
|
||||
internalToken: "iotlcm_diagnosis_2026"
|
||||
|
||||
server:
|
||||
name: "iotlcmupstreamproxy-grpc-svc"
|
||||
address: ":8510"
|
||||
openapiPath: "/api.json"
|
||||
swaggerPath: "/swagger"
|
||||
indexFiles: ["index.html", "index.htm"]
|
||||
indexFolder: false
|
||||
fileServerEnabled: true
|
||||
initLoadMemoryDB: false
|
||||
maxHeaderBytes: "20KB"
|
||||
clientMaxBodySize: "200MB"
|
||||
|
||||
# ---------- 服务注册 ----------
|
||||
registry:
|
||||
type: "consul"
|
||||
address: "consul:8500"
|
||||
|
||||
logger:
|
||||
path: "/app/logs"
|
||||
file: "{Y-m-d-H}.log"
|
||||
prefix: ""
|
||||
level: "info"
|
||||
timeFormat: "2006-01-02T15:04:05.000"
|
||||
ctxKeys: []
|
||||
header: true
|
||||
stdout: true
|
||||
rotateSize: 0
|
||||
rotateExpire: 0
|
||||
rotateBackupLimit: 0
|
||||
rotateBackupExpire: 0
|
||||
rotateBackupCompress: 0
|
||||
rotateCheckInterval: "1h"
|
||||
stdoutColorDisabled: false
|
||||
writerColorEnable: false
|
||||
|
||||
# ---------- 数据库 ----------
|
||||
database:
|
||||
logger:
|
||||
path: "/app/logs"
|
||||
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: "resource/cache"
|
||||
|
||||
# ---------- Redis ----------
|
||||
redis:
|
||||
default:
|
||||
mode: "single"
|
||||
sentinelMasterName: ""
|
||||
address: "redis:6379"
|
||||
db: 0
|
||||
pass: "Iotlcm2026Default"
|
||||
minIdle: 5
|
||||
maxIdle: 30
|
||||
maxActive: 5000
|
||||
idleTimeout: "60s"
|
||||
ClientName: "SystemCache"
|
||||
|
||||
# ---------- 上游通道服务 ----------
|
||||
gateway:
|
||||
# 通道服务地址(同 compose 内服务名)
|
||||
address: "upstream-chan"
|
||||
timeout: 10s
|
||||
# 单次批量转发的总预算上限。
|
||||
# 非 APN 批量按「单卡超时 × 卡数」计算并以此封顶,
|
||||
# 避免通道逐卡串行办理时请求仍在执行就被判失败
|
||||
# (批量重启、停复机、批量查询)。
|
||||
# worker 侧的超时配置必须大于该值。
|
||||
batchTimeout: 20m
|
||||
Reference in New Issue
Block a user