Browse Source

In onion only mode we don't need dynamic dns

Bob Mottram 9 years ago
parent
commit
5101d63653
1 changed files with 38 additions and 0 deletions
  1. 38
    0
      src/freedombone

+ 38
- 0
src/freedombone View File

1216
     fi
1216
     fi
1217
 }
1217
 }
1218
 
1218
 
1219
+function set_default_onion_domains {
1220
+    # If sites are only visible via Tor then for installation
1221
+    # purposes assign them some default domain names
1222
+    if [[ $ONION_ONLY == "no" ]]; then
1223
+        return
1224
+    fi
1225
+
1226
+    if [ $OWNCLOUD_DOMAIN_NAME ]; then
1227
+        OWNCLOUD_DOMAIN_NAME='owncloud.onion'
1228
+    fi
1229
+    if [ $MICROBLOG_DOMAIN_NAME ]; then
1230
+        MICROBLOG_DOMAIN_NAME='microblog.onion'
1231
+    fi
1232
+    if [ $FULLBLOG_DOMAIN_NAME ]; then
1233
+        FULLBLOG_DOMAIN_NAME='blog.onion'
1234
+    fi
1235
+    if [ $GIT_DOMAIN_NAME ]; then
1236
+        GIT_DOMAIN_NAME='git.onion'
1237
+    fi
1238
+    if [ $WIKI_DOMAIN_NAME ]; then
1239
+        WIKI_DOMAIN_NAME='wiki.onion'
1240
+    fi
1241
+    if [ $DEFAULT_DOMAIN_NAME ]; then
1242
+        DEFAULT_DOMAIN_NAME="${PROJECT_NAME}.onion"
1243
+    fi
1244
+}
1245
+
1219
 # check an individual domain name
1246
 # check an individual domain name
1220
 function test_domain_name {
1247
 function test_domain_name {
1221
     if [ $1 ]; then
1248
     if [ $1 ]; then
2939
 }
2966
 }
2940
 
2967
 
2941
 function create_freedns_updater {
2968
 function create_freedns_updater {
2969
+    if [[ $ONION_ONLY != "no" ]]; then
2970
+        return
2971
+    fi
2972
+
2942
     # currently inadyn doesn't work as expected with freeDNS, so this is a workaround
2973
     # currently inadyn doesn't work as expected with freeDNS, so this is a workaround
2943
     if grep -Fxq "create_freedns_updater" $COMPLETION_FILE; then
2974
     if grep -Fxq "create_freedns_updater" $COMPLETION_FILE; then
2944
         return
2975
         return
5628
 }
5659
 }
5629
 
5660
 
5630
 function add_ddns_domain {
5661
 function add_ddns_domain {
5662
+    if [[ $ONION_ONLY != "no" ]]; then
5663
+        return
5664
+    fi
5631
     if [ ! $CURRENT_DDNS_DOMAIN ]; then
5665
     if [ ! $CURRENT_DDNS_DOMAIN ]; then
5632
         echo $'ddns domain not specified'
5666
         echo $'ddns domain not specified'
5633
         exit 5638
5667
         exit 5638
8864
     if [[ $SYSTEM_TYPE == "$VARIANT_MESH" ]]; then
8898
     if [[ $SYSTEM_TYPE == "$VARIANT_MESH" ]]; then
8865
         return
8899
         return
8866
     fi
8900
     fi
8901
+    if [[ $ONION_ONLY != "no" ]]; then
8902
+        return
8903
+    fi
8867
 
8904
 
8868
     # update to the next commit
8905
     # update to the next commit
8869
     if [ -d $INSTALL_DIR/inadyn ]; then
8906
     if [ -d $INSTALL_DIR/inadyn ]; then
9340
 
9377
 
9341
 
9378
 
9342
 read_configuration
9379
 read_configuration
9380
+set_default_onion_domains
9343
 locale_setup
9381
 locale_setup
9344
 parse_args
9382
 parse_args
9345
 check_domains
9383
 check_domains