Skip to content

Commit 08ad9cc

Browse files
authored
Update setup_rathole.sh
1 parent c70e018 commit 08ad9cc

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

docs/setup_rathole.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,13 +90,22 @@ sudo systemctl daemon-reload
9090
sudo systemctl enable ratholes@aquadx --now
9191
sudo systemctl restart ratholes@aquadx
9292

93+
# Ask the user to input the localhost
94+
echo "Please input the host that the rathole server is running on (e.g. euro.prox.aquadx.net):"
95+
read -r host
96+
# Check if the host is empty
97+
if [ -z "$host" ]; then
98+
echo "Host cannot be empty"
99+
exit 1
100+
fi
101+
93102
# Add to caddyfile if the "# Managed by setup_rathole.sh script" line is not found
94103
if ! grep -q "# Managed by setup_rathole.sh script" /etc/caddy/Caddyfile; then
95104
cat <<EOF >> /etc/caddy/Caddyfile
96105
# Managed by setup_rathole.sh script
97106
http:// {
98107
reverse_proxy localhost:8092 {
99-
header_up AllNet-Forwarded-From "euro.prox.aquadx.net"
108+
header_up AllNet-Forwarded-From "$host"
100109
}
101110
}
102111
# !Managed

0 commit comments

Comments
 (0)