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 启动运营商接口挡板,即可在无真实运营商环境时跑通全链路。
This commit is contained in:
@@ -0,0 +1,91 @@
|
||||
# ============================================================
|
||||
# iotlcm-openapi 配置示例
|
||||
#
|
||||
# cp config.example.yaml config.yaml
|
||||
# ============================================================
|
||||
|
||||
system:
|
||||
name: "IotLCM-OpenAPI"
|
||||
version: "1.0"
|
||||
description: "IotLCM OpenAPI Service"
|
||||
gfmode: "prod"
|
||||
|
||||
server:
|
||||
address: ":8000"
|
||||
openapiPath: "/api.json"
|
||||
swaggerPath: "/swagger"
|
||||
maxHeaderBytes: "20KB"
|
||||
clientMaxBodySize: "200MB"
|
||||
readTimeout: "20m"
|
||||
writeTimeout: "20m"
|
||||
|
||||
logger:
|
||||
path: "/app/logs"
|
||||
file: "{Y-m-d-H}.log"
|
||||
level: "info"
|
||||
timeFormat: "2006-01-02T15:04:05"
|
||||
stdout: true
|
||||
header: true
|
||||
|
||||
# ---------- JWT ----------
|
||||
# 必改:必须与 admin-svr、app-server 完全一致,
|
||||
# 否则 admin 签发的令牌在 openapi 侧校验不通过。
|
||||
jwt:
|
||||
signingKey: "${JWT_SIGNING_KEY}"
|
||||
expiresTime: "7d"
|
||||
bufferTime: "1d"
|
||||
issuer: "iotlcm"
|
||||
|
||||
# ---------- 数据库 ----------
|
||||
# 建议为 OpenAPI 单独建只读账号,与 admin 的账号隔离。
|
||||
database:
|
||||
logger:
|
||||
path: "/app/logs/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
|
||||
|
||||
cache:
|
||||
adapter: "redis"
|
||||
fileDir: "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: "OpenAPICache"
|
||||
|
||||
# ---------- RabbitMQ ----------
|
||||
rabbitmq:
|
||||
enabled: true
|
||||
dsn: "amqp://${RABBITMQ_USER}:${RABBITMQ_PASSWORD}@rabbitmq:5672/"
|
||||
|
||||
# ---------- 免登录白名单 ----------
|
||||
router:
|
||||
exceptLogin:
|
||||
- /openapi/v3/query/token
|
||||
|
||||
# ---------- 上游服务地址 ----------
|
||||
upstream:
|
||||
proxy:
|
||||
address: "upstream-proxy:8510"
|
||||
timeout: "10s"
|
||||
gateway:
|
||||
address: "upstream-chan:8110"
|
||||
timeout: "10s"
|
||||
Reference in New Issue
Block a user