From 3da52306b2129c7280df91b879e03b7c0bf8ded3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Bompard?= Date: Thu, 9 Jun 2022 17:41:07 +0200 Subject: [PATCH] Bodhi: workaround python's versioned path for static files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Aurélien Bompard --- roles/bodhi2/base/templates/httpd.conf.j2 | 4 ++-- roles/openshift-apps/bodhi/templates/dockerfile-base | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/roles/bodhi2/base/templates/httpd.conf.j2 b/roles/bodhi2/base/templates/httpd.conf.j2 index 5e780bc5ec..5bd0dff20c 100644 --- a/roles/bodhi2/base/templates/httpd.conf.j2 +++ b/roles/bodhi2/base/templates/httpd.conf.j2 @@ -31,7 +31,7 @@ MaxRequestWorkers 100 AllowOverride None Require all granted - + AllowOverride None Require all granted @@ -56,7 +56,7 @@ TypesConfig /etc/mime.types AddDefaultCharset UTF-8 CoreDumpDirectory /tmp Alias /docs /usr/share/doc/bodhi-docs/html/ -Alias /static/v{{ bodhi_version.split('-')[0] }} /usr/lib/python3.10/site-packages/bodhi/server/static/ +Alias /static/v{{ bodhi_version.split('-')[0] }} /srv/bodhi-static/ WSGIDaemonProcess bodhi display-name=bodhi processes=4 threads=1 maximum-requests=500 home=/httpdir request-timeout=90 WSGIApplicationGroup %{GLOBAL} WSGISocketPrefix run/wsgi diff --git a/roles/openshift-apps/bodhi/templates/dockerfile-base b/roles/openshift-apps/bodhi/templates/dockerfile-base index 6562486e52..21e2e37a4a 100644 --- a/roles/openshift-apps/bodhi/templates/dockerfile-base +++ b/roles/openshift-apps/bodhi/templates/dockerfile-base @@ -1,4 +1,3 @@ -# WARNING: When changing the base distribution, adjust the python version in httpd.conf for static files FROM fedora:36 LABEL \ name="bodhi-base" \ @@ -9,14 +8,15 @@ RUN curl -o /etc/yum.repos.d/infra-tags-stg.repo https://infrastructure.fedorapr {% else %} RUN curl -o /etc/yum.repos.d/infra-tags.repo https://infrastructure.fedoraproject.org/infra/ansible/files/common/fedora-infra-tags.repo {% endif %} -# While dnf has a --nodocs, it doesen't have a --docs... -RUN sed -i '/nodocs/d' /etc/dnf/dnf.conf {% if env == "staging" %} RUN dnf install -y bodhi-server python3-pyramid_sawing python3-gunicorn --refresh {% else %} RUN dnf install -y bodhi-server-{{bodhi_version}} python3-pyramid_sawing python3-gunicorn {% endif %} +# link the static files for a simpler httpd.conf +RUN ln -s $(python3 -Ic "import sysconfig; print(sysconfig.get_path('purelib', 'rpm_prefix'))")/bodhi/server/static/ /srv/bodhi-static + # Set up krb5 RUN rm -f /etc/krb5.conf && \ ln -sf /etc/bodhi/krb5.conf /etc/krb5.conf && \