Set database password on gogs restore

This commit is contained in:
Bob Mottram 2017-06-25 20:37:25 +01:00
parent 3fc4f40cd2
commit f863c21860
1 changed files with 13 additions and 1 deletions

View File

@ -13,7 +13,7 @@
# License
# =======
#
# Copyright (C) 2014-2016 Bob Mottram <bob@freedombone.net>
# Copyright (C) 2014-2017 Bob Mottram <bob@freedombone.net>
#
# 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
@ -279,6 +279,12 @@ function restore_local_gogs {
rm -rf ${temp_restore_dir}ssh
chown -R ${GOGS_USERNAME}:${GOGS_USERNAME} /home/${GOGS_USERNAME}
fi
GOGS_CONFIG_PATH=/home/${GOGS_USERNAME}/custom/conf
GOGS_CONFIG_FILE=${GOGS_CONFIG_PATH}/app.ini
MARIADB_PASSWORD=$(${PROJECT_NAME}-pass -u root -a mariadb)
sed -i "s|PASSWD =.*|PASSWD = $MARIADB_PASSWORD|g" ${GOGS_CONFIG_FILE}
MARIADB_PASSWORD=
fi
}
@ -349,6 +355,12 @@ function restore_remote_gogs {
chown -R ${GOGS_USERNAME}:${GOGS_USERNAME} /home/${GOGS_USERNAME}
echo $"Restore of Gogs complete"
fi
GOGS_CONFIG_PATH=/home/${GOGS_USERNAME}/custom/conf
GOGS_CONFIG_FILE=${GOGS_CONFIG_PATH}/app.ini
MARIADB_PASSWORD=$(${PROJECT_NAME}-pass -u root -a mariadb)
sed -i "s|PASSWD =.*|PASSWD = $MARIADB_PASSWORD|g" ${GOGS_CONFIG_FILE}
MARIADB_PASSWORD=
fi
}