logserver: set CORS header

This change enables cross request to fetch job logs artifacts.

Change-Id: I88ef4d559bb9b8fa3b67b51ec750bf9136a62ffb
This commit is contained in:
Tristan Cacqueray 2019-01-01 13:22:43 +00:00
parent 3bc07944d5
commit 20ae86a8f4
2 changed files with 9 additions and 0 deletions

View File

@ -45,6 +45,12 @@ class openstackci::logserver (
include ::httpd
include ::httpd::mod::wsgi
if ! defined(Httpd::Mod['headers']) {
httpd::mod { 'headers':
ensure => present,
}
}
if ! defined(Httpd::Mod['rewrite']) {
httpd::mod { 'rewrite':
ensure => present,

View File

@ -13,6 +13,9 @@ NameVirtualHost <%= @vhost_name %>:<%= @port %>
<% end -%>
DocumentRoot <%= @docroot %>
# Authorize cross request, e.g. fetch job-output from the zuul builds page
Header set Access-Control-Allow-Origin "*"
WSGIDaemonProcess logs user=www-data group=www-data processes=<%= scope.lookupvar('::openstackci::logserver::wsgi_processes') %> threads=<%= scope.lookupvar('::openstackci::logserver::wsgi_threads') %>
WSGIProcessGroup logs
WSGIApplicationGroup %{GLOBAL}