Skip to content

Releases

v1.2.2 — CI/CD Pipeline Fix (Production Release Hardening)

Choose a tag to compare

@pphothidaen pphothidaen released this 01 Dec 13:37

CI/CD Pipeline Fix (Production Release Hardening)

Fixed

  • Rust CI Formatting: Fixed import ordering in router.rs — grouped use crate::telnet::client::{is_connection_refused, TelnetSession}; alphabetically to satisfy cargo fmt --check
  • All CI Green: Rust Embedded Daemon CI (67/67 tests), Python/Shell tests (65/65), CodeQL, Tier 0 CDN Blocklist Pre-Compiler — all passing on main
  • Branch Cleanup: All feature branches merged and removed; clean main history ready for production tag

Production Verified

  • Router: ZTE F6107A (PON_2.0) @ 192.168.1.1
  • Daemon: ARMv7 musl 509 KB binary
  • Status: FULLY_AUTONOMOUS, 604,974 domains blocked
  • Operations: deploy → check → update → status all verified

CDN Blocklist

  • Domains: 604,973 (29/29 feeds succeeded)
  • Hosts: 16.8 MB
  • SHA256: 39d4e1ac15d82626206cf60aa41562bc671eb5b876d0d2962dc16b66c5cbffb2

Artifacts

  • homeshield-daemon (ARMv7, static musl, 509,252 bytes)

v1.2.1 — Stability & Reliability Patch (Production Hardening)

Choose a tag to compare

@pphothidaen pphothidaen released this 01 Dec 09:06

Critical Fixes (Production Stability)

  • Signal Handling: Added signal-hook crate for graceful SIGTERM/SIGHUP/SIGINT handling in Rust daemon — prevents mid-operation termination during do_update/apply_hosts
  • PID File Liveness Check: acquire_lock() now verifies PID liveness via kill -0 before blocking; atomic write (.tmp + rename) prevents stale lock corruption
  • File Descriptor Limit: Daemon sets RLIMIT_NOFILE=65536 at startup via nix::sys::resource — eliminates "Too many open files" during concurrent do_update operations
  • Memory Pressure Guard: Pre-flight /proc/meminfo MemAvailable check before large allocation in do_update — aborts if < 20 MB free, prevents OOM kill mid-write
  • Firewall Race Reduction: Reduced firewall_tick_stride from 6→2 (30s→10s) in Supervisor; event-driven dnsmasq detection for faster iptables rule restoration
  • Resource Hygiene: All file opens use O_CLOEXEC; watchdog.sh adds trap 'wait' CHLD to reap zombie children

Observability Improvements

  • Graceful shutdown logging with reason (signal received, error, normal)
  • Lock acquisition telemetry (PID, liveness check result, wait time)
  • Memory pressure check result logged before each do_update

Compatibility

  • ✅ ARMv7 musl cross-compile verified (signal-hook, nix work on musl)
  • ✅ Zero-wear Flash delta check preserved (no additional Flash writes)
  • ✅ ZTE cspd self-healing (WAN reconnect host restore) unchanged
  • ✅ BusyBox ash compatible (no new shell dependencies)

Testing Checklist (Pre-Release)

  • ✅ Unit tests: cargo test --manifest-path rust/Cargo.toml --workspace (67/67 pass)
  • ✅ Python tests: python3 -m pytest tests/ -v (65/65 pass)
  • ✅ Integration: Deploy to 192.168.1.1, verify ROUTER_AUTONOMY: FULLY_AUTONOMOUS
  • ✅ Stress: Trigger do_update 10x rapidly — verify no FD exhaustion, no stale lock
  • ✅ Signal: Send SIGTERM/SIGHUP to running daemon — verify graceful shutdown + lock cleanup
  • ✅ Memory: Simulate low memory (MemAvailable < 20MB) — verify do_update aborts cleanly
  • ✅ Firewall: Restart dnsmasq — verify iptables rules restored within 10s
  • ✅ Zombie: Run watchdog.sh for 1 hour — verify no defunct processes accumulate
  • ✅ Regression: Full test suite + router deploy + internet connectivity (DNS/HTTPS/Ping)

Artifacts

  • ARMv7 binary: homeshield-daemon (527 KB static, musl)
  • SHA256: Available from CI artifact homeshield-daemon-armv7

v1.2.0 — Performance Fine-Tuning & Universal IoT Telemetry Shield

Choose a tag to compare

@pphothidaen pphothidaen released this 26 Nov 06:39

🛡️ HomeShield v1.2.0 — Performance Fine-Tuning & Universal IoT Telemetry Shield

⚡ Performance Fine-Tuning (Design Patterns)

  • Builder & Strategy Pattern (BlocklistCompiler::with_capacity): Pre-sizes HashSet & Vec to 300,000+ capacity across homeshield-daemon and homeshield-cli compile, eliminating repeated O(n) rehashing on embedded ARMv7 and CI builds.
  • Flyweight Pattern (Arc<HashSet<String>>): Shares immutable whitelist via BlocklistCompiler::with_shared_whitelist for zero-clone CDN fallback rebuilds.
  • Cache-Aside Pattern (domain_count Sidecar): Writes verified unique domain count during do_update() so do_status() reads in O(1) without scanning 8 MB+ hosts files (reporting 0 cleanly when PAUSED).
  • Buffer Reuse Pattern & 128 KB Streaming I/O: Upgraded file_len_and_fnv1a, write_hosts, write_dual_stack_hosts, apply_hosts, ensure_base_hosts, and fallback count_blocked_v4_domains to 128 KB buffers and single reused String line buffers (eliminating 600k+ heap allocations).
  • Single-Pass Visitor Pattern (/proc scan): Added SystemOps::find_any_process_pids to locate resident daemon processes in 1 /proc directory walk instead of 3.
  • Scatter-Gather Pattern (JoinSet LAN Probe): Parallelized ADB port 5555 discovery across all LAN DHCP/ARP leases (~800 ms total instead of N × 800 ms sequentially).

🌐 Universal IoT & Device Telemetry Blocking (29 Live Feeds)

  • Added 8 verified telemetry feeds (native.amazon.txt, native.apple.txt, native.huawei.txt, native.oppo-realme.txt, native.vivo.txt, native.roku.txt, native.winoffice.txt, WindowsSpyBlocker/spy.txt).
  • Added device CLI alias + DeviceCategory classifier (Smart TV, Smartphone / Tablet, IP Camera, Smart Speaker, Gaming Console) + built-in OEM telemetry fallback rules & mobile core protection.

📊 Verification Highlights

  • TurtleCute Ad Blocker Test: 97% (126 / 130 Blocked) (4 remaining are browser-only cosmetic CSS placeholders and first-party ads.js / pagead.js scripts).
  • Embedded Memory Footprint: 408 kB VmRSS on ARMv7 (ZTE ZXHN F6107A).
  • Diagnostic Whitelist: adblock.turtlecute.org whitelisted for live browser verification.

📦 Release Asset & Checksum

Asset SHA-256
homeshield-daemon-armv7-unknown-linux-musleabi 02e651da197b8251b578a1da2608145fd83a22a71c6ef1c0da6957a73164c9ef