Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/release-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@

## 下載與安裝

- Chrome:下載 `IP.Radar.Chrome_v0.1.22.zip` 解壓,在 `chrome://extensions` 使用開發人員模式載入未封裝項目;既有使用者重新載入並確認權限。
- Firefox:下載 `IP.Radar.Firefox_v0.1.22.zip` 解壓,在 `about:debugging` 臨時載入 `manifest.json`。ZIP 尚未簽名,重啟後需重新載入;永久安裝需另外提供 AMO 已簽名 XPI。目前沒有自動更新。
- Chrome:下載 `IP.Radar.Chrome_v<版本>.zip` 解壓,在 `chrome://extensions` 使用開發人員模式載入未封裝項目;既有使用者重新載入並確認權限。
- Firefox:下載 `IP.Radar.Firefox_v<版本>.xpi`(AMO 已簽名),在 `about:addons` → 齿輪選單 → 「從檔案安裝附加元件…」永久安裝。臨時載入可解壓 XPI 後在 `about:debugging` 選 `manifest.json`。目前沒有自動更新,升級請重新下載安裝。
- macOS:下載 DMG,掛載後拖入 Applications。
- Windows:下載 portable EXE,直接執行。

## 驗證與已知限制

- 77 項擴充功能測試、135 項桌面版測試與 Chrome/Firefox 建置通過;實際 API 連線測試未執行。
- Firefox 靜態檢查無錯誤,2 項警告來自 React 內部 innerHTML 實作;尚未完成 Firefox 實機載入測試或 AMO 簽名。
- Firefox 靜態檢查無錯誤,2 項警告來自 React 內部 innerHTML 實作;AMO unlisted 簽名已納入 Release CI。
- 舊版單一 radarState 的歷史不自動遷移;既有分批紀錄在首次選取時補建缺少的摘要。

此版本保持 Draft。CI 將上傳 Chrome ZIP、未簽名 Firefox ZIP、macOS DMG 與 Windows EXE,待維護者確認後手動發佈。
此版本保持 Draft。CI 將上傳 Chrome ZIP、AMO 已簽名 Firefox XPI、macOS DMG 與 Windows EXE,待維護者確認後手動發佈。
20 changes: 17 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,26 @@ jobs:
working-directory: extension
- run: npm run lint:firefox
working-directory: extension
- name: Attach unsigned Firefox extension for temporary loading or AMO submission
- name: Sign with AMO (unlisted) and attach signed XPI
working-directory: extension
timeout-minutes: 10
shell: bash
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RELEASE_TAG: ${{ github.ref_name }}
working-directory: extension
run: gh release upload "$RELEASE_TAG" "IP.Radar.Firefox_${RELEASE_TAG}.zip" --clobber
WEB_EXT_API_KEY: ${{ secrets.AMO_API_KEY }}
WEB_EXT_API_SECRET: ${{ secrets.AMO_API_SECRET }}
run: |
if [ -z "$WEB_EXT_API_KEY" ] || [ -z "$WEB_EXT_API_SECRET" ]; then
echo "Missing AMO_API_KEY / AMO_API_SECRET repo secrets (addons.mozilla.org JWT credentials)" >&2
exit 1
fi
npx web-ext sign --source-dir dist-firefox --channel unlisted
shopt -s nullglob
xpis=(web-ext-artifacts/*.xpi)
[ "${#xpis[@]}" -eq 1 ] || { echo "Expected exactly one signed xpi in web-ext-artifacts/, found ${#xpis[@]}" >&2; exit 1; }
mv "${xpis[0]}" "IP.Radar.Firefox_${RELEASE_TAG}.xpi"
gh release upload "$RELEASE_TAG" "IP.Radar.Firefox_${RELEASE_TAG}.xpi" --clobber

# Platform builds upload independently to the prepared draft.
build-macos:
Expand Down
6 changes: 3 additions & 3 deletions extension/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ npm run build

## Firefox

在 `extension` 目錄執行 `npm run build:firefox`:產出獨立的 `dist-firefox`(不覆蓋 Chrome 的 `dist`),並打包 `IP.Radar.Firefox_v<版本>.zip`。接著執行 `npm run lint:firefox` 做 Mozilla 靜態檢查。CI 會建置與檢查 Firefox 包;版本標籤的 Release 工作流程會上傳未簽名 ZIP 到 Draft。
在 `extension` 目錄執行 `npm run build:firefox`:產出獨立的 `dist-firefox`(不覆蓋 Chrome 的 `dist`),並打包 `IP.Radar.Firefox_v<版本>.zip`。接著執行 `npm run lint:firefox` 做 Mozilla 靜態檢查。CI 會建置與檢查 Firefox 包;版本標籤的 Release 工作流程會以倉庫 secrets `AMO_API_KEY`/`AMO_API_SECRET` 執行 AMO unlisted 簽名,並上傳已簽名的 `IP.Radar.Firefox_v<版本>.xpi` 到 Draft。

- Firefox 桌面版最低 140;Android manifest 最低 142(本專案尚未做 Android 實機驗證)。manifest 使用事件頁及模組,並宣告查詢 IP 與 API 憑證傳送給所選服務涉及的資料種類,由 Firefox 在安裝時顯示同意要求。沒有讀取瀏覽歷史或分析追蹤功能。
- 臨時安裝:解壓 ZIP,在 Firefox 開啟 `about:debugging#/runtime/this-firefox`,按「Load Temporary Add-on」,選擇 `dist-firefox` 或解壓目錄內的 `manifest.json`。臨時附加元件重啟 Firefox 後即消失。
- 永久安裝需 AMO 簽名(免費,unlisted 不會公開上架):建立 `amo.env`(內含 `WEB_EXT_API_KEY`、`WEB_EXT_API_SECRET`),執行 `set -a; . ./amo.env; set +a` 後再 `npx web-ext sign --source-dir dist-firefox --channel unlisted`。上述載入環境檔指令適用 bash/zsh;簽好的 XPI 在 `web-ext-artifacts/`,需另行上傳 Release 供使用者安裝。簽名憑證不進 Git 或一般打包流程。
- 永久安裝需 AMO 簽名(免費,unlisted 不會公開上架):建立 `amo.env`(內含 `WEB_EXT_API_KEY`、`WEB_EXT_API_SECRET`),執行 `set -a; . ./amo.env; set +a` 後再 `npx web-ext sign --source-dir dist-firefox --channel unlisted`。上述載入環境檔指令適用 bash/zsh;簽好的 XPI 在 `web-ext-artifacts/`。Release 工作流程已自動完成簽名與上傳(走倉庫 secrets `AMO_API_KEY`/`AMO_API_SECRET`),此為本機手動對應路徑。簽名憑證不進 Git 或一般打包流程。
- gecko id 為 `ip-radar-extension@steponeerror.github.io`,首次簽名後必須維持不變。
- **unlisted 重新簽名不會讓已安裝者自動更新**。目前沒有設定 `update_url`,使用者需從 Release 下載新版已簽名 XPI 手動更新;若未來要自動更新,需另行維護 HTTPS 更新清單及已簽名 XPI。詳見 [Mozilla 自發佈說明](https://extensionworkshop.com/documentation/publish/self-distribution/)。
- Firefox「檢查更新」只接受對應版本的 `IP.Radar.Firefox_v<版本>.zip` 或 `.xpi`;ZIP 僅供臨時安裝/提交簽名,不能當作永久安裝包。Chrome 仍只比對 Chrome ZIP。
- Firefox「檢查更新」只接受對應版本的 `IP.Radar.Firefox_v<版本>.zip` 或 `.xpi`(程式碼兩者皆認);Release 現在上傳已簽名 XPI,解壓後亦可用於 `about:debugging` 臨時載入。Chrome 仍只比對 Chrome ZIP。
- Mozilla lint 可能對 React 套件內部的 `innerHTML` 實作產生警告;應逐項檢查輸出。本專案目前沒有直接使用 `innerHTML` 或 `dangerouslySetInnerHTML` 顯示 API 回應。靜態檢查通過不代表 AMO 已核准或已簽名。

## 功能
Expand Down
Loading