From 2ee499393f835adc8ab4b222cab6502ec47d69b7 Mon Sep 17 00:00:00 2001 From: andrewkrug Date: Fri, 21 Apr 2017 09:55:47 -0700 Subject: [PATCH] update to add svg mimetypes and better sass processor --- ansible/main.yml | 24 +++++++++++++++++------- dashboard/app.py | 5 +++++ 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/ansible/main.yml b/ansible/main.yml index c74f4808..8a666ba9 100644 --- a/ansible/main.yml +++ b/ansible/main.yml @@ -42,13 +42,8 @@ - name: Install PyDevel yum: name=python-devel state=latest - - name: Install rubygems - yum: name=rubygems state=latest - - - - name: Install rubygems - gem: name=sass state=latest - + - name: Install rubygems sass compiler + yum: name=rubygem-sass state=latest - name: Install credstash pip: @@ -74,3 +69,18 @@ dest: /sso-dashboard owner: flaskapp mode: 0777 + + - name: Cache busting + file: + path: /sso-dashboard/static/css/gen/all.css + state: absent + + - name: Cache busting + file: + path: /sso-dashboard/static/js/gen/packed.js + state: absent + + - name: Cache busting + file: + path: /sso-dashboard/data/apps.yml-etag + state: absent diff --git a/dashboard/app.py b/dashboard/app.py index 857d8560..2d771a2d 100644 --- a/dashboard/app.py +++ b/dashboard/app.py @@ -7,6 +7,8 @@ import os import hashlib import datetime +import mimetypes + import watchtower import logging @@ -53,6 +55,9 @@ css = Bundle(sass, filters='cssmin', output='css/gen/all.css') assets.register('css_all', css) +# Hack to support serving .svg +mimetypes.add_type('image/svg+xml', '.svg') + oidc_config = config.OIDCConfig() authentication = auth.OpenIDConnect(