Last active
August 10, 2019 17:19
-
-
Save seeni-dev/8ba5d2cc7885abfbc6545fd2765f3155 to your computer and use it in GitHub Desktop.
Basic gogs setup with mysql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
apt-get update -y | |
apt-get upgrade -y | |
apt-get install -y git mysql-server | |
apt-get install -y wget systemd | |
systemctl enable mysql | |
systemctl start mysql | |
echo "Get the download link based on your platform from https://gogs.io/docs/installation/install_from_binary \n." | |
echo "This script uses https://dl.gogs.io/0.11.86/gogs_0.11.86_linux_amd64.tar.gz\n" | |
wget -O gogs.tar.gz https://dl.gogs.io/0.11.86/gogs_0.11.86_linux_amd64.tar.gz | |
tar xvzf gogs.tar.gz | |
mv gogs/ /opt/local/gogs/ | |
mysql -u root -p\n < /opt/local/gogs/scripts/mysql.sql | |
echo "Creating a user name gogs with password as gogs, be sure modify it when you are running the script.\n" | |
echo "GRANT ALL PRIVILEGES ON gogs.* to 'gogs'@'localhost' identified by 'gogs';" > userCreateScript.sql | |
mysql -u root -p\n < userCreateScript.sql | |
echo "=========================================================================================\n" | |
echo "Run the following command and follow the instructions provided below:\n" | |
echo "cd /opt/local/gogs/ && ./gogs web\n" | |
echo "Goto 0.0.0.0:3000\n" | |
echo "Setup the details as follows:\n" | |
echo "Database Settings user:gogs\n" | |
echo "Database Settings password:gogs\n" | |
echo "Application general Settings Run User: root/currentUser" | |
echo "Afer clicking Install, Be sure to create an account right away. The first account that is created will be admin for the whole gogs system." | |
echo "Any accounts that are created after the first account will be normal accounts.\n" | |
echo "=========================================================================================\n" | |
echo "=========================================================================================\n" | |
echo "NOTE!!! Be sure to change all the passwords used in this script after running this script.\n" | |
echo "=========================================================================================\n" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment