Skip to content

Commit

Permalink
Attempt epic hack to fix local REST server issues (#177)
Browse files Browse the repository at this point in the history
  • Loading branch information
the-frey authored Apr 5, 2022
1 parent cfd9b58 commit 968074f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions docker/setup_junod.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,14 @@ else
fi

APP_TOML_CONFIG="$HOME"/.juno/config/app.toml
APP_TOML_CONFIG_NEW="$HOME"/.juno/config/app_new.toml
CONFIG_TOML_CONFIG="$HOME"/.juno/config/config.toml
if [ -n $UNSAFE_CORS ]; then
echo "Unsafe CORS set... updating app.toml and config.toml"
# sorry about this bit, but toml is rubbish for structural editing
sed -n '1h;1!H;${g;s/# Enable defines if the API server should be enabled.\nenable = false/enable = true/;p;}' "$APP_TOML_CONFIG" > "$APP_TOML_CONFIG_NEW"
mv "$APP_TOML_CONFIG_NEW" "$APP_TOML_CONFIG"
# ...and breathe
sed -i "s/enabled-unsafe-cors = false/enabled-unsafe-cors = true/" "$APP_TOML_CONFIG"
sed -i "s/cors_allowed_origins = \[\]/cors_allowed_origins = \[\"\*\"\]/" "$CONFIG_TOML_CONFIG"
fi
Expand Down

0 comments on commit 968074f

Please sign in to comment.