Don't redirect/rewrite direct requests to the ARA database

We want /ara-report/ to load the report dynamically but requests to
/ara-report/ansible.sqlite should allow users to download the raw
database if they want/need to.

Add an exclusion to allow for that and improve the docs a little bit.

Change-Id: I739a3e339f40c76311a99b1d9c452f1aebc01eae
This commit is contained in:
David Moreau Simard 2018-03-29 15:25:55 -04:00
parent 5c14e86d37
commit 8d373a8468
No known key found for this signature in database
GPG Key ID: 33A07694CBB71ECC
1 changed files with 8 additions and 4 deletions

View File

@ -67,14 +67,18 @@ NameVirtualHost <%= @vhost_name %>:<%= @port %>
Satisfy Any
</Files>
</Directory>
# Redirect .*/<%= @ara_middleware_database_directory %> to the ARA sqlite wsgi middleware
# This middleware automatically loads the ARA web application with the
# database located at .*/<%= @ara_middleware_database_directory %>/ansible.sqlite.
# ARA sqlite middleware configuration
# See docs for details: https://ara.readthedocs.io/en/latest/advanced.html
SetEnv ARA_WSGI_TMPDIR_MAX_AGE <%= @ara_middleware_tmpdir_max_age %>
SetEnv ARA_WSGI_LOG_ROOT <%= @docroot %>
SetEnv ARA_WSGI_DATABASE_DIRECTORY <%= @ara_middleware_database_directory %>
WSGIScriptAliasMatch ^.*/<%= @ara_middleware_database_directory %> /usr/local/bin/ara-wsgi-sqlite
# Redirect .*/<%= @ara_middleware_database_directory %> to the ARA sqlite wsgi middleware
# This middleware automatically loads the ARA web application with the
# database located at .*/<%= @ara_middleware_database_directory %>/ansible.sqlite.
# If we get a request directly to the database file, don't load the middleware
# so that users can download the raw database if they wish.
WSGIScriptAliasMatch ^.*/<%= @ara_middleware_database_directory %>(?!/ansible.sqlite) /usr/local/bin/ara-wsgi-sqlite
# Everything beyond this point is rewritten to htmlify.
# Make sure we don't do that for dynamic ARA reports.