Compare commits

..

No commits in common. "d2cb735f092f3b092e34e06c31fc56e6e9255bc7" and "008da014443d3673e806ecdfa7c8288e6cf9ac73" have entirely different histories.

12 changed files with 31 additions and 66 deletions

View File

@ -16,9 +16,6 @@
- [x] **#532 browser extension** (`clients/webext-toolbox/`) — MV3 Firefox
`.xpi`/Chromium; live tracker badge + popup mini Round-Eye graph over
`/social/*`; `GET /wg/toolbox.xpi` + fetch helper + `build-webext.yml`.
- [x] **#532 release** — tag `webext-v0.1.1` published the `.xpi`
(downloadable, verified 200). `make_latest:false` + tag-pinned URL so it
doesn't steal "Latest" from the Android APK release.
- [ ] **release signing** — Android keystore + AMO `.xpi` signing secrets in CI
for stable published fingerprints (currently unsigned sideload).
- [ ] **#532 follow-ups** — optional `GET /social/live/{token}` SSE (replace the

View File

@ -21,18 +21,11 @@ le navigateur : badge live des traceurs + popup.
- **Serve depuis la toolbox** (`2.6.14`) : `GET /wg/toolbox.xpi` (local
sinon 302 → release), bouton `🧩 Extension navigateur` sur les 2
panneaux onboard, helper `secubox-toolbox-fetch-xpi`, postinst dir.
- **CI** : `build-webext.yml``web-ext lint` (0 erreur, 2 warnings
bénins) + build, artifact, release asset sur tag `webext-v*`.
- **Release** (PR #540 + #541, mergées) : tag `webext-v0.1.1` poussé →
CI a publié `secubox-toolbox-webext.xpi` (téléchargeable, vérifié 200).
`make_latest:false` + URL **tag-pinned** dans `/wg/toolbox.xpi` +
`secubox-toolbox-fetch-xpi` pour ne pas voler le pointeur "Latest" à la
release APK Android (dont l'endpoint résout via `/releases/latest/...`).
→ bumper le tag dans la constante + le helper à chaque `webext-v*`.
- **CI** : `build-webext.yml``web-ext lint` + build, artifact, release
asset `secubox-toolbox-webext.xpi` sur tag `webext-v*`.
- **Reste à faire** : signature AMO (`.xpi` non signé = sideload/dev) ;
endpoint SSE `/social/live/{token}` optionnel ; icône PNG Chromium ;
contrôle Poke/Emancipate par-site quand #525 (déception) arrive ;
déployer `secubox-toolbox 2.6.14` sur la board pour activer le bouton.
contrôle Poke/Emancipate par-site quand #525 (déception) arrive.
---

View File

@ -28,13 +28,7 @@ to your cabine over the R3 tunnel — no third-party calls.
## Install
Published release `.xpi` (downloadable directly):
```
https://github.com/CyberMind-FR/secubox-deb/releases/download/webext-v0.1.1/secubox-toolbox-webext.xpi
```
The toolbox also serves it from the cabine:
The toolbox serves the built extension:
```
https://kbin.<board>.secubox.in/wg/toolbox.xpi
@ -42,12 +36,7 @@ https://kbin.<board>.secubox.in/wg/toolbox.xpi
The kbin onboard panel exposes a **🧩 Extension navigateur (cartographie)**
button. When a local build is present the cabine serves it; otherwise it
302-redirects to the **tag-pinned** release asset above. The webext release
is published `make_latest:false` so it does not steal the repo "Latest"
pointer from the Android APK release (whose endpoint resolves via
`/releases/latest/download/…`) — bump the tag in the `/wg/toolbox.xpi`
endpoint constant + `secubox-toolbox-fetch-xpi` when a new `webext-v*`
release is cut.
302-redirects to the latest GitHub release asset `secubox-toolbox-webext.xpi`.
- **Firefox** — open the `.xpi`. A permanent install needs an AMO-signed
build (release CI step / `web-ext sign`); for development use

View File

@ -12,18 +12,15 @@ if (typeof importScripts === "function") {
try { importScripts("api.js"); } catch (_) {}
}
// NB: do NOT declare `const ext` here — api.js already declares it in the
// shared script scope (event page) / worker global (importScripts), and a
// second `const ext` is a "redeclaration of const ext" SyntaxError that
// kills the whole background script. Use api.ext instead.
const api = globalThis.SbxApi;
const ext = globalThis.browser || globalThis.chrome;
const ALARM = "sbx-refresh";
const PERIOD_MIN = 1; // poll the cabine once a minute
function setBadge(text, color) {
try {
api.ext.action.setBadgeText({ text: text || "" });
ext.action.setBadgeText({ text: text || "" });
if (color) ext.action.setBadgeBackgroundColor({ color });
} catch (_) {}
}
@ -62,18 +59,18 @@ async function refresh() {
}
}
api.ext.runtime.onInstalled.addListener(() => {
api.ext.alarms.create(ALARM, { periodInMinutes: PERIOD_MIN });
ext.runtime.onInstalled.addListener(() => {
ext.alarms.create(ALARM, { periodInMinutes: PERIOD_MIN });
refresh();
});
api.ext.runtime.onStartup && api.ext.runtime.onStartup.addListener(() => {
api.ext.alarms.create(ALARM, { periodInMinutes: PERIOD_MIN });
ext.runtime.onStartup && ext.runtime.onStartup.addListener(() => {
ext.alarms.create(ALARM, { periodInMinutes: PERIOD_MIN });
refresh();
});
api.ext.alarms.onAlarm.addListener((a) => { if (a.name === ALARM) refresh(); });
ext.alarms.onAlarm.addListener((a) => { if (a.name === ALARM) refresh(); });
// popup asks for an immediate refresh after pairing / config change
api.ext.runtime.onMessage.addListener((msg, _sender, sendResponse) => {
ext.runtime.onMessage.addListener((msg, _sender, sendResponse) => {
if (msg && msg.type === "refresh") {
refresh().then(() => sendResponse({ ok: true }));
return true; // async response

View File

@ -14,11 +14,9 @@ OUT="secubox-toolbox-webext-${VER}.xpi"
rm -f "$OUT"
# -FS = sync (drop stale entries) ; exclude VCS, dotfiles, build script,
# any previously built artefact, docs, and the SVG icon source (only the
# rasterised PNGs are referenced by the manifest — keep SVG out of the
# package so Firefox never renders it in chrome UI).
# any previously built artefact, and docs.
zip -r -FS "$OUT" . \
-x '*.git*' '*/.*' 'build.sh' '*.xpi' 'README.md' 'icons/icon.svg' >/dev/null
-x '*.git*' '*/.*' 'build.sh' '*.xpi' 'README.md' >/dev/null
echo "built $OUT ($(stat -c%s "$OUT" 2>/dev/null || stat -f%z "$OUT") bytes)"
echo "Firefox: about:debugging → This Firefox → Load Temporary Add-on → pick the .xpi (or manifest.json)."

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 618 B

View File

@ -1,7 +1,7 @@
{
"manifest_version": 3,
"name": "SecuBox ToolBoX — Cartographie sociale",
"version": "0.1.1",
"version": "0.1.0",
"description": "Surface the SecuBox R3 toolbox live tracker analysis (cartographie sociale) in your browser: live badge, per-session trackers, mini Round-Eye graph, RGPD wipe + PDF report.",
"browser_specific_settings": {
"gecko": {
@ -17,13 +17,13 @@
"default_title": "SecuBox Cartographie",
"default_popup": "popup/popup.html",
"default_icon": {
"48": "icons/icon-48.png",
"128": "icons/icon-128.png"
"48": "icons/icon.svg",
"128": "icons/icon.svg"
}
},
"icons": {
"48": "icons/icon-48.png",
"128": "icons/icon-128.png"
"48": "icons/icon.svg",
"128": "icons/icon.svg"
},
"background": {
"service_worker": "background.js",

View File

@ -3,10 +3,8 @@
//
// SecuBox-Deb :: webext-toolbox :: popup controller
// NB: api.js (loaded first in this page) already declares `const ext` in the
// shared script scope — re-declaring it here is a "redeclaration of const ext"
// SyntaxError that aborts popup.js. Use api.ext instead.
const api = globalThis.SbxApi;
const ext = api.ext;
const $ = (id) => document.getElementById(id);
function show(which) {
@ -57,7 +55,7 @@ function paint(data) {
async function load() {
const cfg = await api.getConfig();
$("ver").textContent = "v" + (api.ext.runtime.getManifest().version || "");
$("ver").textContent = "v" + (ext.runtime.getManifest().version || "");
// tunnel indicator
api.r3Check(cfg.host).then((r) => {
@ -98,7 +96,7 @@ $("pairBtn").addEventListener("click", async () => {
await api.setConfig({ host });
const token = await api.pair(host);
await api.setConfig({ token });
api.ext.runtime.sendMessage({ type: "refresh" });
ext.runtime.sendMessage({ type: "refresh" });
await load();
} catch (e) {
$("pairMsg").textContent = e.message + " (es-tu sur le tunnel ?)";
@ -107,11 +105,11 @@ $("pairBtn").addEventListener("click", async () => {
$("openFull").addEventListener("click", async () => {
const cfg = await api.getConfig();
api.ext.tabs.create({ url: api.socialUrl(cfg.host, cfg.token) });
ext.tabs.create({ url: api.socialUrl(cfg.host, cfg.token) });
});
$("pdf").addEventListener("click", async () => {
const cfg = await api.getConfig();
api.ext.tabs.create({ url: api.reportUrl(cfg.host, cfg.token) });
ext.tabs.create({ url: api.reportUrl(cfg.host, cfg.token) });
});
$("wipe").addEventListener("click", async () => {
if (!confirm("Effacer toutes tes données de cartographie sur la cabine ?")) return;
@ -127,7 +125,7 @@ $("wipe").addEventListener("click", async () => {
});
$("settings").addEventListener("click", (e) => {
e.preventDefault();
api.ext.runtime.openOptionsPage();
ext.runtime.openOptionsPage();
});
load();

View File

@ -16,7 +16,7 @@ DEST_DIR="/var/lib/secubox/toolbox/webext"
DEST="${DEST_DIR}/secubox-toolbox-webext.xpi"
# Tag-pinned (not /latest/): the webext release is make_latest:false so it
# doesn't steal "latest" from the Android APK release. Bump on new webext-v*.
RELEASE_URL="https://github.com/CyberMind-FR/secubox-deb/releases/download/webext-v0.1.1/secubox-toolbox-webext.xpi"
RELEASE_URL="https://github.com/CyberMind-FR/secubox-deb/releases/download/webext-v0.1.0/secubox-toolbox-webext.xpi"
log() { logger -t "$MODULE" -- "$*" 2>/dev/null || echo "[$MODULE] $*" >&2; }

View File

@ -1374,7 +1374,7 @@ async def wg_toolbox_apk() -> Response:
_WEBEXT_XPI = Path("/var/lib/secubox/toolbox/webext/secubox-toolbox-webext.xpi")
_WEBEXT_XPI_RELEASE = (
"https://github.com/CyberMind-FR/secubox-deb/releases/download/"
"webext-v0.1.1/secubox-toolbox-webext.xpi"
"webext-v0.1.0/secubox-toolbox-webext.xpi"
)

View File

@ -15,13 +15,7 @@ R3 tunnel — no third-party calls.
## Install
Published release `.xpi` (downloadable directly):
```
https://github.com/CyberMind-FR/secubox-deb/releases/download/webext-v0.1.1/secubox-toolbox-webext.xpi
```
The toolbox also serves it from the cabine:
The toolbox serves the built extension:
```
https://kbin.<board>.secubox.in/wg/toolbox.xpi
@ -29,9 +23,8 @@ https://kbin.<board>.secubox.in/wg/toolbox.xpi
The kbin onboard panel exposes a **🧩 Extension navigateur (cartographie)**
button. When a local build is present the cabine serves it
(`application/x-xpinstall`); otherwise it 302-redirects to the **tag-pinned**
release asset above. The webext release is published `make_latest:false` so it
does not steal the repo "Latest" pointer from the Android APK release.
(`application/x-xpinstall`); otherwise it 302-redirects to the latest GitHub
release asset `secubox-toolbox-webext.xpi`.
- **Firefox** — open the `.xpi`. A permanent install needs an AMO-signed build
(release CI / `web-ext sign`); for development use *about:debugging → Load