Files
senmesh-zc/deploy/offline/config/application.yml
KodouWZF 4eb67e246e feat(交付): 客户侧两台服务器离线部署包
内网机/外网机各起一套栈,两台之间不开任何端口,文件只经光闸在
gate/out 与对端 gate/in 之间单向摆渡。一份 compose + 一份 config +
一份 nginx 模板,全部差异收在 .env 里。

- docker-compose.yml:5 服务只发布前端端口;app 容器 IP 锁死并由
  compose 注入 -Dcode.snowflake.workid.<IP>=<WORK_ID>,绕开兜底 99
  超雪花 5 位上限导致启动即崩的问题
- .env.iw / .env.ow:出厂配置与随机口令已填好,仅 MESHSAFE_SECRET
  故意留占位(以 MeshSafe 侧白名单为准);按 maintainer 决定原样入库
- install.sh iw|ow:按角色建 .env -> 自检 -> sha256 校验 tar -> 架构
  核对 -> docker load 后校验 tag -> 建目录/属主/SELinux 标签 -> 起栈
  并逐个等健康。修掉 pipefail 下 `grep | head -1` 静默中断、架构字段
  误读 manifest.json(实际在 Config blob)、die() 未定义先被调用
- export-images.sh:就地刷新 images/*.tar、sql、.env 的 tag 与
  SHA256SUMS,再打 dist 交付盘;tar 与 SHA256SUMS 由 .gitignore 排除
- sql/01+02:从 backend/db 的 PG 全量与初始数据覆盖拷贝。三个
  upgrade-*.sql 的 PG 段(x_upload_config、x_file_security)已在
  init-table-postgres-full.sql 内,空库跑 01->02 即完整现状
- smoke_test.py:18 条断言的现场验收,凭证全部走环境变量
- 部署说明.md:拓扑、交付清单、出厂口令表、iw/ow 差异、验收清单、
  13 条已知坑

镜像 tar 不进 git,装机包由 export-images.sh 出盘。
2026-11-02 20:40:16 +08:00

98 lines
2.7 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.
# =============================================================================
# s-file 客户侧静态默认配置(两台机器共用同一份,现场一般不用改)
#
# 随角色/环境变化的取值一律由 docker-compose 的环境变量注入,本文件不放:
# 数据库/Redis/MQ 地址与口令、JWT 密钥、用户初始密码、传输方向与摆渡目录、
# MeshSafe 开关与凭证、MQ 交换机命名 —— 全部在 .env 里填
# 这样交付物里不存在任何写死的口令或密钥
# =============================================================================
server:
port: 8080
spring:
application:
name: s-file
datasource:
driver-class-name: org.postgresql.Driver
type: com.alibaba.druid.pool.DruidDataSource
druid:
initial-size: 5
min-idle: 5
max-active: 50
validation-query: SELECT 1
test-while-idle: true
# 摆渡解包/送检会在多任务里并发取连接,压太低会出现等待
max-wait: 10000
redis:
timeout: 5000
lettuce:
pool:
max-active: 16
max-idle: 8
servlet:
multipart:
max-file-size: 500MB
max-request-size: 500MB
main:
allow-bean-definition-overriding: true
mybatis-plus:
mapper-locations: classpath*:com/senmesh/**/mapper/*.xml
# 平台编码,需与 sql/02-init-data.sql 里 uc_platform.platform_code 一致
system:
code: 1
security:
jwt:
enable: true
# secret 由环境变量 SECURITY_JWT_SECRET 注入,勿在此填写
expiration: 86400000
header: Authorization
ignoring: /error,/favicon.ico
login-page: /login
superior-only: false
# 单机自闭环部署:权限走本地库,不接外部用户中心
use-local: true
allow-if-all-abstain-decisions: true
oauth2:
enable: false
not-logs: ""
anonymous: ""
# 新用户初始密码由环境变量 USER_DEFAULT_PASSWORD 注入
user:
default:
password: ${USER_DEFAULT_PASSWORD:}
file:
upload-dir: /data/upload
storage:
type: local
transfer:
# location / send-dir / receive-dir / monitor.cron 均由环境变量注入
# 解包时是否再做一次内容风险识别(依赖下面的 dify,未部署 dify 时保持 false)
unpack-risk-check: false
# 内容风险识别(Dify)。未部署 Dify 时留空并保持 file.transfer.unpack-risk-check=false
dify:
risk:
rule:
api-key: ""
scan:
api-key: ""
# MeshSafe 全段由环境变量注入(MESHSAFE_*),未部署时 MESHSAFE_ENABLED=false 即可,
# 前端会自动隐藏「安全检测」列,跨网摆渡不受影响
meshsafe:
review-sync-to-meshsafe: true
# 接口文档在生产关闭
swagger:
enable: false
logging:
level:
com.senmesh: info