From b001c1ac5a0b4d938a69adb47f4613f64dc71c1a Mon Sep 17 00:00:00 2001 From: Jorge Hernandez Date: Thu, 28 Feb 2019 10:10:49 -0600 Subject: move all hard install config to environment vars + support multiple system properties files with variable interpolation loaded at initialization + support of configurable JVM options (-X, etc ..). + rearrange aaf configuration to avoid {{}} installation variables and use dynamic enviroment variables. + miscellaneous clean up in areas touched and checkstyle. Change-Id: I71ad839778e17eb57c098a2c5cc2bf96e468669a Issue-ID: POLICY-1524 Signed-off-by: Jorge Hernandez --- .../main/server/config/aaf-credentials.properties | 9 --- .../src/main/server/config/aaf-location.properties | 2 - .../src/main/server/config/aaf-system.properties | 43 +++++++++++++ .../src/main/server/config/aaf.properties | 11 ---- .../main/server/config/engine-system.properties | 37 +++++++++++ .../src/main/server/config/engine.properties | 74 ++++++++++++++++++++++ .../main/server/config/policy-engine.properties | 72 --------------------- .../src/main/server/config/system.properties | 26 ++------ 8 files changed, 158 insertions(+), 116 deletions(-) delete mode 100644 policy-management/src/main/server/config/aaf-credentials.properties delete mode 100644 policy-management/src/main/server/config/aaf-location.properties create mode 100644 policy-management/src/main/server/config/aaf-system.properties delete mode 100644 policy-management/src/main/server/config/aaf.properties create mode 100644 policy-management/src/main/server/config/engine-system.properties create mode 100644 policy-management/src/main/server/config/engine.properties delete mode 100644 policy-management/src/main/server/config/policy-engine.properties (limited to 'policy-management/src/main/server') diff --git a/policy-management/src/main/server/config/aaf-credentials.properties b/policy-management/src/main/server/config/aaf-credentials.properties deleted file mode 100644 index aaa5f161..00000000 --- a/policy-management/src/main/server/config/aaf-credentials.properties +++ /dev/null @@ -1,9 +0,0 @@ -cm_url=https://AAF_LOCATE_URL/AAF_NS.cm:2.1 -cadi_x509_issuers=CN=intermediateCA_1, OU=OSAAF, O=ONAP, C=US:CN=intermediateCA_7, OU=OSAAF, O=ONAP, C=US -cadi_keyfile=${{POLICY_HOME}}/config/aaf-cadi.keyfile -cadi_keystore=${{POLICY_HOME}}/etc/ssl/policy-keystore -cadi_keystore_password=${{KEYSTORE_PASSWD}} -cadi_key_password=${{KEYSTORE_PASSWD}} -cadi_alias=policy@policy.onap.org -cadi_truststore=${{POLICY_HOME}}/etc/ssl/policy-truststore -cadi_truststore_password=${{TRUSTSTORE_PASSWD}} \ No newline at end of file diff --git a/policy-management/src/main/server/config/aaf-location.properties b/policy-management/src/main/server/config/aaf-location.properties deleted file mode 100644 index dc828e71..00000000 --- a/policy-management/src/main/server/config/aaf-location.properties +++ /dev/null @@ -1,2 +0,0 @@ -cadi_latitude=38.000 -cadi_longitude=-72.000 diff --git a/policy-management/src/main/server/config/aaf-system.properties b/policy-management/src/main/server/config/aaf-system.properties new file mode 100644 index 00000000..05716cc2 --- /dev/null +++ b/policy-management/src/main/server/config/aaf-system.properties @@ -0,0 +1,43 @@ +# +# ============LICENSE_START======================================================= +# ONAP +# ================================================================================ +# Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. +# ================================================================================ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END========================================================= +# + +# AAF related system properties + +aaf_locate_url=https://${env:AAF_HOST}:8095 +aaf_oauth2_introspect_url=https://AAF_LOCATE_URL/AAF_NS.introspect:2.1/introspect +aaf_oauth2_token_url=https://AAF_LOCATE_URL/AAF_NS.token:2.1/token +aaf_url=https://AAF_LOCATE_URL/AAF_NS.service:2.1 +aaf_env=DEV + +cadi_protocols=TLSv1.1,TLSv1.2 +cadi_latitude=38.000 +cadi_longitude=-72.000 +cadi_loglevel=DEBUG + +cadi_x509_issuers=CN=intermediateCA_1, OU=OSAAF, O=ONAP, C=US:CN=intermediateCA_7, OU=OSAAF, O=ONAP, C=US +cadi_keyfile=${env:POLICY_HOME}/config/aaf-cadi.keyfile +cadi_keystore=${env:POLICY_HOME}/etc/ssl/policy-keystore +cadi_keystore_password=${env:KEYSTORE_PASSWD} +cadi_key_password=${env:KEYSTORE_PASSWD} +cadi_alias=policy@policy.onap.org +cadi_truststore=${env:POLICY_HOME}/etc/ssl/policy-truststore +cadi_truststore_password=${env:TRUSTSTORE_PASSWD} + +cm_url=https://AAF_LOCATE_URL/AAF_NS.cm:2.1 diff --git a/policy-management/src/main/server/config/aaf.properties b/policy-management/src/main/server/config/aaf.properties deleted file mode 100644 index 8084be99..00000000 --- a/policy-management/src/main/server/config/aaf.properties +++ /dev/null @@ -1,11 +0,0 @@ -cadi_prop_files=${{POLICY_HOME}}/config/aaf-credentials.properties:${{POLICY_HOME}}/config/aaf-location.properties -cadi_loglevel=DEBUG -aaf_env=DEV -aaf_locate_url=https://${{AAF_HOST}}:8095 -aaf_oauth2_introspect_url=https://AAF_LOCATE_URL/AAF_NS.introspect:2.1/introspect -aaf_oauth2_token_url=https://AAF_LOCATE_URL/AAF_NS.token:2.1/token -aaf_url=https://AAF_LOCATE_URL/AAF_NS.service:2.1 -cadi_protocols=TLSv1.1,TLSv1.2 -cm_url=https://AAF_LOCATE_URL/AAF_NS.cm:2.1 -fs_url=https://AAF_LOCATE_URL/AAF_NS.fs.2.1 -gui_url=https://AAF_LOCATE_URL/AAF_NS.gui.2.1 diff --git a/policy-management/src/main/server/config/engine-system.properties b/policy-management/src/main/server/config/engine-system.properties new file mode 100644 index 00000000..c1f21b86 --- /dev/null +++ b/policy-management/src/main/server/config/engine-system.properties @@ -0,0 +1,37 @@ +# +# ============LICENSE_START======================================================= +# ONAP +# ================================================================================ +# Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. +# ================================================================================ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END========================================================= +# + +# system properties set within the application + +java.net.preferIPv4Stack=true + +# jmx + +com.sun.management.jmxremote.port=9991 +com.sun.management.jmxremote.authenticate=false +com.sun.management.jmxremote.ssl=false + +# certs + +javax.net.ssl.trustStore=${env:POLICY_HOME}/etc/ssl/policy-truststore +javax.net.ssl.trustStorePassword=${env:TRUSTSTORE_PASSWD} + +javax.net.ssl.keyStore=${env:POLICY_HOME}/etc/ssl/policy-keystore +javax.net.ssl.keyStorePassword=${env:KEYSTORE_PASSWD} diff --git a/policy-management/src/main/server/config/engine.properties b/policy-management/src/main/server/config/engine.properties new file mode 100644 index 00000000..fec99b14 --- /dev/null +++ b/policy-management/src/main/server/config/engine.properties @@ -0,0 +1,74 @@ +### +# ============LICENSE_START======================================================= +# ONAP +# ================================================================================ +# Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. +# ================================================================================ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END========================================================= +### + +# Policy Engine Configuration Channels + +dmaap.source.topics=PDPD-CONFIGURATION,POLICY-PDP-PAP + +dmaap.sink.topics=PDPD-CONFIGURATION,POLICY-PDP-PAP + +dmaap.source.topics.PDPD-CONFIGURATION.servers=${env:DMAAP_SERVERS} +dmaap.source.topics.PDPD-CONFIGURATION.effectiveTopic=${env:PDPD_CONFIGURATION_TOPIC} +dmaap.source.topics.PDPD-CONFIGURATION.apiKey=${env:PDPD_CONFIGURATION_API_KEY} +dmaap.source.topics.PDPD-CONFIGURATION.apiSecret=${env:PDPD_CONFIGURATION_API_SECRET} +dmaap.source.topics.PDPD-CONFIGURATION.consumerGroup=${env:PDPD_CONFIGURATION_CONSUMER_GROUP} +dmaap.source.topics.PDPD-CONFIGURATION.consumerInstance=${env:PDPD_CONFIGURATION_CONSUMER_INSTANCE} +dmaap.source.topics.PDPD-CONFIGURATION.managed=false +dmaap.source.topics.PDPD-CONFIGURATION.https=true + +dmaap.sink.topics.PDPD-CONFIGURATION.servers=${env:DMAAP_SERVERS} +dmaap.sink.topics.PDPD-CONFIGURATION.effectiveTopic=${env:PDPD_CONFIGURATION_TOPIC} +dmaap.sink.topics.PDPD-CONFIGURATION.apiKey=${env:PDPD_CONFIGURATION_API_KEY} +dmaap.sink.topics.PDPD-CONFIGURATION.apiSecret=${env:PDPD_CONFIGURATION_API_SECRET} +dmaap.sink.topics.PDPD-CONFIGURATION.partitionKey=${env:PDPD_CONFIGURATION_PARTITION_KEY} +dmaap.sink.topics.PDPD-CONFIGURATION.managed=false +dmaap.sink.topics.PDPD-CONFIGURATION.https=true + +# Configuration Channel Settings: POLICY-PDP-PAP + +dmaap.source.topics.POLICY-PDP-PAP.servers=${env:DMAAP_SERVERS} +dmaap.source.topics.POLICY-PDP-PAP.effectiveTopic=${env:POLICY_PDP_PAP_TOPIC} +dmaap.source.topics.POLICY-PDP-PAP.apiKey=${env:POLICY_PDP_PAP_API_KEY} +dmaap.source.topics.POLICY-PDP-PAP.apiSecret=${env:POLICY_PDP_PAP_API_SECRET} +dmaap.source.topics.POLICY-PDP-PAP.managed=false +dmaap.source.topics.POLICY-PDP-PAP.https=true + +dmaap.sink.topics.POLICY-PDP-PAP.servers=${env:DMAAP_SERVERS} +dmaap.sink.topics.POLICY-PDP-PAP.effectiveTopic=${env:POLICY_PDP_PAP_TOPIC} +dmaap.sink.topics.POLICY-PDP-PAP.apiKey=${env:POLICY_PDP_PAP_API_KEY} +dmaap.sink.topics.POLICY-PDP-PAP.apiSecret=${env:POLICY_PDP_PAP_API_SECRET} +dmaap.sink.topics.POLICY-PDP-PAP.managed=false +dmaap.sink.topics.POLICY-PDP-PAP.https=true + +http.server.services=SECURED-CONFIG + +http.server.services.SECURED-CONFIG.host=${env:TELEMETRY_HOST} +http.server.services.SECURED-CONFIG.port=9696 +http.server.services.SECURED-CONFIG.userName=${env:TELEMETRY_USER} +http.server.services.SECURED-CONFIG.password=${env:TELEMETRY_PASSWORD} +http.server.services.SECURED-CONFIG.restPackages=org.onap.policy.drools.server.restful +http.server.services.SECURED-CONFIG.managed=false +http.server.services.SECURED-CONFIG.swagger=true +http.server.services.SECURED-CONFIG.https=true +http.server.services.SECURED-CONFIG.aaf=${env:AAF} +http.server.services.SECURED-CONFIG.serialization.provider=org.onap.policy.common.gson.JacksonHandler + +aaf.namespace=${env:AAF_NAMESPACE} +aaf.root.permission=${env:AAF_NAMESPACE}.pdpd diff --git a/policy-management/src/main/server/config/policy-engine.properties b/policy-management/src/main/server/config/policy-engine.properties deleted file mode 100644 index b43971f1..00000000 --- a/policy-management/src/main/server/config/policy-engine.properties +++ /dev/null @@ -1,72 +0,0 @@ -### -# ============LICENSE_START======================================================= -# policy-management -# ================================================================================ -# Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved. -# ================================================================================ -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============LICENSE_END========================================================= -### - -# Policy Engine Configuration - -# Configuration Channel Settings: PDPD-CONFIGURATION - -dmaap.source.topics=${env:PDPD_CONFIGURATION_TOPIC},POLICY-PDP-PAP -dmaap.source.topics.${{PDPD_CONFIGURATION_TOPIC}}.servers=${env:PDPD_CONFIGURATION_SERVERS} -dmaap.source.topics.${{PDPD_CONFIGURATION_TOPIC}}.apiKey=${env:PDPD_CONFIGURATION_API_KEY} -dmaap.source.topics.${{PDPD_CONFIGURATION_TOPIC}}.apiSecret=${env:PDPD_CONFIGURATION_API_SECRET} -dmaap.source.topics.${{PDPD_CONFIGURATION_TOPIC}}.consumerGroup=${env:PDPD_CONFIGURATION_CONSUMER_GROUP} -dmaap.source.topics.${{PDPD_CONFIGURATION_TOPIC}}.consumerInstance=${env:PDPD_CONFIGURATION_CONSUMER_INSTANCE} -dmaap.source.topics.${{PDPD_CONFIGURATION_TOPIC}}.managed=false -dmaap.source.topics.${{PDPD_CONFIGURATION_TOPIC}}.https=true - -dmaap.sink.topics=${env:PDPD_CONFIGURATION_TOPIC},POLICY-PDP-PAP -dmaap.sink.topics.${{PDPD_CONFIGURATION_TOPIC}}.servers=${env:PDPD_CONFIGURATION_SERVERS} -dmaap.sink.topics.${{PDPD_CONFIGURATION_TOPIC}}.apiKey=${env:PDPD_CONFIGURATION_API_KEY} -dmaap.sink.topics.${{PDPD_CONFIGURATION_TOPIC}}.apiSecret=${env:PDPD_CONFIGURATION_API_SECRET} -dmaap.sink.topics.${{PDPD_CONFIGURATION_TOPIC}}.partitionKey=${env:PDPD_CONFIGURATION_PARTITION_KEY} -dmaap.sink.topics.${{PDPD_CONFIGURATION_TOPIC}}.managed=false -dmaap.sink.topics.${{PDPD_CONFIGURATION_TOPIC}}.https=true - -# Configuration Channel Settings: POLICY-PDP-PAP - -dmaap.source.topics.POLICY-PDP-PAP.effectiveTopic=${env:POLICY_PDP_PAP_TOPIC} -dmaap.source.topics.POLICY-PDP-PAP.servers=${env:DMAAP_SERVERS} -dmaap.source.topics.POLICY-PDP-PAP.apiKey=${env:POLICY_PDP_PAP_API_KEY} -dmaap.source.topics.POLICY-PDP-PAP.apiSecret=${env:POLICY_PDP_PAP_API_SECRET} -dmaap.source.topics.POLICY-PDP-PAP.managed=false -dmaap.source.topics.POLICY-PDP-PAP.https=true - -dmaap.sink.topics.POLICY-PDP-PAP.effectiveTopic=${env:POLICY_PDP_PAP_TOPIC} -dmaap.sink.topics.POLICY-PDP-PAP.servers=${env:DMAAP_SERVERS} -dmaap.sink.topics.POLICY-PDP-PAP.apiKey=${env:POLICY_PDP_PAP_API_KEY} -dmaap.sink.topics.POLICY-PDP-PAP.apiSecret=${env:POLICY_PDP_PAP_API_SECRET} -dmaap.sink.topics.POLICY-PDP-PAP.managed=false -dmaap.sink.topics.POLICY-PDP-PAP.https=true - -http.server.services=SECURED-CONFIG - -http.server.services.SECURED-CONFIG.host=${env:TELEMETRY_HOST} -http.server.services.SECURED-CONFIG.port=9696 -http.server.services.SECURED-CONFIG.userName=${env:TELEMETRY_USER} -http.server.services.SECURED-CONFIG.password=${env:TELEMETRY_PASSWORD} -http.server.services.SECURED-CONFIG.restPackages=org.onap.policy.drools.server.restful -http.server.services.SECURED-CONFIG.managed=false -http.server.services.SECURED-CONFIG.swagger=true -http.server.services.SECURED-CONFIG.https=true -http.server.services.SECURED-CONFIG.aaf=${env:AAF} -http.server.services.SECURED-CONFIG.serialization.provider=org.onap.policy.common.gson.JacksonHandler - -aaf.namespace=${env:AAF_NAMESPACE} -aaf.root.permission=${env:AAF_NAMESPACE}.pdpd diff --git a/policy-management/src/main/server/config/system.properties b/policy-management/src/main/server/config/system.properties index 6bac0ea6..9b6be6b6 100644 --- a/policy-management/src/main/server/config/system.properties +++ b/policy-management/src/main/server/config/system.properties @@ -2,7 +2,7 @@ # ============LICENSE_START======================================================= # ONAP # ================================================================================ -# Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved. +# Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved. # ================================================================================ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -18,26 +18,8 @@ # ============LICENSE_END========================================================= ### -# system properties passed to controller +# system properties passed as "-D" arguments to the JVM process. -# jmx +# logging -com.sun.management.jmxremote.port=9991 -com.sun.management.jmxremote.authenticate=false -com.sun.management.jmxremote.ssl=false - -# certs - -javax.net.ssl.trustStore=${{POLICY_HOME}}/etc/ssl/policy-truststore -javax.net.ssl.trustStorePassword=${{TRUSTSTORE_PASSWD}} - -javax.net.ssl.keyStore=${{POLICY_HOME}}/etc/ssl/policy-keystore -javax.net.ssl.keyStorePassword=${{KEYSTORE_PASSWD}} - -# aaf - -cadi_prop_files=config/aaf.properties - -# standard logging - -logback.configurationFile=config/logback.xml +logback.configurationFile=config/logback.xml \ No newline at end of file -- cgit 1.2.3-korg