Readme details for gogs

This commit is contained in:
Bob Mottram 2015-03-18 22:40:58 +00:00
parent dc79307332
commit 7191ec280c
1 changed files with 11 additions and 7 deletions

View File

@ -1518,8 +1518,8 @@ function get_mariadb_gnusocial_admin_password {
function get_mariadb_git_admin_password {
if [ -f /home/$MY_USERNAME/README ]; then
if grep -q "Gogs database password" /home/$MY_USERNAME/README; then
GIT_ADMIN_PASSWORD=$(cat /home/$MY_USERNAME/README | grep "Gogs database password" | awk -F ':' '{print $2}' | sed 's/^ *//')
if grep -q "Gogs admin user password" /home/$MY_USERNAME/README; then
GIT_ADMIN_PASSWORD=$(cat /home/$MY_USERNAME/README | grep "Gogs admin user password" | awk -F ':' '{print $2}' | sed 's/^ *//')
fi
fi
}
@ -6695,20 +6695,24 @@ function install_gogs {
GIT_ADMIN_PASSWORD=$(openssl rand -base64 32)
fi
if ! grep -q "Gogs database user" /home/$MY_USERNAME/README; then
if ! grep -q "Gogs admin user password" /home/$MY_USERNAME/README; then
echo '' >> /home/$MY_USERNAME/README
echo '' >> /home/$MY_USERNAME/README
echo 'Gogs' >> /home/$MY_USERNAME/README
echo '====' >> /home/$MY_USERNAME/README
echo 'Gogs database user: gogsadmin' >> /home/$MY_USERNAME/README
echo "Gogs database password: $GIT_ADMIN_PASSWORD" >> /home/$MY_USERNAME/README
echo 'Gogs database name: gogs' >> /home/$MY_USERNAME/README
echo 'Database type: MySql' >> /home/$MY_USERNAME/README
echo 'Database host: 127.0.0.1:3306' >> /home/$MY_USERNAME/README
echo 'Database user: root' >> /home/$MY_USERNAME/README
echo "Database password: $MARIADB_PASSWORD" >> /home/$MY_USERNAME/README
echo 'Database name: gogs' >> /home/$MY_USERNAME/README
echo 'Gogs admin user: gogsadmin' >> /home/$MY_USERNAME/README
echo "Gogs admin user password: $GIT_ADMIN_PASSWORD" >> /home/$MY_USERNAME/README
echo "Gogs admin user email: $MY_EMAIL_ADDRESS" >> /home/$MY_USERNAME/README
echo '' >> /home/$MY_USERNAME/README
echo 'Install Steps For First-time Run:' >> /home/$MY_USERNAME/README
echo 'Leave email service settings empty' >> /home/$MY_USERNAME/README
echo 'Check "Enable Register Confirmation"' >> /home/$MY_USERNAME/README
echo 'Check "Enable Mail Notification"' >> /home/$MY_USERNAME/README
echo 'Enter some administrator account details and set an email address' >> /home/$MY_USERNAME/README
fi
echo "create database gogs;