Skip to content

Latest commit

ย 

History

425 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

ZeroScale

High-performance, swapless Tailscale manager & live monitor for Asuswrt-Merlin routers.

Note

Attribution & Origin: ZeroScale is based on and inspired by TAILMON originally created by Viktor Jaep (licensed under GPLv3). ZeroScale is an independently developed, standalone evolution engineered specifically for swapless, zero-overhead Tailscale monitoring and management on Asuswrt-Merlin routers.


100% Swapless Tailscale Management & Monitoring

Running modern Go-based services like Tailscale on embedded, memory-constrained Asus routers has traditionally required dedicated USB swap partitions to prevent memory exhaustion, out-of-memory (OOM) kernel kills, and fork failures.

ZeroScale completely eliminates the need for USB swap partitions:

  • ๐Ÿ›ก๏ธ Zero Swap Dependency: Operates smoothly on bare router RAM without requiring an external USB flash drive or swap file.
  • ๐Ÿ’พ Ultra-Low Memory Footprint: Consumes less than 800 KB of RAM (compared to 10โ€“25 MB with heavy multi-process shell loops).
  • โšก Zero Fork Overhead: Native C99 execution avoids spawning hundreds of background awk, sed, grep, and subshell processes every polling cycle.
  • ๐Ÿ”’ Flash Wear Protection: Event-driven architecture eliminates disk thrashing, significantly extending the lifespan of router NAND flash and attached storage.
  • โฑ๏ธ 0.0% Idle CPU Usage: Sleeps on an event-driven terminal loop, reserving 100% of router CPU power for NAT routing, QoS, and WireGuard cryptography.

๐Ÿ“Š Technical Comparison

Metric / Capability Traditional Shell Monitors ZeroScale (C99)
Swap Requirement USB swap partition recommended 100% Swapless (No USB swap needed)
RAM Footprint ~5โ€“15 MB (spawning subshells) < 800 KB resident memory
CPU Usage (Idle/Poll) 2โ€“5% spikes on subshell forks 0.0% CPU (event-driven tick)
Binary Size Multiple scripts / disk files ~149 KB single static musl binary
Rendering Engine ANSI escapes (flickers on refresh) Double-buffered differential matrix (0% flicker)
Input Navigation Number-key menus Full Keyboard (Arrows/Tab) + SGR Mouse Navigation
Dependencies Requires coreutils, awk, sed, screen Zero external dependencies (pure static C99)

โœจ Features

1. ๐Ÿ–ฅ๏ธ Live Monitor Dashboard (VIEW_DASHBOARD)

Dashboard
  • Real-time Status Cards: Live indicators for Daemon status, Tailnet connectivity, Operating Mode (Userspace / Kernel), Watchdog Keepalive state, Exit Node advertisement, and advertised Subnet Routes.
  • Interactive Action Bar: Dynamic action buttons with instant keyboard shortcuts (u, d, r, s, t, l, c, q) and arrow navigation (โ†/โ†’).
  • Color-Coded Peer Topology:
    • ๐ŸŸฃ Self (Router): Bold Magenta (router - self)
    • ๐ŸŸก Exit Nodes: Vivid Gold / Yellow (offers exit node)
    • ๐ŸŸข Active (Direct WireGuard): Bright Green (active; direct ...)
    • ๐Ÿ”ต Idle (Online): Soft Cyan (idle; ...)
    • โšซ Offline Nodes: Dim Gray (offline, last seen ...)
  • Smooth Scrolling: Scroll through large peer lists with the mouse wheel or arrow keys.

2. ๐Ÿ” Modal Peer Inspector (VIEW_PEER_DETAIL)

Peer Detail
  • Select any peer with mouse click or Enter to open a floating, bordered modal inspector.
  • Inspect Node Name, Tailscale IP, OS Platform, Account Owner, Connection Endpoint (Direct vs. DERP Relay), and real-time Tailnet status.
  • Interactive actions directly inside modal:
    • Press p: Instant ICMP ping test.
    • Press t: Real Tailscale WireGuard latency ping.
    • Press c / Esc: Close inspector.

3. โš™๏ธ Unified Configuration & Service Management (VIEW_CONFIG)

Config

Consolidated, interactive settings management with instant persistence to /jffs/addons/zeroscale.d/zeroscale.cfg:

  • Section 1: Daemon & Health Monitor โ€” Toggle Watchdog Keepalive, Persistent Settings, and Boot Autostart (/jffs/scripts/post-mount).
  • Section 2: Tailscale Routing & Mode โ€” Toggle Userspace โŸท Kernel mode, Exit Node advertisement, Subnet Routes advertisement, and interactive Subnet CIDR editor.
  • Section 3: Interface & Logging โ€” Cycle status check intervals (10s โž” 300s) and edit Event Log row retention limits.
  • Section 4: Notifications & Automation โ€” Configure amtm email alerts and scheduled daily autoupdates.
  • Section 5: Binary & Maintenance โ€” Check & update Tailscale binaries, reset daemon state, and run safe install/reinstall/uninstall workflows.

4. ๐Ÿ“œ Full-Screen Event Log Viewer (VIEW_LOGS)

Log Viewer
  • Real-time logging of all configuration changes and daemon events directly to /jffs/addons/zeroscale.d/zeroscale.log.
  • Syntax highlighting for log levels (INFO, WARN, FAIL, ONLINE).
  • Opens directly to the most recent log entries filling the entire screen.
  • Supports โ†‘/โ†“, PgUp/PgDn, g (top), G (bottom), and r (live reload).

๐Ÿ› ๏ธ Universal Installation on Asuswrt-Merlin

Run the following one-line installer on your router over SSH. It automatically detects your router's architecture (ARMv7 vs ARM64) and migrates any existing Tailmon settings:

curl -fsSL https://raw.githubusercontent.com/underd0se/ZeroScale/main/install.sh | sh

Tip

Existing Tailmon Users: The installer automatically detects /jffs/addons/tailmon.d/tailmon.cfg, migrates your routing and exit-node settings to zeroscale.cfg, cleans up old boot hooks, and creates a /opt/bin/tailmon compatibility alias.

# Launch ZeroScale
zeroscale

๐Ÿ’ป Building from Source (macOS / Linux)

Cross-compiling requires Zig:

# 1. Install Zig via Homebrew (macOS)
brew install zig

# 2. Clone repository
git clone https://github.com/underd0se/ZeroScale.git
cd ZeroScale

# 3. Build release binaries for Asus routers (ARMv7 & ARM64)
./build-all.sh

๐ŸŽฎ Navigation & Keyboard Controls

Context Key / Action Description
Anywhere Mouse Left-Click Activate buttons, select peers, toggle settings
Anywhere Shift + Drag (or Fn + Drag) Native terminal text selection and copying across all terminal emulators
Dashboard โ†‘ / โ†“ Navigate between Header Action Bar and Peer Node Table
Dashboard โ† / โ†’ Cycle through Header Action Bar buttons when focused
Dashboard Enter Trigger focused button or open Peer Inspector for selected node
Dashboard u / d Quick direct shortcut for Tailscale up / down
Dashboard r / s / t Quick direct shortcut for daemon restart / start / stop
Dashboard c / l / q Open Configuration / Logs / Quit
Config Menu โ†‘ / โ†“ / โ† / โ†’ Navigate through all 17 configuration items in 2-column layout
Config Menu Enter / Space Toggle setting / Open Subnet CIDR editor / Edit Log retention / Edit Auto-Update Time
Config Menu 1โ€“9, t, z, u, x, i Direct jump and toggle hotkeys (z: Update ZScale, u: Update TS)
Config Menu Esc / e / q Return to Dashboard
Modals & Dialogs โ† / โ†’ / Tab Switch between Action and Cancel buttons
Modals & Dialogs Enter / Space Execute focused modal action
Modals & Dialogs Esc / e / c / q Cancel modal and return cleanly
Input Modals Tab / โ†“ / โ†‘ Move focus between Text Input field and Save/Cancel buttons
Peer Inspector p / t / c / e Live ICMP Ping / Tailscale WireGuard Ping / Close modal
Log Viewer โ†‘ / โ†“ / PgUp / PgDn Scroll log viewer
Log Viewer / / n / N Real-time substring search through event logs
Log Viewer g / G / r / e Jump to Top / Bottom / Refresh logs / Exit

๐Ÿ™ Acknowledgments & Credits


๐Ÿ“„ License

GPL-3.0 License. See LICENSE for details.

About

Run Tailscale natively on Asuswrt-Merlin routers without a swap file. Includes a built-in terminal UI, automatic updates, and advanced crash protection.

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages