Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5fdb221abc | |||
| 46df78d59e | |||
| 0188b0cb2f |
@@ -22,6 +22,9 @@ Install the Git server called Gitea.
|
||||
%make_install
|
||||
|
||||
%post
|
||||
# Display commands and exit on error
|
||||
set -xe
|
||||
|
||||
# Create gitea user
|
||||
if ! id gitea >/dev/null 2>&1; then
|
||||
useradd --base-dir %{_sharedstatedir} --create-home --shell $SHELL --system gitea
|
||||
@@ -29,6 +32,7 @@ fi
|
||||
runuser --user=gitea -- mkdir --parents %{_sharedstatedir}/gitea/{custom,data,log} %{_sharedstatedir}/gitea/custom/conf
|
||||
runuser --user=gitea -- ln --symbolic --force %{_sysconfdir}/gitea/app.ini %{_sharedstatedir}/gitea/custom/conf/app.ini
|
||||
usermod --groups postgres,valkey --append gitea
|
||||
runuser --user=gitea -- printf 'export GITEA_WORK_DIR=$HOME\n' >> ~/.bash_profile
|
||||
|
||||
# Download and install gitea binary
|
||||
export ARCH=$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/')
|
||||
@@ -78,7 +82,6 @@ wget --output-document $ACTRUNNER_BINARY.xz.sha256 https://gitea.com/gitea/act_r
|
||||
cat $ACTRUNNER_BINARY.xz.sha256 | sha256sum --check --status
|
||||
rm $ACTRUNNER_BINARY.xz.sha256
|
||||
unxz $ACTRUNNER_BINARY.xz
|
||||
rm $ACTRUNNER_BINARY.xz
|
||||
chmod 755 $ACTRUNNER_BINARY
|
||||
mv $ACTRUNNER_BINARY %{_sbindir}/act_runner
|
||||
|
||||
@@ -100,6 +103,9 @@ systemctl reenable gitea.service
|
||||
systemctl restart gitea.service nginx.service
|
||||
|
||||
%postun
|
||||
# Display commands and exit on error
|
||||
set -xe
|
||||
|
||||
# If uninstalling, then delete users and db
|
||||
if [ $1 == 0 ]; then
|
||||
# Remove gitea user if existing
|
||||
|
||||
Reference in New Issue
Block a user