15 Commits

Author SHA1 Message Date
e19760d37e fix: typo in spec
Some checks failed
Continuous Delivery / build_n_upload (push) Has been cancelled
2026-03-01 17:03:10 +01:00
89837bef2b fix: remove wget output
Some checks failed
Continuous Delivery / build_n_upload (push) Has been cancelled
2026-03-01 16:56:47 +01:00
3334a877d7 fix: group not exists
Some checks failed
Continuous Delivery / build_n_upload (push) Has been cancelled
2026-03-01 16:45:01 +01:00
bdfe38f896 fix: create gitea user in %pre
Some checks failed
Continuous Delivery / build_n_upload (push) Has been cancelled
2026-03-01 16:38:59 +01:00
de28f71901 fix: config file rights
Some checks failed
Continuous Delivery / build_n_upload (push) Has been cancelled
2026-03-01 16:35:03 +01:00
c313318eb0 fix: dump as gitea 2026-03-01 15:39:38 +01:00
13ed7bfcd8 fix: source dir
Some checks failed
Continuous Delivery / build_n_upload (push) Has been cancelled
2026-03-01 15:37:19 +01:00
366fdd5d34 fix: missing white space
Some checks failed
Continuous Delivery / build_n_upload (push) Has been cancelled
2026-03-01 15:24:08 +01:00
9a5b698f78 fix: add nginx config in install
Some checks failed
Continuous Delivery / build_n_upload (push) Has been cancelled
2026-03-01 15:22:20 +01:00
266a467aa1 feat: add nginx conf 2026-03-01 15:16:59 +01:00
f2c4e95f6f fix: variable typo 2026-03-01 15:07:21 +01:00
4340543fd5 fix: typo in Makefile
Some checks failed
Continuous Delivery / build_n_upload (push) Has been cancelled
2026-02-26 16:17:14 +01:00
b3c20b7831 fix: typo in spec file 2026-02-26 16:12:36 +01:00
2749347415 fix: add unit dir 2026-02-26 14:53:37 +01:00
80210206bf feat: add actrunners 2026-02-26 14:51:52 +01:00
6 changed files with 76 additions and 18 deletions

View File

@@ -2,14 +2,16 @@ NAME = netoik-git
VERSION = $(shell git describe --abbrev=0)
RELEASE = $(shell git rev-parse --short HEAD)
REFERENCE = $(if $(GIT_REFERENCE),$(GIT_REFERENCE),$(shell git branch --show-current))
BUILD_ARCH = noarch
ARCH = noarch
RPM_RPMDIR = $(shell rpm --eval '%{_rpmdir}')
RPM_SBINDIR = $(shell rpm --eval '%{_sbindir}')
RPM_SOURCEDIR = $(shell rpm --eval '%{_sourcedir}')
RPM_SHAREDSTATEDIR = $(shell rpm --eval '%{_sharedstatedir}')
RPM_SYSCONFDIR = $(shell rpm --eval '%{_sysconfdir}')
RPM_UNITDIR = $(shell rpm --eval '%{_unitdir}')
RPM_TARBALL_PATH = $(RPM_SOURCEDIR)/$(NAME)-$(VERSION).tar.gz
RPM_TARBALL_PATH = $(RPM_SOURCEDIR)/$(NAME)-$(VERSION)-$(RELEASE).tar.gz
RPM_BUILD_PATH = $(RPM_RPMDIR)/$(BUILD_ARCH)/$(NAME)-$(VERSION)-$(RELEASE).$(BUILD_ARCH).rpm
.PHONY: name
@@ -24,15 +26,16 @@ version:
release:
@echo "$(RELEASE)"
.PHONY: build_arch
build_arch:
@echo "$(BUILD_ARCH)"
.PHONY: arch
arch:
@echo "$(ARCH)"
.PHONY: install
install:
install --mode=755 --directory $(DESTDIR)$(RPM_SYSCONFDIR)/gitea $(DESTDIR)$(RPM_UNITDIR) $(DESTDIR)/actrunners
install --mode=644 --target-directory=$(DESTDIR)$(RPM_SYSCONFDIR)/gitea files/gitea/app.ini
install --mode=644 --target-directory=$(DESTDIR)$(RPM_UNITDIR)/ files/systemd/gitea.service files/systemd/actrunner@.service
install --mode=755 --directory $(DESTDIR)$(RPM_SYSCONFDIR)/gitea $(DESTDIR)$(RPM_SYSCONFDIR)/nginx/conf.d $(DESTDIR)$(RPM_UNITDIR) $(DESTDIR)$(RPM_SHAREDSTATEDIR)/actrunners
install --mode=644 --target-directory=$(DESTDIR)$(RPM_SYSCONFDIR)/nginx/conf.d/ files/nginx/git.netoik.io.conf
install --mode=640 --target-directory=$(DESTDIR)$(RPM_SYSCONFDIR)/gitea files/gitea/app.ini
install --mode=644 --target-directory=$(DESTDIR)$(RPM_UNITDIR) files/systemd/gitea.service files/systemd/actrunner@.service
$(RPM_TARBALL_PATH): *
git archive --format=tar.gz \

View File

@@ -30,4 +30,4 @@ DISABLE_REGISTRATION = true
[session]
PROVIDER = redis
PROVIDER_CONFIG = /run/redis/redis.sock
PROVIDER_CONFIG = /run/valkey/valkey.sock

View File

@@ -0,0 +1,9 @@
server {
listen 443 ssl;
server_name git.netoik.io;
location / {
proxy_pass http://127.0.0.1:3000;
}
}

View File

@@ -7,7 +7,7 @@ After=network.target gitea.service
ExecStartPre=/usr/bin/rpmdev-setuptree
ExecStart=/usr/local/bin/act_runner daemon
ExecReload=/bin/kill -s HUP $MAINPID
WorkingDirectory=/opt/actrunners/actrunner%i
WorkingDirectory=/var/lib//actrunners/actrunner%i
TimeoutSec=0
RestartSec=10
Restart=always

View File

@@ -1,6 +1,6 @@
[Unit]
Description=Gitea (Git with a cup of tea)
After=network.target postgresql.service
After=network.target postgresql.service valkey.service
[Service]
RestartSec=2s

View File

@@ -7,10 +7,10 @@ Summary: Netoik Reverse Proxy
License: MIT
URL: https://git.netoik.io/samuel/%(make name)
Source0: %{name}-%{version}.tar.gz
Buildarch: %(make build_arch)
Source0: %{name}-%{version}-%{release}.tar.gz
Buildarch: %(make arch)
BuildRequires: make
Requires: netoik-db git
Requires: netoik-rp netoik-db netoik-cache git
%description
Install the Git UI server called Gitea.
@@ -22,17 +22,63 @@ Install the Git UI server called Gitea.
%make_install
%post
# Download gitea bin and verify gpg signature
wget --quiet --output-document %{_tmppath}/gitea "$GITEA_BIN_URL"
wget --quiet --output-document %{_tmppath}/gitea.asc "$GITEA_ASC_URL"
gpg --keyserver "$GITEA_GPG_KEYSERVER" --recv "$GITEA_GPG_RECV"
gpg --verify %{_tmppath}/gitea.asc %{_tmppath}/gitea
mv %{_tmppath}/gitea %{_sbindir}
chmod 755 %{_sbindir}/gitea
rm %{_tmppath}/gitea.asc
# Generate internal token and secret key
INTERNAL_TOKEN="$(gitea generate secret INTERNAL_TOKEN)"
SECRET_KEY="$(gitea generate secret SECRET_KEY)"
envsubst < %{_sysconfdir}/gitea/app.ini > %{_sysconfdir}/gitea/app.ini.new
mv %{_sysconfdir}/gitea/app.ini.new %{_sysconfdir}/gitea/app.ini
# Create gitea user
useradd --system --create-home --base-dir %{_sharedstatedir} gitea
runuser --user gitea -- mkdir --parents %{_sharedstatedir}/gitea/{data,custom}
chgrp gitea %{_sysconfdir}/gitea/app.ini
# Start gitea and nginx services
systemctl daemon-reload
systemctl reenable gitea.service
systemctl restart gitea.service
systemctl restart nginx.service
# Create actrunners
for i in $(seq 1 $GITEA_ACT_RUNNERS); do
if ! id "actrunner$i"; then
useradd --system --create-home --base-dir %{_sharedstatedir}/actrunners "actrunner$i"
systemctl daemon-reload
systemctl reenable "actrunner@$i"
systemctl restart "actrunner@$i"
fi
done
%preun
# Backup gitea data in case of problem
runuser --user gitea -- gitea dump --config %{_sysconfdir}/gitea/app.ini --tempdir %{_tmppath}
%postun
# Remove gitea user after uninstall
#if [ %1 == 0 ]; then
# systemctl stop gitea.service
# userdel --force --remove gitea
#fi
%files
%attr(644, root, root) %{_sysconfdir}/nginx/conf.d/git.netoik.io.conf
%dir %attr(755, root, root) %{_sysconfdir}/gitea
%attr(600, root, root) %{_sysconfdir}/gitea/app.ini
%attr(640, root, -) %{_sysconfdir}/gitea/app.ini
%attr(644, root, root) %{_unitdir}/gitea.service
%attr(644, root, root) %{_unitdir}/actrunner@.service
%dir %attr(755, root, root) /opt/actrunners
%dir %attr(755, root, root) %{_sharedstatedir}/actrunners
%changelog
%autochangelog