From 2eb28bd73111a77405cd58e9c5e50d32ead3d89e Mon Sep 17 00:00:00 2001 From: Slava <20563034+veaceslavdoina@users.noreply.github.com> Date: Wed, 26 Feb 2025 16:58:49 +0200 Subject: [PATCH] feat: adjust package to codex 0.2.0 --- codex-node/docker-entrypoint.sh | 7 ++++--- setup-wizard.yml | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/codex-node/docker-entrypoint.sh b/codex-node/docker-entrypoint.sh index 24b6d73..d21320f 100644 --- a/codex-node/docker-entrypoint.sh +++ b/codex-node/docker-entrypoint.sh @@ -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 diff --git a/setup-wizard.yml b/setup-wizard.yml index ba8569f..8b0d48a 100644 --- a/setup-wizard.yml +++ b/setup-wizard.yml @@ -109,8 +109,8 @@ fields: service: codex-node title: CODEX_NAT description: >- - Public IP address to announce behind a NAT. - pattern: "^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]?|0).){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]?|0)$" + Specify method to use for determining public address. Must be one of: `any`, `none`, `upnp`, `pmp`, `extip:`, default = `any`. Check the [docs](https://docs.codex.storage/learn/run#nat-configuration) for more details. + pattern: "^(any|none|upnp|pmp|extip:((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]?|0).){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]?|0))$" patternErrorMessage: Must be a valid IP address required: true if: { "IP_MODE": { "enum": ["manual"] } }