GITEA is a nice web gui for GIT. It is actually much more and allows for GIT fine tuning of remote repositories and access control. It can be used to version-control any kind of sources, including text documents and scripts.

Installing is easy:

 > echo ">=acct-user/git-0-r3 gitea" >> /etc/portage/package.use/gitea
 > emerge -v gitea

Then you want to move repositories and data and config to your RAID drive, this can be done by changing user gitea home folder:

 > usermod -d /data/daemons/gitea -m gitea

Adapt default config, edit /etc/conf.d/gitea:


and also edit your /data/daemons/gitea/app.ini:

HTTP_PORT = 3001

Reverse Proxy setup

And setup NGINX reverse proxy by creating gitea.conf:

  location /gitea/ {
        client_max_body_size 512M;
        # make nginx use unescaped URI, keep "%2F" as is
        rewrite ^ $request_uri;
        rewrite ^/gitea(/.*) $1 break;
        proxy_set_header Connection $http_connection;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-WEBAUTH-USER $remote_user;
        proxy_set_header Authorization "";

(refer to The Reverse Proxy concept for more details on this)

Now your remote URLs are in the following format:

 For SSH urls: ssh://
Using Reverse Proxy authentication

GITea support reverse proxy authentication. The above NGINX config already set it up, but you need to open GITea settings and go to Authentication Sources and replace the existing one (or add a new one) ad PAM_Auth. The settings you need are:

  • pam_service_name: system-local-login

that's it.