A lightweight and high-performance reverse proxy for NAT traversal, written in Rust. An alternative to frp and ngrok.
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.
Please refer to https://github.com/rapiz1/rathole for more information about rathole
Name | Tag |
---|---|
ghcr.io/ptero-eggs/yolks:rust_latest | ghcr.io/ptero-eggs/yolks:rust_latest |
Name | Description | Environment Variable | Default Value | User Viewable | User Editable |
---|---|---|---|---|---|
Version | VERSION | latest | Yes | Yes | |
Secret | Your random token | TOKEN | Yes | Yes |
#!/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 "-----------------------------------------"