2022-03-08 19:42:28 +01:00
|
|
|
#ORIGIN https://raw.githubusercontent.com/go-gitea/gitea/main/contrib/systemd/gitea.service
|
|
|
|
[Unit]
|
|
|
|
Description=Gitea (Git with a cup of tea)
|
2022-08-18 16:38:37 +02:00
|
|
|
After=risotto.target
|
2022-03-08 19:42:28 +01:00
|
|
|
|
|
|
|
[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=gitea
|
|
|
|
Group=gitea
|
|
|
|
WorkingDirectory=/srv/gitea/lib/
|
|
|
|
ExecStart=/usr/bin/gitea web --config /etc/gitea/app.ini
|
2022-07-16 22:16:24 +02:00
|
|
|
ExecStartPre=-/bin/bash -c 'if /usr/bin/gitea admin auth list --config /etc/gitea/app.ini | grep "OAuth2"; then echo "UPDATE";id=$(/usr/bin/gitea --config /etc/gitea/app.ini admin auth list |tail -n 1|awk "{ print \$1}");/usr/bin/gitea admin auth update-oauth --id $id --name "%%domain_name_eth0" --provider "openidConnect" --key "%%oauth2_client_id" --secret "%%oauth2_client_secret" --scopes "profile email" --auto-discover-url "https://%%oauth2_client_server_domainname/.well-known/openid-configuration" --config /etc/gitea/app.ini;else echo "CONFIGURE"; /usr/bin/gitea admin auth add-oauth --name "%%domain_name_eth0" --provider "openidConnect" --key "%%oauth2_client_id" --secret "%%oauth2_client_secret" --scopes "profile email" --auto-discover-url "https://%%oauth2_client_server_domainname/.well-known/openid-configuration" --config /etc/gitea/app.ini;fi;sleep 2; echo "CONFIGURATION DONE"'
|
2022-03-08 19:42:28 +01:00
|
|
|
Restart=always
|
|
|
|
Environment=USER=gitea HOME=/srv/gitea/home GITEA_WORK_DIR=/srv/gitea/lib
|
|
|
|
|
|
|
|
[Install]
|
|
|
|
WantedBy=multi-user.target
|