Install gitea snap
1 |
snap install gitea --channel=latest/stable |
Add user
1 |
useradd -r -s /bin/bash -d /home/git git |
systemctl edit snap.gitea.web.service
1 2 3 4 5 6 7 8 9 10 11 12 13 |
[Unit] After=mysqld.service AssertPathIsDirectory=/home/git AssertPathIsReadWrite=/home/git [Service] User=git Group=git Environment="GITEA_WORK_DIR=/home/git" "GITEA_CUSTOM=/home/git/custom" WorkingDirectory=/home/git ExecStart= ExecStart=/usr/bin/snap run gitea.web --config /home/git/app.ini Restart=always |
In app.ini
1 2 3 4 5 |
; ; Port number to be exposed in clone URL SSH_PORT = 22 ; ; ; ; The port number the builtin SSH server should listen on SSH_LISTEN_PORT = 2222 |
add firewall forward rule
1 |
firewall-cmd --permanent --add-forward-port=port=22:proto=tcp:toport=2222 --zone=public |