From 6490c755b2942d774a6515eb136f1bc8ae56d48c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Bompard?= Date: Wed, 21 Jul 2021 10:15:55 +0200 Subject: [PATCH] Support the new banner feature in Noggin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See: https://github.com/fedora-infra/noggin/pull/701 Signed-off-by: Aurélien Bompard --- .../openshift-apps/noggin/templates/after-navbar.html | 0 roles/openshift-apps/noggin/templates/configmap.yml | 11 +++++++++++ .../noggin/templates/deploymentconfig.yml | 6 ++++++ roles/openshift-apps/noggin/templates/head.html | 0 roles/openshift-apps/noggin/templates/noggin.cfg.py | 4 ++++ 5 files changed, 21 insertions(+) create mode 100644 roles/openshift-apps/noggin/templates/after-navbar.html create mode 100644 roles/openshift-apps/noggin/templates/head.html diff --git a/roles/openshift-apps/noggin/templates/after-navbar.html b/roles/openshift-apps/noggin/templates/after-navbar.html new file mode 100644 index 0000000000..e69de29bb2 diff --git a/roles/openshift-apps/noggin/templates/configmap.yml b/roles/openshift-apps/noggin/templates/configmap.yml index 570d4dbdc3..6c44b39315 100644 --- a/roles/openshift-apps/noggin/templates/configmap.yml +++ b/roles/openshift-apps/noggin/templates/configmap.yml @@ -15,6 +15,17 @@ items: {{ load_file('noggin.cfg.py') | indent(6) }} gunicorn.conf.py: |- {{ load_file('gunicorn.conf.py') | indent(6) }} +- apiVersion: v1 + kind: ConfigMap + metadata: + name: noggin-templates + labels: + app: {{ app }} + data: + after-navbar.html: |- + {{ load_file('after-navbar.html') | indent(6) }} + head.html: |- + {{ load_file('head.html') | indent(6) }} - apiVersion: v1 kind: ConfigMap metadata: diff --git a/roles/openshift-apps/noggin/templates/deploymentconfig.yml b/roles/openshift-apps/noggin/templates/deploymentconfig.yml index d3cbf0936f..11b7df9466 100644 --- a/roles/openshift-apps/noggin/templates/deploymentconfig.yml +++ b/roles/openshift-apps/noggin/templates/deploymentconfig.yml @@ -38,6 +38,9 @@ spec: - name: noggin-config-volume mountPath: "/etc/noggin" readOnly: true + - name: noggin-templates-volume + mountPath: "/etc/noggin-templates" + readOnly: true - name: noggin-secrets-volume mountPath: "/etc/noggin-secrets" readOnly: true @@ -91,6 +94,9 @@ spec: - name: noggin-config-volume configMap: name: noggin-config + - name: noggin-templates-volume + configMap: + name: noggin-templates - name: noggin-secrets-volume secret: secretName: noggin-secrets diff --git a/roles/openshift-apps/noggin/templates/head.html b/roles/openshift-apps/noggin/templates/head.html new file mode 100644 index 0000000000..e69de29bb2 diff --git a/roles/openshift-apps/noggin/templates/noggin.cfg.py b/roles/openshift-apps/noggin/templates/noggin.cfg.py index c6f887164a..c211a6caa5 100644 --- a/roles/openshift-apps/noggin/templates/noggin.cfg.py +++ b/roles/openshift-apps/noggin/templates/noggin.cfg.py @@ -45,6 +45,10 @@ MAIL_DOMAIN_BLOCKLIST = [ "centosproject.org", ] +# Banners +TEMPLATES_CUSTOM_DIRECTORIES = ["/etc/noggin-templates"] +ACCEPT_IMAGES_FROM = ["pagure.io"] + # Those file should be mounted from OpenShift secrets FREEIPA_ADMIN_PASSWORD = from_file('/etc/noggin-secrets/ipa-admin') FERNET_SECRET = from_file('/etc/noggin-secrets/fernet').encode('utf-8')