mirror of
https://github.com/status-im/nim-dagger.git
synced 2025-01-09 14:15:41 +00:00
update docker files
- remove Disc_ip env - update CODE_NAT parsing logic
This commit is contained in:
parent
b387b6aff4
commit
beae8a4283
@ -139,8 +139,6 @@ type
|
||||
abbr: "i"
|
||||
name: "listen-addrs" }: seq[MultiAddress]
|
||||
|
||||
# TODO: change this once we integrate nat support
|
||||
|
||||
nat* {.
|
||||
desc: "Specify method to use for determining public address. " &
|
||||
"Must be one of: any, none, upnp, pmp, extip:<IP>"
|
||||
|
@ -9,7 +9,6 @@ services:
|
||||
- CODEX_DATA_DIR=${CODEX_DATA_DIR:-/datadir}
|
||||
- CODEX_LISTEN_ADDRS=${CODEX_LISTEN_ADDRS:-/ip4/0.0.0.0/tcp/2345}
|
||||
- CODEX_NAT=${CODEX_NAT:-10.0.0.10}
|
||||
- CODEX_DISC_IP=${CODEX_DISC_IP:-0.0.0.0}
|
||||
- CODEX_DISC_PORT=${CODEX_DISC_PORT:-8090}
|
||||
- CODEX_NET_PRIVKEY=${CODEX_NET_PRIVKEY:-key}
|
||||
# - CODEX_BOOTSTRAP_NODE=${CODEX_BOOTSTRAP_NODE}
|
||||
|
@ -12,7 +12,7 @@ fi
|
||||
# Parameters
|
||||
if [[ -z "${CODEX_NAT}" ]]; then
|
||||
if [[ "${NAT_IP_AUTO}" == "true" && -z "${NAT_PUBLIC_IP_AUTO}" ]]; then
|
||||
export CODEX_NAT=$(hostname --ip-address)
|
||||
export CODEX_NAT="extip:$(hostname --ip-address)"
|
||||
echo "Private: CODEX_NAT=${CODEX_NAT}"
|
||||
elif [[ -n "${NAT_PUBLIC_IP_AUTO}" ]]; then
|
||||
# Run for 60 seconds if fail
|
||||
@ -20,9 +20,10 @@ if [[ -z "${CODEX_NAT}" ]]; then
|
||||
SECONDS=0
|
||||
SLEEP=5
|
||||
while (( SECONDS < WAIT )); do
|
||||
export CODEX_NAT=$(curl -s -f -m 5 "${NAT_PUBLIC_IP_AUTO}")
|
||||
IP=$(curl -s -f -m 5 "${NAT_PUBLIC_IP_AUTO}")
|
||||
# Check if exit code is 0 and returned value is not empty
|
||||
if [[ $? -eq 0 && -n "${CODEX_NAT}" ]]; then
|
||||
if [[ $? -eq 0 && -n "${IP}" ]]; then
|
||||
export CODEX_NAT="extip:${IP}"
|
||||
echo "Public: CODEX_NAT=${CODEX_NAT}"
|
||||
break
|
||||
else
|
||||
|
Loading…
x
Reference in New Issue
Block a user