Download

wget -O gitea https://dl.gitea.io/gitea/1.5.0/gitea-1.5.0-linux-arm-7 && chmod +x gitea

Create a user system

adduser --system --shell /bin/bash --gecos 'Git Version Control' --group --disabled-password --home /home/git git

mkdir -p /home/gitea/{custom,data,indexers,public,log} /etc/gitea

mkdir -p /var/lib/gitea/{custom,data,log}

chown -R git:git /home/gitea/{data,indexers,log}

chmod -R 750 /home/gitea/{data,indexers,log} /var/lib/gitea

Create folder and copy files

mkdir /etc/gitea && chown root:git /etc/gitea && chmod 770 /etc/gitea

cp gitea /usr/local/bin/gitea

Create file service /etc/systemd/system/gitea.service

[Unit]
Description=Gitea (Git with a cup of tea)
After=syslog.target
After=network.target
#After=mysqld.service
#After=postgresql.service
#After=memcached.service
#After=redis.service

[Service]
# Modify these two values and uncomment them if you have
# repos with lots of files and get an HTTP error 500 because
# of that
###
#LimitMEMLOCK=infinity
#LimitNOFILE=65535
RestartSec=2s
Type=simple
User=git
Group=git
WorkingDirectory=/var/lib/gitea/
ExecStart=/usr/local/bin/gitea web -c /etc/gitea/app.ini
Restart=always
Environment=USER=git HOME=/home/git GITEA_WORK_DIR=/var/lib/gitea
# If you want to bind Gitea to a port below 1024 uncomment
# the two values below
###
#CapabilityBoundingSet=CAP_NET_BIND_SERVICE
#AmbientCapabilities=CAP_NET_BIND_SERVICE

[Install]
WantedBy=multi-user.target

Start service

systemctl enable gitea; systemctl start gitea

Continue setup on http://ip-or-name-server:3000

Finish setup

chmod 750 /etc/gitea && chmod 644 /etc/gitea/app.ini

Share on: TwitterFacebookEmail


Related Posts


Published

Category

Notes

Tags

Contact