#!/bin/sh set GITEA_V=1.22.2 # fetch binary wget -O gitea https://dl.gitea.com/gitea/$GITEA_V/gitea-$GITEA_V-linux-amd64 chmod +x gitea # git, add user adduser \ --system \ --shell /bin/bash \ --gecos 'Git Version Control' \ --group \ --disabled-password \ --home /home/git \ git # git, dir structure 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 # git, move bin mv gitea /usr/local/bin/gitea # git, as service sudo cat > /etc/systemd/system/gitea.service < chmod 750 /etc/gitea" echo "> chmod 640 /etc/gitea/app.ini"