Selaa lähdekoodia

Pleroma option to disable routing through tor

Bob Mottram 7 vuotta sitten
vanhempi
commit
a63785a9ca
1 muutettua tiedostoa jossa 23 lisäystä ja 4 poistoa
  1. 23
    4
      src/freedombone-app-pleroma

+ 23
- 4
src/freedombone-app-pleroma Näytä tiedosto

733
             enablechatstr=$'Disable chat system'
733
             enablechatstr=$'Disable chat system'
734
         fi
734
         fi
735
 
735
 
736
+        pleromatorstr=$'Enable routing through Tor for onion addresses'
737
+        if grep -q '9050' $pleroma_secret; then
738
+            pleromatorstr=$'Disable routing through Tor'
739
+        fi
740
+
736
         W=(1 $"Set a background image"
741
         W=(1 $"Set a background image"
737
            2 $"Set the title"
742
            2 $"Set the title"
738
            3 $"Disable new account registrations"
743
            3 $"Disable new account registrations"
739
            4 $"Add a custom emoji"
744
            4 $"Add a custom emoji"
740
            5 $"Set post expiry period (currently $PLEROMA_EXPIRE_MONTHS months)"
745
            5 $"Set post expiry period (currently $PLEROMA_EXPIRE_MONTHS months)"
741
-           6 "$enablechatstr")
746
+           6 "$enablechatstr"
747
+           7 "$pleromatorstr")
742
 
748
 
743
         # shellcheck disable=SC2068
749
         # shellcheck disable=SC2068
744
-        selection=$(dialog --backtitle $"Freedombone Administrator Control Panel" --title $"Pleroma" --menu $"Choose an operation, or ESC to exit:" 13 60 6 "${W[@]}" 3>&2 2>&1 1>&3)
750
+        selection=$(dialog --backtitle $"Freedombone Administrator Control Panel" --title $"Pleroma" --menu $"Choose an operation, or ESC to exit:" 14 60 7 "${W[@]}" 3>&2 2>&1 1>&3)
745
 
751
 
746
         if [ ! "$selection" ]; then
752
         if [ ! "$selection" ]; then
747
             break
753
             break
759
                    pleroma_enable_chat true
765
                    pleroma_enable_chat true
760
                fi
766
                fi
761
                ;;
767
                ;;
768
+            7) if grep -q '9050' $pleroma_secret; then
769
+                   pleroma_disable_tor
770
+               else
771
+                   pleroma_enable_tor
772
+               fi
773
+               ;;
762
         esac
774
         esac
763
     done
775
     done
764
 }
776
 }
765
 
777
 
766
-function pleroma_upgrade_tor {
778
+function pleroma_disable_tor {
779
+    if grep -q '9050' $pleroma_secret; then
780
+        sed -i '/9050/d' $pleroma_secret
781
+        pleroma_recompile
782
+    fi
783
+}
784
+
785
+function pleroma_enable_tor {
767
     pleroma_tor_update=
786
     pleroma_tor_update=
768
 
787
 
769
     if ! grep -q '{:socks5, :localhost, 9050}' $pleroma_secret; then
788
     if ! grep -q '{:socks5, :localhost, 9050}' $pleroma_secret; then
806
         create_pleroma_blocklist
825
         create_pleroma_blocklist
807
     fi
826
     fi
808
 
827
 
809
-    pleroma_upgrade_tor
828
+    #pleroma_enable_tor
810
 
829
 
811
     CURR_PLEROMA_COMMIT=$(get_completion_param "pleroma commit")
830
     CURR_PLEROMA_COMMIT=$(get_completion_param "pleroma commit")
812
     if [[ "$CURR_PLEROMA_COMMIT" == "$PLEROMA_COMMIT" ]]; then
831
     if [[ "$CURR_PLEROMA_COMMIT" == "$PLEROMA_COMMIT" ]]; then