From d2fa8a904bd0216ac22c5ac33c159571f33f6acb Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Tue, 5 Sep 2017 10:36:06 +0200 Subject: [PATCH] Fix the overriding of static files in dist-git --- roles/distgit/templates/lookaside-upload.conf | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/roles/distgit/templates/lookaside-upload.conf b/roles/distgit/templates/lookaside-upload.conf index fcfff76c56..eab5f169f1 100644 --- a/roles/distgit/templates/lookaside-upload.conf +++ b/roles/distgit/templates/lookaside-upload.conf @@ -66,5 +66,20 @@ SSLCryptoDevice builtin Require valid-user + + # Insert the redirect rules allowing pagure to override some of its static + # files. This is pagure related not so much lookaside related but since this + # is using a VirtualHost on port 80 we need to group the configs + + # Configure static files so that a custom theme can override the defaults + RewriteEngine on + + # Check if the static file exists in the template directory + RewriteCond "/usr/share/pagure_dist_git/static/$1" -f + # If it does, use it + RewriteRule "^/static/(.*)" "/usr/share/pagure_dist_git/static/$1" [L] + # Otherwise back out and use the default static folder/theme + RewriteRule "^/static/(.*)" "/usr/lib/python2.7/site-packages/pagure/static/$1" [L] +