AnyBot/docs
王性驊 0c250d5a41 fix: 帳號伺服器的明文規則管到每一個帶密碼或金鑰的連線,在開連線那一刻查;Tailscale 通道認得更準
第三輪(新的獨立審查:兩個早就有的 P1,和幾個 P2):

- A:「從帳號備份還原」不經 relay_join,原本 http 檢查管不到。現在帶帳號密碼、配對碼或這台電腦金鑰
  的請求都經 relay_post/relay_agent:登入、建立帳號、兩步驗證、還原、配對、通知、網站、成員、備份、
  和大腦同步、手腳的指令、還有備用連線(workers)。
- B:http 的帳號伺服器原本只在登入時查一次,之後長連線每次重連都直接連。現在 tunnel::open 每次
  (重)連都對要連的位址查,不符合就不連、狀態寫原因、照原本的退避再試;workers 每一輪也一樣。
- 1(DNS 兩次查):選「釘住」——http 的帳號伺服器用自己的 ureq client,resolver 在開連線那一刻對
  查到的位址做檢查,只連通過的那幾個(web_fetch 已經用同一種做法);長連線也是查完就連那幾個位址。
  名字可以照常用,不必限定 IP 或 *.ts.net。這個 client 不走代理(代理會照它自己的路把明文轉出去)。
- 2:host_port 改用 ureq 自己的 URL 解析(http::Uri),`?`、`#` 後面不是主機;長連線也用它。
  model_fetch_here 的私有位址檢查一起修好。
- 3:Tailscale 通道要「叫 tailscale…」或「點對點介面+Tailscale IPv6(fd7a:115c:a1e0::/48)」,
  Windows 看介面卡名字;PPPoE、電信 NAT、WARP 的 100.x 不算,ip -o addr 的 /32 不再算。ifconfig 找不到
  通道(busybox、舊 net-tools 的 inet addr:)時也問 ip。
- 4:沒有 IPv6 的電腦上,*.ts.net 的 IPv6 位址沒有路由就略過、用 IPv4(原本整個拒絕)。
- 5:介面資料 30 秒更新一次,第一次之後都在背景讀,設定頁每一幀拿快取(Windows 不會在 UI 執行緒跑
  ipconfig);remote::addresses 也用同一份,不再每一幀跑 ifconfig。
- 6:綁不到連接埠時分開說:位址不在、不准用(1024 以下、系統保留)、被占用、其他;65535 會試,不再說
  「65535–65534」。
- 文件照程式寫:SECURITY.md(帳號伺服器的規則管到哪些請求、每次開連線查、釘住、不走代理、一個字的
  名字在一般網路上的風險、通道怎麼認)、phone.md、FEATURES.md。

已驗證: 完整 cargo test(金鑰清空、DOCKER_HOST 指到不存在)全綠(652 過、47 ignored 沒跑);cargo clippy --bin anybot --all-targets
  -- -D warnings 沒有警告;sh deploy/ci/lint-sh.sh 過。每個回退各做一次、新測試都抓到(10 個):relay_post
  不查、長連線開連線不查、workers 用一般 client、resolver 放行一切、host_port 改回手寫切法、任何點對點
  100.x 都算通道、沒路由的位址算拒絕、介面過期時在呼叫的執行緒重讀、不准用說成被占用、65535 不試。
  實機(verify-anybot,這台 Mac 的 utun4 有 100.84.144.91 和 fd7a:115c:a1e0::d738:905c):phone 區範例旅程
  照貼結束碼 0;預設綁定照舊(*:埠、Tailscale 位址 http 200、區網 http 308)。
未驗證: 帳號伺服器的部分沒有接真的帳號伺服器跑——用單元測試走 relay_join、restore、relay_worker、
  tunnel::run 和 http client 的真程式碼(scratch 不准帶 ANYBOT_ACCOUNT,也不手寫含金鑰的設定檔);
  Wi-Fi 自己發 100.64.x 的網路、PPPoE、WARP、busybox 的 ifconfig 只有樣本測試;Linux、Windows 實機沒跑
  (Windows 的 ipconfig 只有樣本;cargo check --target x86_64-pc-windows-msvc 卡在 ring 要 Windows SDK 的 C 標頭,cfg(windows) 那幾行沒編譯過);設定頁顯示快取的那一行沒有開視窗看。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 11:35:43 +08:00
..
demo docs: README 重寫——跟上這一週的功能,圖從現在這版重拍 2026-11-18 08:10:55 +08:00
en version_0_1_1-alpha 2026-11-11 16:19:06 +08:00
feature-map fix: 帳號伺服器的明文規則管到每一個帶密碼或金鑰的連線,在開連線那一刻查;Tailscale 通道認得更準 2026-11-18 11:35:43 +08:00
specs Rewrite decompilation comments as behaviour specs; move reverse-engineering docs out of the repo; drop third-party marks from UI strings (i18n tables synced) 2026-11-09 16:37:33 +08:00
architecture.md 傳送: a file or a few words from any device of the account to any other 2026-11-11 10:04:13 +08:00
install.md design: Bot 的電腦的桌面也換成思源黑體(第 14 版),拿掉粉圓 2026-11-16 22:18:32 +08:00
memory.md 記憶: each bot keeps its own, remembers like a person, and decides for itself 2026-11-11 09:35:59 +08:00
multi-device.md 傳送: a file or a few words from any device of the account to any other 2026-11-11 10:04:13 +08:00
plan-2026-11-computer-use.md Plan: smoother computer use and box logins that survive a rebuild 2026-11-06 22:06:49 +08:00
plan-2026-11-engineering.md refactor: 工具呼叫改成 TurnTool trait:28 個工具照原本的順序排成一張清單,不再是一長串 if 2026-11-17 13:43:57 +08:00
plan-2026-11-improvements.md 記憶: a page to see it, a few lines picked while typing, a local model 2026-11-11 07:46:50 +08:00
protocol.md 傳送: a file or a few words from any device of the account to any other 2026-11-11 10:04:13 +08:00
readme-style.md Readmes: the shape top-starred projects use, and no more overflow 2026-11-10 14:14:27 +08:00
release.md make, README and docs: build and install from source 2026-11-04 22:16:45 +08:00
skills.md version_0_1_1-alpha 2026-11-11 16:19:06 +08:00