Expand Cut Tags

No cut tags
cbrachyrhynchos: (Default)
[personal profile] cbrachyrhynchos

While Nextcloud is nifty for keeping files synchronized across multiple computers. It doesn't handle git archives well. And while I could just use git over ssh, the web-based front ends add some interesting features including:

  • web-based editing
  • big-picture views of when files changed
  • ability to download or pull stuff without ssh.

Gitea seemed like an interesting project that covers most of what I need with a minimal footprint. This unfortunately led me down a rabbit hole of issues that probably would have been fixed if I just bothered to read the manual. Some findings:

Put the gitea binary in your data directory.

Most of what I'm used to involves the standard unix layout. Executable files live in some variant of /usr/bin or /usr/local/bin. Most configuration files live in /etc or /usr/local/etc. Data goes somewhere under /var. Gitea likes to put data in the same directory where the executable lives and fails (without error) if it can't write there. So the gitea executable on my system lives in /home/git.

First run to set up the config files.

To set everything up, run sudo -u git /home/git/gitea web. Gitea will run a web server at http://localhost:3000/ (I had to open a hole in the firewall and log in via ip number). That will take care of most settings including the URL you want to run gitea at. Mine runs under a sub-url of https://hostname.com/gitea. I'm using sqlite3 for my database backend since I plan on being the only user.

After that, you want to create your first admin user by registering.

Gitea Configuration

After the first run, I got into the generated config file to set some other options.

Set gitea to be available at https://hostname.com/gitea/:


ROOT_URL         = https://hostname.com/gitea/

Enable the gitea ssh server because I couldn't get openSSH integration working. I picked an arbitrary port number for gitea to listen for ssh connections:


SSH_PORT         = 7124

Disable registration (since I'm the only user) and require login to view anything:



Apache Configuration

Configuring apache as a proxy server was another pain in the ass that could have been handled by RTFM.

        ProxyPreserveHost On
        ProxyRequests off
        ProxyPass /gitea http://hostname.com:3000
        ProxyPassReverse /gitea http://hostname.com:3000
        RewriteRule ^/gitea - [QSA,L]

SystemD Configuration

Use the template in the contrib folder for gitea. Hopefully everything will run, and with a few repos added, the result should look something like this:

gitea screenshot

Anonymous( )Anonymous This account has disabled anonymous posting.
OpenID( )OpenID You can comment on this post while signed in with an account from many other sites, once you have confirmed your email address. Sign in using OpenID.
Account name:
If you don't have an account you can create one now.
HTML doesn't work in the subject.


Notice: This account is set to log the IP addresses of everyone who comments.
Links will be displayed as unclickable URLs to help prevent spam.


cbrachyrhynchos: (Default)

July 2017

234 5678
91011 1213 1415
16 17 1819202122
23 2425 26272829

Most Popular Tags

Style Credit

Page generated Jul. 28th, 2017 07:00 pm
Powered by Dreamwidth Studios