Egg Repository

Pterodactyl Community Egg Repository

Rathole

A lightweight and high-performance reverse proxy for NAT traversal, written in Rust. An alternative to frp and ngrok.

Read Me

Rathole

A secure, stable and high-performance reverse proxy for NAT traversal, written in Rust

rathole, like frp and ngrok, can help to expose the service on the device behind the NAT to the Internet, via a server with a public IP.

This egg only includes server side of rathole

Please refer to https://github.com/rapiz1/rathole for more information about rathole

Yolks
NameTag
ghcr.io/ptero-eggs/yolks:rust_latestghcr.io/ptero-eggs/yolks:rust_latest
Variables
NameDescriptionEnvironment VariableDefault ValueUser ViewableUser Editable
VersionVERSIONlatestYesYes
SecretYour random tokenTOKENYesYes
Install Script
#!/bin/bash

## get release info and download links
mkdir -p /mnt/server
cd /mnt/server

LATEST_JSON=$(curl --silent "https://api.github.com/repos/rapiz1/rathole/releases/latest")
RELEASES=$(curl --silent "https://api.github.com/repos/rapiz1/rathole/releases")
ARCH=$([[ "$(uname -m)" == "x86_64" ]] && echo "amd64" || echo "aarch64")

if ["${ARCH}" == "aarch64"]; then
    MATCH=rathole-aarch64-unknown-linux-musl.zip
else
    MATCH=rathole-x86_64-unknown-linux-gnu.zip
fi

if [ -z "${VERSION}" ] || [ "${VERSION}" == "latest" ]; then
    DOWNLOAD_URL=$(echo ${LATEST_JSON} | jq .assets | jq -r .[].browser_download_url | grep -i ${MATCH})
else
    VERSION_CHECK=$(echo ${RELEASES} | jq -r --arg VERSION "${VERSION}" '.[] | select(.tag_name==$VERSION) | .tag_name')
    if [ "${VERSION}" == "${VERSION_CHECK}" ]; then
        DOWNLOAD_URL=$(echo ${RELEASES} | jq -r --arg VERSION "${VERSION}" '.[] | select(.tag_name==$VERSION) | .assets[].browser_download_url' | grep -i ${MATCH})
    else
        echo -e "defaulting to latest release"
        DOWNLOAD_URL=$(echo ${LATEST_JSON} | jq .assets | jq -r .[].browser_download_url)
    fi
fi

echo "Download url: ${DOWNLOAD_URL}"
curl -ssL -o rathole.zip ${DOWNLOAD_URL}
unzip rathole.zip
rm rathole.zip
touch server.toml

printf "[server]\nbind_addr=\"0.0.0.0:${SERVER_PORT}\"\n\n[server.services.test]\ntoken=\"${TOKEN}\"\nbind_addr=\"0.0.0.0:${SERVER_PORT}\"" > server.toml
chmod +x rathole

## install end
echo "-----------------------------------------"
echo "Installation completed..."
echo "-----------------------------------------"