Browse Source

onion domain for voip

Bob Mottram 9 years ago
parent
commit
235cdcc9da
1 changed files with 12 additions and 1 deletions
  1. 12
    1
      src/freedombone

+ 12
- 1
src/freedombone View File

@@ -354,6 +354,7 @@ VOIP_SERVER_PASSWORD=
354 354
 VOIP_PORT=64738
355 355
 SIP_SERVER_PASSWORD=
356 356
 SIP_PORT=5060
357
+VOIP_ONION_PORT=8095
357 358
 
358 359
 # Location of VoIP database and configuration
359 360
 VOIP_DATABASE="mumble-server.sqlite"
@@ -9499,7 +9500,16 @@ function install_voip {
9499 9500
     sed -i 's|#imagemessagelength=.*|imagemessagelength=131072|g' /etc/mumble-server.ini
9500 9501
     sed -i 's|#allowhtml=.*|allowhtml=False|g' /etc/mumble-server.ini
9501 9502
     sed -i 's|allowhtml=.*|allowhtml=False|g' /etc/mumble-server.ini
9502
-    sed -i "s|port=.*|port=$VOIP_PORT|g" /etc/mumble-server.ini
9503
+
9504
+    VOIP_ONION_HOSTNAME=$(add_onion_service voip ${VOIP_PORT} ${VOIP_ONION_PORT})
9505
+    if [[ $ONION_ONLY != "no" ]]; then
9506
+        sed -i "s|port=.*|port=${VOIP_ONION_PORT}|g" /etc/mumble-server.ini
9507
+    else
9508
+        sed -i "s|port=.*|port=${VOIP_PORT}|g" /etc/mumble-server.ini
9509
+    fi
9510
+    if ! grep -q $"VoIP onion domain" $COMPLETION_FILE; then
9511
+        echo "VoIP onion domain:$VOIP_ONION_HOSTNAME" >> $COMPLETION_FILE
9512
+    fi
9503 9513
 
9504 9514
     systemctl restart mumble-server
9505 9515
 
@@ -9508,6 +9518,7 @@ function install_voip {
9508 9518
         echo '' >> /home/$MY_USERNAME/README
9509 9519
         echo $'VoIP Server' >> /home/$MY_USERNAME/README
9510 9520
         echo '===========' >> /home/$MY_USERNAME/README
9521
+        echo $"VoIP onion domain:$VOIP_ONION_HOSTNAME" >> /home/$MY_USERNAME/README
9511 9522
         echo $'VoIP server username: mumble-server' >> /home/$MY_USERNAME/README
9512 9523
         if [[ $SYSTEM_TYPE != "VARIANT_MESH" ]]; then
9513 9524
             echo $"VoIP server password: $VOIP_SERVER_PASSWORD" >> /home/$MY_USERNAME/README