d1ab834ecb8f428f852410b974fbf368b2ccf764
Unify broker-mode binding changes in database transactions: advance device generation, invalidate pending authorizations/tasks and prior pairing-code epochs, and persist audit plus invalidation outbox. Add authenticated device unbind alongside robot/admin paths. Pairing codes are hashed, generation- fenced and consumed atomically with binding. Replay Redis invalidation effects without undoing committed unbind. Guard online cleanup and delayed kill events by generation. Introduce a separate router admission credential with no platform-event injection authority. Router verifies signed nonce-bound internal admission on handshake, task traffic and periodic checks; reject stale sessions and control-plane outages. Persist task owner/device/generation/session/worker and original message mapping. Sign routing metadata, verify late results, claim replies once and mark ambiguous/crashed tasks unknown instead of replaying writes. Fence notifications across same-user rebind. Release in-memory slots/waiters even when database or Redis cleanup fails. Validation: 213 passed, 3 skipped (real PostgreSQL not configured), 30 existing uvicorn/websockets deprecation warnings. New lifecycle coverage: 28 tests, including real loopback WebSocket isolation, reverse completion, missed kill, periodic unbind checks, outbox recovery, transaction rollback and cleanup failures. Syntax, docs and staged diff checks pass. Default legacy mode remains unchanged. Broker mode now requires coordinated router admission configuration and a v2 client handshake. No production ECS configuration, real credentials or client installer was changed. PostgreSQL, real Redis multi-node, ARM64 and actual Work/client rollout remain stage 5.
ECS 中继服务源码快照
新环境部署入口
需要部署服务时,请使用 deployable/README.md,该目录已整理统一源码、完整 Compose、配置模板、首次初始化及运维脚本。下面的快照目录保留原样用于追溯。
离线部署需另行取得 ARM64 依赖包;源码仓库不包含镜像二进制或真实运行凭据。实机验收状态见 部署检查报告。
本仓库保存 2026-10-27 从 ECS 导出的解压后源码,共 316 个原始文件,包括运行容器源码、主机源码、部署参考文件和历史补丁源码。
来源与校验
- 原始归档:
hainuo-ecs-source-20261027-165115-qb1aPw.tar.gz - SHA256:
ac3bda5b7835b5d9c4be83c64244554e41c4bddcb94b7cf8adec43bf2efe7e9c - 上传前在 Windows 本地验证归档 SHA256、路径安全性和文件类型。
SOURCE_SHA256SUMS.json记录 316 个原始文件的 SHA256。- 压缩包和外部校验文件没有作为源码提交。
目录说明
| 路径 | 内容 |
|---|---|
container-code/ |
从各运行容器中导出的应用源码;服务与镜像信息见 deployed-services.tsv |
host-code/ |
ECS 主机工作目录中的源码,可能与容器内版本不同 |
deployment-source/ |
已安装的脚本、文档、测试及脱敏部署配置 |
patch-source/ |
历史补丁包中的源码;存在于此处不代表全部已部署 |
patch-inventory.json |
历史补丁来源与校验记录 |
使用范围
这是源码交接快照,不是可直接部署的离线交付包。Compose 中的敏感配置已脱敏;依赖二进制、离线镜像、数据库、运行时配置、证书私钥、设备身份和用户令牌不包含在内。新环境部署需要另行配置应用凭据、域名及证书、数据存储和依赖,并进行业务验收。
本次导入保留原始源码,不合并不同来源的版本,不修改 ECS 服务,也不包含仅安装在 Windows 客户端上的补丁。
上传前检查
敏感文件名及 PEM 私钥标记扫描未发现命中。凭据赋值格式扫描有 6 处命中,人工核对为测试中的 fake-app-secret / fake-secret 示例,不是运行凭据。这些检查不能保证识别所有形式的硬编码敏感信息。
Languages
Python
95.9%
JavaScript
2.1%
Shell
1.1%
HTML
0.8%