提交图

11 次代码提交

作者 SHA1 备注 提交日期
徐勤民
be04c311b9 fix(verify): remove misleading 'optional services not started' message
WARN items include expected behaviors (login skipped in migrate mode,
JWT checks, etc.) — not just unstarted services. All services are
started by default. Changed footer to say '预期降级' instead.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-19 17:01:58 +08:00
徐勤民
54f4d2a06f fix(deploy): correct import API path + show actual error on failure
- /api/private/migrate/import → /api/private/deployment/migrate/import
- replace -sf with -s + HTTP status check to surface real error message

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-19 16:07:47 +08:00
徐勤民
4b41b0bdbe fix(install): exclude data/ from tar extraction on reinstall
Docker writes data/mysql and data/redis as root; re-extracting
over them causes tar permission errors and aborts the script.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-19 15:59:57 +08:00
徐勤民
1dca34de5a fix(deploy): remove self-copy of nginx conf; show migration key input
- cp nginx conf to itself caused error; file is already in place
- migration key prompt changed from silent to visible (read -rp)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-19 15:42:35 +08:00
徐勤民
a6a81b0755 feat(deploy): generic deploy.sh with API-based tenant migration
- Rename deploy-szyx.sh → deploy.sh, remove all customer-specific branding
- Migrate mode: prompt for pmk_ key, call public platform export API,
  pipe to private import API — no MySQL credentials needed
- Remove bcrypt dependency (no longer used in script logic)
- Update install.sh and verify.sh references

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-19 15:14:23 +08:00
徐勤民
43a423b85c feat: 一键安装向导 + 交互式租户初始化
- 新增 install.sh:curl 一键下载依赖安装 + 自动解压部署包 + 启动部署向导
- deploy-szyx.sh:移除硬编码租户常量,改为交互式选择(新建/迁移)
  - 新建租户:收集邮箱/用户名/密码,bcrypt 写入 bootstrap.env
  - 迁移租户:提示输入生产 MySQL 配置,bcrypt 验证主账号后执行迁移
  - 已有数据时迁移前显示红色警告要求 yes 确认
- 移除 docs-site 独立容器(文档已内置于 tenant-web/docs/)
- nginx 和 docker-compose 同步清理 docs-site 残留配置

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-19 14:29:57 +08:00
徐勤民
f0649e9305 feat: 数字医信一键部署脚本 + 文档整理
scripts/deploy-szyx.sh (新增):
  七步幂等脚本,覆盖从预检到验收全流程:
  1. Docker / Compose / 磁盘 / 端口预检
  2. 写入数字医信专属配置(.env / secrets.env / xuqm.env /
     nginx / sdk-json),所有值固化为默认值,支持环境变量覆盖
  3. 登录 ACR (crpi-n44qjpuucgjt8e8c.cn-beijing.personal.cr.aliyuncs.com)
  4. 启动 MySQL + Redis 并轮询就绪
  5. 启动 base profile 业务容器并等待 actuator/health
  6. 迁移数字医信生产租户(szyx@bjca.org.cn),已迁移时自动跳过
  7. 验收:health / PRIVATE 模式 / 两个 appKey SDK config / 注册阻断 / 前端

docs/configuration.md:
  补充 Spring Boot SPRING_DATASOURCE_* 覆盖说明(application.yml
  硬编码生产 DB URL 的关键陷阱),nginx 服务端口对照表,
  docs-site 镜像可选说明。

docs/runbook.md:
  新增租户迁移章节,含前提、命令、自动步骤、验证示例。

README.md:
  快速参考:migrate-tenant.sh 用法、三条部署注意事项。

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-19 08:01:19 +08:00
徐勤民
f6189a5283 feat: harden deployment scripts and add tenant migration
Issues found during P5-01 acceptance testing on WSL2:

configure.sh: sync MySQL/Redis host/port into config/xuqm.env (was
  only writing to .env, leaving xuqm.env with hardcoded 127.0.0.1).

install.sh: add docker login step before compose up; reads
  REGISTRY_USER/REGISTRY_PASSWORD from .env; --skip-registry-login
  flag for offline bundles or pre-authenticated environments.

healthcheck.sh: move docs-site from required to optional container
  list (image may not exist in all ACR namespaces); add localhost
  fallback URL for actuator/health when CONSOLE_DOMAIN is not set;
  add PRIVATE mode verification via /api/private/deployment/status.

scripts/migrate-tenant.sh (new): migrates a single tenant from the
  public platform MySQL to the private deployment. Exports t_tenant,
  t_app, t_feature_service with explicit column names to survive
  schema-order differences; supports --dry-run, --reset-password,
  managed/external destination MySQL, and restarts tenant-service
  after applying.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-19 00:27:10 +08:00
徐勤民
20423a0347 fix: add Spring Boot DB/Redis overrides and full nginx routing
- docker-compose.yml: add SPRING_DATASOURCE_* and SPRING_DATA_REDIS_*
  environment vars for tenant-service and file-service; these override
  hardcoded production URLs in application.yml at startup.
  docs-site depends_on marked required:false so nginx starts even when
  docs-site image is unavailable.
- config/nginx/conf.d/xuqm.conf: add routing for /api/ and /actuator/
  to tenant-service:9001, /file/ to file-service:8086, /ops to ops-web;
  add client_max_body_size 100m and proxy headers.

Discovered and verified during P5-01 WSL2 acceptance testing.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-19 00:13:09 +08:00
徐勤民
9eabe0d699 feat: implement complete private deployment scripts (P1-P4)
- upgrade.sh/rollback.sh: backup→pull→rolling restart→healthcheck→auto-rollback
- backup.sh/restore.sh: mysqldump+redis BGSAVE+config tar, SHA256 manifest, restore with checksum verification
- healthcheck.sh: Docker/container/MySQL/Redis/HTTP/disk checks, JSON output to .deploy-state/
- doctor.sh: sanitized diagnostics archive, vendor API TCP connectivity, cert expiry
- export-offline-bundle.sh: docker pull+save for all profile images, load-images.sh, SHA256
- configure.sh: interactive/non-interactive mode, MySQL/Redis mode selection, domain prompts
- enable-service.sh: domain validation, docker pull + compose up, healthcheck
- disable-service.sh: compose stop+rm, profile removal, render-config
- renew-cert.sh: acme.sh/certbot, --dry-run, backup old cert, nginx reload on success
- alert-webhook.sh: WeCom/DingTalk/Feishu webhook, message sanitization
- bench.sh: ab/wrk/curl benchmark, JSON report with docker stats
- rotate-secrets.sh: JWT and internal token rotation
- vendor credential templates: push.env and store-submit.env with full credential comments
- render-config.sh: auto-sync SDK URL env vars (SDK_FILE_SERVICE_URL, SDK_IM_API_URL, SDK_IM_WS_URL)
- All scripts pass bash -n syntax check

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-18 20:49:25 +08:00
徐勤民
4ada03183a chore: scaffold private deployment repository 2026-05-18 19:49:31 +08:00