Compare commits
2 Commits
4511311565
...
110d22de87
Author | SHA1 | Date | |
---|---|---|---|
110d22de87 | |||
030ba67335 |
32
CloudronPackages/Rathole/CloudronManifest.json
Normal file
32
CloudronPackages/Rathole/CloudronManifest.json
Normal file
@@ -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"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
32
CloudronPackages/Rathole/Dockerfile
Normal file
32
CloudronPackages/Rathole/Dockerfile
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
FROM cloudron/base:4.2.0
|
||||||
|
|
||||||
|
# Install necessary tools for downloading and unzipping
|
||||||
|
RUN apt-get update && apt-get install -y \
|
||||||
|
curl \
|
||||||
|
unzip \
|
||||||
|
--no-install-recommends && \
|
||||||
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
# Download and extract Rathole
|
||||||
|
ARG RATHOLE_VERSION=v0.5.0
|
||||||
|
ARG ARCH=x86_64-unknown-linux-gnu
|
||||||
|
ARG FILENAME=rathole-${ARCH}.zip
|
||||||
|
ARG DOWNLOAD_URL=https://github.com/rathole-org/rathole/releases/download/${RATHOLE_VERSION}/${FILENAME}
|
||||||
|
|
||||||
|
RUN curl -L ${DOWNLOAD_URL} -o /tmp/${FILENAME} && \
|
||||||
|
unzip /tmp/${FILENAME} -d /tmp/rathole && \
|
||||||
|
mv /tmp/rathole/rathole /usr/local/bin/rathole && \
|
||||||
|
rm -rf /tmp/${FILENAME} /tmp/rathole
|
||||||
|
|
||||||
|
# Create a directory for configuration
|
||||||
|
RUN mkdir -p /app/data
|
||||||
|
|
||||||
|
# Set permissions
|
||||||
|
RUN chmod +x /usr/local/bin/rathole
|
||||||
|
|
||||||
|
WORKDIR /app/data
|
||||||
|
|
||||||
|
# Expose the default Rathole server port
|
||||||
|
EXPOSE 2333
|
||||||
|
|
||||||
|
CMD ["/usr/local/bin/rathole", "-c", "/app/data/rathole.toml"]
|
16
CloudronPackages/Rathole/start.sh
Normal file
16
CloudronPackages/Rathole/start.sh
Normal file
@@ -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 <<EOF > /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
|
Reference in New Issue
Block a user