Gogs on CentOS

Gogs also known as Go Git Server is an open source cross-platform self-hosted Git server written in Golang, similar to the GitLab which is written in Ruby. It is easy to install and configure and offers a lot of customization options while installing, it lets you choose between MySQL, SQLite, and PostgreSQL as a Database backend. It is also one of the lightest and fastest self-hosted Git server solutions, it does not offer a lot of features like GitLab, but whatever it offers, it does it without pain. If you don’t already have a CentOS server, you can get a VPS on Digital Ocean, by signing up with this referral you get $10 credit and I get $25 credit. Installing Gogs is easy it’s available as a pre-compiled package from Packager. It receives updates like every other package you would install on your system. So you can do the setup once and receive an update on new builds. This setup being pre-build, might not support SQLite, for this guide, I am using MariaDB. You can use PostgreSQL over MariaDB if you prefer it.

Getting started.

Adding Gogs repository key.

sudo rpm --import https://rpm.packager.io/key  

Add Gogs packager.io repository to your local packages database.

echo "[gogs]  
name=Repository for pkgr/gogs application.  
baseurl=https://rpm.packager.io/gh/pkgr/gogs/centos7/pkgr  
enabled=1" | sudo tee /etc/yum.repos.d/gogs.repo  

Installing Gogs

sudo yum install gogs

Installing MySQL

sudo yum install mysql-server -y  

Setting up MySQL

sudo mysql_secure_installation  

Logging into MySQL console.

mysql -u root -p  

Creating a new Database for Gogs.

CREATE DATABASE gogs;  

Exiting MySQL console.

exit  

Installing NGINX to reverse proxy Gogs to port 80.

sudo rpm -Uhv http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm  


sudo yum install -y nginx  

Editing the NGINX config /etc/nginx/conf.d/default.conf

sudo nano /etc/nginx/conf.d/default.conf  

Add the following lines to your NGINX config.

server {  
listen          80;  
  server_name     ${HOSTNAME};
  location / {
    proxy_pass      http://localhost:3000;
  }
}

Restart NGINX.

sudo service nginx restart  

You can access the newly setup Gogs Server at http://127.0.0.1/, and further configure it to your preference and create your new user, you can now store your projects on your private Git server. Have a question, leave a comment below.

Gogs on Debian

Gogs also known as Go Git Server is an open source cross-platform self-hosted Git server written in Golang, similar to the GitLab which is written in Ruby. It is easy to install and configure and offers a lot of customization options while installing, it lets you choose between MySQL, SQLite, and PostgreSQL as a Database backend. It is also one of the lightest and fastest self-hosted Git server solution, it does not offer a lot of features like GitLab, but whatever it offers, it does it without pain. If you don’t already have a Debian server, you can get a VPS on Digital Ocean, by signing up with this referral you get $10 credit and I get $25 credit. Installing Gogs is easy it’s available as a pre-compiled package from Packager. It receives updates like every other package you would install on your system. So you can do the setup once and receive an update on new builds. This setup being pre-build, might not support SQLite, for this guide, I am using MariaDB. You can use PostgreSQL over MariaDB if you prefer it.

Getting started.

Adding Gogs repository key.

wget -qO - https://deb.packager.io/key | sudo apt-key add -  

Add Gogs packager.io repository to your sources.list.d directory/ For Jessie

sudo echo "deb https://deb.packager.io/gh/pkgr/gogs jessie pkgr" | sudo tee /etc/apt/sources.list.d/gogs.list  

For Wheezy

sudo echo "deb https://deb.packager.io/gh/pkgr/gogs wheezy pkgr" | sudo tee /etc/apt/sources.list.d/gogs.list  

Updating local package database to fetch meta of the new repository.

sudo apt-get update  

Installing Gogs

sudo apt-get install gogs  

Adding MariaDB repository, choose the setup depending on the version of Debian you are using and the closest mirror you prefer, from here.

sudo apt-get update  

Logging into MariaDB console.

mysql -u root -p  

Creating a new Database for Gogs.

CREATE DATABASE gogs;  

Exiting MySQL console.

exit  

Installing NGINX to reverse proxy Gogs to port 80.

sudo apt-get install nginx-full  

Editing the NGINX config /etc/nginx/sites-enabled/default

sudo nano /etc/nginx/sites-enabled/default  

Add the following lines to your NGINX config.

server {  
  listen          80;
  server_name     yourhostname;

  location / {
    proxy_pass      http://127.0.0.1:3000;
  }
}

Restart NGINX.

sudo service nginx restart  

You can access the newly setup Gogs Server at http://127.0.0.1/, and further configure it to your preference and create your new user, you can now store your projects on your private Git server. Have a question, leave a comment below.

GitLab CE on Ubuntu

GitLab CE(Community Edition) is an open source self-hosted, Git Server, that can be hosted on any server, that meets its requirements. It’s easy to install and setup, it gives you the freedom, you want with your Git repository and projects.

You can install GitLab on your Ubuntu Server by following the steps below.

If you are planning to get a VPS that will host your GitLab server, I recommend Digital Ocean

Installing dependencies used by GitLab.

sudo apt-get install curl openssh-server ca-certificates postfix  

Installing GitLab repository.

curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | sudo bash  

Installing GitLab

sudo apt-get install gitlab-ce  

If you are having issues downloading the package, then try this method using apt-fast.

sudo add-apt-repository ppa:saiarcot895/myppa  


sudo apt-get update  

Installing fast.

sudo apt-get install apt-fast  

Now download the GitLab package with apt-fast.

sudo apt-fast gitlab-ce  

Once this is done. You can configure GitLab.

sudo gitlab-ctl reconfigure  

The default user account credentials are:

username: root

password: 5iveL!fe

It’s ready, now you can visit your private GitLab, and start pushing your code.

Thank your for reading.

Have a question? leave a comment below.

How to install and setup GitLab Community Edition on Ubuntu

GitLab is an open source web based Git repository manager with features similar to GitHub like wiki, issue tracking. GitLab CE lets developers host a Gitlab instance on their own servers that lets developers store source code on their own private server that gives them more freedom, and lets them choose the type of hardware they prefer to serve this purpose, GitLab also is a cost effective solution to other Enterprise options like GitHub. GitLab also offers hosted GitLab for developers that prefer GitLab and don’t feel the need to host their own version of GitLab, The hosted GitLab comes with a limit of 1GB per repository.

Recently GitLab CE comes with pre-composed packages that makes the install process hassle free. Lets install GitLab CE.

System requirements

  • 1 GB RAM (required)
  • 1 Code processor.
  • 10 GB of disk space

The higher specification your system will have the better GitLab will perform.

GitLab requirements

sudo apt-get install openssh-server  postfix -y  
  • Once the packages are installed you will be greeted by a postfix setup screen that will ask you for a hostname, you can choose the host name you prefer.
  • Downloading the pre-composed GitLab CE debian package.
    • If you are using Wget go ahead.
wget https://downloads-packages.s3.amazonaws.com/ubuntu-14.04/gitlab_7.8.0-omnibus-1_amd64.deb  
    • If you prefer curl
curl -# -L -O https://downloads-packages.s3.amazonaws.com/ubuntu-14.04/gitlab_7.8.0-omnibus-1_amd64.deb  
  • You can edit the gitlab.rb if needed or go ahead the skip this step.

    editor /etc/gitlab/gitlab.rb

You can find the official documentation over here and official website.

  • Re configuring the GitLab (This is an important step)

    sudo gitlab-ctl reconfigure

Now you can visit the http://127.0.0.1.

The default username is:

root  

the default password is

5iveL!fe  

The system will ask you to set the new password, you can change the settings in the admin area if required depending on your need.

Thanks you reading, If you have any question feel free to leave a comment below.

Sidewalk theme for Grav

I developed Sidewalk. My first theme for Grav CMS. Grav is a flat-file CMS written in PHP developed by Rocket Themes. The theme is inspired by hexo-jade-barebone.

Installing the theme.

Clone the Sidewalk repository into your Grav CMS theme directory.

cd /user/themes/  
git clone https://github.com/DarrylDias/Sidewalk  

Now change the theme: string to Sidewalk

pages:  
  theme: Sidewalk

Now you have Sidewalk theme running on your Grav CMS.

You can edit the Sidewalk.yaml to customise the theme.