Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(entrypoint): environment variables (#307) #313

Merged
merged 1 commit into from
Jul 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,20 +57,23 @@ export_mnemonic() {
EMPTY_STRING=""
PASSWORD="${PASSWORD:-$EMPTY_STRING}"

# gather user's args
ARGS=""

# set tofnd root. TOFND_HOME can be set to a different path by the user.
TOFND_HOME=${TOFND_HOME:-"./.tofnd"}
IMPORT_PATH=$TOFND_HOME/import
EXPORT_PATH=$TOFND_HOME/export

echo "Using tofnd root:" $TOFND_HOME

# gather user's args

# add '--no-password' and '--unsafe' flags to args if enabled
ARGS=${NOPASSWORD:+"${ARGS} --no-password"}
ARGS=${NOPASSWORD:+"--no-password"}
# add '--unsafe' flag to args if enabled
ARGS=${UNSAFE:+"${ARGS} --unsafe"}
ARGS+=${UNSAFE:+" --unsafe"}
# add '--address' flag to args if enabled
ARGS+=${ADDRESS:+" --address ${ADDRESS}"}
# add '--port' flag to args if enabled
ARGS+=${PORT:+" --port ${PORT}"}

# check mnemonic arg
if [ -n "${MNEMONIC_CMD}" ]; then \
Expand Down Expand Up @@ -110,7 +113,7 @@ if [ -n "${MNEMONIC_CMD}" ]; then \
esac

echo "Using existing mnemonic ..."
ARGS="${ARGS} -m existing"
ARGS+=" -m existing"
fi

# execute tofnd daemon
Expand Down