26 lines
545 B
Text
26 lines
545 B
Text
|
#!/bin/bash
|
||
|
|
||
|
set -e
|
||
|
|
||
|
if [[ "$1" == "configure" ]]; then
|
||
|
|
||
|
if ! getent group gitea >/dev/null; then
|
||
|
groupadd --system gitea
|
||
|
fi
|
||
|
|
||
|
if ! getent passwd gitea >/dev/null; then
|
||
|
useradd --system --gid gitea --home-dir /var/lib/gitea --shell /bin/bash gitea
|
||
|
fi
|
||
|
|
||
|
chown gitea:gitea /var/lib/gitea
|
||
|
chmod 0750 /var/lib/gitea
|
||
|
chown root:gitea /etc/gitea/app.ini
|
||
|
chmod g+rx /etc/gitea
|
||
|
chmod g+rw /etc/gitea/app.ini
|
||
|
|
||
|
deb-systemd-helper enable gitea.service
|
||
|
deb-systemd-invoke restart gitea.service
|
||
|
|
||
|
fi
|
||
|
|