Parcourir la source

Avoid mesh conflicts between cryptpad and app download site

Bob Mottram il y a 7 ans
Parent
révision
33fe1d91d8
1 fichiers modifiés avec 13 ajouts et 0 suppressions
  1. 13
    0
      src/freedombone-mesh-batman

+ 13
- 0
src/freedombone-mesh-batman Voir le fichier

@@ -261,6 +261,11 @@ function mesh_create_app_downloads_page {
261 261
     if [ ! -d /var/www/html ]; then
262 262
         return
263 263
     fi
264
+    # Don't go straight to cryptpad when navigating to the peer's IP address
265
+    if [ -L /etc/nginx/sites-enabled/cryptpad ]; then
266
+        rm /etc/nginx/sites-enabled/cryptpad
267
+        systemctl restart nginx
268
+    fi
264 269
     cp /root/$PROJECT_NAME/website/EN/meshindex.html /var/www/html/index.html
265 270
     if [ ! -f /var/www/html/ssb.apk ]; then
266 271
         cp /root/$PROJECT_NAME/image_build/mesh_apps/ssb.apk /var/www/html/ssb.apk
@@ -361,6 +366,14 @@ function start {
361 366
         systemctl enable hostapd
362 367
         systemctl restart hostapd
363 368
         mesh_create_app_downloads_page
369
+    else
370
+        # Recreate the cryptpad symlink
371
+        if [ -f /etc/nginx/sites-available/cryptpad ]; then
372
+            if [ ! -L /etc/nginx/sites-enabled/cryptpad ]; then
373
+                ln -s /etc/nginx/sites-available/cryptpad /etc/nginx/sites-enabled/cryptpad
374
+                systemctl restart nginx
375
+            fi
376
+        fi
364 377
     fi
365 378
 
366 379
     iptables -A INPUT -p icmp --icmp-type echo-request -j ACCEPT