anoni-net / anoni-net/docs

追蹤:OONI Probe CLI 對 OONI Run v2 的支援與 miniooni-darwin-arm64 解析錯誤

Offen
#61 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
bug documentation
Vorherrschende Sprache
JavaScript
Sterne
47
Forks
7
Ø Merge
2 Std. 42 Min.
Gemergte PRs (30 T.)
291

Beschreibung

## 背景

在跑 OONI Run v2 名單時,發現穩定版 `ooniprobe`(Homebrew 那支)沒有 `oonirun` 子指令,需要改用研究版的 `miniooni` 才能讀 OONI Run v2 連結或本地 descriptor 檔。`miniooni` 從 v3.17.0-alpha 開始支援:

```bash
miniooni oonirun -i # 從 OONI Run v2 連結抓 descriptor
miniooni oonirun -f # 讀本地 descriptor JSON 檔
miniooni --repeat-every 3600 oonirun -f descriptor.json # 定時重跑
```

## macOS 取得 miniooni 的方式

Homebrew `ooniprobe` formula 的 `install` 區塊只 build `./cmd/ooniprobe`,**不會帶 `miniooni`**。要在 macOS 上用 `miniooni`,目前三條路:

1. 抓 [probe-cli GitHub Releases](https://github.com/ooni/probe-cli/releases) 的預編譯 binary(`miniooni-darwin-arm64` 或 `miniooni-darwin-amd64`)
2. `go install github.com/ooni/probe-cli/v3/internal/cmd/miniooni@latest`
3. clone repo 後 `go build -o miniooni ./internal/cmd/miniooni`

或跑 [aaimio/miniooni](https://github.com/aaimio/miniooni) 容器。

## 遇到的錯誤

環境:macOS arm64、`miniooni-darwin-arm64` GitHub Releases 預編譯版。

執行時拋出:

```
oonirun: running link failed: invalid character '<' looking for beginning of value
```

這個訊息來自 Go 的 `encoding/json`,意思是 parser 拿到的內容開頭是 `<` 而不是合法 JSON。最常見的成因是抓 descriptor 的 HTTP 回應其實是 HTML(CDN 攔截頁、Cloudflare challenge、重導向到登入頁、404 HTML),而不是 OONI Run API 預期回的 JSON。

需要進一步排查才知道是 miniooni 本身的 bug、descriptor 來源端點變了,還是當下網路環境有 middlebox。

## 接下來要做的事

- [ ] 用 `miniooni -v oonirun -i ` 重跑、貼完整 verbose log(含 HTTP request/response)
- [ ] 確認用的是 `-i URL` 還是 `-f FILE`、URL 是否為合法 OONI Run v2 連結(例如 `https://run.ooni.org/v2/`)
- [ ] 直接 `curl -v ` 看 HTTP 回應是 JSON 還是 HTML(redirect、403、Cloudflare challenge 都會回 HTML)
- [ ] 確認 macOS 版本、`miniooni --version`、跑的完整指令
- [ ] 若是 miniooni bug,整理重現步驟去 [ooni/probe-cli](https://github.com/ooni/probe-cli/issues) 開 upstream issue
- [ ] 若是使用者端可繞過(例如改 endpoint、改用 `-f` 餵本地 descriptor):
- [ ] 把 CLI 段落補進現有 [`tools/ooni-run-v2.md`](https://anoni.net/docs/zh-tw/tools/ooni-run-v2/),或
- [ ] 另開 `tools/ooni-probe-cli.md` 專門寫 CLI(miniooni 安裝、`oonirun` 子指令、`--repeat-every` 等用法)

## 參考

- [PR #844: feat(oonirun): add support for OONIRun v2 links](https://github.com/ooni/probe-cli/pull/844)
- [Release OONI Probe CLI v3.17.0-alpha](https://github.com/ooni/probe-cli/releases/tag/v3.17.0-alpha)
- [Homebrew formula source: Formula/o/ooniprobe.rb](https://github.com/Homebrew/homebrew-core/blob/master/Formula/o/ooniprobe.rb)
- [User Guide: OONI Run](https://ooni.org/support/ooni-run/)
- [User Guide: OONI Probe CLI](https://ooni.org/support/ooni-probe-cli/)
- 站內既有:[tools/ooni-run-v2.md](https://anoni.net/docs/zh-tw/tools/ooni-run-v2/)(目前只寫了手機 App 流程,未提 CLI)

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.