installing gitea

Oct 20, 2023

https://docs.gitea.io/en-us/install-from-binary/

adduser \
   --system \
   --shell /bin/bash \
   --gecos 'Git Version Control' \
   --group \
   --disabled-password \
   --home /home/git \
   git
mkdir -p /var/lib/gitea/{custom,data,log}
chown -R git:git /var/lib/gitea/
chmod -R 750 /var/lib/gitea/
mkdir /etc/gitea
chown root:git /etc/gitea
chmod 770 /etc/gitea

# > NOTE: /etc/gitea is temporary set with write rights for user git so that Web installer could write configuration file. After installation is done, it is recommended to set rights to read-only using:

# > chmod 751 /etc/gitea
# > chmod 640 /etc/gitea/app.ini
wget https://dl.gitea.io/gitea/1.17/gitea-1.17-linux-amd64
mv gitea-1.17-linux-amd64 gitea
mv gitea /usr/local/bin/
# create this file and copy in the contents
vim /etc/systemd/system/gitea.service

# enable it (we're already root, no need to sudo)
root@billmill:~# systemctl enable gitea
Created symlink /etc/systemd/system/multi-user.target.wants/gitea.service  /etc/systemd/system/gitea.service.

# start it
systemctl start gitea

# view it
systemctl status gitea
root@billmill:~# lsof -i -P -n | grep gitea
gitea     1587950             git    6u  IPv6 26317531      0t0  TCP *:3000 (LISTEN)
# reverse proxy to gitea
gitea.billmill.org {
    reverse_proxy 127.0.0.1:3000
}

ssh-keygen -t ed25519

↑ up