From a2dded035a32cd90073e9b00c8f9209f3ce50559 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Bompard?= Date: Tue, 17 Nov 2020 14:26:25 +0100 Subject: [PATCH] FASJSON: fix HTTPS links MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Aurélien Bompard --- roles/openshift-apps/fasjson/templates/Dockerfile | 2 -- roles/openshift-apps/fasjson/templates/configmap.yml | 2 ++ roles/openshift-apps/fasjson/templates/httpd.conf | 4 ++-- roles/openshift-apps/fasjson/templates/wsgi.py | 4 ++++ 4 files changed, 8 insertions(+), 4 deletions(-) create mode 100644 roles/openshift-apps/fasjson/templates/wsgi.py diff --git a/roles/openshift-apps/fasjson/templates/Dockerfile b/roles/openshift-apps/fasjson/templates/Dockerfile index 30333f869d..423db387a5 100644 --- a/roles/openshift-apps/fasjson/templates/Dockerfile +++ b/roles/openshift-apps/fasjson/templates/Dockerfile @@ -33,8 +33,6 @@ RUN git clone https://github.com/fedora-infra/fasjson.git && \ pushd fasjson && \ git checkout {{ (env == 'production')|ternary('stable', 'staging') }} && \ pip-3 install . && \ - mkdir -p /usr/share/fasjson && \ - cp ansible/roles/fasjson/files/fasjson.wsgi /usr/share/fasjson && \ popd && \ rm -rf fasjson RUN rm -f /etc/krb5.conf && ln -sf /etc/krb5/krb5.conf /etc/krb5.conf && \ diff --git a/roles/openshift-apps/fasjson/templates/configmap.yml b/roles/openshift-apps/fasjson/templates/configmap.yml index 50ef5eea6f..bb1ffd0a27 100644 --- a/roles/openshift-apps/fasjson/templates/configmap.yml +++ b/roles/openshift-apps/fasjson/templates/configmap.yml @@ -17,6 +17,8 @@ items: {{ load_file('httpd.conf') | indent(6) }} fasjson.conf: |- {{ load_file('fasjson.conf') | indent(6) }} + wsgi.py: |- + {{ load_file('wsgi.py') | indent(6) }} - apiVersion: v1 kind: ConfigMap metadata: diff --git a/roles/openshift-apps/fasjson/templates/httpd.conf b/roles/openshift-apps/fasjson/templates/httpd.conf index 26f96b34db..6792c022bf 100644 --- a/roles/openshift-apps/fasjson/templates/httpd.conf +++ b/roles/openshift-apps/fasjson/templates/httpd.conf @@ -50,9 +50,9 @@ WSGISocketPrefix run/wsgi WSGIDaemonProcess fasjson processes=4 threads=1 maximum-requests=500 \ display-name=%{GROUP} socket-timeout=2147483647 \ lang=C.UTF-8 locale=C.UTF-8 home=/httpdir -WSGIImportScript /usr/share/fasjson/fasjson.wsgi \ +WSGIImportScript /etc/fasjson/wsgi.py \ process-group=fasjson application-group=fasjson -WSGIScriptAlias / /usr/share/fasjson/fasjson.wsgi +WSGIScriptAlias / /etc/fasjson/wsgi.py WSGIScriptReloading Off WSGIRestrictStdout Off WSGIRestrictSignal Off diff --git a/roles/openshift-apps/fasjson/templates/wsgi.py b/roles/openshift-apps/fasjson/templates/wsgi.py new file mode 100644 index 0000000000..ea22995fcc --- /dev/null +++ b/roles/openshift-apps/fasjson/templates/wsgi.py @@ -0,0 +1,4 @@ +from werkzeug.middleware.proxy_fix import ProxyFix +from fasjson.web.app import create_app +application = create_app() +application.wsgi_app = ProxyFix(application.wsgi_app, x_proto=1, x_host=1)