From adcfed05558dfa1d32d9257bfe161008107fb512 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 23 Apr 2018 11:33:02 +0100 Subject: [PATCH] Remove proxy entry from main pleroma config --- src/freedombone-app-pleroma | 31 +++++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/src/freedombone-app-pleroma b/src/freedombone-app-pleroma index 350bb901..5b17585f 100755 --- a/src/freedombone-app-pleroma +++ b/src/freedombone-app-pleroma @@ -726,6 +726,32 @@ function configure_interactive_pleroma { done } +function pleroma_upgrade_tor { + pleroma_tor_update= + + if ! grep -q '9050' $pleroma_secret; then + pleroma_tor_update=1 + fi + + if ! grep -q '# config :pleroma, :http, proxy_url:' $PLEROMA_DIR/config/config.exs; then + pleroma_tor_update=1 + fi + + if [ ! $pleroma_tor_update ]; then + return + fi + + if ! grep -q '9050' $pleroma_secret; then + sed -i '/url: /aconfig :pleroma, :http, proxy_url: "127.0.0.1:9050"' $pleroma_secret + fi + + if ! grep -q '# config :pleroma, :http, proxy_url:' $PLEROMA_DIR/config/config.exs; then + sed -i 's|config :pleroma, :http, proxy_url:|# config :pleroma, :http, proxy_url:|g' $PLEROMA_DIR/config/config.exs + fi + + pleroma_recompile +} + function upgrade_pleroma { read_config_param PLEROMA_DOMAIN_NAME read_config_param PLEROMA_EXPIRE_MONTHS @@ -740,10 +766,7 @@ function upgrade_pleroma { create_pleroma_blocklist fi - if ! grep -q '9050' $pleroma_secret; then - sed -i '/url: /aconfig :pleroma, :http, proxy_url: "127.0.0.1:9050"' $pleroma_secret - pleroma_recompile - fi + pleroma_upgrade_tor CURR_PLEROMA_COMMIT=$(get_completion_param "pleroma commit") if [[ "$CURR_PLEROMA_COMMIT" == "$PLEROMA_COMMIT" ]]; then