No description
  • C 96.7%
  • Shell 2.5%
  • Makefile 0.8%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-10-06 23:35:49 +02:00
init Initial commit of Mole (moled) daemon 2026-10-06 17:33:41 +02:00
src Add Dynamic DNS (DDNS) support: DuckDNS, Cloudflare, No-IP, and Custom HTTP 2026-10-06 23:35:49 +02:00
.gitignore Add Dynamic DNS (DDNS) support: DuckDNS, Cloudflare, No-IP, and Custom HTTP 2026-10-06 23:35:49 +02:00
Makefile Fix Makefile LIBS linking for Alpine packaging 2026-10-06 17:38:24 +02:00
README.md Initial commit of Mole (moled) daemon 2026-10-06 17:33:41 +02:00

TunnelD

High-performance, lightweight SSH Port Forwarding & Caddy Reverse Proxy Daemon written in C.

Features

  • Zero-runtime dependencies: Standard POSIX C + SQLite3.
  • Embedded WebUI: Monospace dark carbon dashboard with real-time tunnel control.
  • Modes:
    • Remote Reverse (-R): expose local service (localhost:20128, 192.168.1.1:8080) to remote SSH server port.
    • Local Forward (-L): access remote port locally.
    • Dynamic Proxy (-D): SOCKS5 proxy over SSH.
  • Process Supervisor: Background ssh process management with autostart and crash keepalive.
  • Caddy Integration: Automatic Caddy reverse-proxy snippet generation (/etc/caddy/Caddyfile.d/tunneld.caddy) and live reload.
  • DNS Helper: Detects public IPv4/IPv6 and displays DNS A/AAAA records.
  • Native Daemonization: Full double-fork, setsid, PID file, and signal handling (SIGCHLD, SIGTERM, SIGINT).

Build & Install

make
sudo make install

CLI Usage

tunneld [options]

Options:
  -d, --daemon           Run in background as Unix daemon
  -p, --port <port>      HTTP WebUI port (default: 8888)
  -b, --bind <ip>        Bind IP address (default: 0.0.0.0)
  -u, --user <user>      Basic Auth user (default: admin)
  -w, --pass <pass>      Basic Auth password (default: admin123)
  -D, --db <path>        SQLite database path (default: /var/lib/tunneld/tunnels.db)
  -P, --pidfile <path>   PID file path (default: /run/tunneld.pid)
  -c, --caddy <path>     Caddy snippet path (default: /etc/caddy/Caddyfile.d/tunneld.caddy)

Init Scripts Included

  • systemd: init/systemd/tunneld.service -> /etc/systemd/system/
  • OpenRC: init/openrc/tunneld.initd -> /etc/init.d/tunneld
  • SysVinit: init/sysvinit/tunneld.init -> /etc/init.d/tunneld
  • runit: init/runit/run -> /etc/sv/tunneld/run
  • dinit: init/dinit/tunneld.dinit -> /etc/dinit.d/tunneld
  • launchd: init/launchd/com.tunneld.plist -> /Library/LaunchDaemons/