Commit Graph

2327 Commits

Author SHA1 Message Date
fb07e679e8 Merge branch 'fix/remove-authelia-sso' — remove Authelia SSO 2026-06-29 06:14:31 +02:00
f0a284e36b feat(authelia): remove SSO entirely — permissive no-op gate
Authelia SSO is removed. nginx/authelia.conf is reduced to a permissive
no-op: /__sbx_auth_verify returns 200 for every request and
@sbx_auth_login falls back to the app root. The two named locations are
kept only because grafana/lyrion/yacy/rustdesk/fmrelay/zigbee/nextcloud
vhosts still reference them; without them nginx fails to load.

postinst now disables + masks secubox-authelia.service instead of
enabling it. No SSO portal, no session check, no Authelia socket.

Fixes the dead sso.gk2.secubox.in 302 that produced a password prompt
on LAN clients (live USB at 192.168.1.9). Apps keep their native auth;
exposure boundaries stay with HAProxy + WAF.
2026-06-29 06:14:27 +02:00
c3cfd512d7 fix(image): keep http-level nginx conf.d (geo/map), only strip location-only
Some checks are pending
License Headers / check (push) Waiting to run
The live-usb nginx cleanup deleted ALL conf.d/*secubox*.conf, including
secubox-lan-geo.conf which defines 'geo $lan_client'. authelia.conf then hit
'unknown lan_client variable' -> nginx -t fails -> no web server -> blank
kiosk with a connection error. Only remove conf.d files that actually contain
a location block (misplaced); keep geo/map/limit_req_zone/upstream.
2026-06-29 06:05:00 +02:00
99af60bc16 fix(image): don't abort USB build on invalid nginx config (set -e trap)
Some checks are pending
License Headers / check (push) Waiting to run
The 'final nginx cleanup' branch runs precisely when nginx -t fails, but
nginx_error=$(nginx -t|head) and missing_file=$(...grep...) then trip
set -e/pipefail and abort the whole build right after the warn. Guard both
with || true. nginx config is regenerated at first boot by secubox-net-detect,
so a build-time-invalid config is non-fatal. This was the last blocker on the
amd64 USB (kiosk + everything else already pass).
2026-06-28 11:27:16 +02:00
854805fbbd fix(image): build-live-usb.sh accept --kiosk (was only --no-kiosk)
The workflow passes --kiosk (consistent with build-rpi-usb.sh); build-live-usb.sh
only had --no-kiosk and erred 'Unknown argument: --kiosk', failing the x64 USB
build. Add a --kiosk case (INCLUDE_KIOSK=1).
2026-06-28 11:14:19 +02:00
b945c831a0 fix(image): policy-rc.d so the kiosk (X11/chromium) installs in chroot
Some checks are pending
License Headers / check (push) Waiting to run
The live-usb kiosk stack (dbus, X11, chromium) aborted its postinst in the
init-less chroot ('Failed to connect to system message bus', invoke-rc.d
errors), failing the build. Add /usr/sbin/policy-rc.d (exit 101) before the
installs and remove it before squashfs, so packages don't try to start
services at build time but the booted system still does. Keep kiosk ON for
amd64 USB (extra_args=--kiosk). Do NOT disable kiosk.
2026-06-28 11:05:08 +02:00
2b52eaa330 fix(image): global dpkg force-confold in live-usb chroot (mesh.toml prompt)
The per-install flag didn't cover secubox-mesh's configure path; write
/etc/dpkg/dpkg.cfg.d/90-secubox-confold (force-confold/confdef) into the chroot
before any install so every dpkg op keeps conffiles and never prompts. Fixes
'end of file on stdin at conffile prompt' aborting the amd64 USB build.
2026-06-28 10:45:16 +02:00
f3fc9a3a92 fix(image): non-interactive conffile handling for secubox-full install
Some checks are pending
License Headers / check (push) Waiting to run
secubox-mesh's mesh.toml is an auto-detected conffile that triggers an
interactive dpkg prompt (*** mesh.toml [Y/I/N/O/D/Z]) during configure,
failing the headless chroot install in build-live-usb.sh (amd64 USB build).
Install secubox-full with DEBIAN_FRONTEND=noninteractive + --force-confold/
--force-confdef + a follow-up dpkg --configure -a, in build-live-usb.sh and
build-image.sh.
2026-06-28 09:15:35 +02:00
4398ebe654 Merge #760: LAN 192.168.10.0/24 standardization + build-pipeline fixes (dearmor, golang-go, arch=both, -d) + 1.10.0 2026-06-28 09:10:47 +02:00
1a60f82de9 fix(ci): build pure-Go pkgs with -d (golang-go metapackage dep-check) (ref #760)
dpi/toolbox-ng/waf-ng are CGO_ENABLED=0 cross-compiles; the go toolchain is
present (golang-1.22-go) but dpkg-checkbuilddeps trips on the golang-go
metapackage. Skip the dep check for just these three (-mod=vendor, self-contained).
2026-06-28 09:10:45 +02:00
bb9208cbcc Merge p2p fixes: master-link statedir, www path, no-self-peer, invite ownership (#762 substrate) 2026-06-28 09:09:08 +02:00
119771eadb fix(p2p): sbx-mesh-invite re-owns token store to secubox when run as root
Root-owned tokens.json made the secubox-user p2p (and the in-process
aggregator) crash with EACCES. chown -R secubox the master-link dir if root.
2026-06-28 09:06:36 +02:00
973c9e3a78 fix(p2p): don't count/list the local node as a peer
list_peers inserted+persisted get_self_peer() into PEERS_FILE, so peer_count
and online_peers counted the node itself (showed '<host> (local)' as a phantom
peer). /status and /peers now exclude is_local/self; self info stays available
via /discover/self for announcements.
2026-06-28 08:47:41 +02:00
675c4806ea fix(p2p): install web UI to /usr/share/secubox/www (fixes Module Not Found)
p2p shipped its UI to /var/www/secubox/p2p, but the dashboard vhost serves
modules from /usr/share/secubox/www (root + try_files). So /p2p/ fell through
to the unknown-module page. Install p2p + master-link UIs there like all other
modules; update nginx aliases to match.
2026-06-28 08:27:07 +02:00
255677c219 fix(p2p): postinst creates /var/lib/secubox/p2p/master-link owned secubox
The app's master-link init mkdir's master-link/ and failed EACCES when
/var/lib/secubox/p2p was root-owned (it was never created by the package),
500-ing /api/v1/p2p/status and breaking mesh-join enrollment. Create p2p/ +
master-link/ as secubox in postinst (mirroring the log-dir pattern) and chown
to repair pre-existing installs. Never touches the shared parent (#494/#511).
2026-06-28 08:22:54 +02:00
8d5627567d fix(ci): build-packages arch=both must expand to both arches (ref #760)
The discover matrix filter only compared requested_arch against amd64/arm64/
empty, so the 'both' workflow_dispatch option produced an EMPTY matrix (no
builds, collect failed). Normalize 'both' -> empty (= all arches).
2026-06-28 06:57:25 +02:00
8bbc573149 fix(ci): install golang-go so arm64 pure-Go packages build (ref #760)
secubox-dpi and secubox-toolbox-ng are CGO_ENABLED=0, GOARCH=arm64,
-mod=vendor offline cross-compiles. They failed the arm64 build only
because golang-go was never installed, so dpkg-checkbuilddeps aborted on
their `Build-Depends: golang-go (>= 1.22)`. Not a CGO cross-toolchain
gap. ubuntu-24.04 ships golang-go >= 1.22; installing it lets the pure-Go
arm64 cross-compile run on the amd64 runner.

Unblocks a complete amd64+arm64 package set for the apt repo + arm64 images.
2026-06-28 06:52:40 +02:00
6a557cbe2c fix(image): dearmor apt keyring for signed-by (apt rejects armored) (ref #760)
build-image.sh / build-installer-iso.sh / validate-staged-repo.sh fetched the
ASCII-armored secubox-keyring.gpg and used it directly as
`signed-by=/usr/share/keyrings/secubox.gpg`. apt's signed-by requires a
DEARMORED (binary) keyring, so the chroot apt-get update failed with
"NO_PUBKEY 44E50F0178E8BC7E / repository not signed" even though the repo
signature and key are correct. Pipe the key through `gpg --dearmor`.

Root cause of all image-build failures since the keyring became armored;
not a key desync (repo signer == published keyring == 44E50F0178E8BC7E).
2026-06-27 17:44:13 +02:00
a52af3b50a feat(netplan): standardize SecuBox LAN to 192.168.10.0/24; bump 1.10.0 (ref #760)
Default br-lan 192.168.1.1/24 collided with common ISP-router LANs
(Freebox/Livebox 192.168.1.0/24) when the appliance sits behind one:
WAN(DHCP)+LAN land on the same subnet -> duplicate route, ARP ambiguity,
unreachable mgmt IP. Observed live on c3box behind a Freebox.

- All board netplans (mochabin, espressobin-v7/ultra, x64-vm, x64-live)
  + VM LANs (vm-x64, vm-arm64) -> br-lan/LAN 192.168.10.1/24
- Generators: secubox-netmodes (inline + router.yaml.j2 template),
  secubox-hub preview, secubox-net-detect
- dnsmasq (espressobin-v7.conf): dhcp-range + option:router + dns-server
- live-usb build scripts + self-signed cert SANs -> IP:192.168.10.1
- Out of scope (untouched): 192.168.255.1 mgmt/trusted-proxy whitelist,
  WAN-probe GATEWAYS lists, remote-ui/round + tests
- Minor "medium" bump 1.9.0 -> 1.10.0 (core build scripts; mochabin-live
  stays on its 2.0.0 track)

Live: c3box br-lan already 192.168.10.1/24 + netmodes template aligned;
gk2 WAN moved to eth2 DHCP @ .200 (Freebox reservation on eth2 MAC).
2026-06-27 17:11:23 +02:00
47076b24d3 fix(netplan): mochabin — copper eth2 as 2nd DHCP WAN candidate, out of br-lan
Some checks are pending
License Headers / check (push) Waiting to run
The image labelled eth0 (SFP+) as the only WAN; the single copper RJ45
(eth2/mvpp2-2) was trapped in br-lan, so an operator/uplink arriving on
copper got no lease. Make both eth0 (SFP+) and eth2 (copper) DHCP WAN
candidates (whichever is cabled gets the lease); br-lan keeps the switch
LAN ports. Verified live on the c3box reference install.
2026-06-27 16:27:05 +02:00
cb6eee4b0b docs: netboot validation + c3box first install to Debian + #748 (ref #748 #737)
- HISTORY: 2026-06-27 milestone — gk2→c3box netboot proven, first SecuBox Debian
  install on a physical MOCHAbin, #748 wget scissor documented, boot.scr workaround
- WIP: update to 2026-06-27; c3box=reference install DONE; #748 deferred; rig teardown pending
- TODO: T5 section — proper bootloader (extlinux addr fix + #748 paths), package the
  netboot signed-install flow, rig teardown checklist
- wiki/Netboot-Install.md: new reference page — prereqs, TFTP steps, signed install,
  boot.scr persistence fix, gotchas table, eMMC layout
- wiki/_Sidebar.md: link Netboot-Install under BOOT section
2026-06-27 16:27:05 +02:00
CyberMind
5d505cae16
Merge PR #759 — nft-based network stats dashboard (#758)
nft-based network stats — log/counter drops, attacks, ad-blocks, in/out traffic into the dashboard
2026-06-27 16:25:52 +02:00
1c6a978748 feat(toolbox): add Réseau dashboard tab with nft throughput sparklines (ref #758) 2026-06-27 11:35:52 +02:00
9696cdad13 feat(toolbox): network_drops sourced from hub netstats snapshot (ref #758) 2026-06-27 11:31:16 +02:00
fd9f535e63 fix(hub): require JWT on netstats endpoints (ref #758)
Add user=Depends(require_jwt) to netstats_summary and netstats_series,
matching the sibling pattern used throughout the same router.
Drop redundant int() casts on already-typed window/step params.
2026-06-27 11:29:00 +02:00
d91f6a8b67 feat(hub): /netstats/summary + /netstats/series endpoints (ref #758) 2026-06-27 11:26:06 +02:00
c1c4810f3e feat(hub): package netstats collector, timer, nft tap deploy, sudoers (ref #758) 2026-06-27 11:22:04 +02:00
d05deee7ff feat(hub): netstats snapshot builder + privileged collector + root wrapper (ref #758) 2026-06-27 11:16:38 +02:00
b30a69316a fix(hub): robust max_ts guard + multi-name category aggregation test (ref #758)
- Replace truthiness guard (max_ts_c or max_ts_i) with explicit None-check
  any(t is not None ...) so a sole sample at ts=0 (boot edge) is handled by
  intent, not coincidence.
- Add test_query_drops_sums_multiple_names_per_category: proves blacklist_v4
  and blacklist_v6 (same category) are summed (10+5=15) in the same bucket,
  not overwritten.
2026-06-27 11:13:58 +02:00
851af7d172 feat(hub): netstats SQLite store + reset-aware series query (ref #758) 2026-06-27 11:10:43 +02:00
55814ac3a0 feat(hub): netstats pure parsers (proc/net/dev, nft counters, reset-aware delta) (ref #758) 2026-06-27 11:07:27 +02:00
e6260215a4 feat(hub): inet filter input policy-drop nft tap counter (ref #758) 2026-06-27 11:04:27 +02:00
6ae107db91 feat(mitmproxy): named nft counter on WAF rate-limit drops (ref #758) 2026-06-27 11:02:06 +02:00
60f876ad08 feat(toolbox): named nft counters in blacklist spine + named-counter reader (ref #758) 2026-06-27 10:58:58 +02:00
bdafced25a docs(netstats): implementation plan — 11 TDD tasks (ref #758) 2026-06-27 10:54:47 +02:00
5b283b6bff docs(netstats): design spec — nft-based network stats dashboard (ref #758) 2026-06-27 10:14:23 +02:00
740cbd291f release: toolbox-ng 0.1.26 (#757 reval nudge) + toolbox 2.7.24 (Liveness card removed)
Some checks are pending
License Headers / check (push) Waiting to run
2026-06-27 09:46:14 +02:00
d203b9aa8f Merge branch 'feature/757-sw-revalidation-nudge' — SW revalidation nudge (#757) + remove Liveness card
#757: for sw-neuter allow-listed hosts, strip If-None-Match/If-Modified-Since on
HTML document fetches so a stale-while-revalidate SW re-fetches a full 200 (banner
injected) and caches a banner'd shell without being neutered. Reviewed APPROVED.
Also removes the redundant ♥ Liveness dashboard card (version stays in the top badge).
2026-06-27 09:45:19 +02:00
52d358c9d8 ui(toolbox): remove redundant Liveness card — version stays in the top badge (ref #757) 2026-06-27 09:44:57 +02:00
20fca011a1 feat(sbxmitm): SW revalidation nudge — strip If-None-Match/If-Modified-Since for allow-listed HTML fetches (ref #757)
Add requestWantsHTML (Sec-Fetch-Dest: document or Accept: text/html) and use
it in mitmPipeline to strip conditional headers before up.Do for sw-neuter
allow-listed hosts, forcing a full 200 so the injected banner is cached by a
stale-while-revalidate Service Worker.
2026-06-27 09:42:13 +02:00
fb90349670 docs(sbxmitm): plan — SW revalidation nudge (ref #757) 2026-06-27 09:40:32 +02:00
90a7df6f4b release: toolbox-ng 0.1.25 + toolbox 2.7.23 — #755 #ads breakdown + #756 cosmetic scroll 2026-06-27 09:19:37 +02:00
f997d1c9a9 Merge branch 'feature/755-ads-aggregate' — #ads MITM-stats breakdown (#755) + cosmetic scroll-restore (#756)
#755: the #ads card becomes an honest labeled breakdown — Pubs bloquées (204),
Trackers détectés (social_edges distinct cookie-trackers), Pages nettoyées (new
sbxmitm cosmetic counter, wg-gated), Drops réseau (blacklist nft). #756: the
cosmetic ad-hide style restores html,body overflow so paywall scroll-locks
(Bloomberg) no longer leave the page unscrollable. Final review: one wg-gate fix
applied; race-clean, contract airtight end-to-end.
2026-06-27 09:18:27 +02:00
24fa9da107 fix(sbxmitm): gate recordCosmetic() on wg to stop over-counting pages_cleaned (ref #755)
Non-WG LAN clients never receive the cosmetic ad-hide <style> (injectHTML
gates injectCosmetic behind `if wg`), yet recordCosmetic() fired on every
successful inject — inflating pages_cleaned for banner-only flows.
Gate the call with `if wg && px.ads != nil` to match injectHTML's own gate.
2026-06-27 09:17:49 +02:00
ff439d9395 feat(toolbox): cosmetic-pages counter → #ads 'Pages nettoyées' (ref #755) 2026-06-27 09:10:37 +02:00
6100a3e8ed feat(toolbox): #ads breakdown — trackers_seen + network_drops (ref #755)
Co-Authored-By: Gérald Kerma <devel@cybermind.fr>
2026-06-27 09:05:22 +02:00
3473320ad0 fix(sbxmitm): cosmetic restores scroll (overflow:auto) — paywall scroll-lock left Bloomberg dead (ref #756) 2026-06-27 09:02:43 +02:00
3e8b3e80fd docs(toolbox): implementation plan — #ads aggregate MITM stats (ref #755) 2026-06-27 08:54:57 +02:00
a76da4f783 release: toolbox-ng 0.1.24 + toolbox 2.7.22 — SW-neuter #753
Some checks are pending
License Headers / check (push) Waiting to run
2026-06-27 08:43:21 +02:00
ad4fc51d21 Merge branch 'feature/753-sw-neuter' — targeted Service-Worker neuter for the R3 banner (ref #753)
PWA news sites (leparisien, cnn, 20minutes, franceinfo) serve their main HTML
from a Service-Worker cache so the navigation never reaches the MITM and the
banner can't be injected. For an operator-curated allow-list, sbxmitm answers
the SW script fetch with a passive self-unregistering SW (next navigation reaches
the MITM → banner), with an auto-learn candidate feed to /__toolbox/sw-candidate.
Targeted-strict: empty list = no-op. Final review READY TO MERGE (race-clean).
2026-06-27 08:41:52 +02:00