#!/bin/bash set -euo pipefail # Rathole runs in SERVER mode on Cloudron: the box has the public IP and # rathole clients behind NAT dial in on the control port (container port # 2333, bridged 1:1 by default). Tunneled services bind container ports # 5200-5299, which Cloudron exposes in sequence from the SERVICE_PORT # value chosen at install time. # # Rathole has no HTTP interface of its own, so a tiny static status page # is served on the Cloudron HTTP port. That gives the platform a health # check endpoint and gives the admin an auth-proxied landing page # (httpAuth.type = proxy gates it at the platform edge). export RATHOLE_CONFIG="/app/data/server.toml" if [[ ! -f "${RATHOLE_CONFIG}" ]]; then default_token="$(openssl rand -hex 24)" cat > "${RATHOLE_CONFIG}" <