Add public ip resolution to bedrock-entry.sh (#687)
This commit is contained in:
1 parent
d1d4b77e31
commit
bfa71eeea8
2 files changed
+11
No files matched your search
@@ -445,6 +445,14 @@ if [[ -n "$ALLOW_LIST_USERS" || -n "$WHITE_LIST_USERS" ]]; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ "$SERVER_UDP_PORTS" == *"<public_ip>"* ]]; then
|
||||||
|
echo "Replacing <public_ip> in $SERVER_UDP_PORTS"
|
||||||
|
public_ip=$(curl -s ifconfig.me)
|
||||||
|
echo "Public IP resolved to: $public_ip"
|
||||||
|
SERVER_UDP_PORTS="${SERVER_UDP_PORTS//<public_ip>/$public_ip}"
|
||||||
|
export SERVER_UDP_PORTS
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ -n "$VARIABLES" ]]; then
|
if [[ -n "$VARIABLES" ]]; then
|
||||||
echo "Setting variables"
|
echo "Setting variables"
|
||||||
mkdir -p config/default
|
mkdir -p config/default
|
||||||
|
|||||||
@@ -9,6 +9,9 @@ services:
|
|||||||
# Advertised mapping behind Docker bridge / extra NAT: <reachable-ip>:external-udp:internal-udp
|
# Advertised mapping behind Docker bridge / extra NAT: <reachable-ip>:external-udp:internal-udp
|
||||||
# (IPv4 or IPv6 literal, not a hostname)
|
# (IPv4 or IPv6 literal, not a hostname)
|
||||||
# SERVER_UDP_PORTS: "<reachable-ip>:19140-19155:19140-19155"
|
# SERVER_UDP_PORTS: "<reachable-ip>:19140-19155:19140-19155"
|
||||||
|
# you may use the literal string <public_ip>, which will be replaced with your public ip from
|
||||||
|
# curl ifconfig.me on startup
|
||||||
|
# SERVER_UDP_PORTS: "<public_ip>:19140-19155:19140-19155"
|
||||||
ports:
|
ports:
|
||||||
- "19132:19132/tcp"
|
- "19132:19132/tcp"
|
||||||
- "19140-19155:19140-19155/udp"
|
- "19140-19155:19140-19155/udp"
|
||||||
|
|||||||
Reference in new issue
Block a user