From 73f653729c9200298fa954db41dc1d829f1f9729 Mon Sep 17 00:00:00 2001 From: morph027 Date: Sat, 20 Jun 2020 10:16:02 +0200 Subject: [PATCH] systemd: add GITEA_WORK_DIR, relax EnvironmentFile loader --- package_scripts/after-install.sh | 6 +++++- package_scripts/gitea.service | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/package_scripts/after-install.sh b/package_scripts/after-install.sh index 1b3daf0..370bf2d 100644 --- a/package_scripts/after-install.sh +++ b/package_scripts/after-install.sh @@ -6,5 +6,9 @@ getent passwd gitea >/dev/null 2>&1 || adduser \ --gecos 'Gitea' \ --group \ --disabled-password \ - --home /home/gitea \ + --home /var/lib/gitea \ gitea + +if [ ! -d /etc/gitea ]; then + install -d -o gitea -g gitea -m 770 /etc/gitea +fi diff --git a/package_scripts/gitea.service b/package_scripts/gitea.service index f769bb2..8c55c91 100644 --- a/package_scripts/gitea.service +++ b/package_scripts/gitea.service @@ -10,7 +10,8 @@ Group=gitea WorkingDirectory=/var/lib/gitea/ ExecStart=/usr/bin/gitea web -c /etc/gitea/app.ini Restart=always -EnvironmentFile=/etc/default/gitea +Environment="GITEA_WORK_DIR=/var/lib/gitea/" +EnvironmentFile=-/etc/default/gitea [Install] WantedBy=multi-user.target