# YAOM gitlab installation Debian 11

apt update && apt upgrade -y && apt dist-upgrade -y && apt autoremove -y && echo "OK"

apt install git mariadb-server -y
mysql_secure_installation

wget -O gitea https://dl.gitea.io/gitea/1.17.3/gitea-1.17.3-linux-amd64
chmod +x gitea
cp gitea /usr/local/bin/gitea

wget "https://raw.githubusercontent.com/go-gitea/gitea/main/contrib/systemd/gitea.service" -O /etc/systemd/system/gitea.service
systemctl enable gitea
systemctl start gitea

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

mysql -u root
CREATE DATABASE gitea;
CREATE USER 'gitea'@localhost IDENTIFIED BY 'xxxxxxxx';
GRANT ALL PRIVILEGES ON *.* TO 'gitea'@localhost IDENTIFIED BY 'xxxxxxxx';
FLUSH PRIVILEGES;
exit

Open https://git.bici.madrid/ and follow the wizard to finish the installation.

chmod 750 /etc/gitea
chmod 640 /etc/gitea/app.ini