Browse Source

finish guide

Craig Stewart 3 years ago
  1. 3
  2. 17


@ -44,7 +44,8 @@ My Blog
<div id="content">
<p>We have most of the prerequisites installed for gitea, and we could download the binary and run it as we are, but we want this to be a daemon (a process that runs in the background, and doesn't need an interactive shell open to run in) so we need to create a system user for it, and set it up as a service. We will also need to create the config files, and directory structure that Gitea expects. (most of the following is taken from the documentation at <a href="" title="Gitea Documentation">Gitea's documentation pages</a> with a few minor tweaks)</p>
<pre>sudo adduser \
<pre>sudo apt-get install git
sudo adduser \
--system \
--shell /bin/bash \
--gecos 'Git Version Control' \


@ -58,6 +58,23 @@ chmod 600 ~/.ssh</pre>
<pre>sudo apt-get install ntp</pre>
<p>It's that simple, our computer will now keep it's clock accurate</p>
<p>If you've fully followed this guide you should now have a working git server, however software is not perfect and over time bugs will be found and fixed in the packages running on our server, and in the gitea binary we are running. It would be a good idea to be notified when these changes are available to install so that we can keep our server up to date. For the debian packages I use apticron to inform me via email when updates are available.</p>
<pre>sudo apt-get install apticron
cat << EOF | sudo tee -a /etc/apt/apt.conf.d/10periodic > /dev/null
APT::Periodic::Enable "1";
APT::Periodic::Update-Package-Lists "1";
APT::Periodic::CleanInterval "10";
sudo sed -i 's/EMAIL="root"/EMAIL=""/' /etc/apticron/apticron.conf</pre>
<p>This will send an email to once a day if there are any updates available. You should substitute for a valid email address. Unfortunately as we have installed gitea from binary this will not update gitea. You will need to download the latest binary and replace the one on disk when it becomes available, if you follow <a href="" title="Gitea Blog">the gitea blog</a> they announce new releases. At the time of writing the latest version was 1.4.2, but if when you follow this guide a newer version is available you should use that instead. To update gitea when a new version is available you need to stop gitea, and replace the binary on disk and restart gitea.</p>
<pre>sudo service gitea stop
VERSION=1.4.2 wget -O gitea$VERSION/gitea-$VERSION-linux-amd64
sudo rm /usr/local/bin/gitea
sudo chown root:root gitea
sudo mv gitea /usr/local/bin/
sudo chmod +x /usr/local/bin/gitea
sudo service gitea start</pre>
<p>You will need to substitute 1.4.2 with the version you are wanting to install.</p>
<p style="text-align:center;"><a href="/guides/building-a-git-repo/finalising.html" title="Finalising Everything">Finalising Everything</a>|<a href="/guides/building-a-git-repo/" title="Building A git Repository Server">Main Page</a></p>