19 Commits

Author SHA1 Message Date
641ac4adb6 fix: forgejo web command
Some checks failed
Continuous Delivery / build_n_upload (push) Has been cancelled
2026-03-03 01:34:18 +01:00
bb55579880 fix: usermod command syntax
Some checks failed
Continuous Delivery / build_n_upload (push) Has been cancelled
2026-03-03 01:28:21 +01:00
c4adafb535 fix: add folders in make instal
Some checks failed
Continuous Delivery / build_n_upload (push) Has been cancelled
2026-03-03 01:11:39 +01:00
c0de29a266 feat: replace gitea by forgejo 2026-03-03 01:09:48 +01:00
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
7 changed files with 63 additions and 64 deletions

View File

@@ -2,37 +2,45 @@ 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
OWNER = samuel
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
name:
@echo "$(NAME)"
@echo $(NAME)
.PHONY: version
version:
@echo "$(VERSION)"
@echo $(VERSION)
.PHONY: release
release:
@echo "$(RELEASE)"
@echo $(RELEASE)
.PHONY: build_arch
build_arch:
@echo "$(BUILD_ARCH)"
.PHONY: arch
arch:
@echo $(ARCH)
.PHONY: owner
owner:
@echo $(OWNER)
.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)/nginx/conf.d $(DESTDIR)$(RPM_SYSCONFDIR)/forgejo/conf $(DESTDIR)$(RPM_UNITDIR)/forgejo.service.d
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)/forgejo/conf files/forgejo/netoik_app.ini
install --mode=644 --target-directory=$(DESTDIR)$(RPM_UNITDIR)/forgejo.service.d files/systemd/forgejo.conf
$(RPM_TARBALL_PATH): *
git archive --format=tar.gz \
@@ -46,6 +54,4 @@ tarball: $(RPM_TARBALL_PATH)
.PHONY: upload
upload:
curl --fail-with-body --upload-file "$(RPM_BUILD_PATH)" --user "$(GIT_PACKAGES_USERNAME):$(GIT_PACKAGES_TOKEN)" https://git.netoik.io/api/packages/$(GIT_PACKAGES_USERNAME)/rpm/upload
curl --fail-with-body --upload-file "$(RPM_BUILD_PATH)" --user "$(OWNER):$(GIT_PACKAGES_TOKEN)" https://git.netoik.io/api/packages/$(OWNER)/rpm/upload

View File

@@ -2,9 +2,9 @@
# See official doc here: https://docs.gitea.com/next/administration/config-cheat-sheet
APP_NAME = Netoïk Git Server
RUN_USER = gitea
RUN_USER = forgejo
RUN_MODE = prod
WORK_PATH = /var/lib/gitea
WORK_PATH = /var/lib/forgejo
[server]
DOMAIN = git.netoik.io
@@ -17,8 +17,8 @@ SSH_PORT = 22222
[database]
DB_TYPE = postgres
HOST = /run/postgresql
NAME = gitea
USER = gitea
NAME = forgejo
USER = forgejo
[security]
INSTALL_LOCK = true
@@ -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

@@ -1,17 +0,0 @@
[Unit]
Description=Gitea Actions runner #%i
Documentation=https://gitea.com/gitea/act_runner
After=network.target gitea.service
[Service]
ExecStartPre=/usr/bin/rpmdev-setuptree
ExecStart=/usr/local/bin/act_runner daemon
ExecReload=/bin/kill -s HUP $MAINPID
WorkingDirectory=/opt/actrunners/actrunner%i
TimeoutSec=0
RestartSec=10
Restart=always
User=actrunner%i
[Install]
WantedBy=multi-user.target

View File

@@ -0,0 +1,3 @@
[Service]
ExecStart=
ExecStart=/usr/bin/forgejo web --config /etc/forgejo/conf/netoik_app.ini

View File

@@ -1,15 +0,0 @@
[Unit]
Description=Gitea (Git with a cup of tea)
After=network.target postgresql.service
[Service]
RestartSec=2s
Type=simple
User=gitea
Group=gitea
WorkingDirectory=/var/lib/gitea/
ExecStart=/usr/local/bin/gitea web --config /etc/gitea/app.ini
Restart=always
[Install]
WantedBy=multi-user.target

View File

@@ -5,15 +5,15 @@ Version: %(make version)
Release: %(make release)
Summary: Netoik Reverse Proxy
License: MIT
URL: https://git.netoik.io/samuel/%(make name)
URL: https://git.netoik.io/%(make owner)/%(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 forgejo
%description
Install the Git UI server called Gitea.
Install the Git UI server called Forgejo (fork of Gitea).
%prep
%autosetup -v
@@ -22,17 +22,30 @@ Install the Git UI server called Gitea.
%make_install
%post
# Change rights on config file
chgrp forgejo %{_sysconfdir}/forgejo/conf/netoik_app.ini
# Add user forgejo to db groups
usermod --groups postgres,valkey --append forgejo
# Create postgres user and db
if ! runuser --user=postgres -- psql --quiet --tuples-only --command='\du' | grep --quiet forgejo; then
runuser --user=postgres -- createuser forgejo
runuser --user=postgres -- createdb --owner=forgejo forgejo
fi
# Restart forgejo and nginx services
systemctl daemon-reload
systemctl reenable forgejo.service
systemctl restart forgejo.service
systemctl restart nginx.service
%files
%dir %attr(755, root, root) %{_sysconfdir}/gitea
%attr(600, root, root) %{_sysconfdir}/gitea/app.ini
%attr(640, root, -) %{_sysconfdir}/forgejo/conf/netoik_app.ini
%attr(644, root, root) %{_sysconfdir}/nginx/conf.d/git.netoik.io.conf
%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) %{_unitdir}/forgejo.service.d
%attr(644, root, root) %{_unitdir}/forgejo.service.d/forgejo.conf
%changelog
%autochangelog