1
0
This repository has been archived on 2024-03-30. You can view files and clone it, but cannot push or open issues or pull requests.
Matheus Sampaio Queiroga 469d6e2d43
Some checks failed
/ release (push) Blocked by required conditions
/ build (riscv64) (push) Has been cancelled
/ build (arm) (push) Has been cancelled
/ build (386) (push) Has been cancelled
/ build (arm64) (push) Has been cancelled
/ build (amd64) (push) Has been cancelled
Update post install
Signed-off-by: Matheus Sampaio Queiroga <srherobrine20@gmail.com>
2024-03-29 19:03:22 -03:00

32 lines
1008 B
Bash
Executable File

#!/usr/bin/env bash
# https://docs.gitea.io/en-us/install-from-binary/
USERNAME=git
GROUP=git
if getent passwd gitea >/dev/null 2>&1; then
USERNAME=gitea
GROUP=gitea
elif ! getent passwd $USERNAME >/dev/null 2>&1;then
echo "Creating $USERNAME user"
adduser --system --shell /bin/bash --gecos 'Git Version Control' --group --disabled-password --home /var/lib/gitea/home $USERNAME
fi
if ![[ -f "/etc/gitea/app.ini" ]]; then
echo "Creating and set permissions to /etc/gitea"
mkdir /etc/gitea || echo "Folder ared exit, continue"
chown -R root:$GROUP /etc/gitea
chmod 770 /etc/gitea
cp -v /etc/gitea/example.ini /etc/gitea/app.ini
chmod 640 /etc/gitea/app.ini
fi
# Set gitea folder permisions
chown $USERNAME:$GROUP /var/lib/gitea
# Start service
if command -v systemctl &> /dev/null; then
systemctl daemon-reload || echo "Systemctl not loaded"
systemctl enable gitea.service || echo "Gitea service is ared enabled"
systemctl restart gitea.service || echo "Systemctl not loaded"
fi