From cf0748a0265679d5063c91999fad1d941d0311a1 Mon Sep 17 00:00:00 2001 From: midoks Date: Sat, 25 Jun 2022 23:55:29 +0800 Subject: [PATCH] up --- plugins/gogs/init.d/gogs.service.tpl | 6 +++--- plugins/gogs/install.sh | 8 ++++++++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/plugins/gogs/init.d/gogs.service.tpl b/plugins/gogs/init.d/gogs.service.tpl index 1936b6ac7..8b58b1c81 100644 --- a/plugins/gogs/init.d/gogs.service.tpl +++ b/plugins/gogs/init.d/gogs.service.tpl @@ -10,13 +10,13 @@ After=network.target #LimitMEMLOCK=infinity #LimitNOFILE=65535 Type=simple -User=root -Group=root +User=git +Group=git WorkingDirectory={$SERVER_PATH}/gogs ExecStart={$SERVER_PATH}/gogs/gogs web ExecReload=/bin/kill -USR2 $MAINPID Restart=always -Environment=USER=root HOME=/root +Environment=USER=git HOME=/home/git # Some distributions may not support these hardening directives. If you cannot start the service due # to an unknown option, comment out the ones not supported by your version of systemd. diff --git a/plugins/gogs/install.sh b/plugins/gogs/install.sh index c9631fac9..e33e54734 100755 --- a/plugins/gogs/install.sh +++ b/plugins/gogs/install.sh @@ -35,6 +35,14 @@ Install_gogs() version=$1 os=`getOs` + if id git &> /dev/null ;then + echo "git uid is `id -u git`" + echo "git shell is `grep "^git:" /etc/passwd |cut -d':' -f7 `" + else + groupadd git + useradd -g git git + fi + if [ "darwin" == "$os" ];then file=gogs_${version}_darwin_amd64.zip else