From 2dca3ece8e8438cb15bbaa962d3adc8d729ed785 Mon Sep 17 00:00:00 2001 From: vasraz Date: Wed, 9 Feb 2022 15:55:38 +0000 Subject: Redirect root URL to sdc1 Change-Id: I792cf2bfbb2f8f1e891d30048ff63acefac3604e Signed-off-by: Vasyl Razinkov Issue-ID: SDC-3877 --- .../SDC_Simulator_5_create_jetty_modules.rb | 69 ++++++++++++---------- .../default/SDC-Simulator-jetty-rewrire.xml.erb | 19 ++++++ utils/webseal-simulator/sdc-simulator/startup.sh | 1 + 3 files changed, 58 insertions(+), 31 deletions(-) create mode 100644 utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/templates/default/SDC-Simulator-jetty-rewrire.xml.erb (limited to 'utils/webseal-simulator') diff --git a/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/recipes/SDC_Simulator_5_create_jetty_modules.rb b/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/recipes/SDC_Simulator_5_create_jetty_modules.rb index 5e0d8eb50a..1e1ff795aa 100644 --- a/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/recipes/SDC_Simulator_5_create_jetty_modules.rb +++ b/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/recipes/SDC_Simulator_5_create_jetty_modules.rb @@ -1,55 +1,62 @@ # # Set the http module option if node['disableHttp'] - http_option = "#--module=http" + http_option = "#--module=http" else - http_option = "--module=http" + http_option = "--module=http" 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,console-capture,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,console-capture,setuid,rewrite" cwd "#{ENV['JETTY_BASE']}" action :run end template "http-ini" do - path "#{ENV['JETTY_BASE']}/start.d/http.ini" - source "SDC-Simulator-http-ini.erb" - owner "#{ENV['JETTY_USER']}" - group "#{ENV['JETTY_GROUP']}" - mode "0755" - variables({ - :http_option => http_option, - :http_port => "8080" - }) + path "#{ENV['JETTY_BASE']}/start.d/http.ini" + source "SDC-Simulator-http-ini.erb" + owner "#{ENV['JETTY_USER']}" + group "#{ENV['JETTY_GROUP']}" + mode "0755" + variables({ + :http_option => http_option, + :http_port => "8080" + }) end +template "jetty-rewrite" do + path "#{ENV['JETTY_BASE']}/etc/rewrite-root-to-sdc1.xml" + source "SDC-Simulator-jetty-rewrire.xml.erb" + owner "#{ENV['JETTY_USER']}" + group "#{ENV['JETTY_GROUP']}" + mode "0644" +end template "https-ini" do - path "#{ENV['JETTY_BASE']}/start.d/https.ini" - source "SDC-Simulator-https-ini.erb" - owner "#{ENV['JETTY_USER']}" - group "#{ENV['JETTY_GROUP']}" - mode "0755" - variables({ - :https_port => "8443" - }) + path "#{ENV['JETTY_BASE']}/start.d/https.ini" + source "SDC-Simulator-https-ini.erb" + owner "#{ENV['JETTY_USER']}" + group "#{ENV['JETTY_GROUP']}" + mode "0755" + variables({ + :https_port => "8443" + }) end # TO CHANGE THE KEYSTORE/TRUSTSTORE CERT THE JVM CONFIGURATION # MUST BE ALSO CHANGE IN THE startup.sh FILE template "ssl-ini" do - path "#{ENV['JETTY_BASE']}/start.d/ssl.ini" - source "SDC-Simulator-ssl-ini.erb" - owner "#{ENV['JETTY_USER']}" - group "#{ENV['JETTY_GROUP']}" - mode "0755" - variables({ - :https_port => "8443", - :jetty_truststore_pwd => "z+KEj;t+,KN^iimSiS89e#p0", - :jetty_keystore_pwd => "?(kP!Yur![*!Y5!E^f(ZKc31", - :jetty_keymanager_pwd => "?(kP!Yur![*!Y5!E^f(ZKc31", - }) + path "#{ENV['JETTY_BASE']}/start.d/ssl.ini" + source "SDC-Simulator-ssl-ini.erb" + owner "#{ENV['JETTY_USER']}" + group "#{ENV['JETTY_GROUP']}" + mode "0755" + variables({ + :https_port => "8443", + :jetty_truststore_pwd => "z+KEj;t+,KN^iimSiS89e#p0", + :jetty_keystore_pwd => "?(kP!Yur![*!Y5!E^f(ZKc31", + :jetty_keymanager_pwd => "?(kP!Yur![*!Y5!E^f(ZKc31", + }) end execute "echo status" do diff --git a/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/templates/default/SDC-Simulator-jetty-rewrire.xml.erb b/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/templates/default/SDC-Simulator-jetty-rewrire.xml.erb new file mode 100644 index 0000000000..e0862a5bfd --- /dev/null +++ b/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/templates/default/SDC-Simulator-jetty-rewrire.xml.erb @@ -0,0 +1,19 @@ + + + + + + + + /sdc1 + + + + + + + + + false + + diff --git a/utils/webseal-simulator/sdc-simulator/startup.sh b/utils/webseal-simulator/sdc-simulator/startup.sh index 49fdf3ef16..d218211796 100644 --- a/utils/webseal-simulator/sdc-simulator/startup.sh +++ b/utils/webseal-simulator/sdc-simulator/startup.sh @@ -13,5 +13,6 @@ cd $JETTY_BASE/chef-solo chef-solo -c solo.rb -E ${ENVNAME} cd $JETTY_HOME +echo "etc/rewrite-root-to-sdc1.xml" >> $JETTY_HOME/start.d/rewrite.ini java $JAVA_OPTIONS -jar "${JETTY_HOME}/start.jar" -- cgit 1.2.3-korg