# if this file and binary resides on other than filesystem root then COPY the service to NOT link it
# Change directories below to fit your install
[Unit]
Description=Gitea (Git with a cup of tea)
After=syslog.target
After=network.target
# Binary, System Files and Repos on other than filesystem root then include this require/after
# With below command you can find the unit of the mounted drive of those files
#systemctl list-units | grep
# gitea files in opt/gitea
Requires=opt.mount
After=opt.mount
# repo/db/data for gitea in mnt/git-server
Requires=mnt-data.mount
After=mnt-data.mount
# using local sqlite
#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=sysadmin
Group=sysadmin
Environment=GITEA_DIR=@d
Environment=GITEA_REPOS=@r
ExecStart=/bin/bash -c '${GITEA_DIR}/scripts/run -r ${GITEA_REPOS} %i '
Restart=always
# 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