diff options
Diffstat (limited to 'catalog-be/src/main/docker/backend/chef-repo')
2 files changed, 30 insertions, 2 deletions
diff --git a/catalog-be/src/main/docker/backend/chef-repo/cookbooks/sdc-catalog-be/recipes/BE_4_jetty_Modules.rb b/catalog-be/src/main/docker/backend/chef-repo/cookbooks/sdc-catalog-be/recipes/BE_4_jetty_Modules.rb index 9e57212176..5655d0fd6f 100644 --- a/catalog-be/src/main/docker/backend/chef-repo/cookbooks/sdc-catalog-be/recipes/BE_4_jetty_Modules.rb +++ b/catalog-be/src/main/docker/backend/chef-repo/cookbooks/sdc-catalog-be/recipes/BE_4_jetty_Modules.rb @@ -6,7 +6,7 @@ else end execute "create-jetty-modules" do - command "java -jar #{ENV['JETTY_HOME']}/start.jar --add-to-start=deploy && java -jar #{ENV['JETTY_HOME']}/start.jar --create-startd --add-to-start=http,https,setuid" + command "java -jar #{ENV['JETTY_HOME']}/start.jar --add-to-start=deploy && java -jar #{ENV['JETTY_HOME']}/start.jar --create-startd --add-to-start=http,https,setuid,rewrite" cwd "#{ENV['JETTY_BASE']}" action :run end @@ -21,7 +21,15 @@ template "http-ini" do :http_option => http_option , :http_port => "#{node['BE'][:http_port]}" }) - + +end + +template "jetty-rewrite" do + path "#{ENV['JETTY_BASE']}/etc/rewrite-root-to-swagger-ui.xml" + source "BE-jetty-rewrite.yaml.erb" + owner "#{ENV['JETTY_USER']}" + group "#{ENV['JETTY_GROUP']}" + mode "0644" end diff --git a/catalog-be/src/main/docker/backend/chef-repo/cookbooks/sdc-catalog-be/templates/default/BE-jetty-rewrite.yaml.erb b/catalog-be/src/main/docker/backend/chef-repo/cookbooks/sdc-catalog-be/templates/default/BE-jetty-rewrite.yaml.erb new file mode 100644 index 0000000000..ea0e9aa57c --- /dev/null +++ b/catalog-be/src/main/docker/backend/chef-repo/cookbooks/sdc-catalog-be/templates/default/BE-jetty-rewrite.yaml.erb @@ -0,0 +1,20 @@ +<?xml version="1.0"?><!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_3.dtd"> +<Configure id="Server" class="org.eclipse.jetty.server.Server"> + <Ref refid="Rewrite"> + <Call name="addRule"> + <Arg> + <New class="org.eclipse.jetty.rewrite.handler.RedirectPatternRule"> + <Set name="pattern" type="String"/> + <Set name="location">/swagger-ui/index.html</Set> + </New> + </Arg> + </Call> + </Ref> + + <!-- ===================== --> + <!-- DefaultHandler config --> + <!-- ===================== --> + <Ref id="DefaultHandler"> + <Set name="showContexts">false</Set> + </Ref> +</Configure> |