udphole

Basic UDP wormhole proxy
git clone git://git.finwo.net/app/udphole
Log | Files | Refs | README | LICENSE

commit dbb36807a4481ac1e804b81b88e737e032e9d590
parent 2f471cb77188c26788e6b66f19f612d0b3f68968
Author: Robin Bron <robin.bron@yourhosting.nl>
Date:   Fri,  6 Mar 2026 18:15:39 +0100

Update docs and entrypoint to reflect correct usage

Diffstat:
MDOCKER.md | 17++++++++---------
MMakefile | 2+-
Mdocker-compose.yml | 4++--
Mentrypoint.sh | 8++------
4 files changed, 13 insertions(+), 18 deletions(-)

diff --git a/DOCKER.md b/DOCKER.md @@ -8,6 +8,8 @@ Run udphole as a Docker container. docker run -p 6379:6379 -p 7000-7999:7000-7999/udp finwo/udphole ``` +The entrypoint always adds `--no-daemonize` to ensure the container stays running. + ## Environment Variables | Variable | Default | Description | @@ -17,12 +19,9 @@ docker run -p 6379:6379 -p 7000-7999:7000-7999/udp finwo/udphole | `LOG_LEVEL` | `info` | Log verbosity: fatal, error, warn, info, debug, trace | | `API_ADMIN_USER` | `admin` | Username for admin user | | `API_ADMIN_PASS` | `supers3cret` | Password for admin user | -| `CLUSTER` | | Comma-separated list of cluster node names (enables cluster mode) | -| `CLUSTER_<NAME>` | | Connection string for cluster node `<NAME>` (e.g., `tcp://user:pass@host:port`) | - -## Configuration +| `CLUSTER` | | Comma-separated list of cluster node addresses (enables cluster mode, e.g., `tcp://user:pass@host1:6379,tcp://user:pass@host2:6379`) | -### Auto-generated Config +## Auto-generated Config If no config file is mounted, the container auto-generates `/etc/udphole.conf` from environment variables: @@ -46,6 +45,8 @@ docker run -p 6379:6379 -p 7000-7999:7000-7999/udp \ finwo/udphole ``` +Note: Even with cluster fields defined in a mounted config, you must set `CLUSTER` to any value to run in cluster mode (the entrypoint uses this to decide between `daemon` and `cluster` commands). + ### Listen Address Formats The `listen` directive supports multiple addresses: @@ -71,13 +72,11 @@ listen = unix:///tmp/udphole.sock ## Cluster Mode -To run in cluster mode, set the `CLUSTER` environment variable and define node addresses: +To run in cluster mode, set the `CLUSTER` environment variable with comma-separated node addresses: ```bash docker run -p 6379:6379 -p 7000-7999:7000-7999/udp \ - -e CLUSTER=node1,node2 \ - -e CLUSTER_NODE1=tcp://user:pass@192.168.1.10:6379 \ - -e CLUSTER_NODE2=tcp://user:pass@192.168.1.11:6379 \ + -e CLUSTER="tcp://user:pass@192.168.1.10:6379,tcp://user:pass@192.168.1.11:6379" \ finwo/udphole ``` diff --git a/Makefile b/Makefile @@ -7,7 +7,7 @@ SRC:= # UNAME_SYSTEM=$(call lc,$(shell uname -s)) BIN?=udphole -VERSION?=1.3.7 +VERSION?=1.3.8 CC:=gcc CPP:=g++ diff --git a/docker-compose.yml b/docker-compose.yml @@ -9,8 +9,8 @@ services: ports: - "${API_PORT:-6379}:${API_PORT:-6379}" - "7000-7999:7000-7999/udp" - volumes: - - ./udphole.conf:/etc/udphole.conf:ro + # volumes: + # - ./udphole.conf:/etc/udphole.conf:ro environment: - API_PORT=6379 - UDP_PORTS=7000-7999 diff --git a/entrypoint.sh b/entrypoint.sh @@ -16,12 +16,8 @@ else echo "listen = :${API_PORT:-6379}" if [ -n "$CLUSTER" ]; then - for name in $(echo "$CLUSTER" | tr ',' ' '); do - env_var="CLUSTER_$name" - eval "value=\$$env_var" - if [ -n "$value" ]; then - echo "cluster = $value" - fi + for addr in $(echo "$CLUSTER" | tr ',' ' '); do + echo "cluster = $addr" done fi