Chotaire Wiki

Stuff you didn't know

User Tools

Site Tools


Gitea Cheat Sheet

Gitea selinux module for Fedora 29

This assumes that Gitea runs as user git and is installed in /home/git/gitea and the repositories are also located in /home/git. This shall also be the case for the remainder of this document.

I've created a selinux module for Gitea which will work for small installations (tested with SQlite3 and without PAM), just upload it to the box (source included) and run as root:

fc29-gitea-selinux.tar.bz2 (v1.1: Now allows Gitea to send e-mails)

tar -zxvf fc29-gitea-selinux.tar.bz2
semodule -i fc29-gitea.pp

Build Gitea master branch on Fedora 29

As root, install golang and make:

dnf install golang-bin make -y

If user “git” doesn't exist, add the user to the system:

useradd -m git

Become user git and setup GOPATH environment:

su - git
echo "export GOPATH=$HOME/go" >> $HOME/.bash_profile
su - git

Download gitea master branch and all required packages:

go get -d
cd "$GOPATH/src/"

Edit /home/git/go/src/ and remove -i flag from “GOFLAGS := -v” so that it reads:


Make sure that go-bindata can be found:

mkdir $HOME/bin ; cd $HOME/bin
ln -s /home/git/go/bin/go-bindata go-bindata


cd $HOME/go/src/
TAGS="bindata sqlite sqlite_unlock_notify" make generate build

Et voila, the binary can be found in:

$ ls -al /home/git/go/src/
-rwxrwxr-x. 1 git git 54773448  7. Apr 02:18 /home/git/go/src/

Copy binary:

mkdir /home/git/gitea
cp -a /home/git/go/src/ /home/git/gitea

As user git, run gitea for the first time:

cd /home/git/gitea
./gitea web

Press CTRL + C to stop gitea.
Did gitea start? Delete the source and its dependencies (this will delete about 500mb in files) and logout:

cd $HOME
rm -rf go
rm -rf .cache/go-build

As root, remove golang:

dnf history undo last

Gitea systemd service

As root user, create file /etc/systemd/system/gitea.service with the following contents:

#After=mariadb.service mysqld.service postgresql.service memcached.service redis.service

# Modify these two values and uncomment them if you have
# repos with lots of files and get an HTTP error 500 because
# of that
ExecStart=/home/git/gitea/gitea web
Environment=USER=git HOME=/home/git

# Some distributions may not support these hardening directives. If you cannot start the service due
# to an unknown option, comment out the ones not supported by your version of systemd.


Enable and start service (make sure the gitea selinux module is installed first):

systemctl daemon-reload
systemctl enable gitea
systemctl start gitea


Configuration file app.ini is located in /home/git/gitea/custom/conf

Config Cheat Sheet:
Customizing Gitea:

Problems when uploading release attachments?

Having issues with uploads of attachments e.g. when uploading a zip file to a release? See ALLOWED_TYPES configuration option at This worked for me in app.ini:


There is still an open issue when uploading a release attachment fails for mirror repositories.
See for more information.

linux-gitea.txt · Last modified: 2019/04/20 16:55 by chotaire