From 309479ee1c39954661a4748a0b116bedd3f6e245 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 25 Jun 2017 20:28:59 +0100 Subject: [PATCH] Set database password on etherpad restore --- src/freedombone-app-dokuwiki | 1 - src/freedombone-app-etherpad | 12 +++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/freedombone-app-dokuwiki b/src/freedombone-app-dokuwiki index f7b5023e..4a90eed7 100755 --- a/src/freedombone-app-dokuwiki +++ b/src/freedombone-app-dokuwiki @@ -556,7 +556,6 @@ function install_dokuwiki { systemctl restart php7.0-fpm systemctl restart nginx - systemctl restart mariadb function_check add_ddns_domain add_ddns_domain $DOKUWIKI_DOMAIN_NAME diff --git a/src/freedombone-app-etherpad b/src/freedombone-app-etherpad index b53db778..05c947b9 100755 --- a/src/freedombone-app-etherpad +++ b/src/freedombone-app-etherpad @@ -13,7 +13,7 @@ # License # ======= # -# Copyright (C) 2016 Bob Mottram +# Copyright (C) 2016-2017 Bob Mottram # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by @@ -360,6 +360,11 @@ function restore_local_etherpad { if [ -f /etc/ssl/private/${ETHERPAD_DOMAIN_NAME}.key ]; then chown etherpad: /etc/ssl/private/${ETHERPAD_DOMAIN_NAME}.key fi + + MARIADB_PASSWORD=$(${PROJECT_NAME}-pass -u root -a mariadb) + settings_file=/var/www/${ETHERPAD_DOMAIN_NAME}/htdocs/settings.json + sed -i "s|\"password\":.*|\"password\": \"${MARIADB_PASSWORD}\",|g" $settings_file + MARIADB_PASSWORD= fi } @@ -405,6 +410,11 @@ function restore_remote_etherpad { if [ -f /etc/ssl/private/${ETHERPAD_DOMAIN_NAME}.key ]; then chown etherpad: /etc/ssl/private/${ETHERPAD_DOMAIN_NAME}.key fi + + MARIADB_PASSWORD=$(${PROJECT_NAME}-pass -u root -a mariadb) + settings_file=/var/www/${ETHERPAD_DOMAIN_NAME}/htdocs/settings.json + sed -i "s|\"password\":.*|\"password\": \"${MARIADB_PASSWORD}\",|g" $settings_file + MARIADB_PASSWORD= fi }