Bodhi: workaround python's versioned path for static files

Signed-off-by: Aurélien Bompard <aurelien@bompard.org>
This commit is contained in:
Aurélien Bompard 2022-06-09 17:41:07 +02:00
parent 91f3d3b0bc
commit 3da52306b2
No known key found for this signature in database
GPG key ID: 31584CFEB9BF64AD
2 changed files with 5 additions and 5 deletions

View file

@ -31,7 +31,7 @@ MaxRequestWorkers 100
AllowOverride None AllowOverride None
Require all granted Require all granted
</Directory> </Directory>
<Directory "/usr/lib/python3.10/site-packages/bodhi/server/static/"> <Directory "/srv/bodhi-static/">
AllowOverride None AllowOverride None
Require all granted Require all granted
</Directory> </Directory>
@ -56,7 +56,7 @@ TypesConfig /etc/mime.types
AddDefaultCharset UTF-8 AddDefaultCharset UTF-8
CoreDumpDirectory /tmp CoreDumpDirectory /tmp
Alias /docs /usr/share/doc/bodhi-docs/html/ 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 WSGIDaemonProcess bodhi display-name=bodhi processes=4 threads=1 maximum-requests=500 home=/httpdir request-timeout=90
WSGIApplicationGroup %{GLOBAL} WSGIApplicationGroup %{GLOBAL}
WSGISocketPrefix run/wsgi WSGISocketPrefix run/wsgi

View file

@ -1,4 +1,3 @@
# WARNING: When changing the base distribution, adjust the python version in httpd.conf for static files
FROM fedora:36 FROM fedora:36
LABEL \ LABEL \
name="bodhi-base" \ name="bodhi-base" \
@ -9,14 +8,15 @@ RUN curl -o /etc/yum.repos.d/infra-tags-stg.repo https://infrastructure.fedorapr
{% else %} {% else %}
RUN curl -o /etc/yum.repos.d/infra-tags.repo https://infrastructure.fedoraproject.org/infra/ansible/files/common/fedora-infra-tags.repo RUN curl -o /etc/yum.repos.d/infra-tags.repo https://infrastructure.fedoraproject.org/infra/ansible/files/common/fedora-infra-tags.repo
{% endif %} {% endif %}
# While dnf has a --nodocs, it doesen't have a --docs...
RUN sed -i '/nodocs/d' /etc/dnf/dnf.conf
{% if env == "staging" %} {% if env == "staging" %}
RUN dnf install -y bodhi-server python3-pyramid_sawing python3-gunicorn --refresh RUN dnf install -y bodhi-server python3-pyramid_sawing python3-gunicorn --refresh
{% else %} {% else %}
RUN dnf install -y bodhi-server-{{bodhi_version}} python3-pyramid_sawing python3-gunicorn RUN dnf install -y bodhi-server-{{bodhi_version}} python3-pyramid_sawing python3-gunicorn
{% endif %} {% 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 # Set up krb5
RUN rm -f /etc/krb5.conf && \ RUN rm -f /etc/krb5.conf && \
ln -sf /etc/bodhi/krb5.conf /etc/krb5.conf && \ ln -sf /etc/bodhi/krb5.conf /etc/krb5.conf && \