Update Zuulv3 url rewrites

This updates the rewrite rules to the current state of the zuulv3
dashboard, and removes the overlap with zuul v2 urls.

Change-Id: Idd84facca4a0e0170234bf7d4ee2b42811f52b67
This commit is contained in:
James E. Blair 2017-12-08 14:47:07 -08:00
parent 18afb9dd6f
commit a405aafdf5
2 changed files with 49 additions and 7 deletions

View File

@ -129,4 +129,26 @@ class zuul::web (
onlyif => "curl -I https://code.angularjs.org/1.5.8/angular.min.js -z /var/lib/zuul/www/static/js/angular.min.js | grep '200 OK'",
creates => '/var/lib/zuul/www/static/js/angular.min.js',
}
# For now, symlink in the static parts of zuul-web which are not
# tenant-scoped since they share a URL space with the external
# dependencies.
file { '/var/lib/zuul/www/static/javascripts':
ensure => link,
target => '/opt/zuul/zuul/web/static/javascripts',
require => [File['/var/lib/zuul/www/static'],
Vcsrepo['/opt/zuul']],
}
file { '/var/lib/zuul/www/static/images':
ensure => link,
target => '/opt/zuul/zuul/web/static/images',
require => [File['/var/lib/zuul/www/static'],
Vcsrepo['/opt/zuul']],
}
file { '/var/lib/zuul/www/static/styles':
ensure => link,
target => '/opt/zuul/zuul/web/static/styles',
require => [File['/var/lib/zuul/www/static'],
Vcsrepo['/opt/zuul']],
}
}

View File

@ -34,12 +34,23 @@
RewriteRule ^/status.json - [F]
<% end -%>
RewriteRule ^/keys/(.*) <%= @zuul_status_url %>/keys/$1 [P]
<% unless @zuulv3 %>
RewriteRule ^/status.json$ <%= @zuul_status_url %>/status.json [P]
RewriteRule ^/status/(.*) <%= @zuul_status_url %>/status/$1 [P]
RewriteRule ^/connection/(.*) <%= @zuul_scheduler_url %>/connection/$1 [P]
<% end %>
<% if @zuulv3 %>
RewriteRule ^/status.json <%= @zuul_web_url %>/status.json [P]
RewriteRule ^/status.html <%= @zuul_web_url %>/status.html [P]
RewriteRule ^/jobs.json <%= @zuul_web_url %>/jobs.json [P]
RewriteRule ^/jobs.html <%= @zuul_web_url %>/jobs.html [P]
RewriteRule ^/builds.json <%= @zuul_web_url %>/builds.json [P]
RewriteRule ^/builds.html <%= @zuul_web_url %>/builds.html [P]
RewriteRule ^/console-stream <%= @zuul_web_url.sub('http://', 'ws://') %>/console-stream [P]
RewriteRule ^/static/(.*) <%= @zuul_web_url %>/static/$1 [P]
RewriteRule ^/jobs/(.*) <%= @zuul_web_url %>/jobs/$1 [P]
RewriteRule ^/stream.html <%= @zuul_web_url %>/stream.html [P]
RewriteRule ^/$ <%= @zuul_web_url %>/status.html [P]
<% end %>
AddOutputFilterByType DEFLATE application/json
@ -103,13 +114,22 @@
RewriteCond %{HTTP_REFERER} =<%= referer %>
RewriteRule ^/status.json - [F]
<% end -%>
RewriteRule ^/keys/(.*) <%= @zuul_status_url %>/keys/$1 [P]
<% unless @zuulv3 %>
RewriteRule ^/status.json$ <%= @zuul_status_url %>/status.json [P]
RewriteRule ^/status/(.*) <%= @zuul_status_url %>/status/$1 [P]
RewriteRule ^/connection/(.*) <%= @zuul_scheduler_url %>/connection/$1 [P]
<% end %>
<% if @zuulv3 %>
RewriteRule ^/status.json <%= @zuul_web_url %>/status.json [P]
RewriteRule ^/status.html <%= @zuul_web_url %>/status.html [P]
RewriteRule ^/jobs.json <%= @zuul_web_url %>/jobs.json [P]
RewriteRule ^/jobs.html <%= @zuul_web_url %>/jobs.html [P]
RewriteRule ^/builds.json <%= @zuul_web_url %>/builds.json [P]
RewriteRule ^/builds.html <%= @zuul_web_url %>/builds.html [P]
RewriteRule ^/console-stream <%= @zuul_web_url.sub('http://', 'ws://') %>/console-stream [P]
RewriteRule ^/static/(.*) <%= @zuul_web_url %>/static/$1 [P]
RewriteRule ^/jobs/(.*) <%= @zuul_web_url %>/jobs/$1 [P]
RewriteRule ^/stream.html <%= @zuul_web_url %>/stream.html [P]
RewriteRule ^/$ <%= @zuul_web_url %>/status.html [P]
<% end %>
AddOutputFilterByType DEFLATE application/json