Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 0188b0cb2f | |||
| c2b680c6df |
@@ -22,6 +22,9 @@ Install the Git server called Gitea.
|
|||||||
%make_install
|
%make_install
|
||||||
|
|
||||||
%post
|
%post
|
||||||
|
# Display commands and exit on error
|
||||||
|
set -xe
|
||||||
|
|
||||||
# Create gitea user
|
# Create gitea user
|
||||||
if ! id gitea >/dev/null 2>&1; then
|
if ! id gitea >/dev/null 2>&1; then
|
||||||
useradd --base-dir %{_sharedstatedir} --create-home --shell $SHELL --system gitea
|
useradd --base-dir %{_sharedstatedir} --create-home --shell $SHELL --system gitea
|
||||||
@@ -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
|
cat $ACTRUNNER_BINARY.xz.sha256 | sha256sum --check --status
|
||||||
rm $ACTRUNNER_BINARY.xz.sha256
|
rm $ACTRUNNER_BINARY.xz.sha256
|
||||||
unxz $ACTRUNNER_BINARY.xz
|
unxz $ACTRUNNER_BINARY.xz
|
||||||
rm $ACTRUNNER_BINARY.xz
|
|
||||||
chmod 755 $ACTRUNNER_BINARY
|
chmod 755 $ACTRUNNER_BINARY
|
||||||
mv $ACTRUNNER_BINARY %{_sbindir}/act_runner
|
mv $ACTRUNNER_BINARY %{_sbindir}/act_runner
|
||||||
|
|
||||||
# Create 4 actrunner users
|
# 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
|
for i in $(seq 1 4); do
|
||||||
if ! id actrunner$i >/dev/null 2>&1; then
|
if ! id actrunner$i >/dev/null 2>&1; then
|
||||||
useradd --base-dir %{_sharedstatedir} --create-home --shell $SHELL --system actrunner$i
|
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
|
systemctl restart gitea.service nginx.service
|
||||||
|
|
||||||
%postun
|
%postun
|
||||||
|
# Display commands and exit on error
|
||||||
|
set -xe
|
||||||
|
|
||||||
# If uninstalling, then delete users and db
|
# If uninstalling, then delete users and db
|
||||||
if [ $1 == 0 ]; then
|
if [ $1 == 0 ]; then
|
||||||
# Remove gitea user if existing
|
# Remove gitea user if existing
|
||||||
|
|||||||
Reference in New Issue
Block a user