Skip to content
Snippets Groups Projects
Commit f863c218 authored by Bob Mottram's avatar Bob Mottram
Browse files

Set database password on gogs restore

parent 3fc4f40c
No related branches found
No related tags found
No related merge requests found
......@@ -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
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment