Skip to content

Instantly share code, notes, and snippets.

@Andelnyr
Forked from jniltinho/install_gogs_ubuntu.sh
Created May 15, 2020 03:58
Show Gist options
  • Save Andelnyr/366b61c4d3b748b7b4071b7961e15c6c to your computer and use it in GitHub Desktop.
Save Andelnyr/366b61c4d3b748b7b4071b7961e15c6c to your computer and use it in GitHub Desktop.

Revisions

  1. @jniltinho jniltinho revised this gist Jun 19, 2017. 1 changed file with 0 additions and 1 deletion.
    1 change: 0 additions & 1 deletion install_gogs_ubuntu.sh
    Original file line number Diff line number Diff line change
    @@ -36,7 +36,6 @@ apt-get update
    apt-get install -y wget nginx git-core mysql-client mysql-server
    adduser --disabled-login --gecos 'Gogs' git


    cd /home/git
    wget --no-check-certificate https://dl.gogs.io/0.11.4/linux_amd64.tar.gz
    tar -xvf linux_amd64.tar.gz && rm -f linux_amd64.tar.gz
  2. @jniltinho jniltinho revised this gist Jun 19, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion install_gogs_ubuntu.sh
    Original file line number Diff line number Diff line change
    @@ -5,7 +5,7 @@
    ## Version: 3.5

    ### Tested on Ubuntu 16.04 LTS 64Bits
    ### Tested on Debian 8.7 64Bits
    ### Tested on Debian 8/9 64Bits

    echo 'install_gogs_ubuntu.sh'
    echo 'Support Ubuntu/Debian'
  3. @jniltinho jniltinho revised this gist Jun 19, 2017. 1 changed file with 0 additions and 4 deletions.
    4 changes: 0 additions & 4 deletions install_gogs_ubuntu.sh
    Original file line number Diff line number Diff line change
    @@ -32,10 +32,6 @@ echo "$SERVER_IP $SERVER_FQDN" >>/etc/hosts
    hostnamectl set-hostname $SERVER_FQDN
    echo "$SERVER_FQDN" > /proc/sys/kernel/hostname

    echo "" >>/etc/hosts
    echo "$SERVER_IP $SERVER_FQDN" >>/etc/hosts
    echo "$SERVER_FQDN" >/etc/hostname

    apt-get update
    apt-get install -y wget nginx git-core mysql-client mysql-server
    adduser --disabled-login --gecos 'Gogs' git
  4. @jniltinho jniltinho revised this gist Jun 19, 2017. 1 changed file with 13 additions and 7 deletions.
    20 changes: 13 additions & 7 deletions install_gogs_ubuntu.sh
    Original file line number Diff line number Diff line change
    @@ -2,7 +2,7 @@
    ## Install Gogs v0.11.4 + Nginx Webserver + Mysql
    ## On Debian, Ubuntu 64Bits
    ## Author: Nilton OS -- www.linuxpro.com.br
    ## Version: 3.2
    ## Version: 3.5

    ### Tested on Ubuntu 16.04 LTS 64Bits
    ### Tested on Debian 8.7 64Bits
    @@ -19,13 +19,19 @@ echo "You must run the script as root or using sudo"
    exit 1
    fi

    MY_IP=$(ip a s|sed -ne '/127.0.0.1/!{s/^[ \t]*inet[ \t]*\([0-9.]\+\)\/.*$/\1/p}' | tr '\n' ' ')

    echo -e "Set Server Name Ex: git.domain.com : \c "
    echo -e "Set Server Name Ex: git.domain.com []: \c "
    read SERVER_FQDN

    echo -e "Set Server IP (commonly 127.0.0.1 works): \c "
    echo -e "Set Server IP Ex: $MY_IP []: \c "
    read SERVER_IP

    echo "" >>/etc/hosts
    echo "$SERVER_IP $SERVER_FQDN" >>/etc/hosts
    hostnamectl set-hostname $SERVER_FQDN
    echo "$SERVER_FQDN" > /proc/sys/kernel/hostname

    echo "" >>/etc/hosts
    echo "$SERVER_IP $SERVER_FQDN" >>/etc/hosts
    echo "$SERVER_FQDN" >/etc/hostname
    @@ -39,12 +45,12 @@ cd /home/git
    wget --no-check-certificate https://dl.gogs.io/0.11.4/linux_amd64.tar.gz
    tar -xvf linux_amd64.tar.gz && rm -f linux_amd64.tar.gz

    echo -e "Set Password for Gogs in Mysql Ex: gogs_password : \c "
    read GOGS_PASS

    echo "Enter Mysql root password"

    ## Create user gogs on Mysql/MariaDB
    ## CREATE USER 'gogs'@'localhost' IDENTIFIED BY 'gogs_password';
    ## GRANT ALL PRIVILEGES ON gogs.* TO 'gogs'@'localhost';
    echo "CREATE USER 'gogs'@'localhost' IDENTIFIED BY $GOGS_PASS;" >>/home/git/gogs/scripts/mysql.sql
    echo "GRANT ALL PRIVILEGES ON gogs.* TO 'gogs'@'localhost';" >>/home/git/gogs/scripts/mysql.sql

    echo "--------------------"
    mysql -p < /home/git/gogs/scripts/mysql.sql
  5. @jniltinho jniltinho revised this gist Jun 10, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion install_gogs_ubuntu.sh
    Original file line number Diff line number Diff line change
    @@ -61,7 +61,7 @@ echo "Setup Webserver Nginx"
    echo "--------------------"

    cp /home/git/gogs/scripts/systemd/gogs.service /etc/systemd/system/
    sed -i 's|mysqld.service|mysqld.service mysql.service |' /etc/systemd/system/gogs.service
    sed -i 's|mysqld.service|mysqld.service mysql.service|' /etc/systemd/system/gogs.service

    systemctl daemon-reload
    systemctl enable gogs.service
  6. @jniltinho jniltinho revised this gist Jun 10, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion install_gogs_ubuntu.sh
    Original file line number Diff line number Diff line change
    @@ -61,7 +61,7 @@ echo "Setup Webserver Nginx"
    echo "--------------------"

    cp /home/git/gogs/scripts/systemd/gogs.service /etc/systemd/system/
    #sed -i 's|#After=mysqld.service|After=mysql.service|' /etc/systemd/system/gogs.service
    sed -i 's|mysqld.service|mysqld.service mysql.service |' /etc/systemd/system/gogs.service

    systemctl daemon-reload
    systemctl enable gogs.service
  7. @jniltinho jniltinho revised this gist Jun 3, 2017. 1 changed file with 5 additions and 0 deletions.
    5 changes: 5 additions & 0 deletions install_gogs_ubuntu.sh
    Original file line number Diff line number Diff line change
    @@ -41,6 +41,11 @@ tar -xvf linux_amd64.tar.gz && rm -f linux_amd64.tar.gz


    echo "Enter Mysql root password"

    ## Create user gogs on Mysql/MariaDB
    ## CREATE USER 'gogs'@'localhost' IDENTIFIED BY 'gogs_password';
    ## GRANT ALL PRIVILEGES ON gogs.* TO 'gogs'@'localhost';

    echo "--------------------"
    mysql -p < /home/git/gogs/scripts/mysql.sql

  8. @jniltinho jniltinho revised this gist Jun 3, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion install_gogs_ubuntu.sh
    Original file line number Diff line number Diff line change
    @@ -56,7 +56,7 @@ echo "Setup Webserver Nginx"
    echo "--------------------"

    cp /home/git/gogs/scripts/systemd/gogs.service /etc/systemd/system/
    sed -i 's|#After=mysqld.service|After=mysql.service|' /etc/systemd/system/gogs.service
    #sed -i 's|#After=mysqld.service|After=mysql.service|' /etc/systemd/system/gogs.service

    systemctl daemon-reload
    systemctl enable gogs.service
  9. @jniltinho jniltinho revised this gist Jun 3, 2017. 1 changed file with 2 additions and 8 deletions.
    10 changes: 2 additions & 8 deletions install_gogs_ubuntu.sh
    Original file line number Diff line number Diff line change
    @@ -30,20 +30,14 @@ echo "" >>/etc/hosts
    echo "$SERVER_IP $SERVER_FQDN" >>/etc/hosts
    echo "$SERVER_FQDN" >/etc/hostname


    ### Vars
    GOGS_LINK="https://dl.gogs.io/0.11.4/linux_amd64.tar.gz"
    GOGS_FILE=linux_amd64.tar.gz


    apt-get update
    apt-get install -y wget nginx git-core mysql-client mysql-server
    adduser --disabled-login --gecos 'Gogs' git


    cd /home/git
    wget --no-check-certificate $GOGS_LINK
    tar -xvf $GOGS_FILE && rm -f $GOGS_FILE
    wget --no-check-certificate https://dl.gogs.io/0.11.4/linux_amd64.tar.gz
    tar -xvf linux_amd64.tar.gz && rm -f linux_amd64.tar.gz


    echo "Enter Mysql root password"
  10. @jniltinho jniltinho revised this gist Jun 3, 2017. 1 changed file with 6 additions and 6 deletions.
    12 changes: 6 additions & 6 deletions install_gogs_ubuntu.sh
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    #!/bin/bash
    ## Install Gogs v0.9.113 + Nginx Webserver + Mysql
    ## Install Gogs v0.11.4 + Nginx Webserver + Mysql
    ## On Debian, Ubuntu 64Bits
    ## Author: Nilton OS -- www.linuxpro.com.br
    ## Version: 3.2
    @@ -9,7 +9,7 @@

    echo 'install_gogs_ubuntu.sh'
    echo 'Support Ubuntu/Debian'
    echo 'Installs Gogs 0.9.113'
    echo 'Installs Gogs 0.11.4'
    echo 'Requires Ubuntu 16.04+, Debian 8+'


    @@ -32,8 +32,8 @@ echo "$SERVER_FQDN" >/etc/hostname


    ### Vars
    GOGS_LINK="https://dl.gogs.io"
    GOGS_FILE=gogs_v0.9.113_linux_amd64.tar.gz
    GOGS_LINK="https://dl.gogs.io/0.11.4/linux_amd64.tar.gz"
    GOGS_FILE=linux_amd64.tar.gz


    apt-get update
    @@ -42,7 +42,7 @@ adduser --disabled-login --gecos 'Gogs' git


    cd /home/git
    wget --no-check-certificate $GOGS_LINK/$GOGS_FILE
    wget --no-check-certificate $GOGS_LINK
    tar -xvf $GOGS_FILE && rm -f $GOGS_FILE


    @@ -92,7 +92,7 @@ echo "Gogs Server App run on port 3000, Nginx on port 80"
    echo "Access http://$SERVER_FQDN to continue the installation"
    echo ""

    echo "Screencast Install: http://blog.linuxpro.com.br/2015/08/14/instalando-gogs-no-ubuntu/"
    echo "Screencast Install: http://www.linuxpro.com.br/2017/04/instalando-gogs-no-ubuntu/"

    ## Links
    ## http://gogs.io/docs/installation/install_from_source.html
  11. @jniltinho jniltinho revised this gist Jan 20, 2017. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions install_gogs_ubuntu.sh
    Original file line number Diff line number Diff line change
    @@ -28,6 +28,7 @@ read SERVER_IP

    echo "" >>/etc/hosts
    echo "$SERVER_IP $SERVER_FQDN" >>/etc/hosts
    echo "$SERVER_FQDN" >/etc/hostname


    ### Vars
  12. @jniltinho jniltinho revised this gist Jan 20, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion install_gogs_ubuntu.sh
    Original file line number Diff line number Diff line change
    @@ -61,7 +61,7 @@ echo "Setup Webserver Nginx"
    echo "--------------------"

    cp /home/git/gogs/scripts/systemd/gogs.service /etc/systemd/system/
    sed -i 's|#After=mysqld.service|After=mysqld.service|' /etc/systemd/system/gogs.service
    sed -i 's|#After=mysqld.service|After=mysql.service|' /etc/systemd/system/gogs.service

    systemctl daemon-reload
    systemctl enable gogs.service
  13. @jniltinho jniltinho revised this gist Jan 20, 2017. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions install_gogs_ubuntu.sh
    Original file line number Diff line number Diff line change
    @@ -61,6 +61,8 @@ echo "Setup Webserver Nginx"
    echo "--------------------"

    cp /home/git/gogs/scripts/systemd/gogs.service /etc/systemd/system/
    sed -i 's|#After=mysqld.service|After=mysqld.service|' /etc/systemd/system/gogs.service

    systemctl daemon-reload
    systemctl enable gogs.service
    systemctl start gogs.service
  14. @jniltinho jniltinho revised this gist Jan 20, 2017. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions install_gogs_ubuntu.sh
    Original file line number Diff line number Diff line change
    @@ -26,8 +26,8 @@ read SERVER_FQDN
    echo -e "Set Server IP (commonly 127.0.0.1 works): \c "
    read SERVER_IP

    #echo "" >>/etc/hosts
    #echo "$SERVER_IP $SERVER_FQDN" >>/etc/hosts
    echo "" >>/etc/hosts
    echo "$SERVER_IP $SERVER_FQDN" >>/etc/hosts


    ### Vars
  15. @jniltinho jniltinho revised this gist Jan 20, 2017. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions install_gogs_ubuntu.sh
    Original file line number Diff line number Diff line change
    @@ -26,8 +26,8 @@ read SERVER_FQDN
    echo -e "Set Server IP (commonly 127.0.0.1 works): \c "
    read SERVER_IP

    echo "" >>/etc/hosts
    echo "$SERVER_IP $SERVER_FQDN" >>/etc/hosts
    #echo "" >>/etc/hosts
    #echo "$SERVER_IP $SERVER_FQDN" >>/etc/hosts


    ### Vars
  16. @jniltinho jniltinho revised this gist Jan 20, 2017. 1 changed file with 4 additions and 7 deletions.
    11 changes: 4 additions & 7 deletions install_gogs_ubuntu.sh
    Original file line number Diff line number Diff line change
    @@ -30,18 +30,15 @@ echo "" >>/etc/hosts
    echo "$SERVER_IP $SERVER_FQDN" >>/etc/hosts


    GET_OS=$(cat /etc/os-release | head -n1 | cut -d'=' -f2 | awk '{ print tolower($1) }'| tr -d '"')

    ### Vars
    GOGS_LINK="https://dl.gogs.io"
    GOGS_FILE=gogs_v0.9.113_linux_amd64.tar.gz


    if [[ $GET_OS == 'debian' || $GET_OS == 'ubuntu' ]]; then
    apt-get update
    apt-get install -y wget nginx git-core mysql-client mysql-server
    adduser --disabled-login --gecos 'Gogs' git
    fi
    apt-get update
    apt-get install -y wget nginx git-core mysql-client mysql-server
    adduser --disabled-login --gecos 'Gogs' git


    cd /home/git
    wget --no-check-certificate $GOGS_LINK/$GOGS_FILE
  17. @jniltinho jniltinho revised this gist Jan 20, 2017. 1 changed file with 5 additions and 21 deletions.
    26 changes: 5 additions & 21 deletions install_gogs_ubuntu.sh
    Original file line number Diff line number Diff line change
    @@ -58,32 +58,16 @@ mkdir -p /home/git/gogs/log
    chown -R git:git /home/git/gogs
    chown -R git:git /home/git/gogs/*

    ## Start Gogs App
    if [[ $GET_OS == 'debian' || $GET_OS == 'ubuntu' ]]; then
    echo '[program:gogs]
    directory=/home/git/gogs/
    command=/home/git/gogs/gogs web
    autostart=true
    autorestart=true
    startsecs=20
    stdout_logfile=/home/git/gogs/log/stdout.log
    stdout_logfile_maxbytes=1MB
    stdout_logfile_backups=10
    stdout_capture_maxbytes=1MB
    stderr_logfile=/home/git/gogs/log/stderr.log
    stderr_logfile_maxbytes=1MB
    stderr_logfile_backups=10
    stderr_capture_maxbytes=1MB
    environment = HOME="/home/git", USER="git"
    user = git' >> /etc/supervisor/conf.d/gogs.conf
    service supervisor restart
    fi


    echo ""
    echo "Setup Webserver Nginx"
    echo "--------------------"

    cp /home/git/gogs/scripts/systemd/gogs.service /etc/systemd/system/
    systemctl daemon-reload
    systemctl enable gogs.service
    systemctl start gogs.service


    echo 'server {
    listen YOUR_SERVER_IP:80;
  18. @jniltinho jniltinho revised this gist Jan 20, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion install_gogs_ubuntu.sh
    Original file line number Diff line number Diff line change
    @@ -39,7 +39,7 @@ GOGS_FILE=gogs_v0.9.113_linux_amd64.tar.gz

    if [[ $GET_OS == 'debian' || $GET_OS == 'ubuntu' ]]; then
    apt-get update
    apt-get install -y wget nginx supervisor git-core mysql-client mysql-server
    apt-get install -y wget nginx git-core mysql-client mysql-server
    adduser --disabled-login --gecos 'Gogs' git
    fi

  19. @jniltinho jniltinho revised this gist Jan 20, 2017. 1 changed file with 11 additions and 0 deletions.
    11 changes: 11 additions & 0 deletions install_gogs_ubuntu.sh
    Original file line number Diff line number Diff line change
    @@ -19,6 +19,17 @@ echo "You must run the script as root or using sudo"
    exit 1
    fi


    echo -e "Set Server Name Ex: git.domain.com : \c "
    read SERVER_FQDN

    echo -e "Set Server IP (commonly 127.0.0.1 works): \c "
    read SERVER_IP

    echo "" >>/etc/hosts
    echo "$SERVER_IP $SERVER_FQDN" >>/etc/hosts


    GET_OS=$(cat /etc/os-release | head -n1 | cut -d'=' -f2 | awk '{ print tolower($1) }'| tr -d '"')

    ### Vars
  20. @jniltinho jniltinho revised this gist Jan 20, 2017. 1 changed file with 0 additions and 6 deletions.
    6 changes: 0 additions & 6 deletions install_gogs_ubuntu.sh
    Original file line number Diff line number Diff line change
    @@ -68,12 +68,6 @@ user = git' >> /etc/supervisor/conf.d/gogs.conf
    service supervisor restart
    fi

    if [[ $GET_OS == 'opensuse' ]]; then
    cp /home/git/gogs/scripts/systemd/gogs.service /usr/lib/systemd/system/
    sed -i 's|#After=mysqld.service|After=mysqld.service|' /usr/lib/systemd/system/gogs.service
    systemctl enable gogs.service
    service gogs start
    fi

    echo ""
    echo "Setup Webserver Nginx"
  21. @jniltinho jniltinho revised this gist Jan 20, 2017. No changes.
  22. @jniltinho jniltinho revised this gist Jan 20, 2017. 1 changed file with 13 additions and 48 deletions.
    61 changes: 13 additions & 48 deletions install_gogs_ubuntu.sh
    Original file line number Diff line number Diff line change
    @@ -1,17 +1,16 @@
    #!/bin/bash
    ## Install Gogs v0.8.0 + Nginx Webserver + Mysql
    ## On Debian, Ubuntu, OpenSUSE 64Bits
    ## Install Gogs v0.9.113 + Nginx Webserver + Mysql
    ## On Debian, Ubuntu 64Bits
    ## Author: Nilton OS -- www.linuxpro.com.br
    ## Version: 3.1
    ## Version: 3.2

    ### Tested on Ubuntu 14.04 LTS 64Bits
    ### Tested on Debian 8 64Bits
    ### Tested on OpenSUSE 13.2 64Bits
    ### Tested on Ubuntu 16.04 LTS 64Bits
    ### Tested on Debian 8.7 64Bits

    echo 'install_gogs_ubuntu.sh'
    echo 'Support Ubuntu/Debian/OpenSUSE'
    echo 'Installs Gogs 0.8.0'
    echo 'Requires Ubuntu 14.04+, Debian 8+, OpenSUSE 13.X'
    echo 'Support Ubuntu/Debian'
    echo 'Installs Gogs 0.9.113'
    echo 'Requires Ubuntu 16.04+, Debian 8+'


    # Check if user has root privileges
    @@ -23,53 +22,19 @@ fi
    GET_OS=$(cat /etc/os-release | head -n1 | cut -d'=' -f2 | awk '{ print tolower($1) }'| tr -d '"')

    ### Vars
    GOGS_LINK=https://dl.gogs.io/gogs_v0.8.0_linux_amd64.zip
    GOGS_FILE=gogs_v0.8.0_linux_amd64.zip
    GOGS_LINK="https://dl.gogs.io"
    GOGS_FILE=gogs_v0.9.113_linux_amd64.tar.gz



    echo -e "Set Server Name Ex: git.domain.com : \c "
    read SERVER_FQDN

    echo -e "Set Server IP (commonly 127.0.0.1 works): \c "
    read SERVER_IP

    echo "" >>/etc/hosts
    echo "$SERVER_IP $SERVER_FQDN" >>/etc/hosts

    if [[ $GET_OS == 'opensuse' ]]; then
    SUSE_VERSION=$(cat /etc/issue | awk '{ print $4 }' | head -n1)
    zypper ar http://download.opensuse.org/repositories/server:/http/openSUSE_${SUSE_VERSION}/ nginx
    zypper --no-gpg-checks refresh
    zypper in -y mysql-community-server unzip wget nginx git-core

    zypper rr nginx
    zypper refresh
    useradd -m -U --system -s /bin/sh -c 'Gogs' git

    mkdir -p /etc/nginx/vhosts.d
    mkdir -p /etc/nginx/sites-available
    ln -s /etc/nginx/vhosts.d /etc/nginx/sites-enabled

    systemctl enable mysql.service
    systemctl enable nginx.service

    service mysql start
    echo "To secure the MySQL installation, run:"
    mysql_secure_installation
    fi

    if [[ $GET_OS == 'debian' || $GET_OS == 'ubuntu' ]]; then
    echo 'LC_ALL="en_US.utf8"' >>/etc/environment
    . /etc/environment
    apt-get update
    apt-get install -y unzip wget nginx supervisor git-core mysql-client mysql-server
    apt-get install -y wget nginx supervisor git-core mysql-client mysql-server
    adduser --disabled-login --gecos 'Gogs' git
    fi

    cd /home/git
    wget --no-check-certificate $GOGS_LINK
    unzip $GOGS_FILE && rm -f $GOGS_FILE
    wget --no-check-certificate $GOGS_LINK/$GOGS_FILE
    tar -xvf $GOGS_FILE && rm -f $GOGS_FILE


    echo "Enter Mysql root password"
  23. @jniltinho jniltinho revised this gist Dec 13, 2015. 1 changed file with 7 additions and 6 deletions.
    13 changes: 7 additions & 6 deletions install_gogs_ubuntu.sh
    Original file line number Diff line number Diff line change
    @@ -1,16 +1,16 @@
    #!/bin/bash
    ## Install Gogs 0.7.6 + Nginx Webserver + Mysql
    ## Install Gogs v0.8.0 + Nginx Webserver + Mysql
    ## On Debian, Ubuntu, OpenSUSE 64Bits
    ## Author: Nilton OS -- www.linuxpro.com.br
    ## Version: 3.0
    ## Version: 3.1

    ### Tested on Ubuntu 14.04 LTS 64Bits
    ### Tested on Debian 8 64Bits
    ### Tested on OpenSUSE 13.2 64Bits

    echo 'install_gogs_ubuntu.sh'
    echo 'Support Ubuntu/Debian/OpenSUSE'
    echo 'Installs Gogs 0.7.6'
    echo 'Installs Gogs 0.8.0'
    echo 'Requires Ubuntu 14.04+, Debian 8+, OpenSUSE 13.X'


    @@ -23,8 +23,9 @@ fi
    GET_OS=$(cat /etc/os-release | head -n1 | cut -d'=' -f2 | awk '{ print tolower($1) }'| tr -d '"')

    ### Vars
    GOGS_LINK=https://dl.gogs.io/gogs_v0.7.6_linux_amd64.zip
    GOGS_FILE=gogs_v0.7.6_linux_amd64.zip
    GOGS_LINK=https://dl.gogs.io/gogs_v0.8.0_linux_amd64.zip
    GOGS_FILE=gogs_v0.8.0_linux_amd64.zip



    echo -e "Set Server Name Ex: git.domain.com : \c "
    @@ -67,7 +68,7 @@ if [[ $GET_OS == 'debian' || $GET_OS == 'ubuntu' ]]; then
    fi

    cd /home/git
    wget $GOGS_LINK
    wget --no-check-certificate $GOGS_LINK
    unzip $GOGS_FILE && rm -f $GOGS_FILE


  24. @jniltinho jniltinho revised this gist Nov 19, 2015. 1 changed file with 6 additions and 6 deletions.
    12 changes: 6 additions & 6 deletions install_gogs_ubuntu.sh
    Original file line number Diff line number Diff line change
    @@ -1,16 +1,16 @@
    #!/bin/bash
    ## Install Gogs 0.6.15 + Nginx Webserver + Mysql
    ## Install Gogs 0.7.6 + Nginx Webserver + Mysql
    ## On Debian, Ubuntu, OpenSUSE 64Bits
    ## Author: Nilton OS -- www.linuxpro.com.br
    ## Version: 2.9
    ## Version: 3.0

    ### Tested on Ubuntu 14.04 LTS 64Bits
    ### Tested on Debian 8 64Bits
    ### Tested on OpenSUSE 13.2 64Bits

    echo 'install_gogs_ubuntu.sh'
    echo 'Support Ubuntu/Debian/OpenSUSE'
    echo 'Installs Gogs 0.6.15'
    echo 'Installs Gogs 0.7.6'
    echo 'Requires Ubuntu 14.04+, Debian 8+, OpenSUSE 13.X'


    @@ -23,8 +23,8 @@ fi
    GET_OS=$(cat /etc/os-release | head -n1 | cut -d'=' -f2 | awk '{ print tolower($1) }'| tr -d '"')

    ### Vars
    GOGS_LINK=http://7d9nal.com2.z0.glb.qiniucdn.com/gogs_v0.6.15_linux_amd64.zip
    GOGS_FILE=gogs_v0.6.15_linux_amd64.zip
    GOGS_LINK=https://dl.gogs.io/gogs_v0.7.6_linux_amd64.zip
    GOGS_FILE=gogs_v0.7.6_linux_amd64.zip


    echo -e "Set Server Name Ex: git.domain.com : \c "
    @@ -73,7 +73,7 @@ unzip $GOGS_FILE && rm -f $GOGS_FILE

    echo "Enter Mysql root password"
    echo "--------------------"
    mysql -p < /home/git/gogs/etc/mysql.sql
    mysql -p < /home/git/gogs/scripts/mysql.sql

    chmod +x /home/git/gogs/gogs
    mkdir -p /home/git/gogs/log
  25. @jniltinho jniltinho revised this gist Oct 17, 2015. 1 changed file with 5 additions and 5 deletions.
    10 changes: 5 additions & 5 deletions install_gogs_ubuntu.sh
    Original file line number Diff line number Diff line change
    @@ -1,16 +1,16 @@
    #!/bin/bash
    ## Install Gogs 0.6.9 + Nginx Webserver + Mysql
    ## Install Gogs 0.6.15 + Nginx Webserver + Mysql
    ## On Debian, Ubuntu, OpenSUSE 64Bits
    ## Author: Nilton OS -- www.linuxpro.com.br
    ## Version: 2.8
    ## Version: 2.9

    ### Tested on Ubuntu 14.04 LTS 64Bits
    ### Tested on Debian 8 64Bits
    ### Tested on OpenSUSE 13.2 64Bits

    echo 'install_gogs_ubuntu.sh'
    echo 'Support Ubuntu/Debian/OpenSUSE'
    echo 'Installs Gogs 0.6.5'
    echo 'Installs Gogs 0.6.15'
    echo 'Requires Ubuntu 14.04+, Debian 8+, OpenSUSE 13.X'


    @@ -23,8 +23,8 @@ fi
    GET_OS=$(cat /etc/os-release | head -n1 | cut -d'=' -f2 | awk '{ print tolower($1) }'| tr -d '"')

    ### Vars
    GOGS_LINK=http://7d9nal.com2.z0.glb.qiniucdn.com/gogs_v0.6.9_linux_amd64.zip
    GOGS_FILE=gogs_v0.6.9_linux_amd64.zip
    GOGS_LINK=http://7d9nal.com2.z0.glb.qiniucdn.com/gogs_v0.6.15_linux_amd64.zip
    GOGS_FILE=gogs_v0.6.15_linux_amd64.zip


    echo -e "Set Server Name Ex: git.domain.com : \c "
  26. @jniltinho jniltinho revised this gist Sep 20, 2015. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions install_gogs_ubuntu.sh
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    #!/bin/bash
    ## Install Gogs 0.6.5 + Nginx Webserver + Mysql
    ## Install Gogs 0.6.9 + Nginx Webserver + Mysql
    ## On Debian, Ubuntu, OpenSUSE 64Bits
    ## Author: Nilton OS -- www.linuxpro.com.br
    ## Version: 2.8
    @@ -23,8 +23,8 @@ fi
    GET_OS=$(cat /etc/os-release | head -n1 | cut -d'=' -f2 | awk '{ print tolower($1) }'| tr -d '"')

    ### Vars
    GOGS_LINK=http://gogs.dn.qbox.me/gogs_v0.6.5_linux_amd64.zip
    GOGS_FILE=gogs_v0.6.5_linux_amd64.zip
    GOGS_LINK=http://7d9nal.com2.z0.glb.qiniucdn.com/gogs_v0.6.9_linux_amd64.zip
    GOGS_FILE=gogs_v0.6.9_linux_amd64.zip


    echo -e "Set Server Name Ex: git.domain.com : \c "
  27. @jniltinho jniltinho revised this gist Aug 16, 2015. 1 changed file with 18 additions and 7 deletions.
    25 changes: 18 additions & 7 deletions install_gogs_ubuntu.sh
    Original file line number Diff line number Diff line change
    @@ -62,7 +62,7 @@ if [[ $GET_OS == 'debian' || $GET_OS == 'ubuntu' ]]; then
    echo 'LC_ALL="en_US.utf8"' >>/etc/environment
    . /etc/environment
    apt-get update
    apt-get install -y unzip wget nginx git-core mysql-client mysql-server
    apt-get install -y unzip wget nginx supervisor git-core mysql-client mysql-server
    adduser --disabled-login --gecos 'Gogs' git
    fi

    @@ -83,12 +83,23 @@ chown -R git:git /home/git/gogs/*

    ## Start Gogs App
    if [[ $GET_OS == 'debian' || $GET_OS == 'ubuntu' ]]; then
    cp /home/git/gogs/scripts/init/debian/gogs /etc/init.d/gogs
    chmod +x /etc/init.d/gogs
    sed -i -e 's/\r$//' /etc/init.d/gogs
    /etc/init.d/gogs start
    ## Gogs enable on Boot
    update-rc.d gogs defaults
    echo '[program:gogs]
    directory=/home/git/gogs/
    command=/home/git/gogs/gogs web
    autostart=true
    autorestart=true
    startsecs=20
    stdout_logfile=/home/git/gogs/log/stdout.log
    stdout_logfile_maxbytes=1MB
    stdout_logfile_backups=10
    stdout_capture_maxbytes=1MB
    stderr_logfile=/home/git/gogs/log/stderr.log
    stderr_logfile_maxbytes=1MB
    stderr_logfile_backups=10
    stderr_capture_maxbytes=1MB
    environment = HOME="/home/git", USER="git"
    user = git' >> /etc/supervisor/conf.d/gogs.conf
    service supervisor restart
    fi

    if [[ $GET_OS == 'opensuse' ]]; then
  28. @jniltinho jniltinho revised this gist Aug 16, 2015. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions install_gogs_ubuntu.sh
    Original file line number Diff line number Diff line change
    @@ -86,6 +86,7 @@ if [[ $GET_OS == 'debian' || $GET_OS == 'ubuntu' ]]; then
    cp /home/git/gogs/scripts/init/debian/gogs /etc/init.d/gogs
    chmod +x /etc/init.d/gogs
    sed -i -e 's/\r$//' /etc/init.d/gogs
    /etc/init.d/gogs start
    ## Gogs enable on Boot
    update-rc.d gogs defaults
    fi
  29. @jniltinho jniltinho revised this gist Aug 16, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion install_gogs_ubuntu.sh
    Original file line number Diff line number Diff line change
    @@ -122,7 +122,7 @@ service nginx restart

    echo ""
    echo "Gogs Server App run on port 3000, Nginx on port 80"
    echo "Access http://$YOUR_SERVER_FQDN to continue the installation"
    echo "Access http://$SERVER_FQDN to continue the installation"
    echo ""

    echo "Screencast Install: http://blog.linuxpro.com.br/2015/08/14/instalando-gogs-no-ubuntu/"
  30. @jniltinho jniltinho revised this gist Aug 16, 2015. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions install_gogs_ubuntu.sh
    Original file line number Diff line number Diff line change
    @@ -83,9 +83,9 @@ chown -R git:git /home/git/gogs/*

    ## Start Gogs App
    if [[ $GET_OS == 'debian' || $GET_OS == 'ubuntu' ]]; then
    cp /home/git/gogs/scripts/init/debian /etc/init.d/gogs
    cp /home/git/gogs/scripts/init/debian/gogs /etc/init.d/gogs
    chmod +x /etc/init.d/gogs
    # sed -i -e 's/\r$//' /etc/init.d/gogs
    sed -i -e 's/\r$//' /etc/init.d/gogs
    ## Gogs enable on Boot
    update-rc.d gogs defaults
    fi