From 15bada6db5f682c351883e437303e5960d073765 Mon Sep 17 00:00:00 2001 From: lasantha Date: Sun, 31 Dec 2017 15:04:47 +0530 Subject: [PATCH 1/4] Adding super admin credentials changing script --- .../scripts/change-superadmin-credentials.sh | 165 ++++++++++++++++++ 1 file changed, 165 insertions(+) create mode 100644 modules/scripts/change-superadmin-credentials.sh diff --git a/modules/scripts/change-superadmin-credentials.sh b/modules/scripts/change-superadmin-credentials.sh new file mode 100644 index 00000000..f51f1829 --- /dev/null +++ b/modules/scripts/change-superadmin-credentials.sh @@ -0,0 +1,165 @@ +#!/bin/bash + +echo "" +echo "----------------------------------------" +echo "WSO2 IoT Server Super Admin Credentials Changing tool" +echo "----------------------------------------" + + +##################################### Super Admin Credentials Change #################################### + +echo "" +echo ">>> Change current super admin username and password of the IoT server" + +echo "" +echo "Please enter the old username and password of the IoTS super Admin" +echo "if you are trying out IoTS for the first time username/password will be 'admin/admin'" +echo "Old Username : " +read val1; +echo "Old Password : " +read val2; + +while [[ -z $val1 || -z $val2 ]]; do #if $val1 is a zero length String + echo "Username or Password couldn't be empty, Hence Re-Enter old username and password of IoTS Super Admin" + echo "Old Username : " + read val1; + echo "Old Password : " + read val2; +done + +echo "" +echo "Please enter the new password of the IoTS super admin" +echo "New Username : " +read val3; +echo "New Password : " +read val4; + +while [[ -z $val3 || -z $val4 ]]; do #if $val2 is a zero length String + echo "Username or Password couldn't be empty, Hence Re-Enter new username and password of IoTS Super Admin" + echo "New Username : " + read val3; + echo "New Password : " + read val4; +done + +echo "Changing /conf/app-manager.xml" +sed -i -e 's#\(\)'$val1'\(\)#\1'$val3'\2#g' ../conf/app-manager.xml +sed -i -e 's#\(\)'$val2'\(\)#\1'$val4'\2#g' ../conf/app-manager.xml + +sed -i -e 's#\(\)'$val1'\(\)#\1'$val3'\2#g' ../conf/app-manager.xml +sed -i -e 's#\(\)'$val2'\(\)#\1'$val4'\2#g' ../conf/app-manager.xml + +sed -i -e 's#\(\)'$val1'\(\)#\1'$val3'\2#g' ../conf/app-manager.xml +sed -i -e 's#\(\)'$val2'\(\)#\1'$val4'\2#g' ../conf/app-manager.xml + +sed -i -e 's#\(\)'$val1'\(\)#\1'$val3'\2#g' ../conf/app-manager.xml +sed -i -e 's#\(\)'$val2'\(\)#\1'$val4'\2#g' ../conf/app-manager.xml + +sed -i -e 's#\(\)'$val1'\(\)#\1'$val3'\2#g' ../conf/app-manager.xml +sed -i -e 's#\(\)'$val2'\(\)#\1'$val4'\2#g' ../conf/app-manager.xml +echo "Completed!!" + +echo "Changing /conf/iot-api-config.xml" +sed -i -e 's#\(\)'$val1'\(\)#\1'$val3'\2#g' ../conf/iot-api-config.xml +sed -i -e 's#\(\)'$val2'\(\)#\1'$val4'\2#g' ../conf/iot-api-config.xml +echo "Completed!!" + +echo "Changing /conf/apim-integration.xml" +sed -i -e 's#\(\)'$val1'\(\)#\1'$val3'\2#g' ../conf/apim-integration.xml +sed -i -e 's#\(\)'$val2'\(\)#\1'$val4'\2#g' ../conf/apim-integration.xml +echo "Completed!!" + +echo "Changing /conf/analytics/analytics-data-config.xml" +sed -i -e 's#\(\)'$val1'\(\)#\1'$val3'\2#g' ../conf/analytics/analytics-data-config.xml +sed -i -e 's#\(\)'$val2'\(\)#\1'$val4'\2#g' ../conf/analytics/analytics-data-config.xml +echo "Completed!!" + +echo "Changing /wso2/analytics/conf/analytics/analytics-data-config.xml" +sed -i -e 's#\(\)'$val1'\(\)#\1'$val3'\2#g' ../wso2/analytics/conf/analytics/analytics-data-config.xml +sed -i -e 's#\(\)'$val2'\(\)#\1'$val4'\2#g' ../wso2/analytics/conf/analytics/analytics-data-config.xml +echo "Completed!!" + +echo "Changing /wso2/analytics/conf/input-event-adapters.xml" +sed -i -e 's#\(\)'$val1'\(\)#\1'$val3'\2#g' ../wso2/analytics/conf/input-event-adapters.xml +sed -i -e 's#\(\)'$val2'\(\)#\1'$val4'\2#g' ../wso2/analytics/conf/input-event-adapters.xml +echo "Completed!!" + +echo "Changing /conf/user-mgt.xml" +sed -i -e 's#\(\)'$val1'\(\)#\1'$val3'\2#g' ../conf/user-mgt.xml +sed -i -e 's#\(\)'$val2'\(\)#\1'$val4'\2#g' ../conf/user-mgt.xml +echo "Completed!!" + +echo "Changing /wso2/broker/conf/user-mgt.xml" +sed -i -e 's#\(\)'$val1'\(\)#\1'$val3'\2#g' ../wso2/broker/conf/user-mgt.xml +sed -i -e 's#\(\)'$val2'\(\)#\1'$val4'\2#g' ../wso2/broker/conf/user-mgt.xml +echo "Completed!!" + +echo "Changing /wso2/analytics/conf/user-mgt.xml" +sed -i -e 's#\(\)'$val1'\(\)#\1'$val3'\2#g' ../wso2/analytics/conf/user-mgt.xml +sed -i -e 's#\(\)'$val2'\(\)#\1'$val4'\2#g' ../wso2/analytics/conf/user-mgt.xml +echo "Completed!!" + +echo "Changing /conf/metrics.xml" +sed -i -e 's#\(\)'$val1'\(\)#\1'$val3'\2#g' ../conf/metrics.xml +sed -i -e 's#\(\)'$val2'\(\)#\1'$val4'\2#g' ../conf/metrics.xml +echo "Completed!!" + +echo "Changing /wso2/analytics/conf/metrics.xml" +sed -i -e 's#\(\)'$val1'\(\)#\1'$val3'\2#g' ../wso2/analytics/conf/metrics.xml +sed -i -e 's#\(\)'$val2'\(\)#\1'$val4'\2#g' ../wso2/analytics/conf/metrics.xml +echo "Completed!!" + +echo "Changing /wso2/broker/conf/metrics.xml" +sed -i -e 's#\(\)'$val1'\(\)#\1'$val3'\2#g' ../wso2/broker/conf/metrics.xml +sed -i -e 's#\(\)'$val2'\(\)#\1'$val4'\2#g' ../wso2/broker/conf/metrics.xml +echo "Completed!!" + +echo "Changing /wso2/broker/conf/broker.xml" +sed -i -e 's#\(\)'$val1'\(\)#\1'$val3'\2#g' ../wso2/broker/conf/broker.xml +sed -i -e 's#\(\)'$val2'\(\)#\1'$val4'\2#g' ../wso2/broker/conf/broker.xml +echo "Completed!!" + +echo "" +echo "If tenant domain is carbon.super enter 'Y' otherwise enter 'N' " +read val5; + +if [ $val5 = "Y" ]; then + echo "Changing /repository/deployment/server/jaggeryapps/devicemgt/app/conf/config.json" + sed -i -e 's#\("adminUser": "\)'$val1'\(@carbon.super"\)#\1'$val3'\2#g' ../repository/deployment/server/jaggeryapps/devicemgt/app/conf/config.json + sed -i -e 's#\("owner": "\)'$val1'\(@carbon.super"\)#\1'$val3'\2#g' ../repository/deployment/server/jaggeryapps/devicemgt/app/conf/config.json + echo "Completed!!" + + echo "Changing /repository/deployment/server/jaggeryapps/android-web-agent/app/conf/config.json" + sed -i -e 's#\("owner": "\)'$val1'\(@carbon.super"\)#\1'$val3'\2#g' ../repository/deployment/server/jaggeryapps/android-web-agent/app/conf/config.json + echo "Completed!!" +else if [ $val5 = "N" ]; then + echo "" + echo "Please enter the old tenant domain of the IoTS " + echo "if you are trying out IoTS for the first time 'carbon.super' will be the tenant domain" + echo "Old tenant domain : " + read val6; + echo "New tenant domain : " + read val7; + + while [[ -z $val6 || -z $val7 ]]; do #if $val1 is a zero length String + echo "tenant domains couldn't be empty, Hence Re-Enter non-empty tenant domains" + echo "Old tenant domain : " + read val6; + echo "New tenant domain : " + read val7; + done + + echo "Changing /repository/deployment/server/jaggeryapps/devicemgt/app/conf/config.json" + sed -i -e 's#\("adminUser": "\)'$val1'\(@\)'$val6'\("\)#\1'$val3'\2'$val7'\3#g' ../repository/deployment/server/jaggeryapps/devicemgt/app/conf/config.json + sed -i -e 's#\("owner": "\)'$val1'\(@\)'$val6'\("\)#\1'$val3'\2'$val7'\3#g' ../repository/deployment/server/jaggeryapps/devicemgt/app/conf/config.json + echo "Completed!!" + + echo "Changing /repository/deployment/server/jaggeryapps/android-web-agent/app/conf/config.json" + sed -i -e 's#\("owner": "\)'$val1'\(@\)'$val6'\("\)#\1'$val3'\2'$val7'\3#g' ../repository/deployment/server/jaggeryapps/android-web-agent/app/conf/config.json + echo "Completed!!" +fi + +fi + +echo "" +echo "Configuration Completed!!!" From 03f5d140383fcfa689787976614ca8d6e9fbcdb1 Mon Sep 17 00:00:00 2001 From: Rasika Perera Date: Tue, 9 Jan 2018 20:09:00 +0530 Subject: [PATCH 2/4] Adding androidAgentDownloadURL for the change-ip script --- modules/scripts/change-ip.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/scripts/change-ip.sh b/modules/scripts/change-ip.sh index 7519a2b5..705cd4e9 100644 --- a/modules/scripts/change-ip.sh +++ b/modules/scripts/change-ip.sh @@ -62,6 +62,11 @@ sed -i -e 's/"identityProvider.*/\"identityProviderUrl\"\ :\ "https\:\/\/'$val2' sed -i -e 's/"acs.*/\"acs\"\ :\ "https\:\/\/'$val2':9443\/devicemgt\/uuf\/sso\/acs\"\,/' ../repository/deployment/server/jaggeryapps/devicemgt/app/conf/app-conf.json echo "Completed!!" +#-------------------- +echo "Changing /repository/deployment/server/jaggeryapps/devicemgt/app/conf/config.json" +sed -i -e 's/"androidAgentDownloadURL.*/\"androidAgentDownloadURL\":\ "https\:\/\/\%iot.manager.host\%\:\%iot.manager.https.port\%\/devicemgt\/public\/cdmf.unit.device.type.android.type-view\/assets\/android-agent.apk\",/' ../repository/deployment/server/jaggeryapps/devicemgt/app/conf/config.json +echo "Completed!!" + #-------------------- echo "Changing /repository/deployment/server/jaggeryapps/api-store/site/conf/site.json" sed -i -e 's/"identityProvider.*/\"identityProviderURL\"\ :\ "https\:\/\/'$val2':9443\/samlsso\"\,/' ../repository/deployment/server/jaggeryapps/api-store/site/conf/site.json From 6909c055e6d2c5739983f4555f1dc2b0ca41b16c Mon Sep 17 00:00:00 2001 From: Rasika Perera Date: Tue, 9 Jan 2018 21:01:40 +0530 Subject: [PATCH 3/4] Removed android-web-agent app --- modules/distribution/src/assembly/bin.xml | 21 ------- .../android-web-agent/jaggery.conf | 58 ------------------- .../scripts/change-superadmin-credentials.sh | 7 --- 3 files changed, 86 deletions(-) delete mode 100644 modules/distribution/src/core/jaggeryapps/android-web-agent/jaggery.conf diff --git a/modules/distribution/src/assembly/bin.xml b/modules/distribution/src/assembly/bin.xml index 7ab1f3fb..3ebe56cd 100755 --- a/modules/distribution/src/assembly/bin.xml +++ b/modules/distribution/src/assembly/bin.xml @@ -371,19 +371,6 @@ - - - - ../p2-profile/iot-core-profile/target/wso2carbon-core-${carbon.kernel.version}/wso2/deployment/server/jaggeryapps/android-web-agent/ - - - ${pom.artifactId}-${pom.version}/repository/deployment/server/jaggeryapps/android-web-agent - - - **/jaggery.conf - - - ../p2-profile/iot-core-profile/target/wso2carbon-core-${carbon.kernel.version}/wso2/deployment/server/webapps/ @@ -1503,14 +1490,6 @@ true 644 - - - src/core/jaggeryapps/android-web-agent/jaggery.conf - - ${pom.artifactId}-${pom.version}/repository/deployment/server/jaggeryapps/android-web-agent/ - - 755 - src/core/jaggeryapps/api-store/jaggery.conf diff --git a/modules/distribution/src/core/jaggeryapps/android-web-agent/jaggery.conf b/modules/distribution/src/core/jaggeryapps/android-web-agent/jaggery.conf deleted file mode 100644 index 7c33479a..00000000 --- a/modules/distribution/src/core/jaggeryapps/android-web-agent/jaggery.conf +++ /dev/null @@ -1,58 +0,0 @@ -{ - "displayName": "UUF Template App", - "logLevel": "warn", - "urlMappings": [ - { - "url": "/uuf/login", - "path": "/lib/modules/auth/login.jag" - }, - { - "url": "/uuf/logout", - "path": "/lib/modules/auth/logout.jag" - }, - { - "url": "/uuf/sso/acs", - "path": "/lib/modules/auth/acs.jag" - }, - { - "url": "/public/*", - "path": "/lib/static-files.jag" - }, - { - "url": "/unit/*", - "path": "/lib/units.jag" - }, - { - "url": "/*", - "path": "/lib/pages.jag" - } - ], - "filters": [ - { - "name": "ContentTypeBasedCachePreventionFilter", - "class": "org.wso2.carbon.ui.filters.cache.ContentTypeBasedCachePreventionFilter", - "params" : [ - {"name" : "patterns", "value" : "text/html\" ,application/json\" ,text/plain"}, - {"name" : "filterAction", "value" : "enforce"}, - {"name" : "httpHeaders", "value" : "Cache-Control: no-store, no-cache, must-revalidate, private"} - ] - }, - { - "name":"HttpHeaderSecurityFilter", - "class":"org.apache.catalina.filters.HttpHeaderSecurityFilter", - "params" : [{"name" : "hstsEnabled", "value" : "false"}] - } - - ], - "filterMappings": [ - { - "name":"HttpHeaderSecurityFilter", - "url":"*" - }, - { - "name":"ContentTypeBasedCachePreventionFilter", - "url":"*" - } - - ] -} diff --git a/modules/scripts/change-superadmin-credentials.sh b/modules/scripts/change-superadmin-credentials.sh index f51f1829..fc0d2aa5 100644 --- a/modules/scripts/change-superadmin-credentials.sh +++ b/modules/scripts/change-superadmin-credentials.sh @@ -129,9 +129,6 @@ if [ $val5 = "Y" ]; then sed -i -e 's#\("owner": "\)'$val1'\(@carbon.super"\)#\1'$val3'\2#g' ../repository/deployment/server/jaggeryapps/devicemgt/app/conf/config.json echo "Completed!!" - echo "Changing /repository/deployment/server/jaggeryapps/android-web-agent/app/conf/config.json" - sed -i -e 's#\("owner": "\)'$val1'\(@carbon.super"\)#\1'$val3'\2#g' ../repository/deployment/server/jaggeryapps/android-web-agent/app/conf/config.json - echo "Completed!!" else if [ $val5 = "N" ]; then echo "" echo "Please enter the old tenant domain of the IoTS " @@ -153,10 +150,6 @@ else if [ $val5 = "N" ]; then sed -i -e 's#\("adminUser": "\)'$val1'\(@\)'$val6'\("\)#\1'$val3'\2'$val7'\3#g' ../repository/deployment/server/jaggeryapps/devicemgt/app/conf/config.json sed -i -e 's#\("owner": "\)'$val1'\(@\)'$val6'\("\)#\1'$val3'\2'$val7'\3#g' ../repository/deployment/server/jaggeryapps/devicemgt/app/conf/config.json echo "Completed!!" - - echo "Changing /repository/deployment/server/jaggeryapps/android-web-agent/app/conf/config.json" - sed -i -e 's#\("owner": "\)'$val1'\(@\)'$val6'\("\)#\1'$val3'\2'$val7'\3#g' ../repository/deployment/server/jaggeryapps/android-web-agent/app/conf/config.json - echo "Completed!!" fi fi From 0c89fe8b524c6d493ead6a65fe3f98ecf7af02d5 Mon Sep 17 00:00:00 2001 From: Rasika Perera Date: Tue, 9 Jan 2018 21:07:27 +0530 Subject: [PATCH 4/4] Version bump in devicemgt and devicemgt-plugins --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 68e6a17b..fc4c4f69 100644 --- a/pom.xml +++ b/pom.xml @@ -1517,14 +1517,14 @@ 4.7.8 - 3.0.189 + 3.0.196 [3.0.0, 4.0.0) ${project.version} - 4.0.105 + 4.0.108 6.1.109