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

[RFC] docker/entrypoint.sh: Allow to load config/keys/passphrase from file #140

Open
wants to merge 1 commit into
base: staging
Choose a base branch
from
Open
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
24 changes: 24 additions & 0 deletions docker/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,28 @@ if [ -n "${POCKET_CORE_CONFIG}" ] ; then
echo "${POCKET_CORE_CONFIG}" > /home/app/.pocket/config/config.json
fi

# Allowing to distribute those files through a shared r/o volume for example
# (like Vault sidecar)

if [ -f "${POCKET_CORE_GENESIS_PATH}" ] ; then
cp -f ${POCKET_CORE_GENESIS_PATH} /home/app/.pocket/config/genesis.json
fi

if [ -f "${POCKET_CORE_CHAINS_PATH}" ] ; then
cp -f ${POCKET_CORE_CHAINS_PATH} /home/app/.pocket/config/chains.json
fi

if [ -f "${POCKET_CORE_CONFIG_PATH}" ] ; then
cp -f ${POCKET_CORE_CONFIG_PATH} /home/app/.pocket/config/config.json
fi

if [ -f "${POCKET_CORE_KEY_FILE}" ] ; then
export POCKET_CORE_KEY=$(cat ${POCKET_CORE_KEY_FILE} )
fi

if [ -f "${POCKET_CORE_PASSPHRASE_FILE}" ] ; then
export POCKET_CORE_PASSPHRASE=$(cat ${POCKET_CORE_PASSPHRASE_FILE} )
fi


/usr/bin/expect /home/app/command.sh $@