diff --git a/CloudronPackages/Rathole/CloudronManifest.json b/CloudronPackages/Rathole/CloudronManifest.json new file mode 100644 index 0000000..a8bbc1d --- /dev/null +++ b/CloudronPackages/Rathole/CloudronManifest.json @@ -0,0 +1,32 @@ +{ + "id": "rathole", + "title": "Rathole", + "description": "A secure, stable, and high-performance reverse proxy for NAT traversal.", + "tagline": "Secure NAT traversal reverse proxy", + "icon": "https://cdn.cloudron.io/icons/rathole.svg", + "main": { + "type": "docker", + "image": "cloudron/base:4.2.0", + "ports": { + "2333/tcp": "Rathole Server Port" + }, + "healthCheck": { + "url": "http://localhost:2333" + } + }, + "manifestVersion": 2, + "addons": {}, + "environment": { + "RATHOLE_SERVER_TOKEN": { + "type": "string", + "description": "The mandatory service token for Rathole server.", + "required": true + }, + "RATHOLE_SERVER_PORT": { + "type": "string", + "description": "The port Rathole server will listen on. Default is 2333.", + "required": false, + "default": "2333" + } + } +} \ No newline at end of file diff --git a/CloudronPackages/Rathole/start.sh b/CloudronPackages/Rathole/start.sh new file mode 100644 index 0000000..e6a8db6 --- /dev/null +++ b/CloudronPackages/Rathole/start.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +set -euo pipefail + +# Set default port if not provided +: ${RATHOLE_SERVER_PORT:=2333} + +# Generate rathole.toml configuration file +cat < /app/data/rathole.toml +[server] +bind_addr = "0.0.0.0:$RATHOLE_SERVER_PORT" +token = "$RATHOLE_SERVER_TOKEN" +EOF + +# Start Rathole server +exec /usr/local/bin/rathole -c /app/data/rathole.toml