===== Gitea Installation ===== ==== Installing Gitea itself ==== - Download and extract [[https://dl.gitea.io/gitea/|binary]] \\ ''curl -O https://dl.gitea.io/gitea/1.12.4/gitea-1.12.4-linux-arm64.xz'' \\ ''xz -d gitea-1.12.4-linux-arm64.xz'' - Move binary to path \\ ''mv gitea-1.12.4-linux-arm64 /usr/local/bin/gitea\\ chmod +x /usr/local/bin/gitea'' - Create git user \\ ''%%adduser --system --shell /bin/bash --gecos 'Git Version Control' --group --disabled-password --home /web/git git%%'' - Create directories \\ ''mkdir -p /web/git/lib/{custom,data,log}\\ ln -s /web/git/lib /var/lib/gitea\\ chown -R git:git /web/git/lib\\ chmod -R 750 /web/git/lib\\ mkdir /web/git/etc\\ ln -s /web/git/etc /etc/gitea\\ chown root:git /web/git/etc\\ chmod 770 /web/git/etc'' - Create systemd unit in ''/etc/systemd/system/gitea.''\\ [Unit] Description=Gitea (Git with a cup of tea) After=syslog.target After=network.target [Service] RestartSec=2s Type=simple User=git Group=git WorkingDirectory=/web/git/lib/ ExecStart=/usr/local/bin/gitea web --config /web/git/etc/app.ini Restart=always Environment=USER=git HOME=/web/git GITEA_WORK_DIR=/web/git/lib [Install] WantedBy=multi-user.target - Add unit it to start-full-system.target.wants\\ ''ln -s /etc/systemd/system/gitea /etc/systemd/system/start-full-system.target.wants''\\ Alternatively, just enable:\\ ''systemctl enable gitea''. - Reload units and start Gitea\\ ''systemctl daemon-reload''\\ ''systemctl start gitea'' - Access web server on port 3000, i.e. [[http://athena:3000/]] - Click Register to start configuration - Choose SQLite3 or what have you - Change Site Title, SSH Server Domain & Port, Gitea Base URL - Server and Third-Party Service Settings: Disable Self-Registration - Administrator Account Settings: Create a user ==== nginx Configuration ==== - Stop gitea and change base URL. Change the following line in ''/web/git/etc/app.ini'':\\ ROOT_URL = https://wgratz.net/gitea/ - Insert into nginx config:\\ location /gitea { return 301 $scheme://$host/gitea/; } location ^~ /gitea/ { proxy_pass http://localhost:3000; rewrite /gitea(.*) $1 break; } ==== Links ==== [[https://docs.gitea.io/en-us/install-from-binary/|Gitea.io - Install from binary]] [[https://dl.gitea.io/gitea/|Gitea.io - Download links]]