From 451a3400b76511393c62a444f588a4ed15f4a549 Mon Sep 17 00:00:00 2001 From: Michael Lando Date: Sun, 19 Feb 2017 10:28:42 +0200 Subject: Initial OpenECOMP SDC commit Change-Id: I0924d5a6ae9cdc161ae17c68d3689a30d10f407b Signed-off-by: Michael Lando --- .../src/main/resources/application-context.xml | 23 ++++ .../src/main/resources/config/configuration.yaml | 78 +++++++++++++ .../config/ecomp-error-configuration.yaml | 48 ++++++++ catalog-fe/src/main/resources/config/logback.xml | 125 +++++++++++++++++++++ .../resources/config/rest-configuration-info.yaml | 12 ++ catalog-fe/src/main/resources/jetty-ipaccess.xml | 30 +++++ catalog-fe/src/main/resources/portal.properties | 28 +++++ catalog-fe/src/main/resources/scripts/install.sh | 61 ++++++++++ .../src/main/resources/scripts/installJettyBase.sh | 14 +++ .../src/main/resources/scripts/jvm.properties | 5 + .../src/main/resources/scripts/startJetty.sh | 10 ++ .../src/main/resources/scripts/updateSslParams.sh | 33 ++++++ 12 files changed, 467 insertions(+) create mode 100644 catalog-fe/src/main/resources/application-context.xml create mode 100644 catalog-fe/src/main/resources/config/configuration.yaml create mode 100644 catalog-fe/src/main/resources/config/ecomp-error-configuration.yaml create mode 100644 catalog-fe/src/main/resources/config/logback.xml create mode 100644 catalog-fe/src/main/resources/config/rest-configuration-info.yaml create mode 100644 catalog-fe/src/main/resources/jetty-ipaccess.xml create mode 100644 catalog-fe/src/main/resources/portal.properties create mode 100644 catalog-fe/src/main/resources/scripts/install.sh create mode 100644 catalog-fe/src/main/resources/scripts/installJettyBase.sh create mode 100644 catalog-fe/src/main/resources/scripts/jvm.properties create mode 100644 catalog-fe/src/main/resources/scripts/startJetty.sh create mode 100644 catalog-fe/src/main/resources/scripts/updateSslParams.sh (limited to 'catalog-fe/src/main/resources') diff --git a/catalog-fe/src/main/resources/application-context.xml b/catalog-fe/src/main/resources/application-context.xml new file mode 100644 index 0000000000..a5ec92697a --- /dev/null +++ b/catalog-fe/src/main/resources/application-context.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + diff --git a/catalog-fe/src/main/resources/config/configuration.yaml b/catalog-fe/src/main/resources/config/configuration.yaml new file mode 100644 index 0000000000..6be93b330d --- /dev/null +++ b/catalog-fe/src/main/resources/config/configuration.yaml @@ -0,0 +1,78 @@ +# Needed for logging purposes. To be populated by DevOps - currently dummy +feFqdn: asdcFe.att.com + +# catalog backend hostname +beHost: localhost + +# catalog backend http port +beHttpPort: 8080 + +# catalog backend http context +beContext: /sdc2/rest/v1/catalog/upload/resources + +# catalog backend protocol +beProtocol: http + +# catalog backend ssl port +beSslPort: 8443 + +# threadpool size for handling requests +threadpoolSize: 50 + +# request processing timeout (seconds) +requestTimeout: 10 + +healthCheckSocketTimeoutInMs: 5000 + +healthCheckIntervalInSeconds: 5 + +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/catalog-fe/src/main/resources/config/ecomp-error-configuration.yaml b/catalog-fe/src/main/resources/config/ecomp-error-configuration.yaml new file mode 100644 index 0000000000..8982b2424f --- /dev/null +++ b/catalog-fe/src/main/resources/config/ecomp-error-configuration.yaml @@ -0,0 +1,48 @@ +########################################### +# Note the conventions of the field values: +# type can be one of: CONFIG_ERROR, SYSTEM_ERROR, DATA_ERROR, CONNECTION_PROBLEM +# severity can be one of: WARN, ERROR, FATAL +# alarmSeverity can be one of: CRITICAL,MAJOR,MINOR,INFORMATIONAL,NONE +# code is a unique integer in range of 3003-9999 (3000-3002 are occupied for internal usage) +# The above enumeration values are out-of-the-box and can be changed in code. +# In case of config and code mismatch, the appropriate error will be printed to log +# +# Range of FE codes - 8000-9999 + + +errors: + FeHealthCheckConnectionError: { + type: CONNECTION_PROBLEM, + code: ASDC_8000, + severity: ERROR, + description: "Connection error during FE Health Check", + alarmSeverity: CRITICAL + } + FeHttpLoggingError: { + type: SYSTEM_ERROR, + code: ASDC_8001, + severity: ERROR, + description: "Error when logging FE HTTP request/response", + alarmSeverity: MINOR + } + FePortalServletError: { + type: SYSTEM_ERROR, + code: ASDC_8002, + severity: ERROR, + description: "Error when trying to access FE Portal page", + alarmSeverity: MAJOR + } + FeHealthCheckGeneralError: { + type: SYSTEM_ERROR, + code: ASDC_8004, + severity: ERROR, + description: "General error during FE Health Check", + alarmSeverity: CRITICAL + } + FeHealthCheckRecovery: { + type: RECOVERY, + code: ASDC_8005, + severity: INFO, + description: "BE Health Check Recovery", + alarmSeverity: INFORMATIONAL + } \ No newline at end of file diff --git a/catalog-fe/src/main/resources/config/logback.xml b/catalog-fe/src/main/resources/config/logback.xml new file mode 100644 index 0000000000..fd2e13ca43 --- /dev/null +++ b/catalog-fe/src/main/resources/config/logback.xml @@ -0,0 +1,125 @@ + + + + + + + + + + + + + + + + ${log.home}/${ECOMP-component-name}/${ECOMP-subcomponent-name}/all.log + + + + ${log.home}/${ECOMP-component-name}/${ECOMP-subcomponent-name}/all.log.%i + + 1 + 10 + + + + 20MB + + + ${default-log-pattern} + + + + + + + + + + + + + ${log.home}/${ECOMP-component-name}/${ECOMP-subcomponent-name}/error.log + + + + + INFO + + + + ${log.home}/${ECOMP-component-name}/${ECOMP-subcomponent-name}/error.log.%i + + 1 + 10 + + + + 20MB + + + ${default-log-pattern} + + + + + + ${log.home}/${ECOMP-component-name}/${ECOMP-subcomponent-name}/debug.log + + + + + + + e.level.toInt() <= DEBUG.toInt() + + + DENY + NEUTRAL + + + + ${log.home}/${ECOMP-component-name}/${ECOMP-subcomponent-name}/debug.log.%i + + 1 + 10 + + + + 20MB + + + ${default-log-pattern} + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/catalog-fe/src/main/resources/config/rest-configuration-info.yaml b/catalog-fe/src/main/resources/config/rest-configuration-info.yaml new file mode 100644 index 0000000000..083adcf7c7 --- /dev/null +++ b/catalog-fe/src/main/resources/config/rest-configuration-info.yaml @@ -0,0 +1,12 @@ +# rest read timeout - means no timeout +readTimeoutInSec: 0 + +# whether to ignore certificate +ignoreCertificate: false + +# the connection pool size +connectionPoolSize: 10 + +# create connection timeout +connectTimeoutInSec: 10 + diff --git a/catalog-fe/src/main/resources/jetty-ipaccess.xml b/catalog-fe/src/main/resources/jetty-ipaccess.xml new file mode 100644 index 0000000000..97db551f02 --- /dev/null +++ b/catalog-fe/src/main/resources/jetty-ipaccess.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + 0-255.0-255.0-255.0-255 + + + + + 127.0.0.1/blacklisted + 127.0.0.2/black.html + + + false + + + diff --git a/catalog-fe/src/main/resources/portal.properties b/catalog-fe/src/main/resources/portal.properties new file mode 100644 index 0000000000..880c4fe9e9 --- /dev/null +++ b/catalog-fe/src/main/resources/portal.properties @@ -0,0 +1,28 @@ +# Portal REST URL, ends "/auxapi" +ecomp_rest_url = https://portal.api.simpledemo.openecomp.org/ecompportal/auxapi + +# Java implementation of interface +portal.api.impl.class = org.openecomp.sdc.be.ecomp.EcompIntImpl + +# CSP-SSO URL +ecomp_redirect_url = http://portal.api.simpledemo.openecomp.org:8989/ECOMPPORTAL/login.htm + +# Cookie set by CSP-SSO +csp_cookie_name = attESSec +# CSP setting, most use PROD; DEV also recognized +csp_gate_keeper_prod_key = PROD + +# Comma-separated list of UEB server names +ueb_url_list = +# UEB topic where Portal listens +ecomp_portal_inbox_name = ECOMP-PORTAL-INBOX-TEST +# UEB key generated while on-boarding +ueb_app_key = app_key_here +# UEB secret generated while on-boarding +ueb_app_secret = app_secret_here +# UEB topic where App listens +ueb_app_mailbox_name = app_topic_name_here +# Consumer group name; most Apps should use {UUID} +ueb_app_consumer_group_name = {UUID} + +decryption_key = AGLDdG4D04BKm2IxIWEr8o== \ No newline at end of file diff --git a/catalog-fe/src/main/resources/scripts/install.sh b/catalog-fe/src/main/resources/scripts/install.sh new file mode 100644 index 0000000000..bed9411795 --- /dev/null +++ b/catalog-fe/src/main/resources/scripts/install.sh @@ -0,0 +1,61 @@ +#!/bin/sh + +export JETTY_BASE=/home/jetty/base + +COMP=$1 + +function usage() { + echo "$0 " +} + +function exitOnError() { + if [ $1 -ne 0 ] + then + echo "Failed running task $2" + exit 2 + fi +} + +if [ $# -ne 1 ] +then + usage + exit 1 + +fi + +/opt/app/sdc/catalog-${COMP}/scripts/installJettyBase.sh +exitOnError $? "installJettyBase" + +cd ${JETTY_BASE} +exitOnError $? "move_to_base_dir" + +mkdir -p scripts + +cp /opt/app/sdc/catalog-${COMP}/scripts/* scripts +exitOnError $? "copy_scripts_from_rpm" + +cp /opt/app/sdc/catalog-${COMP}/ext/jetty-ipaccess.xml etc +exitOnError $? "override_jetty-ipaccess_module." + +cp /opt/app/sdc/catalog-${COMP}/catalog-${COMP}-*.war webapps +exitOnError $? "copy_war" + +cp /opt/app/sdc/catalog-${COMP}/scripts/startJetty.sh . +exitOnError $? "copy_startJetty" + +cp /opt/app/sdc/catalog-${COMP}/scripts/jvm.properties . +exitOnError $? "copy_jvm_properties" + +./scripts/updateSslParams.sh ${JETTY_BASE} +exitOnError $? "updateSslParams_script" + +#ONLY FOR BE +#cp /opt/app/sdc/config/catalog-${COMP}/elasticsearch.yml config +#exitOnError $? "copy_elasticsearch_yaml_to_config" + +mkdir -p ${JETTY_BASE}/config/catalog-${COMP} +cp -r /opt/app/sdc/config/catalog-${COMP}/*.xml ${JETTY_BASE}/config/catalog-${COMP} +exitOnError $? "copy_xml_files_to_config" + +cp -r /opt/app/sdc/config/catalog-${COMP}/*.yaml ${JETTY_BASE}/config/catalog-${COMP} +exitOnError $? "copy_yaml_files_to_config" diff --git a/catalog-fe/src/main/resources/scripts/installJettyBase.sh b/catalog-fe/src/main/resources/scripts/installJettyBase.sh new file mode 100644 index 0000000000..0f8ac7e109 --- /dev/null +++ b/catalog-fe/src/main/resources/scripts/installJettyBase.sh @@ -0,0 +1,14 @@ +#!/bin/sh + +export JETTY_HOME=/home/jetty/jetty-distribution-9.2.7.v20150116 +export JETTY_BASE=/home/jetty/base + +mkdir -p ${JETTY_BASE} +mkdir -p ${JETTY_BASE}/config + +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,ipaccess + +cd - diff --git a/catalog-fe/src/main/resources/scripts/jvm.properties b/catalog-fe/src/main/resources/scripts/jvm.properties new file mode 100644 index 0000000000..52b5134f34 --- /dev/null +++ b/catalog-fe/src/main/resources/scripts/jvm.properties @@ -0,0 +1,5 @@ +-XX:MaxPermSize=256m +-Xmx1500m +-Dconfig.home=${JETTY_BASE}/config +-Dlog.home=${JETTY_BASE}/logs +-Dlogback.configurationFile=${JETTY_BASE}/config/catalog-fe/logback.xml \ No newline at end of file diff --git a/catalog-fe/src/main/resources/scripts/startJetty.sh b/catalog-fe/src/main/resources/scripts/startJetty.sh new file mode 100644 index 0000000000..074d91d6f7 --- /dev/null +++ b/catalog-fe/src/main/resources/scripts/startJetty.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +export JETTY_HOME=/home/jetty/jetty-distribution-9.2.7.v20150116 +export JETTY_BASE=/home/jetty/base + +eval "jvmargs=`sed '/^#/d' jvm.properties | paste -s -d"#"`" +jvmargs=`echo $jvmargs | sed 's/#/ /g'` +echo $jvmargs + +java -jar $JETTY_HOME/start.jar $jvmargs $@ \ No newline at end of file diff --git a/catalog-fe/src/main/resources/scripts/updateSslParams.sh b/catalog-fe/src/main/resources/scripts/updateSslParams.sh new file mode 100644 index 0000000000..d9e955e0f5 --- /dev/null +++ b/catalog-fe/src/main/resources/scripts/updateSslParams.sh @@ -0,0 +1,33 @@ +#!/bin/sh + +function usage() { + echo "$0 " +} + +function exitOnError() { + if [ $1 -ne 0 ] + then + echo "Failed running task $2" + exit 2 + fi +} + +if [ $# -ne 1 ] +then + usage + if [ ${#OLDPWD} -ne 0 ] + then + cd - + fi + exit 1 + +fi + +WORK_DIR=$1 + +cd $WORK_DIR + +sed -i 's/\(^https.port=\)\(.*\)/\1443/g' start.d/https.ini +exitOnError $? "update_port_in_https_ini" + +cd - -- cgit 1.2.3-korg