XuqmGroup
9084831b2a
fix(安全中心): 修复健康检查误判 force-recreate 旧容器为失败
...
force-recreate 会先停掉旧容器(status=exited),若此时健康检查
轮询到旧容器的 exited 状态,会误判新容器失败并触发不必要的回滚。
修复方式:
- 新增 getNewestContainerId() 在 compose up 后立即拿到新容器 ID
- waitForServiceStable 接受 containerId 参数,通过 docker inspect
精确轮询新容器状态,完全隔离旧容器的干扰
- 退化路径(containerId=null)保留原有服务名轮询逻辑
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-13 01:18:01 +08:00
XuqmGroup
9a9524ac07
feat(安全中心): 一键更新增加健康检查与自动回滚
...
每个服务重建后轮询容器状态最长 60s:
- 容器保持 running 10s 以上 → 更新成功
- 容器已 exited → 立即触发回滚(retag 旧镜像 ID 重建容器)
- 超时未就绪 → 同样触发回滚
tenant-service 的自更新助手容器也包含相同逻辑:
60s 内不健康则 retag 旧镜像并重建,保证平台始终可访问。
拉取镜像前统一保存各服务旧镜像 ID(captureCurrentImageIds),
回滚时通过 docker tag <old-id> <image:tag> 恢复旧版本。
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-13 00:54:02 +08:00
XuqmGroup
ce64c8fa60
fix: 修复私有化一键更新三个问题
...
1. Jenkinsfile: versions.json 补充 platformVersion 字段(取 tenant-service 版本),
并为每个服务添加 changed 标记;私有部署 checkForUpdates 依赖此字段判断是否有新版本,
缺失时始终返回 hasUpdate=false。
2. SystemUpdateService: dockerLogin 改为返回 boolean,凭据缺失/登录失败时
中止更新流程(原来失败后继续,导致 docker compose pull 静默失败仍用旧镜像)。
readRemoteVersions 新增 VERSIONS_MANIFEST_URL 远端拉取支持,
私有服务器可在 .env 中配置后自动同步公有端版本清单。
新增 migrate_v20260610_gray_mode_simplify_bookmark 迁移标记(实际 SQL 由 update-service 执行)。
3. SystemUpdateController: 新增 GET /api/system/versions/manifest 公开端点,
公有服务器部署后即可作为私有服务器的 VERSIONS_MANIFEST_URL 目标地址。
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-11 20:04:47 +08:00
XuqmGroup
167d403da6
feat(system): 添加系统更新管理和版本控制功能
...
- 新增私有化部署系统更新API接口(检查更新、选择性更新、重置等)
- 实现版本管理系统,支持平台版本和服务版本对比检查
- 集成Jenkinsfile自动化构建流程,支持多种版本策略
- 添加Docker镜像版本标签管理和自动注入功能
- 实现选择性更新机制,可指定服务进行增量更新
- 完善版本日志记录和更新历史追踪功能
2026-06-11 13:30:41 +08:00
XuqmGroup
3e2db6441e
feat(update): 添加 API Key 管理和 WebSocket 实时通知功能
...
- 新增 API Key 管理功能,支持外部工具认证调用平台 API
- 实现 WebSocket 实时通知,版本发布时推送轻量通知给客户端
- 添加 APK 文件哈希校验,支持已下载检测和直接安装
- 支持外部 APK 上传使用 API Key 认证
- 优化私有化部署自动注入 nginx WebSocket 代理配置
- 扩展 SDK 功能包括已下载检测、直接安装和实时通知监听
2026-06-11 12:25:16 +08:00
XuqmGroup
eb8bc70ff5
feat(deploy): 优化版本管理和多租户合并逻辑
...
- 修改 readCurrentVersion 方法优先读取镜像内的 /app/VERSION 文件
- 添加对宿主机挂载目录 VERSION 文件的兼容性支持
- 移除 bumpVersionFile 方法,不再在更新后写入版本号
- 重构多租户合并逻辑,优化数据库查询和更新操作
- 简化孤儿数据修复逻辑,直接更新为保留租户ID
- 在 Dockerfile 中复制 VERSION 文件到镜像内部
- 在 Jenkinsfile 中添加自动递增构建号功能
2026-05-27 19:25:50 +08:00
XuqmGroup
898597d6b6
```
...
refactor(tenant): 优化系统更新服务和租户数据修复逻辑
- 添加版本文件更新功能,在更新完成后写入新版本号到 VERSION 文件
- 重命名租户数据修复方法,从 consolidate_private_tenants 改为 fix_orphan_tenant_data
- 重构租户数据修复逻辑,支持多租户合并和孤儿数据修复两种场景
- 优化数据库操作,使用更精确的查询条件修复孤儿租户数据
- 改进迁移过程的日志输出和状态记录机制
```
2026-05-27 19:14:45 +08:00
XuqmGroup
e3e16352d5
```
...
fix(tenant): 修复私有化部署下的租户注册和引导配置逻辑
- 修改 PrivateDeploymentProperties 中的 tenantRegisterEnabled 方法,
在私有化模式下始终返回 false
- 修改 PrivateDeploymentProperties 中的 tenantBootstrapEnabled 方法,
在私有化模式下始终返回 true
- 在 SystemUpdateService 中注入 PrivateDeploymentProperties 依赖
- 添加 migrate_v20260527_consolidate_private_tenants 数据库迁移方法
- 实现私有化部署下合并多租户功能,保留最早租户并替换其余租户ID
- 迁移涉及 t_app、t_operation_log、t_migrate_key 等表的数据
- 更新子账号的 parent_id 指向保留的租户
- 删除合并后多余的租户记录
```
2026-05-27 18:57:21 +08:00
XuqmGroup
db986808f2
feat(database): 新增 push 和 license 操作日志表
...
- 在 tenant-service 的系统更新服务中添加新的数据库迁移方法
- 为 push-service 创建 PushSchemaMigrationService 并实现数据库迁移逻辑
- 为 license-service 创建 LicenseSchemaMigrationService 并实现数据库迁移逻辑
- 创建 push_operation_log 表用于记录推送服务操作日志
- 创建 license_operation_log 表用于记录授权服务操作日志
- 实现数据库迁移记录表 _schema_migrations 以跟踪迁移状态
- 添加迁移验证和错误处理机制确保迁移过程可靠性
2026-05-27 18:01:31 +08:00
XuqmGroup
f9ad40cb98
feat(log): 优化操作日志记录和展示功能
...
- 在OperationLogEntity实体中新增summary和ipAddress字段存储摘要和IP信息
- 修改operationLogService.record方法支持传入操作摘要信息
- 实现客户端IP地址解析功能,支持X-Forwarded-For和X-Real-IP头
- 更新系统更新服务中的数据库表结构迁移逻辑,增加NOT NULL列处理
- 优化前端操作日志页面展示,添加标签分类和详情弹窗功能
- 在系统更新流式响应中增加网络连接异常处理机制
- 添加Nginx代理配置中的缓冲区设置以支持实时日志流式传输
2026-05-27 12:27:42 +08:00
XuqmGroup
67da05dadc
fix: remove @NotBlank from Java records, add manual validation + reset with data preservation
...
- Remove @Valid/@NotBlank/@Size/@Email/@NotNull from all Java record DTOs
(incompatible with Jackson deserialization in Spring Boot 3.x)
- Add manual validation in controllers instead
- Add database reset with data preservation to reset container feature
(exports core config tables, drops all tables, Hibernate recreates on startup,
then restores preserved data)
- Update nginx timeout regex to cover all system endpoints
Affected services: tenant-service, license-service, im-service, push-service
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-23 02:43:35 +08:00
XuqmGroup
26261263a0
fix: use docker ps labels to list services and fetch logs
...
Replace compose-file-path-dependent `docker compose -f <path>` calls
with label-based `docker ps` queries so the ops log viewer works on
both public cloud and private deployments regardless of compose file
location.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-22 23:43:39 +08:00
XuqmGroup
5e788fe26b
feat(system): 添加服务日志查看功能及版本化数据库迁移机制
...
- SystemUpdateService: 引入 _schema_migrations 迁移表,启动时自动执行,替换
原 docker exec 方式;新增 getRunningServices / getServiceLogs 供日志查看使用
- SystemUpdateController: 新增 GET /api/system/services、/logs/{service}、/version
- OpsController: 新增 GET /api/ops/system/services、/logs/{service}(ROLE_OPS)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-22 23:22:46 +08:00
XuqmGroup
0e5558116c
feat(system): 添加系统版本查询和数据库迁移功能
...
- 移除 license-service 中 DeviceEntity 的 device_id 唯一约束注解
- 添加 /api/system/version 接口用于查询当前部署版本
- 实现数据库 schema 版本化迁移机制
- 添加自动执行数据库迁移的功能
- 在前端安全中心界面显示当前版本和迁移状态
- 优化配置文件修复逻辑和代码结构
2026-05-22 23:04:36 +08:00
XuqmGroup
ccb976c605
tenant: auto-generate license file on app creation, decouple from license service
...
- AppEntity: add licenseFileContent field to store pre-generated encrypted license
- AppService: generate license file content on create/update with normalized baseUrl
- AppController: read license file content from entity instead of generating on-the-fly
- Web: remove license download v-if serviceEnabled check, always show download button
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-22 17:56:12 +08:00
XuqmGroup
138360b760
fix(update): rewrite file-service URL to internal address for private deployments
...
UpdateAssetService: add FILE_BASE_URL / FILE_SERVICE_INTERNAL_URL config; any URL
starting with FILE_BASE_URL is rewritten to the internal file-service address instead
of going through the external domain, fixing APK inspect timeout on private deployments.
SystemUpdateService: add patchDockerComposeUpdateService() to inject FILE_BASE_URL and
FILE_SERVICE_INTERNAL_URL into existing customers' docker-compose.yml on update.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-22 16:03:09 +08:00
XuqmGroup
32aa3c0eef
feat(tenant): split update/reset ops, remove bootstrap app auto-creation
...
- SystemUpdateService: split runUpdate() (pull+recreate) and runReset() (recreate only)
- SystemUpdateController: add POST /api/system/reset endpoint
- SdkAppProvisioningService: remove ensureBootstrapApp/ensureApp/ensureFeatureDefaults; resolveApp now throws 404 instead of auto-creating
- SdkAppInitializer: remove ensureBootstrapApp call; only runs one-time migration marking existing system apps as isDefault=true
- PrivateTenantBootstrapInitializer: remove bootstrap app creation; only ensures admin tenant account exists
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-22 15:33:20 +08:00
XuqmGroup
c9c50038bf
fix(tenant-service): 自动修复 nginx 更新接口 60s 超时
...
patchNginxUpdateTimeout 为 /api/system/update 注入精确匹配 location,
proxy_read_timeout 设为 600s,避免 docker pull 静默期断连。
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-21 17:19:55 +08:00
XuqmGroup
4a38147cb9
feat(tenant-service): 一键更新自动修复配置文件
...
- 更新前执行幂等配置修复:nginx location /file/ → /api/file/,
docker-compose.yml 补齐 FILE_UPLOAD_DIR 和 FILE_BASE_URL
- nginx 移至 OTHER_SERVICES 末尾,最后重启以应用修复后的配置
- docker login 读取 .env 中的仓库凭据,解决私有镜像拉取 403
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-21 17:08:01 +08:00
XuqmGroup
b0e7f198db
feat(license): 支持修改 License 过期时间 + 修复一键更新三个问题
...
License 过期时间:
- LicenseAdminController PATCH 接口增加 expiresAt 字段
- AppLicenseService.update() 移除"一旦设置不可修改"限制,支持清空(永久)或更新日期
一键更新 (SystemUpdateService) 修复:
1. 改用 docker compose (v2) 替换 docker-compose (v1)
2. isRunning/getCurrentImage 去掉 project=xuqm 标签过滤
(deploy.sh 不传 -p 参数,实际 project 标签为目录名)
3. 拉取前读取 deployRoot/.env 中的 REGISTRY 凭据并执行 docker login
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-21 16:26:01 +08:00
XuqmGroup
aece1fd08d
fix(system-update): 用 compose label 查询容器,修复 isRunning 和自更新助手镜像
...
- isRunning() 改用 docker ps --filter label=com.docker.compose.service
兼容 Compose v1 (xuqm_svc_1) 和 v2 (xuqm-svc-1) 命名格式
- 自更新助手镜像改用 getCurrentImage() 从运行中容器的 label 获取,
不再依赖容器环境变量 REGISTRY/IMAGE_TAG(容器内未注入这两个变量)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-21 15:46:39 +08:00
XuqmGroup
a98dbca26d
fix(system-update): 用独立助手容器替代 CompletableFuture 实现 tenant-service 自重建
...
原方案:CompletableFuture 延迟调用 docker-compose up。
问题:docker-compose 发出 stop 指令后,容器内全部进程(含 CompletableFuture 线程)
被立即杀死,rm/create/start 步骤永远不会执行,tenant-service 停在停止状态。
新方案:先用 docker run -d 启动独立助手容器(xuqm-self-updater),
它不依附于 tenant-service,不会随之终止;8 秒后执行 force-recreate。
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-21 14:52:36 +08:00
XuqmGroup
f2e126e2d0
feat(tenant-service): 一键更新接口 + Dockerfile 添加 docker-compose
...
- 新增 SystemUpdateController POST /api/system/update(PRIVATE 模式)
- SystemUpdateService 通过 docker-compose 拉镜像并逐服务重建容器
- Dockerfile 添加 docker-cli + docker-compose(用于容器内调用 Docker API)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-21 14:46:40 +08:00