From 857a51651a97324e8628a5f2b4591116eef1bcc1 Mon Sep 17 00:00:00 2001 From: Tal Gitelman Date: Thu, 17 Aug 2017 21:18:39 +0300 Subject: [SDC-154] - sdc-simulator docker task Change-Id: Ife75655d7ad0a6566a93ebabed217566f17ee246 Signed-off-by: Tal Gitelman --- .../recipes/FE_6_create_jetty_modules.rb | 45 ------------ .../sdc-catalog-fe/recipes/FE_6_locate_keystore.rb | 16 ++++ .../recipes/FE_7_create_jetty_modules.rb | 45 ++++++++++++ .../sdc-catalog-fe/recipes/FE_7_locate_keystore.rb | 16 ---- .../sdc-frontend/chef-solo/roles/catalog-fe.json | 4 +- utils/webseal-simulator/sdc-simulator/Dockerfile | 2 +- .../sdc-simulator/files/default/webseal.conf | 2 +- .../recipes/SDC_Simulator_2_setup_configuration.rb | 9 --- .../recipes/SDC_Simulator_4_logback.rb | 17 +++-- .../SDC_Simulator_6_create_jetty_modules.rb | 45 ------------ .../recipes/SDC_Simulator_6_locate_keystore.rb | 16 ++++ .../SDC_Simulator_7_create_jetty_modules.rb | 45 ++++++++++++ .../recipes/SDC_Simulator_7_locate_keystore.rb | 16 ---- .../templates/default/FE-configuration.yaml.erb | 85 ---------------------- .../templates/default/FE-http-ini.erb | 32 -------- .../templates/default/FE-https-ini.erb | 15 ---- .../default/FE-onboarding-configuration.yaml.erb | 5 -- .../sdc-simulator/templates/default/FE-ssl-ini.erb | 83 --------------------- .../default/SDC-Simulator-configuration.yaml.erb | 85 ++++++++++++++++++++++ .../templates/default/SDC-Simulator-http-ini.erb | 32 ++++++++ .../templates/default/SDC-Simulator-https-ini.erb | 15 ++++ ...SDC-Simulator-onboarding-configuration.yaml.erb | 5 ++ .../templates/default/SDC-Simulator-ssl-ini.erb | 83 +++++++++++++++++++++ .../chef-solo/roles/sdc-simulator.json | 4 +- utils/webseal-simulator/sdc-simulator/startup.sh | 4 +- .../org/openecomp/sdc/webseal/simulator/Login.java | 4 +- 26 files changed, 364 insertions(+), 366 deletions(-) delete mode 100644 sdc-os-chef/sdc-frontend/chef-repo/cookbooks/sdc-catalog-fe/recipes/FE_6_create_jetty_modules.rb create mode 100644 sdc-os-chef/sdc-frontend/chef-repo/cookbooks/sdc-catalog-fe/recipes/FE_6_locate_keystore.rb create mode 100644 sdc-os-chef/sdc-frontend/chef-repo/cookbooks/sdc-catalog-fe/recipes/FE_7_create_jetty_modules.rb delete mode 100644 sdc-os-chef/sdc-frontend/chef-repo/cookbooks/sdc-catalog-fe/recipes/FE_7_locate_keystore.rb delete mode 100644 utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/recipes/SDC_Simulator_6_create_jetty_modules.rb create mode 100644 utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/recipes/SDC_Simulator_6_locate_keystore.rb create mode 100644 utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/recipes/SDC_Simulator_7_create_jetty_modules.rb delete mode 100644 utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/recipes/SDC_Simulator_7_locate_keystore.rb delete mode 100644 utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/templates/default/FE-configuration.yaml.erb delete mode 100644 utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/templates/default/FE-http-ini.erb delete mode 100644 utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/templates/default/FE-https-ini.erb delete mode 100644 utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/templates/default/FE-onboarding-configuration.yaml.erb delete mode 100644 utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/templates/default/FE-ssl-ini.erb create mode 100644 utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/templates/default/SDC-Simulator-configuration.yaml.erb create mode 100644 utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/templates/default/SDC-Simulator-http-ini.erb create mode 100644 utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/templates/default/SDC-Simulator-https-ini.erb create mode 100644 utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/templates/default/SDC-Simulator-onboarding-configuration.yaml.erb create mode 100644 utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/templates/default/SDC-Simulator-ssl-ini.erb diff --git a/sdc-os-chef/sdc-frontend/chef-repo/cookbooks/sdc-catalog-fe/recipes/FE_6_create_jetty_modules.rb b/sdc-os-chef/sdc-frontend/chef-repo/cookbooks/sdc-catalog-fe/recipes/FE_6_create_jetty_modules.rb deleted file mode 100644 index 2800fd1808..0000000000 --- a/sdc-os-chef/sdc-frontend/chef-repo/cookbooks/sdc-catalog-fe/recipes/FE_6_create_jetty_modules.rb +++ /dev/null @@ -1,45 +0,0 @@ -jetty_base="/var/lib/jetty" -jetty_home="/usr/local/jetty" - -###### create Jetty modules -bash "create-jetty-modules" do -cwd "#{jetty_base}" -code <<-EOH - cd "#{jetty_base}" - java -jar "/#{jetty_home}"/start.jar --add-to-start=deploy - java -jar "/#{jetty_home}"/start.jar --add-to-startd=http,https,logging,setuid -EOH -not_if "ls /#{jetty_base}/start.d/https.ini" -end - - -###### configure Jetty modules -template "FE-http-ini" do - path "/#{jetty_base}/start.d/http.ini" - source "FE-http-ini.erb" - owner "jetty" - group "jetty" - mode "0755" - variables :FE_http_port => "#{node['FE'][:http_port]}" -end - - -template "FE-https-ini" do - path "/#{jetty_base}/start.d/https.ini" - source "FE-https-ini.erb" - owner "jetty" - group "jetty" - mode "0755" - variables :FE_https_port => "#{node['FE'][:https_port]}" -end - - -template "FE-ssl-ini" do - path "/#{jetty_base}/start.d/ssl.ini" - source "FE-ssl-ini.erb" - owner "jetty" - group "jetty" - mode "0755" - variables :FE_https_port => "#{node['FE'][:https_port]}" -end - diff --git a/sdc-os-chef/sdc-frontend/chef-repo/cookbooks/sdc-catalog-fe/recipes/FE_6_locate_keystore.rb b/sdc-os-chef/sdc-frontend/chef-repo/cookbooks/sdc-catalog-fe/recipes/FE_6_locate_keystore.rb new file mode 100644 index 0000000000..bdf0d37b28 --- /dev/null +++ b/sdc-os-chef/sdc-frontend/chef-repo/cookbooks/sdc-catalog-fe/recipes/FE_6_locate_keystore.rb @@ -0,0 +1,16 @@ +jetty_base="/var/lib/jetty" + +directory "Jetty_etcdir_creation" do + path "/#{jetty_base}/etc" + owner 'jetty' + group 'jetty' + mode '0755' + action :create +end + +cookbook_file "/#{jetty_base}/etc/keystore" do + source "keystore" + owner "jetty" + group "jetty" + mode 0755 +end diff --git a/sdc-os-chef/sdc-frontend/chef-repo/cookbooks/sdc-catalog-fe/recipes/FE_7_create_jetty_modules.rb b/sdc-os-chef/sdc-frontend/chef-repo/cookbooks/sdc-catalog-fe/recipes/FE_7_create_jetty_modules.rb new file mode 100644 index 0000000000..2800fd1808 --- /dev/null +++ b/sdc-os-chef/sdc-frontend/chef-repo/cookbooks/sdc-catalog-fe/recipes/FE_7_create_jetty_modules.rb @@ -0,0 +1,45 @@ +jetty_base="/var/lib/jetty" +jetty_home="/usr/local/jetty" + +###### create Jetty modules +bash "create-jetty-modules" do +cwd "#{jetty_base}" +code <<-EOH + cd "#{jetty_base}" + java -jar "/#{jetty_home}"/start.jar --add-to-start=deploy + java -jar "/#{jetty_home}"/start.jar --add-to-startd=http,https,logging,setuid +EOH +not_if "ls /#{jetty_base}/start.d/https.ini" +end + + +###### configure Jetty modules +template "FE-http-ini" do + path "/#{jetty_base}/start.d/http.ini" + source "FE-http-ini.erb" + owner "jetty" + group "jetty" + mode "0755" + variables :FE_http_port => "#{node['FE'][:http_port]}" +end + + +template "FE-https-ini" do + path "/#{jetty_base}/start.d/https.ini" + source "FE-https-ini.erb" + owner "jetty" + group "jetty" + mode "0755" + variables :FE_https_port => "#{node['FE'][:https_port]}" +end + + +template "FE-ssl-ini" do + path "/#{jetty_base}/start.d/ssl.ini" + source "FE-ssl-ini.erb" + owner "jetty" + group "jetty" + mode "0755" + variables :FE_https_port => "#{node['FE'][:https_port]}" +end + diff --git a/sdc-os-chef/sdc-frontend/chef-repo/cookbooks/sdc-catalog-fe/recipes/FE_7_locate_keystore.rb b/sdc-os-chef/sdc-frontend/chef-repo/cookbooks/sdc-catalog-fe/recipes/FE_7_locate_keystore.rb deleted file mode 100644 index bdf0d37b28..0000000000 --- a/sdc-os-chef/sdc-frontend/chef-repo/cookbooks/sdc-catalog-fe/recipes/FE_7_locate_keystore.rb +++ /dev/null @@ -1,16 +0,0 @@ -jetty_base="/var/lib/jetty" - -directory "Jetty_etcdir_creation" do - path "/#{jetty_base}/etc" - owner 'jetty' - group 'jetty' - mode '0755' - action :create -end - -cookbook_file "/#{jetty_base}/etc/keystore" do - source "keystore" - owner "jetty" - group "jetty" - mode 0755 -end diff --git a/sdc-os-chef/sdc-frontend/chef-solo/roles/catalog-fe.json b/sdc-os-chef/sdc-frontend/chef-solo/roles/catalog-fe.json index 547c00657c..fdc99d0259 100644 --- a/sdc-os-chef/sdc-frontend/chef-solo/roles/catalog-fe.json +++ b/sdc-os-chef/sdc-frontend/chef-solo/roles/catalog-fe.json @@ -15,8 +15,8 @@ "recipe[sdc-catalog-fe::FE_3_errors_config]", "recipe[sdc-catalog-fe::FE_4_logback]", "recipe[sdc-catalog-fe::FE_5_rest_configuration]", - "recipe[sdc-catalog-fe::FE_7_locate_keystore]", - "recipe[sdc-catalog-fe::FE_6_create_jetty_modules]" + "recipe[sdc-catalog-fe::FE_6_locate_keystore]", + "recipe[sdc-catalog-fe::FE_7_create_jetty_modules]" ], "env_run_lists": { } diff --git a/utils/webseal-simulator/sdc-simulator/Dockerfile b/utils/webseal-simulator/sdc-simulator/Dockerfile index bd682be3f7..95d452f677 100644 --- a/utils/webseal-simulator/sdc-simulator/Dockerfile +++ b/utils/webseal-simulator/sdc-simulator/Dockerfile @@ -1,4 +1,4 @@ -FROM jetty:9.3.15-jre8 +FROM jetty:9.3-jre8 ARG HTTP_PROXY ARG HTTPS_PROXY diff --git a/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/files/default/webseal.conf b/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/files/default/webseal.conf index a7026e39fa..25952fd304 100644 --- a/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/files/default/webseal.conf +++ b/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/files/default/webseal.conf @@ -1,6 +1,6 @@ { webseal { - fe="http://localhost:8181" + fe="http://10.0.2.15:8181" users = [ { userId="cs0008" diff --git a/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/recipes/SDC_Simulator_2_setup_configuration.rb b/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/recipes/SDC_Simulator_2_setup_configuration.rb index 05c787fa0f..ca7d23737c 100644 --- a/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/recipes/SDC_Simulator_2_setup_configuration.rb +++ b/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/recipes/SDC_Simulator_2_setup_configuration.rb @@ -6,13 +6,4 @@ cookbook_file "webseal.conf" do owner "jetty" group "jetty" mode "0755" -end - - -cookbook_file "logback.xml" do - path "#{jetty_base}/config/sdc-simulator/logback.xml" - source "logback.xml" - owner "jetty" - group "jetty" - mode "0755" end \ No newline at end of file diff --git a/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/recipes/SDC_Simulator_4_logback.rb b/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/recipes/SDC_Simulator_4_logback.rb index ba3097ce0b..0d9282b28a 100644 --- a/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/recipes/SDC_Simulator_4_logback.rb +++ b/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/recipes/SDC_Simulator_4_logback.rb @@ -1,7 +1,10 @@ -#cookbook_file "/var/lib/jetty/config/catalog-fe/logback.xml" do -# source "FE-logback.xml" -# mode 0755 -# owner "jetty" -# group "jetty" -#end - +jetty_base="/var/lib/jetty" + + +cookbook_file "logback.xml" do + path "#{jetty_base}/config/sdc-simulator/logback.xml" + source "logback.xml" + owner "jetty" + group "jetty" + mode "0755" +end \ No newline at end of file diff --git a/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/recipes/SDC_Simulator_6_create_jetty_modules.rb b/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/recipes/SDC_Simulator_6_create_jetty_modules.rb deleted file mode 100644 index 2800fd1808..0000000000 --- a/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/recipes/SDC_Simulator_6_create_jetty_modules.rb +++ /dev/null @@ -1,45 +0,0 @@ -jetty_base="/var/lib/jetty" -jetty_home="/usr/local/jetty" - -###### create Jetty modules -bash "create-jetty-modules" do -cwd "#{jetty_base}" -code <<-EOH - cd "#{jetty_base}" - java -jar "/#{jetty_home}"/start.jar --add-to-start=deploy - java -jar "/#{jetty_home}"/start.jar --add-to-startd=http,https,logging,setuid -EOH -not_if "ls /#{jetty_base}/start.d/https.ini" -end - - -###### configure Jetty modules -template "FE-http-ini" do - path "/#{jetty_base}/start.d/http.ini" - source "FE-http-ini.erb" - owner "jetty" - group "jetty" - mode "0755" - variables :FE_http_port => "#{node['FE'][:http_port]}" -end - - -template "FE-https-ini" do - path "/#{jetty_base}/start.d/https.ini" - source "FE-https-ini.erb" - owner "jetty" - group "jetty" - mode "0755" - variables :FE_https_port => "#{node['FE'][:https_port]}" -end - - -template "FE-ssl-ini" do - path "/#{jetty_base}/start.d/ssl.ini" - source "FE-ssl-ini.erb" - owner "jetty" - group "jetty" - mode "0755" - variables :FE_https_port => "#{node['FE'][:https_port]}" -end - diff --git a/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/recipes/SDC_Simulator_6_locate_keystore.rb b/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/recipes/SDC_Simulator_6_locate_keystore.rb new file mode 100644 index 0000000000..3bb482d89a --- /dev/null +++ b/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/recipes/SDC_Simulator_6_locate_keystore.rb @@ -0,0 +1,16 @@ +jetty_base="/var/lib/jetty" + +directory "Jetty_etcdir_creation" do + path "/#{jetty_base}/etc" + owner 'jetty' + group 'jetty' + mode '0755' + action :create +end + +cookbook_file "/#{jetty_base}/etc/keystore" do + source "keystore" + owner "jetty" + group "jetty" + mode 0755 +end \ No newline at end of file diff --git a/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/recipes/SDC_Simulator_7_create_jetty_modules.rb b/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/recipes/SDC_Simulator_7_create_jetty_modules.rb new file mode 100644 index 0000000000..b4de469563 --- /dev/null +++ b/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/recipes/SDC_Simulator_7_create_jetty_modules.rb @@ -0,0 +1,45 @@ +jetty_base="/var/lib/jetty" +jetty_home="/usr/local/jetty" + +###### create Jetty modules +bash "create-jetty-modules" do +cwd "#{jetty_base}" +code <<-EOH + cd "#{jetty_base}" + java -jar "/#{jetty_home}"/start.jar --add-to-start=deploy + java -jar "/#{jetty_home}"/start.jar --add-to-startd=http,https,logging,setuid +EOH +not_if "ls /#{jetty_base}/start.d/https.ini" +end + + +####### configure Jetty modules +#template "SDC-Simulator-http-ini" do +# path "/#{jetty_base}/start.d/http.ini" +# source "SDC-Simulator-http-ini.erb" +# owner "jetty" +# group "jetty" +# mode "0755" +# variables :Simulator_http_port => "#{node['simulator'][:http_port]}" +#end + + +#template "FE-https-ini" do +# path "/#{jetty_base}/start.d/https.ini" +# source "FE-https-ini.erb" +# owner "jetty" +# group "jetty" +# mode "0755" +# variables :FE_https_port => "#{node['FE'][:https_port]}" +#end +# +# +#template "FE-ssl-ini" do +# path "/#{jetty_base}/start.d/ssl.ini" +# source "FE-ssl-ini.erb" +# owner "jetty" +# group "jetty" +# mode "0755" +# variables :FE_https_port => "#{node['FE'][:https_port]}" +#end + diff --git a/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/recipes/SDC_Simulator_7_locate_keystore.rb b/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/recipes/SDC_Simulator_7_locate_keystore.rb deleted file mode 100644 index 3bb482d89a..0000000000 --- a/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/recipes/SDC_Simulator_7_locate_keystore.rb +++ /dev/null @@ -1,16 +0,0 @@ -jetty_base="/var/lib/jetty" - -directory "Jetty_etcdir_creation" do - path "/#{jetty_base}/etc" - owner 'jetty' - group 'jetty' - mode '0755' - action :create -end - -cookbook_file "/#{jetty_base}/etc/keystore" do - source "keystore" - owner "jetty" - group "jetty" - mode 0755 -end \ No newline at end of file diff --git a/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/templates/default/FE-configuration.yaml.erb b/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/templates/default/FE-configuration.yaml.erb deleted file mode 100644 index 6a6ea29608..0000000000 --- a/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/templates/default/FE-configuration.yaml.erb +++ /dev/null @@ -1,85 +0,0 @@ -# Needed for logging purposes. To be populated by DevOps - currently dummy -feFqdn: <%= @fe_host_ip %> - -# catalog backend hostname -beHost: <%= @be_host_ip %> - -# catalog backend http port -beHttpPort: <%= @catalog_port %> - -# catalog backend http context -beContext: /sdc2/rest/v1/catalog/upload/resources - -# catalog backend protocol -beProtocol: http - -# catalog backend ssl port -beSslPort: <%= @ssl_port %> - -# threadpool size for handling requests -threadpoolSize: 50 - -# request processing timeout (seconds) -requestTimeout: 10 - -healthCheckSocketTimeoutInMs: 5000 - -healthCheckIntervalInSeconds: 5 - -onboarding: - protocol: http - host: <%= @fe_host_ip %> - port: 8181 - healthCheckUri: "/onboarding/v1.0/healthcheck" - -identificationHeaderFields: - - - - &HTTP_IV_USER HTTP_IV_USER - - &iv-user iv-user - - - - &USER_ID USER_ID - - &user-id user-id - - - - &HTTP_CSP_ATTUID HTTP_CSP_ATTUID - - &csp-attuid csp-attuid - - - - &HTTP_CSP_WSTYPE HTTP_CSP_WSTYPE - - &csp-wstype csp-wstype - -optionalHeaderFields: - - - - &HTTP_CSP_FIRSTNAME HTTP_CSP_FIRSTNAME - - &csp-firstname csp-firstname - - - - &HTTP_CSP_LASTNAME HTTP_CSP_LASTNAME - - &csp-lastname csp-lastname - - - - &HTTP_IV_REMOTE_ADDRESS HTTP_IV_REMOTE_ADDRESS - - &iv-remote-address iv-remote-address - - - - &HTTP_CSP_EMAIL HTTP_CSP_EMAIL - - &csp-email csp-email - - -version: 1.0 -released: 2012-11-30 - -# Connection parameters -connection: - url: jdbc:mysql://localhost:3306/db - poolSize: 17 - -# Protocols -protocols: - - http - - https - - -systemMonitoring: - enabled: false - isProxy: true - probeIntervalInSeconds: 15 - -kibanaHost: localhost -kibanaPort: 5601 -kibanaProtocol: http diff --git a/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/templates/default/FE-http-ini.erb b/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/templates/default/FE-http-ini.erb deleted file mode 100644 index 34a73fdf55..0000000000 --- a/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/templates/default/FE-http-ini.erb +++ /dev/null @@ -1,32 +0,0 @@ -# --------------------------------------- -# Module: http ---module=http - -### HTTP Connector Configuration - -## Connector host/address to bind to -# jetty.http.host=0.0.0.0 - -## Connector port to listen on -jetty.http.port=<%= @FE_http_port %> - -## Connector idle timeout in milliseconds -jetty.http.idleTimeout=30000 - -## Connector socket linger time in seconds (-1 to disable) -# jetty.http.soLingerTime=-1 - -## Number of acceptors (-1 picks default based on number of cores) -# jetty.http.acceptors=-1 - -## Number of selectors (-1 picks default based on number of cores) -# jetty.http.selectors=-1 - -## ServerSocketChannel backlog (0 picks platform default) -# jetty.http.acceptorQueueSize=0 - -## Thread priority delta to give to acceptor threads -# jetty.http.acceptorPriorityDelta=0 - -## HTTP Compliance: RFC7230, RFC2616, LEGACY -# jetty.http.compliance=RFC7230 diff --git a/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/templates/default/FE-https-ini.erb b/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/templates/default/FE-https-ini.erb deleted file mode 100644 index f8ca5252b0..0000000000 --- a/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/templates/default/FE-https-ini.erb +++ /dev/null @@ -1,15 +0,0 @@ -# --------------------------------------- -# Module: https ---module=https - -## HTTPS Configuration -# HTTP port to listen on -https.port=<%= @FE_https_port %> - -# HTTPS idle timeout in milliseconds -jetty.https.idleTimeout=300000 - -# HTTPS Socket.soLingerTime in seconds. (-1 to disable) -# https.soLingerTime=-1 - - diff --git a/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/templates/default/FE-onboarding-configuration.yaml.erb b/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/templates/default/FE-onboarding-configuration.yaml.erb deleted file mode 100644 index 4646661dfb..0000000000 --- a/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/templates/default/FE-onboarding-configuration.yaml.erb +++ /dev/null @@ -1,5 +0,0 @@ -notifications: - pollingIntervalMsec: 2000 - selectionSize: 100 - beHost: <%= @catalog_ip %> - beHttpPort: <%= @catalog_port %> \ No newline at end of file diff --git a/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/templates/default/FE-ssl-ini.erb b/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/templates/default/FE-ssl-ini.erb deleted file mode 100644 index 426e0e44b5..0000000000 --- a/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/templates/default/FE-ssl-ini.erb +++ /dev/null @@ -1,83 +0,0 @@ -# --------------------------------------- -# Module: ssl ---module=ssl - -### TLS(SSL) Connector Configuration - -## Connector host/address to bind to -# jetty.ssl.host=0.0.0.0 - -## Connector port to listen on -jetty.ssl.port=<%= @FE_https_port %> - -## Connector idle timeout in milliseconds -# jetty.ssl.idleTimeout=30000 - -## Connector socket linger time in seconds (-1 to disable) -# jetty.ssl.soLingerTime=-1 - -## Number of acceptors (-1 picks default based on number of cores) -# jetty.ssl.acceptors=-1 - -## Number of selectors (-1 picks default based on number of cores) -# jetty.ssl.selectors=-1 - -## ServerSocketChannel backlog (0 picks platform default) -# jetty.ssl.acceptorQueueSize=0 - -## Thread priority delta to give to acceptor threads -# jetty.ssl.acceptorPriorityDelta=0 - -## Whether request host names are checked to match any SNI names -# jetty.ssl.sniHostCheck=true - -## max age in seconds for a Strict-Transport-Security response header (default -1) -# jetty.ssl.stsMaxAgeSeconds=31536000 - -## include subdomain property in any Strict-Transport-Security header (default false) -# jetty.ssl.stsIncludeSubdomains=true - -### SslContextFactory Configuration -## Note that OBF passwords are not secure, just protected from casual observation -## See http://www.eclipse.org/jetty/documentation/current/configuring-security-secure-passwords.html - -## Keystore file path (relative to $jetty.base) -# jetty.sslContext.keyStorePath=etc/keystore - -## Truststore file path (relative to $jetty.base) -# jetty.sslContext.trustStorePath=etc/keystore - -## Keystore password -# jetty.sslContext.keyStorePassword=OBF:1vny1zlo1x8e1vnw1vn61x8g1zlu1vn4 - -## Keystore type and provider -# jetty.sslContext.keyStoreType=JKS -# jetty.sslContext.keyStoreProvider= - -## KeyManager password -# jetty.sslContext.keyManagerPassword=OBF:1u2u1wml1z7s1z7a1wnl1u2g - -## Truststore password -# jetty.sslContext.trustStorePassword=OBF:1vny1zlo1x8e1vnw1vn61x8g1zlu1vn4 - -## Truststore type and provider -# jetty.sslContext.trustStoreType=JKS -# jetty.sslContext.trustStoreProvider= - -## whether client certificate authentication is required -# jetty.sslContext.needClientAuth=false - -## Whether client certificate authentication is desired -# jetty.sslContext.wantClientAuth=false - -## Whether cipher order is significant (since java 8 only) -# jetty.sslContext.useCipherSuitesOrder=true - -## To configure Includes / Excludes for Cipher Suites or Protocols see tweak-ssl.xml example at -## https://www.eclipse.org/jetty/documentation/current/configuring-ssl.html#configuring-sslcontextfactory-cipherSuites - -## Set the size of the SslSession cache -# jetty.sslContext.sslSessionCacheSize=-1 - -## Set the timeout (in seconds) of the SslSession cache timeout -# jetty.sslContext.sslSessionTimeout=-1 diff --git a/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/templates/default/SDC-Simulator-configuration.yaml.erb b/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/templates/default/SDC-Simulator-configuration.yaml.erb new file mode 100644 index 0000000000..6a6ea29608 --- /dev/null +++ b/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/templates/default/SDC-Simulator-configuration.yaml.erb @@ -0,0 +1,85 @@ +# Needed for logging purposes. To be populated by DevOps - currently dummy +feFqdn: <%= @fe_host_ip %> + +# catalog backend hostname +beHost: <%= @be_host_ip %> + +# catalog backend http port +beHttpPort: <%= @catalog_port %> + +# catalog backend http context +beContext: /sdc2/rest/v1/catalog/upload/resources + +# catalog backend protocol +beProtocol: http + +# catalog backend ssl port +beSslPort: <%= @ssl_port %> + +# threadpool size for handling requests +threadpoolSize: 50 + +# request processing timeout (seconds) +requestTimeout: 10 + +healthCheckSocketTimeoutInMs: 5000 + +healthCheckIntervalInSeconds: 5 + +onboarding: + protocol: http + host: <%= @fe_host_ip %> + port: 8181 + healthCheckUri: "/onboarding/v1.0/healthcheck" + +identificationHeaderFields: + - + - &HTTP_IV_USER HTTP_IV_USER + - &iv-user iv-user + - + - &USER_ID USER_ID + - &user-id user-id + - + - &HTTP_CSP_ATTUID HTTP_CSP_ATTUID + - &csp-attuid csp-attuid + - + - &HTTP_CSP_WSTYPE HTTP_CSP_WSTYPE + - &csp-wstype csp-wstype + +optionalHeaderFields: + - + - &HTTP_CSP_FIRSTNAME HTTP_CSP_FIRSTNAME + - &csp-firstname csp-firstname + - + - &HTTP_CSP_LASTNAME HTTP_CSP_LASTNAME + - &csp-lastname csp-lastname + - + - &HTTP_IV_REMOTE_ADDRESS HTTP_IV_REMOTE_ADDRESS + - &iv-remote-address iv-remote-address + - + - &HTTP_CSP_EMAIL HTTP_CSP_EMAIL + - &csp-email csp-email + + +version: 1.0 +released: 2012-11-30 + +# Connection parameters +connection: + url: jdbc:mysql://localhost:3306/db + poolSize: 17 + +# Protocols +protocols: + - http + - https + + +systemMonitoring: + enabled: false + isProxy: true + probeIntervalInSeconds: 15 + +kibanaHost: localhost +kibanaPort: 5601 +kibanaProtocol: http diff --git a/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/templates/default/SDC-Simulator-http-ini.erb b/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/templates/default/SDC-Simulator-http-ini.erb new file mode 100644 index 0000000000..51b9addd93 --- /dev/null +++ b/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/templates/default/SDC-Simulator-http-ini.erb @@ -0,0 +1,32 @@ +# --------------------------------------- +# Module: http +--module=http + +### HTTP Connector Configuration + +## Connector host/address to bind to +# jetty.http.host=0.0.0.0 + +## Connector port to listen on +jetty.http.port=<%= @Simulator_http_port %> + +## Connector idle timeout in milliseconds +jetty.http.idleTimeout=30000 + +## Connector socket linger time in seconds (-1 to disable) +# jetty.http.soLingerTime=-1 + +## Number of acceptors (-1 picks default based on number of cores) +# jetty.http.acceptors=-1 + +## Number of selectors (-1 picks default based on number of cores) +# jetty.http.selectors=-1 + +## ServerSocketChannel backlog (0 picks platform default) +# jetty.http.acceptorQueueSize=0 + +## Thread priority delta to give to acceptor threads +# jetty.http.acceptorPriorityDelta=0 + +## HTTP Compliance: RFC7230, RFC2616, LEGACY +# jetty.http.compliance=RFC7230 diff --git a/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/templates/default/SDC-Simulator-https-ini.erb b/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/templates/default/SDC-Simulator-https-ini.erb new file mode 100644 index 0000000000..f8ca5252b0 --- /dev/null +++ b/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/templates/default/SDC-Simulator-https-ini.erb @@ -0,0 +1,15 @@ +# --------------------------------------- +# Module: https +--module=https + +## HTTPS Configuration +# HTTP port to listen on +https.port=<%= @FE_https_port %> + +# HTTPS idle timeout in milliseconds +jetty.https.idleTimeout=300000 + +# HTTPS Socket.soLingerTime in seconds. (-1 to disable) +# https.soLingerTime=-1 + + diff --git a/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/templates/default/SDC-Simulator-onboarding-configuration.yaml.erb b/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/templates/default/SDC-Simulator-onboarding-configuration.yaml.erb new file mode 100644 index 0000000000..4646661dfb --- /dev/null +++ b/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/templates/default/SDC-Simulator-onboarding-configuration.yaml.erb @@ -0,0 +1,5 @@ +notifications: + pollingIntervalMsec: 2000 + selectionSize: 100 + beHost: <%= @catalog_ip %> + beHttpPort: <%= @catalog_port %> \ No newline at end of file diff --git a/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/templates/default/SDC-Simulator-ssl-ini.erb b/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/templates/default/SDC-Simulator-ssl-ini.erb new file mode 100644 index 0000000000..426e0e44b5 --- /dev/null +++ b/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/templates/default/SDC-Simulator-ssl-ini.erb @@ -0,0 +1,83 @@ +# --------------------------------------- +# Module: ssl +--module=ssl + +### TLS(SSL) Connector Configuration + +## Connector host/address to bind to +# jetty.ssl.host=0.0.0.0 + +## Connector port to listen on +jetty.ssl.port=<%= @FE_https_port %> + +## Connector idle timeout in milliseconds +# jetty.ssl.idleTimeout=30000 + +## Connector socket linger time in seconds (-1 to disable) +# jetty.ssl.soLingerTime=-1 + +## Number of acceptors (-1 picks default based on number of cores) +# jetty.ssl.acceptors=-1 + +## Number of selectors (-1 picks default based on number of cores) +# jetty.ssl.selectors=-1 + +## ServerSocketChannel backlog (0 picks platform default) +# jetty.ssl.acceptorQueueSize=0 + +## Thread priority delta to give to acceptor threads +# jetty.ssl.acceptorPriorityDelta=0 + +## Whether request host names are checked to match any SNI names +# jetty.ssl.sniHostCheck=true + +## max age in seconds for a Strict-Transport-Security response header (default -1) +# jetty.ssl.stsMaxAgeSeconds=31536000 + +## include subdomain property in any Strict-Transport-Security header (default false) +# jetty.ssl.stsIncludeSubdomains=true + +### SslContextFactory Configuration +## Note that OBF passwords are not secure, just protected from casual observation +## See http://www.eclipse.org/jetty/documentation/current/configuring-security-secure-passwords.html + +## Keystore file path (relative to $jetty.base) +# jetty.sslContext.keyStorePath=etc/keystore + +## Truststore file path (relative to $jetty.base) +# jetty.sslContext.trustStorePath=etc/keystore + +## Keystore password +# jetty.sslContext.keyStorePassword=OBF:1vny1zlo1x8e1vnw1vn61x8g1zlu1vn4 + +## Keystore type and provider +# jetty.sslContext.keyStoreType=JKS +# jetty.sslContext.keyStoreProvider= + +## KeyManager password +# jetty.sslContext.keyManagerPassword=OBF:1u2u1wml1z7s1z7a1wnl1u2g + +## Truststore password +# jetty.sslContext.trustStorePassword=OBF:1vny1zlo1x8e1vnw1vn61x8g1zlu1vn4 + +## Truststore type and provider +# jetty.sslContext.trustStoreType=JKS +# jetty.sslContext.trustStoreProvider= + +## whether client certificate authentication is required +# jetty.sslContext.needClientAuth=false + +## Whether client certificate authentication is desired +# jetty.sslContext.wantClientAuth=false + +## Whether cipher order is significant (since java 8 only) +# jetty.sslContext.useCipherSuitesOrder=true + +## To configure Includes / Excludes for Cipher Suites or Protocols see tweak-ssl.xml example at +## https://www.eclipse.org/jetty/documentation/current/configuring-ssl.html#configuring-sslcontextfactory-cipherSuites + +## Set the size of the SslSession cache +# jetty.sslContext.sslSessionCacheSize=-1 + +## Set the timeout (in seconds) of the SslSession cache timeout +# jetty.sslContext.sslSessionTimeout=-1 diff --git a/utils/webseal-simulator/sdc-simulator/chef-solo/roles/sdc-simulator.json b/utils/webseal-simulator/sdc-simulator/chef-solo/roles/sdc-simulator.json index 8f84675d4b..36a163708a 100644 --- a/utils/webseal-simulator/sdc-simulator/chef-solo/roles/sdc-simulator.json +++ b/utils/webseal-simulator/sdc-simulator/chef-solo/roles/sdc-simulator.json @@ -12,7 +12,9 @@ "run_list": [ "recipe[sdc-simulator::SDC_Simulator_1_cleanup_jettydir]", "recipe[sdc-simulator::SDC_Simulator_2_setup_configuration]", - "recipe[sdc-simulator::SDC_Simulator_7_locate_keystore]" + "recipe[sdc-simulator::SDC_Simulator_4_logback]", + "recipe[sdc-simulator::SDC_Simulator_6_locate_keystore]", + "recipe[sdc-simulator::SDC_Simulator_7_create_jetty_modules]" ], "env_run_lists": { } diff --git a/utils/webseal-simulator/sdc-simulator/startup.sh b/utils/webseal-simulator/sdc-simulator/startup.sh index 46a3173337..d5abda9f1e 100644 --- a/utils/webseal-simulator/sdc-simulator/startup.sh +++ b/utils/webseal-simulator/sdc-simulator/startup.sh @@ -6,7 +6,9 @@ echo "normal['HOST_IP'] = \"${HOST_IP}\"" > /root/chef-solo/cookbooks/sdc-simula chef-solo -c solo.rb #chef-solo -c solo.rb -E ${CHEFNAME} -sed -i '/^set -e/aJAVA_OPTIONS=\"-Xdebug -Xmx128m -Xms128m -Xss1m -Dconfig.home=${JETTY_BASE}/config -Dlog.home=${JETTY_BASE}/logs -Dlogback.configurationFile=${JETTY_BASE}/config/sdc-simulator/logback.xml -Djetty.logging.dir=${JETTY_BASE}/logs\"' /docker-entrypoint.sh +sed -i '/^set -e/aJAVA_OPTIONS=\"-Xdebug -Xmx128m -Xms128m -Xss1m -Dconfig.home=${JETTY_BASE}/config/sdc-simulator -Dlog.home=${JETTY_BASE}/logs -Dlogback.configurationFile=${JETTY_BASE}/config/sdc-simulator/logback.xml -Djetty.logging.dir=${JETTY_BASE}/logs -Djetty.base=${JETTY_BASE} \"' /docker-entrypoint.sh +#Moty Default WS startup args +#/usr/bin/java -Dconfig.home=/apps/jetty/base/ws/config -Dlog.home=/apps/jetty/base/ws/logs -Dlogback.configurationFile=/apps/jetty/base/ws/logback.xml -Djetty.logging.dir=/apps/jetty/base/ws/logs -Djetty.home=/apps/jetty/jetty-distribution-9.3.6.v20151106 -Djetty.base=/apps/jetty/base/ws -Djava.io.tmpdir=/tmp -jar /apps/jetty/jetty-distribution-9.3.6.v20151106/start.jar jetty.state=/apps/jetty/base/ws/webseal-simulator.state jetty-logging.xml jetty-started.xml sed -i '/^set -e/aTMPDIR=${JETTY_BASE}\/temp' /docker-entrypoint.sh cd /var/lib/jetty diff --git a/utils/webseal-simulator/src/main/java/org/openecomp/sdc/webseal/simulator/Login.java b/utils/webseal-simulator/src/main/java/org/openecomp/sdc/webseal/simulator/Login.java index db4853a8f1..2798f68563 100644 --- a/utils/webseal-simulator/src/main/java/org/openecomp/sdc/webseal/simulator/Login.java +++ b/utils/webseal-simulator/src/main/java/org/openecomp/sdc/webseal/simulator/Login.java @@ -112,8 +112,8 @@ public class Login extends HttpServlet { System.out.println("Login -> doPOst userId=" + userId); User user = getUser(userId, password); if (user == null) { - request.setAttribute("message", "ERROR: userId or password incorect"); - doGet(request, response); + response.sendError(500, "ERROR: userId or password incorect"); +// doGet(request, response); } else { System.out.println("Login -> doPOst redirext to /sdc1 (to proxy)"); Cookie cookieUser = new Cookie("HTTP_IV_USER", user.getUserId()); -- cgit 1.2.3-korg