Mole

← ~john | SSH port forwarding, Caddy reverse proxy & DDNS daemon

about

Mole (moled) is a lightweight, zero-dependency background daemon written in C for managing SSH port forwards, reverse tunnels, Caddy reverse proxy routes, and Dynamic DNS updates through a responsive WebUI.

install via apk (alpine linux)

Add the repository and signing key:

wget -P /etc/apk/keys/ https://tilde.horse/~john/repo/alpine/john.rsa.pub
echo "https://tilde.horse/~john/repo/alpine" >> /etc/apk/repositories
apk update
apk add mole mole-openrc

Packages available for x86_64 and aarch64 (ARM64).

quick start

Run daemon in foreground or as a background service:

moled -p 8888 -u admin -w secret123
# Open http://localhost:8888 in browser

CLI options:

Usage: moled [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/moled/mole.db)
  -P, --pidfile <path>   PID file path (default: /run/moled.pid)
  -c, --caddy <path>     Caddy snippet path (default: /etc/caddy/Caddyfile.d/mole.caddy)

source code

Build from source (requires GCC and SQLite3):

git clone https://git.tilde.horse/john/mole.git
cd mole
make
sudo make install