diff --git a/roles/pdc/frontend/tasks/main.yml b/roles/pdc/frontend/tasks/main.yml index 3c27db11f4..790531232f 100644 --- a/roles/pdc/frontend/tasks/main.yml +++ b/roles/pdc/frontend/tasks/main.yml @@ -50,6 +50,14 @@ - pdc - cron +- name: cron to generate cache of active component branches for pagure-sync-bugzilla + cron: name="export-branches" minute="15" user="apache" + job="/usr/local/bin/lock-wrapper export-branches 'python /usr/lib/python2.7/site-packages/pdc/manage.py exportbranches > /var/www/html/extras/active_branches.json'" + cron_file=export-branches + tags: + - pdc + - cron + - name: Copy over httpd config template: src=pdc.conf dest=/etc/httpd/conf.d/pdc.conf notify: reload httpd diff --git a/roles/pdc/frontend/templates/pdc.conf b/roles/pdc/frontend/templates/pdc.conf index 5f279ff14d..17add4bf7a 100644 --- a/roles/pdc/frontend/templates/pdc.conf +++ b/roles/pdc/frontend/templates/pdc.conf @@ -31,6 +31,10 @@ WSGIScriptAlias / /usr/lib/python2.7/site-packages/pdc/wsgi.py # Try to find them in the patternfly files RewriteRule "^/static/(.*)" "/usr/share/patternfly1/resources/$1" [L] + # An entry for our exported branches + RewriteCond "/var/www/html/extras/$1" -f + RewriteRule "^/extras/(.*)" "/var/www/html/extras/$1" [L] + SetHandler wsgi-script @@ -85,6 +89,21 @@ WSGIScriptAlias / /usr/lib/python2.7/site-packages/pdc/wsgi.py ExpiresDefault "access plus 10 years" + + SetHandler None + + # Disable auth on the extras content, so that we're aren't forced to + # use Kerberos. Doing so would remove "Expires" headers from the extras + # content, which would lead to poor page-load times. + AuthType none + Satisfy Any + Require all granted + + # Many file types are likely to benefit from compression + # Enable gzip compression on them: + AddOutputFilterByType DEFLATE text/html text/plain text/xml text/javascript application/x-javascript text/css + + SetHandler None