Files
MemRelay/projects/25464650-ed5d-440e-b362-190f2852d451/Checkpoint 2026-09-30 02-44-56 UTC [0aad732800].md
T
memrelay 68b355fe24 create: Checkpoint 2026-09-30 02:44:56 UTC [0aad732800]
MemRelay-Operation: checkpoint-save:fix2-register-ip-20260930-checkpoint
MemRelay-Resource: 2734590b-d531-434a-8dce-1d6098829ae3
2026-09-30 10:45:14 +08:00

41 lines
1.5 KiB
Markdown
Raw 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.
---
title: Checkpoint 2026-09-30 02:44:56 UTC [0aad732800]
type: checkpoint
permalink: main/projects/25464650-ed5d-440e-b362-190f2852d451/checkpoint-2026-09-30-02-44-56-utc-0aad732800
stable_id: 2734590b-d531-434a-8dce-1d6098829ae3
scope: project
memory_type: checkpoint
project_id: 25464650-ed5d-440e-b362-190f2852d451
usage_profile_id: 0c9feb46-d06e-43cd-9ef0-c5813c84a998
status: active
revision: 1
request_id: fix2-register-ip-20260930-checkpoint
created_at: '2026-09-30T02:44:56.888336+00:00'
updated_at: '2026-09-30T02:44:56.888336+00:00'
tags:
- ready-to-merge
- fix-2
- feat/fix-2-register-ip
---
# fix issue #2 · 自助注册接入 trusted_proxies
## 完成
- 分支 `feat/fix-2-register-ip`,commit `73ee4e74c7bcd493891c655f2f9315b6e7850dea`,已推送 origin(未合 main、未关 issue)。
- 工作树 `e:\\code\\NixMsg-wt\\fix2`,基线 `origin/main@479a08e`。
## 修法
`cmd/nixmsg/serve.go` 在 `identity.New` 注入与管理接口相同的 `httpx.ClientIP(r, trustedNets)`,注册安全码锁定按真实客户端 IP 计;非信任代理不采信 XFF。不改锁定阈值与注册语义。
## 文件
- `cmd/nixmsg/serve.go`
- `internal/app/identity/register_test.go`(`TestRegisterTrustedProxyClientIPLock`)
- `docs/DEVIATIONS.md`(追加 `### fix-issue-2`)
## 验证
`go test ./internal/app/identity/ ./internal/httpx/ ./cmd/nixmsg/ -count=1` 全绿。未跑全仓 task check。
## 给下个会话
- 总控可审阅后 ff-only 合 main;勿强推 main。
- 主工作区 `e:\\code\\NixMsg` 未改。