From 96459188c91a78ece4ed876889e373f962691fd6 Mon Sep 17 00:00:00 2001 From: Slava <20563034+veaceslavdoina@users.noreply.github.com> Date: Sun, 3 Nov 2024 08:51:57 +0200 Subject: [PATCH] Add ETH_PRIVATE_KEY to Docker entrypoint (#982) * Add ETH_PRIVATE_KEY to Docker entrypoint * Add deprecation warning for PRIV_KEY variable Signed-off-by: Slava <20563034+veaceslavdoina@users.noreply.github.com> --------- Signed-off-by: Slava <20563034+veaceslavdoina@users.noreply.github.com> --- docker/docker-entrypoint.sh | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/docker/docker-entrypoint.sh b/docker/docker-entrypoint.sh index 325025c9..c824c7c6 100644 --- a/docker/docker-entrypoint.sh +++ b/docker/docker-entrypoint.sh @@ -45,12 +45,16 @@ fi # If marketplace is enabled from the testing environment, # The file has to be written before Codex starts. -if [ -n "${PRIV_KEY}" ]; then - echo ${PRIV_KEY} > "private.key" - chmod 600 "private.key" - export CODEX_ETH_PRIVATE_KEY="private.key" - echo "Private key set" -fi +for key in PRIV_KEY ETH_PRIVATE_KEY; do + keyfile="private.key" + if [[ -n "${!key}" ]]; then + [[ "${key}" == "PRIV_KEY" ]] && echo "PRIV_KEY variable is deprecated and will be removed in the next releases, please use ETH_PRIVATE_KEY instead!" + echo "${!key}" > "${keyfile}" + chmod 600 "${keyfile}" + export CODEX_ETH_PRIVATE_KEY="${keyfile}" + echo "Private key set" + fi +done # Circuit downloader # cirdl [circuitPath] [rpcEndpoint] [marketplaceAddress]