Parcourir la source

updates after restoring GS/pA

Bob Mottram il y a 7 ans
Parent
révision
e14f250be2

+ 4
- 6
src/freedombone-app-gnusocial Voir le fichier

@@ -405,9 +405,8 @@ function restore_local_gnusocial {
405 405
             rm -rf $temp_restore_dir
406 406
         fi
407 407
 
408
-        # start the daemons
409
-        cd $gnusocial_dir
410
-        su -c "sh scripts/startdaemons.sh" -s /bin/sh www-data
408
+        gnusocial_update_after_restore gnusocial ${GNUSOCIAL_DOMAIN_NAME}
409
+
411 410
         echo $"Restore of gnusocial complete"
412 411
     fi
413 412
 }
@@ -454,9 +453,8 @@ function restore_remote_gnusocial {
454 453
             rm -rf /root/tempgnusocial
455 454
         fi
456 455
 
457
-        # start the daemons
458
-        cd /var/www/${GNUSOCIAL_DOMAIN_NAME}/htdocs
459
-        su -c "sh scripts/startdaemons.sh" -s /bin/sh www-data
456
+        gnusocial_update_after_restore gnusocial ${GNUSOCIAL_DOMAIN_NAME}
457
+
460 458
         echo $"Restore of gnusocial complete"
461 459
     fi
462 460
 }

+ 2
- 6
src/freedombone-app-postactiv Voir le fichier

@@ -420,9 +420,7 @@ function restore_local_postactiv {
420 420
             rm -rf $temp_restore_dir
421 421
         fi
422 422
 
423
-        # start the daemons
424
-        cd $postactiv_dir
425
-        su -c "sh scripts/startdaemons.sh" -s /bin/sh www-data
423
+        gnusocial_update_after_restore postactiv ${POSTACTIV_DOMAIN_NAME}
426 424
     fi
427 425
 }
428 426
 
@@ -465,9 +463,7 @@ function restore_remote_postactiv {
465 463
             rm -rf /root/temppostactiv
466 464
         fi
467 465
 
468
-        # start the daemons
469
-        cd /var/www/${POSTACTIV_DOMAIN_NAME}/htdocs
470
-        su -c "sh scripts/startdaemons.sh" -s /bin/sh www-data
466
+        gnusocial_update_after_restore postactiv ${POSTACTIV_DOMAIN_NAME}
471 467
     fi
472 468
 }
473 469
 

+ 26
- 0
src/freedombone-utils-gnusocialtools Voir le fichier

@@ -46,6 +46,32 @@ SHARINGS_THEME_COMMIT='7106c7ef03'
46 46
 GNUSOCIAL_MARKDOWN_REPO="https://git.gnu.io/chimo/markdown.git"
47 47
 GNUSOCIAL_MARKDOWN_COMMIT='03c53942f94b3376f0946e6e1fe566cc21ccf232'
48 48
 
49
+# Stuff to be done after restoring from backup
50
+function gnusocial_update_after_restore {
51
+    gnusocial_variant=$1
52
+    gnusocial_domain=$2
53
+
54
+    cd /var/www/${gnusocial_domain}/htdocs
55
+
56
+    # Ensure that the database password is correct
57
+    MARIADB_PASSWORD=$(${PROJECT_NAME}-pass -u root -a mariadb)
58
+    sed -i "s|\$config['db']['database'].*|\$config['db']['database'] = 'mysqli://root:${MARIADB_PASSWORD}@localhost/${gnusocial_variant}';|g" config.php
59
+
60
+    # Set permissions
61
+    chmod g+w /var/www/$gnusocial_domain/htdocs
62
+    chmod a+w /var/www/$gnusocial_domain/htdocs/avatar
63
+    chmod a+w /var/www/$gnusocial_domain/htdocs/file
64
+    chown -R www-data:www-data /var/www/$gnusocial_domain/htdocs
65
+    chmod +x /var/www/$gnusocial_domain/htdocs/scripts/maildaemon.php
66
+
67
+    # This seems to be necessary to get the UI back
68
+    gnusocial_use_classic $gnusocial_variant
69
+    gnusocial_use_qvitter $gnusocial_variant
70
+
71
+    # start the daemons
72
+    su -c "sh scripts/startdaemons.sh" -s /bin/sh www-data
73
+}
74
+
49 75
 function qvitter_update_background {
50 76
     domain_name="$1"
51 77
     ext=$2