From 089f7f8bac1f9653e5b9f9f6001ee85bc8da1231 Mon Sep 17 00:00:00 2001 From: MCJ Vasseur <14887731+vmcj@users.noreply.github.com> Date: Fri, 1 Aug 2025 17:17:57 +0200 Subject: [PATCH 1/2] Document fedora packages for development --- doc/manual/develop.rst | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/doc/manual/develop.rst b/doc/manual/develop.rst index 9b66f874a4..10952ad37f 100644 --- a/doc/manual/develop.rst +++ b/doc/manual/develop.rst @@ -43,6 +43,15 @@ already listed under python3-sphinx python3-sphinx-rtd-theme fontconfig python3-yaml \ latexmk texlive-latex-recommended texlive-latex-extra tex-gyre +For Fedora use:: + + sudo dnf install git autoconf automake bats \ + sphinx-build python3-sphinx_rtd_theme latexmk texlive-cmap \ + texlive-metafont texlive-tex-gyre texlive-fncychap texlive-wrapfig \ + texlive-capt-of texlive-framed texlive-upquote texlive-needspace \ + texlive-tabulary texlive-parskip texlive-oberdiek texlive-makeindex \ + texlive-ellipse texlive-pict2e texlive-collection-fontsextra + When this software is present, bootstrapping can be done by running ``make dist``, which creates the ``configure`` script, downloads and installs the PHP dependencies via composer and From 5acd2a275a4e99807b0094e099644d3054067c5f Mon Sep 17 00:00:00 2001 From: MCJ Vasseur <14887731+vmcj@users.noreply.github.com> Date: Sat, 2 Aug 2025 09:05:06 +0200 Subject: [PATCH 2/2] Set maintainer-install configuration & permissions for fedora installations This is only for the domserver installation. The full configuration for the judgedaemon is left for the future. It would need: - Installation of the needed files (sudoers for example) - Setting up a SELinux domain; - the judgedaemon interacts with proc which is normally blocked, - the judgedaemon creates and reads and chowns some files after judgement. --- Makefile | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index fcfd998979..67eb7232cf 100644 --- a/Makefile +++ b/Makefile @@ -11,6 +11,9 @@ REC_TARGETS=build domserver install-domserver judgehost install-judgehost \ # Global Makefile definitions include $(TOPDIR)/Makefile.global +debpool := /etc/php/$(PHPVERSION)/fpm/pool.d +fedpool := /etc/php-fpm.d + default: @echo "No default target" @echo @@ -275,6 +278,14 @@ inplace-postinstall-permissions: setfacl -R -m u:$(DOMJUDGE_USER):rwx $(CURDIR)/webapp/var setfacl -R -m d:m::rwx $(CURDIR)/webapp/var setfacl -R -m m::rwx $(CURDIR)/webapp/var + if command -v sestatus >/dev/null 2>&1; then \ + chcon -R -t httpd_sys_content_t $(CURDIR)/webapp; \ + chcon -R -t httpd_config_t $(CURDIR)/etc; \ + chcon -R -t httpd_log_t $(CURDIR)/webapp/var/log; \ + chcon -R -t httpd_sys_rw_content_t $(CURDIR)/webapp/var/cache; \ + chcon -R -t httpd_sys_rw_content_t $(CURDIR)/webapp/public/images; \ + chcon -t httpd_exec_t $(CURDIR)/lib/alert; \ + fi inplace-postinstall-apache: inplace-postinstall-permissions @if [ ! -d "/etc/apache2/conf-enabled" ]; then echo "Couldn't find directory /etc/apache2/conf-enabled. Is apache installed?"; false; fi @@ -284,12 +295,23 @@ inplace-postinstall-apache: inplace-postinstall-permissions systemctl restart apache2 inplace-postinstall-nginx: inplace-postinstall-permissions - @if [ ! -d "/etc/nginx/sites-enabled/" ]; then echo "Couldn't find directory /etc/nginx/sites-enabled/. Is nginx installed?"; false; fi - @if [ ! -d "/etc/php/$(PHPVERSION)/fpm/pool.d/" ]; then echo "Couldn't find directory /etc/php/$(PHPVERSION)/fpm/pool.d/. Is php-fpm installed?"; false; fi - ln -sf $(CURDIR)/etc/nginx-conf /etc/nginx/sites-enabled/domjudge.conf - ln -sf $(CURDIR)/etc/domjudge-fpm.conf /etc/php/$(PHPVERSION)/fpm/pool.d/domjudge-fpm.conf + @if [ ! -d "/etc/nginx/" ]; then echo "Couldn't find directory /etc/nginx/. Is nginx installed?"; false; fi + @cmd="ln -sf $(CURDIR)/etc/nginx-conf /etc/nginx/conf.d/domjudge.conf"; \ + if [ -d "/etc/nginx/sites-enabled/" ]; then \ + cmd="ln -sf $(CURDIR)/etc/nginx-conf /etc/nginx/sites-enabled/domjudge.conf"; \ + fi; echo $$cmd; $$cmd systemctl restart nginx - systemctl restart php$(PHPVERSION)-fpm + @if [ ! -d "$(debpool)" ] && [ ! -d "$(fedpool)" ]; then \ + echo "Couldn't find directory $(debpool) or $(fedpool). Is php-fpm installed?"; false; \ + fi + @service="php-fpm"; phppool="$(fedpool)"; \ + if [ -d "$(debpool)" ]; then \ + phppool="ln -sf $(CURDIR)/etc/domjudge-fpm.conf $(debpool)/domjudge-fpm.conf"; \ + service="php$(PHPVERSION)-fpm"; \ + fi; \ + service="systemctl restart $$service"; \ + ln="ln -sf $(CURDIR)/etc/domjudge-fpm.conf $$phppool/domjudge-fpm.conf"; \ + echo $$ln; echo $$service; $$ln; $$service # Removes created symlinks; generated logs, submissions, etc. remain in output subdir. inplace-uninstall-l: