From 6a5180a31a2b25d3f4a040f7be42e0fa5f54a88f Mon Sep 17 00:00:00 2001 From: Tom Marble Date: Thu, 28 Mar 2019 17:07:20 -0500 Subject: [PATCH] Resets secret store config on startup Now networks/secret-store/config/config.toml may be mutated, but is always reset when running start_ocean.sh Fixes #126 Signed-off-by: Tom Marble --- .gitignore | 14 +++++++++++++- .../config/{config.toml => config.toml.save} | 0 start_ocean.sh | 10 +++++++++- 3 files changed, 22 insertions(+), 2 deletions(-) rename networks/secret-store/config/{config.toml => config.toml.save} (100%) diff --git a/.gitignore b/.gitignore index eec7f1e..c6303d3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,17 @@ -.idea/ +# Project specific artifacts/ ganache-db/ + +# IDE side effects +.idea/ + +# Emacs +*~ + +# mutable secret store config (Issue #126) +networks/secret-store/config/config.toml + +# Mac OS Filesystem artifacts .DS_Store **/.DS_Store +._* diff --git a/networks/secret-store/config/config.toml b/networks/secret-store/config/config.toml.save similarity index 100% rename from networks/secret-store/config/config.toml rename to networks/secret-store/config/config.toml.save diff --git a/start_ocean.sh b/start_ocean.sh index 07c8f9c..d97a69e 100755 --- a/start_ocean.sh +++ b/start_ocean.sh @@ -74,6 +74,14 @@ function show_banner { echo "" } +function configure_secret_store { + # restore default secret store config (Issue #126) + if [ -e "$DIR/networks/secret-store/config/config.toml.save" ]; then + cp "$DIR/networks/secret-store/config/config.toml.save" \ + "$DIR/networks/secret-store/config/config.toml" + fi +} + function check_if_owned_by_root { if [ -d "$OCEAN_HOME" ]; then uid=$(ls -nd "$OCEAN_HOME" | awk '{print $3;}') @@ -256,6 +264,7 @@ while :; do ;; *) printf $COLOR_Y'Starting Ocean...\n\n'$COLOR_RESET + configure_secret_store [ ! -z ${NODE_COMPOSE_FILE} ] && COMPOSE_FILES+=" -f ${NODE_COMPOSE_FILE}" [ ${FORCEPULL} = "true" ] && docker-compose $DOCKER_COMPOSE_EXTRA_OPTS --project-name=$PROJECT_NAME $COMPOSE_FILES pull eval docker-compose $DOCKER_COMPOSE_EXTRA_OPTS --project-name=$PROJECT_NAME $COMPOSE_FILES up --remove-orphans @@ -263,4 +272,3 @@ while :; do esac shift done -