3 Commits

Author SHA1 Message Date
0188b0cb2f fix: unxz does already remove file automatically
All checks were successful
Continuous Delivery / build_n_upload (push) Successful in 22s
2026-04-06 16:45:33 +02:00
c2b680c6df fix: typo in token generate command
Some checks failed
Continuous Delivery / build_n_upload (push) Has been cancelled
2026-04-06 11:01:33 +02:00
545898493c fix: add logos to files
Some checks failed
Continuous Delivery / build_n_upload (push) Has been cancelled
2026-04-06 10:47:25 +02:00

View File

@@ -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
@@ -55,7 +58,7 @@ export GITEA_LUGIT_THEME=gitea-lugit-theme
wget --output-document %{_tmppath}/$GITEA_LUGIT_THEME.tar.gz https://github.com/lucas-labs/gitea-lugit-theme/releases/download/v1.0.1/$GITEA_LUGIT_THEME.tar.gz
runuser --user=gitea -- tar --extract --gzip --overwrite --directory=%{_sharedstatedir}/gitea/custom --file %{_tmppath}/$GITEA_LUGIT_THEME.tar.gz
rm %{_tmppath}/$GITEA_LUGIT_THEME.tar.gz
runuser --user=gitea -- mv %{_tmppath}/gitea_images/* %{_sharedstatedir}/gitea/custom/public/assets/img
runuser --user=gitea -- cp %{_tmppath}/gitea_images/* %{_sharedstatedir}/gitea/custom/public/assets/img
# Create postgres user and db
if ! runuser --user=postgres -- psql --quiet --tuples-only --command='\du' | grep --quiet gitea; then
@@ -78,12 +81,11 @@ 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
# Create 4 actrunner users
export ACTRUNNER_TOKEN=$(runuser --user=gitea -- gitea actions generate-token-runner --scope samuel)
export ACTRUNNER_TOKEN=$(runuser --user=gitea -- gitea actions generate-runner-token)
for i in $(seq 1 4); do
if ! id actrunner$i >/dev/null 2>&1; then
useradd --base-dir %{_sharedstatedir} --create-home --shell $SHELL --system actrunner$i
@@ -100,6 +102,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
@@ -136,6 +141,7 @@ fi
%ghost %attr(755, root, root) %{_sbindir}/act_runner
%dir %attr(755, root, root) %{_tmppath}/gitea_images
%attr(644, root, root) %{_tmppath}/gitea_images/{favicon,logo}.{png,svg}
%changelog
%autochangelog