Expand Cut Tags

No cut tags

Jul. 5th, 2017

cbrachyrhynchos: (Default)

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/:

[server]
...

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:

[server]
...

SSH_PORT         = 7124
START_SSH_SERVER = true

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

[service]
...

DISABLE_REGISTRATION       = true
REQUIRE_SIGNIN_VIEW        = true

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

Profile

cbrachyrhynchos: (Default)
cbrachyrhynchos

July 2017

S M T W T F S
       1
234 5678
91011 1213 1415
16 17 1819202122
23 2425 26272829
3031     

Most Popular Tags

Page Summary

Style Credit

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