Browse Source

ssb tor integration

Bob Mottram 7 years ago
parent
commit
5c07267254
1 changed files with 14 additions and 6 deletions
  1. 14
    6
      src/freedombone-app-scuttlebot

+ 14
- 6
src/freedombone-app-scuttlebot View File

@@ -481,9 +481,19 @@ function install_scuttlebot {
481 481
         exit 73528
482 482
     fi
483 483
 
484
-    { echo '{';
485
-      echo "  \"host\": \"${DEFAULT_DOMAIN_NAME}\",";
486
-      echo "  \"port\": ${SCUTTLEBOT_PORT},";
484
+    SCUTTLEBOT_ONION_HOSTNAME=$(add_onion_service scuttlebot 80 ${SCUTTLEBOT_ONION_PORT})
485
+
486
+    if [[ "$ONION_ONLY" == 'no' ]]; then
487
+        { echo '{';
488
+          echo "  \"host\": \"${DEFAULT_DOMAIN_NAME}\",";
489
+          echo '  "tor-only": false,'; } > /etc/scuttlebot/.ssb/config
490
+    else
491
+        { echo '{';
492
+          echo "  \"host\": \"${SCUTTLEBOT_ONION_HOSTNAME}\",";
493
+          echo '  "tor-only": true,'; } > /etc/scuttlebot/.ssb/config
494
+    fi
495
+
496
+    { echo "  \"port\": ${SCUTTLEBOT_PORT},";
487 497
       echo '  "timeout": 30000,';
488 498
       echo '  "pub": true,';
489 499
       echo '  "local": true,';
@@ -498,15 +508,13 @@ function install_scuttlebot {
498 508
       echo '  "logging": {';
499 509
       echo '    "level": "error"';
500 510
       echo '  }';
501
-      echo '}'; } > /etc/scuttlebot/.ssb/config
511
+      echo '}'; } >> /etc/scuttlebot/.ssb/config
502 512
     chown scuttlebot:scuttlebot /etc/scuttlebot/.ssb/config
503 513
     systemctl restart scuttlebot.service
504 514
 
505 515
     firewall_add scuttlebot ${SCUTTLEBOT_PORT}
506 516
     firewall_add git_ssb ${GIT_SSB_PORT}
507 517
 
508
-
509
-    SCUTTLEBOT_ONION_HOSTNAME=$(add_onion_service scuttlebot 80 ${SCUTTLEBOT_ONION_PORT})
510 518
     scuttlebot_git_setup
511 519
     git_ssb_script
512 520