Skip to content

Commit

Permalink
fix(docker): add init step to copy passport keys from external storag…
Browse files Browse the repository at this point in the history
…e (i.e. kubernetes secrets)
  • Loading branch information
tuxpiper committed Jun 29, 2020
1 parent 6a4aa00 commit 175bfc1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion docker/common.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
#!/bin/bash
set -e

function copy_dot_env() {
function copy_external_config() {
if [ -n "$DOTENV_PATH" ] && [ -f "$DOTENV_PATH" ]; then
if [ -f .env ]; then
echo "NOTICE: replacing .env file with contents from $DOTENV_PATH"
fi
cat $DOTENV_PATH > .env
fi
if [ -n "$PASSPORT_KEYS_PATH" ] && [ -d "$PASSPORT_KEYS_PATH" ] && [ -e "$PASSPORT_KEYS_PATH/oauth-private.key" ] ; then
if [ -e ./storage/passport/oauth-private.key ]; then
echo "NOTICE: replacing passport key files with those from $PASSPORT_KEYS_PATH"
fi
cp -f $PASSPORT_KEYS_PATH/*.key ./storage/passport/
fi
}

function check_vols_src() {
Expand Down
2 changes: 1 addition & 1 deletion docker/run.run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ fi

set -e

copy_dot_env
copy_external_config
touch_logs

# Dump lumen disk logs if something fails
Expand Down

0 comments on commit 175bfc1

Please sign in to comment.