From 00adf33c689997201681c561e99892650c110f8e Mon Sep 17 00:00:00 2001 From: Tim Flink Date: Tue, 23 May 2017 04:13:29 +0000 Subject: [PATCH] adjusting upstreamfirst pagure to use themes --- inventory/host_vars/upstreamfirst.fedorainfracloud.org | 2 ++ .../upstreamfirst-frontend/templates/0_pagure.conf | 9 ++++++++- roles/pagure/upstreamfirst-frontend/templates/pagure.cfg | 4 ++-- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/inventory/host_vars/upstreamfirst.fedorainfracloud.org b/inventory/host_vars/upstreamfirst.fedorainfracloud.org index dae17d4f0e..abb9fc82d3 100644 --- a/inventory/host_vars/upstreamfirst.fedorainfracloud.org +++ b/inventory/host_vars/upstreamfirst.fedorainfracloud.org @@ -91,6 +91,8 @@ pagure_ssh_host_sha256: 'SHA256:ggRdzg+ugyR6WIzeiuyASAdEHf+HG5yZqJJIu/YTtHI=' new_pagure_admin_groups: ['sysadmin-main', 'sysadmin-qa'] pagure_instance_name: "Upstream First Pagure" +pagure_theme_static_dir:'/var/www/upstreamfirst-paguretheme/static' +pagure_theme_template_dir:'/var/www/upstreamfirst-paguretheme/templates' stunnel_service: "eventsource" stunnel_source_port: 8088 diff --git a/roles/pagure/upstreamfirst-frontend/templates/0_pagure.conf b/roles/pagure/upstreamfirst-frontend/templates/0_pagure.conf index 83c32fc643..0ecbe9943a 100644 --- a/roles/pagure/upstreamfirst-frontend/templates/0_pagure.conf +++ b/roles/pagure/upstreamfirst-frontend/templates/0_pagure.conf @@ -117,7 +117,14 @@ WSGIDaemonProcess paguredocs user=git group=git maximum-requests=1000 display-na SSLCipherSuite RC4-SHA:AES128-SHA:ALL:!ADH:!EXP:!LOW:!MD5:!SSLV2:!NULL SSLProtocol ALL -SSLv2 - Alias /static /usr/lib/python2.7/site-packages/pagure/static/ +# Configure static files so that a custom theme can override the defaults +# +RewriteCond "{{ pagure_theme_static_dir }}/$1" -f +RewriteRule "^/static/(.*)" "{{ pagure_theme_static_dir }}/$1" [L] + +# Use the application default theme for files not customized + +RewriteRule "^/static/(.*)" "/usr/lib/python2.7/site-packages/pagure/static/$1" [L] WSGIProcessGroup paguredocs diff --git a/roles/pagure/upstreamfirst-frontend/templates/pagure.cfg b/roles/pagure/upstreamfirst-frontend/templates/pagure.cfg index 7783d0c31e..b569395276 100644 --- a/roles/pagure/upstreamfirst-frontend/templates/pagure.cfg +++ b/roles/pagure/upstreamfirst-frontend/templates/pagure.cfg @@ -2,8 +2,8 @@ from datetime import timedelta INSTANCE_NAME= '{{ pagure_instance_name }}' -THEME_TEMPLATE_FOLDER='/var/www/upstreamfirst-paguretheme/templates' -THEME_STATIC_FOLDER='/var/www/upstreamfirst-paguretheme/static' +THEME_TEMPLATE_FOLDER='{{ pagure_theme_template_dir }}' +THEME_STATIC_FOLDER='{{ pagure_theme_static_dir }}' ### Set the time after which the admin session expires # There are two sessions on pagure, login that holds for 31 days and