package-pipelines-miscellan.../forgejo/debian.postinst

26 lines
545 B
Text
Raw Normal View History

2023-12-05 23:40:22 +01:00
#!/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