yoloserv/doc/gitea_setup.md

1.8 KiB

Gitea Setup

Table of Contents

The Problem we faced is that yoloserv was to big to be hosted on Gitlab. Gitlab would also suspend the repo if bills were not paid and user seats were maxed. Obviously this was not a viable solution. Explored maybe self hosting without an intreface just to have repos but when I read Gitea did not need docker and could be run as a system service I tried it out.

Setting up the Server

First step was setting up the server to run gitea. I scanned my local netowrk with bash arp-scan --localnet to find the IP address of the server. I could nto find my server running I had to reset the DHCP client with these commands. Use nmcli connection show to find the connection name and then nmcli connection down <connection name> and nmcli connection up <connection name> to reset the DHCP client. Was able to succesfully ping 8.8.8.8 to confirm the server was running.

Installation

I remoted onto the server and installed gitea with the following commands:

Ran free -h to check memory and df -h to check disk space. Was recommended to have at least 8GB of RAM and 2.5 repo size of disk space. These seem a bit much.

Depending on what distro you run commands may vary but I:

  • Updated and upgraded the system
  • Installed git, openssh-server, ufw and fail2ban
  • sudo ufw enable, sudo ufw allow ssh, sudo ufw allow 3000

SSH Hardening

Can harden the SSH to be keys only should be done will be a future addition. Done in /etc/ssh/sshd_config. Run sudo systemctl restart sshd to apply changes.

PasswordAuthentication no
PermitRootLogin no