gitea first commit slackbuilds

This commit is contained in:
2026-04-07 17:08:43 -03:00
commit dde5c94590
21 changed files with 1880 additions and 0 deletions

33
slackbuilds/doinst.sh Normal file
View File

@@ -0,0 +1,33 @@
#!/bin/sh
# doinst.sh - Post-installation script for gitea
# Create git group if it doesn't exist
if ! getent group git > /dev/null 2>&1; then
groupadd -r git
fi
# Create git user if it doesn't exist
if ! getent passwd git > /dev/null 2>&1; then
useradd -r -g git -d /var/lib/gitea -s /bin/bash -c "Gitea service" git
fi
# Set ownership on gitea directories
chown -R git:git /var/lib/gitea/
chmod -R 750 /var/lib/gitea/
chown root:git /etc/gitea
chmod 770 /etc/gitea
# Handle .new configuration files
config()
{
NEW="$1"
OLD="$(dirname $NEW)/$(basename $NEW .new)"
if [ ! -r "$OLD" ]; then
mv "$NEW" "$OLD"
elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then
rm "$NEW"
fi
}
config etc/gitea/app.ini.new
config etc/rc.d/rc.gitea.new