Add entrypoint script for configurable Reticulum networking in Docker

Replaces static CMD with an entrypoint that generates RNS config from
environment variables (RNS_TCP_HOST/PORT), enabling TCP transport for
environments without LAN auto-discovery (e.g. Docker on macOS).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Derick Phan 2026-03-26 18:44:26 -07:00
parent ddaba43710
commit 5f8863ce77
No known key found for this signature in database
4 changed files with 47 additions and 2 deletions

39
entrypoint.sh Executable file
View file

@ -0,0 +1,39 @@
#!/bin/sh
# Generate Reticulum config with optional TCP peer
# Set RNS_TCP_HOST and RNS_TCP_PORT env vars to connect to a remote instance
CONFIG_DIR="/data/.reticulum"
CONFIG_FILE="$CONFIG_DIR/config"
mkdir -p "$CONFIG_DIR"
if [ ! -f "$CONFIG_FILE" ]; then
cat > "$CONFIG_FILE" <<EOF
[reticulum]
enable_transport = False
share_instance = Yes
[logging]
loglevel = 4
[interfaces]
[[Default Interface]]
type = AutoInterface
enabled = Yes
EOF
if [ -n "$RNS_TCP_HOST" ]; then
RNS_TCP_PORT="${RNS_TCP_PORT:-4242}"
cat >> "$CONFIG_FILE" <<EOF
[[TCP Link]]
type = TCPClientInterface
enabled = yes
target_host = $RNS_TCP_HOST
target_port = $RNS_TCP_PORT
EOF
fi
fi
export RNS_CONFIG_DIR="$CONFIG_DIR"
exec python app.py