AnyBot/docs
王性驊 413aab7d19 fix: 手機直接連線的 http 只認真的 Tailscale 通道;ANYBOT_PHONE_BIND 讓它只聽一個位址
區網直連的 HTTPS 前面放行不加密 http 的規則,看的是「來源位址在 100.64.0.0/10」。那一段是電信業者
NAT 的共用位址,不是 Tailscale 專用:Wi-Fi 自己發 100.64.x 位址時(部分熱點、校園和公司網路),
手機和這台都是 100.x,設定頁還把這台列成 http://100.x,手機密碼和登入就在空中明文傳。真的 Tailscale
沒有問題(位址在 utun/tailscale0 通道上,WireGuard 加密,tailnet 以外連不到)。

- lantls:不加密的 http 只收 loopback,或「來源在 Tailscale 範圍、而且連到的是這台 Tailscale
  通道介面上的位址」。通道位址從 ifconfig(POINTOPOINT)或 ip -o addr(tailscale0、/32)讀,30 秒快取;
  讀不到介面的電腦(Windows)沒有通道位址,http 一律轉 https。
- remote:列出的網址只有通道位址用 http(原本凡 100. 開頭都是 http);ANYBOT_PHONE_BIND 讓手機頁面
  只聽一個位址(127.0.0.1 給前面有代理或測試用的副本、Tailscale 位址只給 tailnet),列出的網址也只剩那個;
  寫的不是位址就不打開直接連線(不會退回聽每個位址)。沒設時照舊聽 0.0.0.0。
- 伺服器部署不受影響:大腦在 Docker 裡沒有發佈這個連接埠,tailscale serve 前面接的是帳號伺服器(8780)。
- verify-anybot:scratch 的 --serve 用 ANYBOT_PHONE_BIND=127.0.0.1,doctor 檢查只聽 127.0.0.1;
  要驗證從區網/Tailscale 連進來時用 ABV_PHONE_BIND=0.0.0.0。
- 文件:phone.md(http 只認通道、ANYBOT_PHONE_BIND/ANYBOT_PHONE_PORT、Windows、驗證加 lantls::)、
  FEATURES.md(手機網址、環境變數)、SECURITY.md。

已驗證: 完整 cargo test(金鑰清空、DOCKER_HOST 指到不存在)全綠(643 過、47 ignored 沒跑);cargo clippy --bin anybot --all-targets
  -- -D warnings 沒有警告;sh deploy/ci/lint-sh.sh 過;新測試 lantls::tests::tailscale_is_the_tunnel_not_the_range、
  remote::tests::the_phone_page_listens_where_it_is_told_and_lists_that,plain_http_from_the_wifi_is_sent_to_https
  加了 Wi-Fi 發 100.64.x 的情況。實機(這台 Mac,utun4 上 100.84.144.91)用 verify-anybot:修改前 scratch 的
  --serve 聽 *:埠,Tailscale 位址 http 200、區網 http 308;修改後預設(ctl)只聽 127.0.0.1,區網和 Tailscale
  位址連不上;ABV_PHONE_BIND=0.0.0.0 時照舊 *:埠、Tailscale 位址 http 200、區網 http 308→https(預設行為沒變);
  phone 區的範例旅程在只聽 127.0.0.1 下整段照貼結束碼 0。
未驗證: Wi-Fi 自己發 100.64.x 位址的網路——手邊沒有這種網路,只有單元測試;Linux(ifconfig/ip -o addr
  的格式只用樣本測)和 Windows(認不出通道、http 轉 https)沒有實機;伺服器部署沒有重新部署(沒有改 deploy/);
  手機實機連線沒有測(用無頭 Chrome 代替)。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 10:36:45 +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: 手機直接連線的 http 只認真的 Tailscale 通道;ANYBOT_PHONE_BIND 讓它只聽一個位址 2026-11-18 10:36:45 +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