{"id":61,"date":"2015-12-04T14:48:01","date_gmt":"2015-12-04T14:48:01","guid":{"rendered":"http:\/\/codestrian.com\/?p=61"},"modified":"2018-01-14T11:56:59","modified_gmt":"2018-01-14T11:56:59","slug":"a-guide-on-setting-up-gitlab-on-fedora-22","status":"publish","type":"post","link":"https:\/\/codestrian.com\/index.php\/2015\/12\/04\/a-guide-on-setting-up-gitlab-on-fedora-22\/","title":{"rendered":"A guide on setting up GitLab on Fedora 22"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/about.gitlab.com\/images\/press\/logo\/wm_no_bg.svg\" alt=\"GitLab\" \/><br \/>\nI believe that most developers should have heard of\/used GitHub. One of the main issues with GitHub is the lack of private repository for free users(except for student account). In the event that one needs a private repository, some will use BitBucket instead of GitHub. Alternatively, one can host a git server on his\/her own machine. Here I am presenting another solution known as GitLab, which is pretty similar to GitHub except that it allows you to host the software on third-party server which is perfect for personal use. As GitLab does not have official support on Fedora. It will take a few more steps than usual to get it up and running on a Fedora server.<\/p>\n<ol>\n<li>\n<strong>Installing Pre-requisties<\/strong><\/p>\n<pre>\r\nsudo dnf install sendmail sendmail-cf curl openssh-server\r\n<\/pre>\n<\/li>\n<li>\n<strong>Starting and Enabling Services<\/strong><\/p>\n<pre>\r\nsudo systemctl start sshd\r\nsudo systemctl enable sshd\r\n<\/pre>\n<\/li>\n<li>\n<strong>Downloading GitLab<\/strong><\/p>\n<pre>\r\ncurl https:\/\/packages.gitlab.com\/gitlab\/gitlab-ce\/packages\/el\/7\/gitlab-ce-8.1.2-ce.0.el7.x86_64.rpm\/download\r\n<\/pre>\n<\/li>\n<li>\n<strong>GitLab Installation<\/strong><\/p>\n<pre>\r\ndnf install gitlab-ce-8.1.2-ce.0.el7.x86_64.rpm\r\n<\/pre>\n<\/li>\n<li>\n<strong>Configuring and Starting GitLab<\/strong><br \/>\nBefore running the gitlab, we will need to edit the configuration file.<\/p>\n<pre>\r\nsudo -e \/etc\/gitlab\/gitlab.rb\r\n<\/pre>\n<p>Change the external url to your domain.<\/p>\n<pre>\r\n external_url 'http:\/\/mydomain.com'\r\n<\/pre>\n<p>Run the following to have gitlab reconfigured and restarted.<\/p>\n<pre>\r\nsudo gitlab-ctl reconfigure\r\n<\/pre>\n<\/li>\n<li>\n<strong>Configure Firewall Setting<\/strong><\/p>\n<pre>\r\nsudo firewall-cmd --permanent --add-service=http\r\nsudo firewall-cmd --reload\r\n<\/pre>\n<\/li>\n<li>\n<strong>Configure Sendmail<\/strong><br \/>\nIn this example, gmail is used as the mailing agent.<br \/>\nBefore you make changes, make sure a back up of sendmail.mc and sendmail.cf is created.<\/p>\n<pre>\r\ncd \/etc\/mail\r\nsudo cp sendmail.mc sendmail.mc.bak\r\nsudo cp sendmail.cf sendmail.cf.bak\r\n<\/pre>\n<p>Add the following lines to the top of the first Mailer in \/etc\/mail\/sendmail.mc<\/p>\n<pre>\r\ndefine(`SMART_HOST',`[smtp.gmail.com]')dnl\r\ndefine(`RELAY_MAILER_ARGS', `TCP $h 587')dnl\r\ndefine(`ESMTP_MAILER_ARGS', `TCP $h 587')dnl\r\ndefine(`confAUTH_OPTIONS', `A p')dnl\r\nTRUST_AUTH_MECH(`EXTERNAL DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl\r\ndefine(`confAUTH_MECHANISMS', `EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl\r\nFEATURE(`authinfo',`hash -o \/etc\/mail\/authinfo\/gmail-auth.db')dnl\r\n<\/pre>\n<p>Now we will need to create the gmail-auth.db so that sendmail can login to the gmail mailing server with the credentials<\/p>\n<pre>\r\nsudo mkdir -m 700 \/etc\/mail\/authinfo\/\r\nsudo cd \/etc\/mail\/authinfo\/\r\n<\/pre>\n<p>Create the file gmail-auth and insert the following line.<\/p>\n<pre>\r\nAuthInfo: \"U:root\" \"I:EMAIL ADDRESS\" \"P:PASSWORD\"\r\n<\/pre>\n<p>Next we will need to create the hash file. (you may wanna delete original gmail-auth for security reason)<\/p>\n<pre>\r\nmakemap hash gmail-auth < gmail-auth\r\n<\/pre>\n<p>Next, we will need to have sendmail reconfigured and restarted.<\/p>\n<pre>\r\nm4 \/etc\/mail\/sendmail.mc > \/etc\/mail\/sendmail.cf\r\nsudo service sendmail restart\r\n<\/pre>\n<\/li>\n<li>\n<strong>Accessing GitLab Web Interface<\/strong><br \/>\nNow that everything has been configured, you may try to access the web interface via the external URL that you have specified in the beginning.<br \/>\nTry making an account and see if you actually receives a confirmation email. If everything works fine, you can start creating code repository on your very own git server.<br \/>\nIn the event that sendmail fails to send the confirmation email. you may want to check the log in \/var\/log\/maillog for more information.\n<\/li\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>I believe that most developers should have heard of\/used GitHub. One of the main issues with GitHub is the lack of private repository for free users(except for student account). In the event that one needs a private repository, some will use BitBucket instead of GitHub. Alternatively, one can host a [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[12,13],"_links":{"self":[{"href":"https:\/\/codestrian.com\/index.php\/wp-json\/wp\/v2\/posts\/61"}],"collection":[{"href":"https:\/\/codestrian.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/codestrian.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/codestrian.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/codestrian.com\/index.php\/wp-json\/wp\/v2\/comments?post=61"}],"version-history":[{"count":12,"href":"https:\/\/codestrian.com\/index.php\/wp-json\/wp\/v2\/posts\/61\/revisions"}],"predecessor-version":[{"id":162,"href":"https:\/\/codestrian.com\/index.php\/wp-json\/wp\/v2\/posts\/61\/revisions\/162"}],"wp:attachment":[{"href":"https:\/\/codestrian.com\/index.php\/wp-json\/wp\/v2\/media?parent=61"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/codestrian.com\/index.php\/wp-json\/wp\/v2\/categories?post=61"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/codestrian.com\/index.php\/wp-json\/wp\/v2\/tags?post=61"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}