Skip to content

Configuration

Environment Variables

Create /etc/cloud-cli-proxy/env (systemd deployment) or .env (Docker Compose deployment).

Use setup-env.sh for interactive generation:

bash
bash deploy/scripts/setup-env.sh

Control Plane

VariableRequiredDefaultDescription
DATABASE_URLYesPostgreSQL connection string, e.g. postgres://user:pass@host:5432/db?sslmode=disable
CONTROL_PLANE_ADDRNo:8080Control plane HTTP API listen address
ADMIN_USERNAMENoadminAdmin username
ADMIN_PASSWORDYesAdmin password, used as seed on first startup
ADMIN_JWT_SECRETYesJWT signing key (32+ chars), disables admin API if unset
HOST_AGENT_MODENosocketHost-agent mode. socket = connect to standalone process via Unix socket, embedded = run inside control plane process
HOST_AGENT_SOCKETNo/run/cloud-cli-proxy/host-agent.sockHost-agent Unix socket path (socket mode only)
DATA_DIRNo/var/lib/cloud-cli-proxyData directory for WireGuard keys and runtime files
SSH_PROXY_ADDRNo:2222SSH proxy listen address
LOG_FORMATNojsonLog format, json or text
LOG_LEVELNoinfoLog level: debug / info / warn / error

Database (Docker Compose built-in PostgreSQL)

VariableRequiredDefaultDescription
DB_MODENodockerDatabase mode: docker = built-in, external = external
POSTGRES_DBNocloudproxyDatabase name
POSTGRES_USERNocloudproxyDatabase user
POSTGRES_PASSWORDYes (docker mode)Database password

Admin Dashboard

VariableRequiredDefaultDescription
ADMIN_PORTNo3000Admin frontend port (maps to container port 80)

Docker Compose Port Mappings

VariableDefaultDescription
SSH_PROXY_PORT2222Host SSH proxy port
ADMIN_PORT3000Host admin dashboard port

WireGuard Configuration

Each WireGuard-type egress IP corresponds to a WireGuard peer. Provide these parameters when creating via Admin API or dashboard:

ParameterRequiredDescription
wg_endpointYesWireGuard peer endpoint (e.g., 1.2.3.4:51820)
wg_public_keyYesPeer public key (Base64)
wg_peer_addressYesLocal assigned address (CIDR, e.g., 10.0.0.2/32)
wg_allowed_ipsNoAllowed IP range, defaults to 0.0.0.0/0 (full tunnel)
wg_preshared_keyNoPre-shared key (Base64)
wg_dns_serverNoDNS server address (e.g., 1.1.1.1)

WireGuard interfaces are configured by host-agent into the container's network namespace using the birthplace-namespace pattern, ensuring keys never traverse the host network stack.

Proxy Protocol Configuration

For proxy-type egress IPs, provide a proxy_config JSON field following the sing-box outbound format.

Supported Protocols

SOCKS5

json
{
  "type": "socks",
  "server": "192.0.2.50",
  "server_port": 1080,
  "username": "user",
  "password": "pass"
}

Shadowsocks

json
{
  "type": "shadowsocks",
  "server": "198.51.100.5",
  "server_port": 8388,
  "method": "aes-256-gcm",
  "password": "your-password"
}

Supported methods: aes-128-gcm, aes-256-gcm, chacha20-ietf-poly1305, etc.

VMess

json
{
  "type": "vmess",
  "server": "203.0.113.20",
  "server_port": 443,
  "uuid": "your-uuid",
  "security": "auto",
  "alter_id": 0
}

Trojan

json
{
  "type": "trojan",
  "server": "203.0.113.30",
  "server_port": 443,
  "password": "your-password",
  "tls": {
    "enabled": true,
    "server_name": "your-domain.com"
  }
}

HTTP

json
{
  "type": "http",
  "server": "192.0.2.100",
  "server_port": 8080,
  "username": "user",
  "password": "pass"
}

Admin Dashboard Configuration

The egress IP form dynamically switches fields based on the selected tunnel type:

  • WireGuard: Shows WireGuard configuration fields
  • Proxy: Shows protocol selector with corresponding fields, plus a JSON editor mode

Firewall Rules

Container Level

Host-agent uses nftables to set default-deny policy for each container namespace:

  • WireGuard mode: Only allows traffic through the WireGuard tunnel
  • Proxy mode: Only allows connections to the proxy server

Rules are managed automatically by host-agent.

Host Level

Recommended host firewall:

bash
nft add table inet filter
nft add chain inet filter input '{ type filter hook input priority 0; policy drop; }'
nft add rule inet filter input ct state established,related accept
nft add rule inet filter input iif lo accept
nft add rule inet filter input tcp dport 22 accept     # Host SSH
nft add rule inet filter input tcp dport 8080 accept   # API
nft add rule inet filter input tcp dport 3000 accept   # Admin dashboard
nft add rule inet filter input tcp dport 2222 accept   # SSH proxy

Docker Images

All images are built via GitHub Actions for linux/amd64 and linux/arm64.

ImageRegistryDescription
control-planeghcr.io/zanel1u/cloud-cli-proxy/control-planeControl plane API server
adminghcr.io/zanel1u/cloud-cli-proxy/adminAdmin dashboard frontend (Nginx)
managed-userghcr.io/zanel1u/cloud-cli-proxy/managed-userUser container image
sing-box-gatewayghcr.io/zanel1u/cloud-cli-proxy/sing-box-gatewaysing-box gateway sidecar

Tag convention:

TagDescription
latestLatest build from main
1.2.3Release version, corresponds to GitHub Release
1.2Auto-follows latest patch
1Auto-follows latest minor
a1b2c3dPinned to exact commit

Pin versions in production:

bash
docker pull ghcr.io/zanel1u/cloud-cli-proxy/control-plane:1.2.3

User Container Pre-installed Software

The managed user image is based on Ubuntu 24.04 with:

SoftwareVersionDescription
OpenSSH Server10.2p1SSH access
Claude CodeLatestAI coding assistant
KasmVNC1.4.0Remote desktop server
ChromiumLatestBrowser (with KasmVNC)
FluxboxLightweight window manager
sing-box1.13.3Proxy mode tunnel client
Git, tmux, zshCommon dev tools
Node.jsLTSJavaScript runtime