diff --git a/src/freedombone-app-gnusocial b/src/freedombone-app-gnusocial index b439cc7d..e5f192a6 100755 --- a/src/freedombone-app-gnusocial +++ b/src/freedombone-app-gnusocial @@ -405,9 +405,8 @@ function restore_local_gnusocial { rm -rf $temp_restore_dir fi - # start the daemons - cd $gnusocial_dir - su -c "sh scripts/startdaemons.sh" -s /bin/sh www-data + gnusocial_update_after_restore gnusocial ${GNUSOCIAL_DOMAIN_NAME} + echo $"Restore of gnusocial complete" fi } @@ -454,9 +453,8 @@ function restore_remote_gnusocial { rm -rf /root/tempgnusocial fi - # start the daemons - cd /var/www/${GNUSOCIAL_DOMAIN_NAME}/htdocs - su -c "sh scripts/startdaemons.sh" -s /bin/sh www-data + gnusocial_update_after_restore gnusocial ${GNUSOCIAL_DOMAIN_NAME} + echo $"Restore of gnusocial complete" fi } diff --git a/src/freedombone-app-postactiv b/src/freedombone-app-postactiv index c115c3d3..2e10145c 100755 --- a/src/freedombone-app-postactiv +++ b/src/freedombone-app-postactiv @@ -420,9 +420,7 @@ function restore_local_postactiv { rm -rf $temp_restore_dir fi - # start the daemons - cd $postactiv_dir - su -c "sh scripts/startdaemons.sh" -s /bin/sh www-data + gnusocial_update_after_restore postactiv ${POSTACTIV_DOMAIN_NAME} fi } @@ -465,9 +463,7 @@ function restore_remote_postactiv { rm -rf /root/temppostactiv fi - # start the daemons - cd /var/www/${POSTACTIV_DOMAIN_NAME}/htdocs - su -c "sh scripts/startdaemons.sh" -s /bin/sh www-data + gnusocial_update_after_restore postactiv ${POSTACTIV_DOMAIN_NAME} fi } diff --git a/src/freedombone-utils-gnusocialtools b/src/freedombone-utils-gnusocialtools index d641c689..022d5677 100755 --- a/src/freedombone-utils-gnusocialtools +++ b/src/freedombone-utils-gnusocialtools @@ -46,6 +46,32 @@ SHARINGS_THEME_COMMIT='7106c7ef03' GNUSOCIAL_MARKDOWN_REPO="https://git.gnu.io/chimo/markdown.git" GNUSOCIAL_MARKDOWN_COMMIT='03c53942f94b3376f0946e6e1fe566cc21ccf232' +# Stuff to be done after restoring from backup +function gnusocial_update_after_restore { + gnusocial_variant=$1 + gnusocial_domain=$2 + + cd /var/www/${gnusocial_domain}/htdocs + + # Ensure that the database password is correct + MARIADB_PASSWORD=$(${PROJECT_NAME}-pass -u root -a mariadb) + sed -i "s|\$config['db']['database'].*|\$config['db']['database'] = 'mysqli://root:${MARIADB_PASSWORD}@localhost/${gnusocial_variant}';|g" config.php + + # Set permissions + chmod g+w /var/www/$gnusocial_domain/htdocs + chmod a+w /var/www/$gnusocial_domain/htdocs/avatar + chmod a+w /var/www/$gnusocial_domain/htdocs/file + chown -R www-data:www-data /var/www/$gnusocial_domain/htdocs + chmod +x /var/www/$gnusocial_domain/htdocs/scripts/maildaemon.php + + # This seems to be necessary to get the UI back + gnusocial_use_classic $gnusocial_variant + gnusocial_use_qvitter $gnusocial_variant + + # start the daemons + su -c "sh scripts/startdaemons.sh" -s /bin/sh www-data +} + function qvitter_update_background { domain_name="$1" ext=$2