From d699f3cc480683e722b396bf3181787249753b0c Mon Sep 17 00:00:00 2001 From: ckm007 Date: Wed, 17 Jul 2024 23:03:42 +0530 Subject: [PATCH 1/8] [MOSIP-34233] added helm lint and publish workflow Signed-off-by: ckm007 --- .github/workflows/chart-lint-publish.yml | 62 ++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 .github/workflows/chart-lint-publish.yml diff --git a/.github/workflows/chart-lint-publish.yml b/.github/workflows/chart-lint-publish.yml new file mode 100644 index 00000000..c8d6ba3b --- /dev/null +++ b/.github/workflows/chart-lint-publish.yml @@ -0,0 +1,62 @@ +name: Validate / Publish helm charts + +on: + release: + types: [published] + pull_request: + types: [opened, reopened, synchronize] + paths: + - 'helm/**' + workflow_dispatch: + inputs: + IGNORE_CHARTS: + description: 'Provide list of charts to be ignored separated by pipe(|)' + required: false + default: '""' + type: string + CHART_PUBLISH: + description: 'Chart publishing to gh-pages branch' + required: false + default: 'NO' + type: string + options: + - YES + - NO + INCLUDE_ALL_CHARTS: + description: 'Include all charts for Linting/Publishing (YES/NO)' + required: false + default: 'NO' + type: string + options: + - YES + - NO + push: + branches: + - '!release-branch' + - '!master' + - 1.* + - 0.* + - develop + - release* + paths: + - 'helm/**' + +jobs: + chart-lint-publish: + uses: mosip/kattu/.github/workflows/chart-lint-publish.yml@master + with: + CHARTS_DIR: ./helm + CHARTS_URL: https://mosip.github.io/mosip-helm + REPOSITORY: mosip-helm + BRANCH: gh-pages + INCLUDE_ALL_CHARTS: "${{ inputs.INCLUDE_ALL_CHARTS || 'NO' }}" + IGNORE_CHARTS: "${{ inputs.IGNORE_CHARTS || '\"\"' }}" + CHART_PUBLISH: "${{ inputs.CHART_PUBLISH || 'YES' }}" + LINTING_CHART_SCHEMA_YAML_URL: "https://raw.githubusercontent.com/mosip/kattu/master/.github/helm-lint-configs/chart-schema.yaml" + LINTING_LINTCONF_YAML_URL: "https://raw.githubusercontent.com/mosip/kattu/master/.github/helm-lint-configs/lintconf.yaml" + LINTING_CHART_TESTING_CONFIG_YAML_URL: "https://raw.githubusercontent.com/mosip/kattu/master/.github/helm-lint-configs/chart-testing-config.yaml" + LINTING_HEALTH_CHECK_SCHEMA_YAML_URL: "https://raw.githubusercontent.com/mosip/kattu/master/.github/helm-lint-configs/health-check-schema.yaml" + DEPENDENCIES: "mosip,https://mosip.github.io/mosip-helm;" + secrets: + TOKEN: ${{ secrets.ACTION_PAT }} + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} From 57b650aa0cf7232249fed16af27da59e4bdc1198 Mon Sep 17 00:00:00 2001 From: ckm007 Date: Wed, 17 Jul 2024 23:09:42 +0530 Subject: [PATCH 2/8] [MOSIP-34233] added deployment script for resident ui Signed-off-by: ckm007 --- deploy/README.md | 10 + deploy/certs_upload/postman/README.md | 39 ++ deploy/certs_upload/postman/collection.json | 436 ++++++++++++++++++++ deploy/certs_upload/postman/env.json | 29 ++ deploy/copy_cm.sh | 24 ++ deploy/copy_secrets.sh | 22 + deploy/delete.sh | 24 ++ deploy/install.sh | 69 ++++ deploy/restart.sh | 25 ++ 9 files changed, 678 insertions(+) create mode 100644 deploy/README.md create mode 100644 deploy/certs_upload/postman/README.md create mode 100644 deploy/certs_upload/postman/collection.json create mode 100644 deploy/certs_upload/postman/env.json create mode 100755 deploy/copy_cm.sh create mode 100755 deploy/copy_secrets.sh create mode 100755 deploy/delete.sh create mode 100755 deploy/install.sh create mode 100755 deploy/restart.sh diff --git a/deploy/README.md b/deploy/README.md new file mode 100644 index 00000000..2613aa7b --- /dev/null +++ b/deploy/README.md @@ -0,0 +1,10 @@ +# Resident Services + +## Install +```sh +./install.sh +``` +* During the execution of the `install.sh` script, a prompt appears requesting information regarding the presence of a public domain and a valid SSL certificate on the server. +* If the server lacks a public domain and a valid SSL certificate, it is advisable to select the `n` option. Opting it will enable the `init-container` with an `emptyDir` volume and include it in the deployment process. +* The init-container will proceed to download the server's self-signed SSL certificate and mount it to the specified location within the container's Java keystore (i.e., `cacerts`) file. +* This particular functionality caters to scenarios where the script needs to be employed on a server utilizing self-signed SSL certificates. diff --git a/deploy/certs_upload/postman/README.md b/deploy/certs_upload/postman/README.md new file mode 100644 index 00000000..ba697ea0 --- /dev/null +++ b/deploy/certs_upload/postman/README.md @@ -0,0 +1,39 @@ +# Resident Cert Upload (_Work-in-progress_) + +The folder here contains Postman Collection to upload RESIDENT certs. + +## Prerequisites +Install Postman (browser or command line). The command line version is called `newman`. + +## Run +* Inspect `env.json` for any changes in default params. +* Run on command line +```sh +newman run collection.json -e env.json --env-var 'url=https://xxx.yyy.zzz' --env-var 'admin-client-secret=xxxxxxxxxxxx' +``` + +output: + +``` + +┌─────────────────────────┬─────────────────────┬─────────────────────┐ +│ │ executed │ failed │ +├─────────────────────────┼─────────────────────┼─────────────────────┤ +│ iterations │ 1 │ 0 │ +├─────────────────────────┼─────────────────────┼─────────────────────┤ +│ requests │ 8 │ 0 │ +├─────────────────────────┼─────────────────────┼─────────────────────┤ +│ test-scripts │ 8 │ 0 │ +├─────────────────────────┼─────────────────────┼─────────────────────┤ +│ prerequest-scripts │ 4 │ 0 │ +├─────────────────────────┼─────────────────────┼─────────────────────┤ +│ assertions │ 9 │ 0 │ +├─────────────────────────┴─────────────────────┴─────────────────────┤ +│ total run duration: 3.7s │ +├─────────────────────────────────────────────────────────────────────┤ +│ total data received: 7.16KB (approx) │ +├─────────────────────────────────────────────────────────────────────┤ +│ average response time: 432ms [min: 112ms, max: 1461ms, s.d.: 413ms] │ +└─────────────────────────────────────────────────────────────────────┘ + +``` diff --git a/deploy/certs_upload/postman/collection.json b/deploy/certs_upload/postman/collection.json new file mode 100644 index 00000000..e8e7946c --- /dev/null +++ b/deploy/certs_upload/postman/collection.json @@ -0,0 +1,436 @@ +{ + "info": { + "_postman_id": "5a43932c-5022-4731-bafc-282af54996a2", + "name": "Automated Cert Upload for Resident", + "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" + }, + "item": [ + { + "name": "Authentication", + "event": [ + { + "listen": "prerequest", + "script": { + "exec": [ + "postman.setGlobalVariable('requesttime', (new Date()).toISOString());" + ], + "type": "text/javascript" + } + }, + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Clientid and Token combination has been validated successfully\", function () {\r", + " pm.expect(pm.response.text()).to.include(\"Clientid and Token combination had been validated successfully\");\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\r\n \"id\": \"string\",\r\n \"metadata\": {},\r\n \"request\": {\r\n \"appId\": \"ida\",\r\n \"clientId\": \"mosip-admin-client\",\r\n \"secretKey\": \"{{admin-client-secret}}\"\r\n },\r\n \"requesttime\": \"{{requesttime}}\",\r\n \"version\": \"string\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{url}}/v1/authmanager/authenticate/clientidsecretkey", + "host": [ + "{{url}}" + ], + "path": [ + "v1", + "authmanager", + "authenticate", + "clientidsecretkey" + ] + } + }, + "response": [] + }, + { + "name": "GET RESIDENT Root Certificate", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var jsonData = JSON.parse(responseBody);\r", + "var data = JSON.stringify(jsonData.response.certificate);\r", + "console.log(data);\r", + "pm.environment.set(\"Resrootcert\",data);\r", + "\r", + "var jsonData = JSON.parse(responseBody);\r", + "pm.test(\"Got RESIDENT-ROOT-cert\", function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(jsonData.errors).to.eql(null);\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{url}}/v1/keymanager/getCertificate?applicationId=ROOT", + "host": [ + "{{url}}" + ], + "path": [ + "v1", + "keymanager", + "getCertificate" + ], + "query": [ + { + "key": "applicationId", + "value": "ROOT" + } + ] + } + }, + "response": [] + }, + { + "name": "POST RESIDENT_Root certificate", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var jsonData = JSON.parse(responseBody);\r", + "var jsonData = JSON.stringify(jsonData.errors);\r", + "if (jsonData==\"[]\"){\r", + " pm.test(\"Posted RESIDENT-ROOT-Cert\", function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(jsonData.errors).to.eql([]);\r", + " });\r", + "}\r", + "else{\r", + " pm.test(\"Certificate already exists in DB\", function () {\r", + " pm.expect(pm.response.text()).to.include(\"Certificate already exists \");\r", + " });\r", + "}" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "postman.setGlobalVariable('requesttime', (new Date()).toISOString());" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\r\n \"id\": \"string\",\r\n \"metadata\": {},\r\n \"request\": {\r\n \"certificateData\":{{Resrootcert}},\r\n \"partnerDomain\": \"AUTH\"\r\n },\r\n \"requesttime\": \"{{requesttime}}\",\r\n \"version\": \"string\"\r\n}\r\n", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{url}}/v1/partnermanager/partners/certificate/ca/upload", + "host": [ + "{{url}}" + ], + "path": [ + "v1", + "partnermanager", + "partners", + "certificate", + "ca", + "upload" + ] + } + }, + "response": [] + }, + { + "name": "GET resident certificate", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var jsonData = JSON.parse(responseBody);\r", + "var data = JSON.stringify(jsonData.response.certificate);\r", + "console.log(data);\r", + "pm.environment.set(\"Rescert\",data);\r", + "var jsonData = JSON.parse(responseBody);\r", + "pm.test(\"Got Resident-cert\", function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(jsonData.errors).to.eql(null);\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{url}}/v1/keymanager/getCertificate?applicationId=RESIDENT", + "host": [ + "{{url}}" + ], + "path": [ + "v1", + "keymanager", + "getCertificate" + ], + "query": [ + { + "key": "applicationId", + "value": "RESIDENT" + } + ] + } + }, + "response": [] + }, + { + "name": "POST Resident certificate", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var jsonData = JSON.parse(responseBody);\r", + "var jsonData = JSON.stringify(jsonData.errors);\r", + "if (jsonData==\"[]\"){\r", + " pm.test(\"Posted RESIDENT cert\", function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(jsonData.errors).to.eql([]);;\r", + " });\r", + "}\r", + "else{\r", + " pm.test(\"Certificate already exists in DB\", function () {\r", + " pm.expect(pm.response.text()).to.include(\"Certificate already exists \");\r", + " });\r", + "}" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "postman.setGlobalVariable('requesttime', (new Date()).toISOString());" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\r\n \"id\": \"string\",\r\n \"metadata\": {},\r\n \"request\": {\r\n \"certificateData\":{{Rescert}},\r\n \"partnerDomain\": \"AUTH\"\r\n },\r\n \"requesttime\": \"{{requesttime}}\",\r\n \"version\": \"string\"\r\n}\r\n", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{url}}/v1/partnermanager/partners/certificate/ca/upload", + "host": [ + "{{url}}" + ], + "path": [ + "v1", + "partnermanager", + "partners", + "certificate", + "ca", + "upload" + ] + } + }, + "response": [] + }, + { + "name": "GET Mpartner default resident cert", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var jsonData = JSON.parse(responseBody);\r", + "var data = JSON.stringify(jsonData.response.certificate);\r", + "console.log(data);\r", + "pm.environment.set(\"MPDRcert\",data);\r", + "var jsonData = JSON.parse(responseBody);\r", + "pm.test(\"Got mpartner-default-resident-cert\", function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(jsonData.errors).to.eql(null);\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{url}}/v1/keymanager/getCertificate?applicationId=RESIDENT&referenceId=mpartner-default-resident", + "host": [ + "{{url}}" + ], + "path": [ + "v1", + "keymanager", + "getCertificate" + ], + "query": [ + { + "key": "applicationId", + "value": "RESIDENT" + }, + { + "key": "referenceId", + "value": "mpartner-default-resident" + } + ] + } + }, + "response": [] + }, + { + "name": "POST mpartner default resident cert", + "event": [ + { + "listen": "prerequest", + "script": { + "exec": [ + "postman.setGlobalVariable('requesttime', (new Date()).toISOString());" + ], + "type": "text/javascript" + } + }, + { + "listen": "test", + "script": { + "exec": [ + "var jsonData = JSON.parse(responseBody);\r", + "var jsonData = JSON.stringify(jsonData.errors);\r", + "if (jsonData==\"[]\"){\r", + " pm.test(\"Posted Mpartner-default-resident cert\", function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(jsonData.errors).to.eql([]);\r", + " });\r", + "}\r", + "else{\r", + " pm.test(\"Certificate already exists in DB\", function () {\r", + " pm.expect(pm.response.text()).to.include(\"Certificate already exists \");\r", + " });\r", + "}\r", + "var jsonData = JSON.parse(responseBody);\r", + "var data = JSON.stringify(jsonData.response.signedCertificateData);\r", + "pm.environment.set(\"signedmpartnerdefaultresidentcert\",data);\r", + "var jsonData = JSON.parse(responseBody);\r", + "pm.test(\"Got signed-certificate\", function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(jsonData.errors).to.eql([]);\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\r\n \"id\": \"string\",\r\n \"metadata\": {},\r\n \"request\": {\r\n \"certificateData\":{{MPDRcert}},\r\n \"partnerDomain\": \"AUTH\",\r\n \"partnerId\": \"mpartner-default-resident\"\r\n },\r\n \"requesttime\": \"{{requesttime}}\",\r\n \"version\": \"string\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{url}}/v1/partnermanager/partners/certificate/upload", + "host": [ + "{{url}}" + ], + "path": [ + "v1", + "partnermanager", + "partners", + "certificate", + "upload" + ] + } + }, + "response": [] + }, + { + "name": "Upload Signed Certificate Copy", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "\r", + "pm.test(\"Posted Signed certificate\", function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(jsonData.errors).to.eql(null);\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\r\n \"id\": \"string\",\r\n \"metadata\": {},\r\n \"request\": {\r\n \"applicationId\": \"RESIDENT\",\r\n \"certificateData\":{{signedmpartnerdefaultresidentcert}},\r\n \"referenceId\": \"mpartner-default-resident\"\r\n },\r\n \"requesttime\": \"{{requesttime}}\",\r\n \"version\": \"string\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{url}}/v1/keymanager/uploadCertificate", + "host": [ + "{{url}}" + ], + "path": [ + "v1", + "keymanager", + "uploadCertificate" + ] + } + }, + "response": [] + } + ] +} diff --git a/deploy/certs_upload/postman/env.json b/deploy/certs_upload/postman/env.json new file mode 100644 index 00000000..5df9b0ec --- /dev/null +++ b/deploy/certs_upload/postman/env.json @@ -0,0 +1,29 @@ +{ + "id": "97f5ce5c-9a16-432d-be16-dcb1feeb5669", + "name": "Automated Cert Upload for Resident", + "values": [ + { + "key": "Resrootcert", + "value": "", + "enabled": true + }, + { + "key": "Rescert", + "value": "", + "enabled": true + }, + { + "key": "MPDRcert", + "value": "", + "enabled": true + }, + { + "key": "signedmpartnerdefaultresidentcert", + "value": "", + "enabled": true + } + ], + "_postman_variable_scope": "environment", + "_postman_exported_at": "2021-11-10T10:15:11.999Z", + "_postman_exported_using": "Postman/8.12.5" +} diff --git a/deploy/copy_cm.sh b/deploy/copy_cm.sh new file mode 100755 index 00000000..92a2db2d --- /dev/null +++ b/deploy/copy_cm.sh @@ -0,0 +1,24 @@ +#!/bin/bash +# Copy configmaps from other namespaces +# DST_NS: Destination namespace + +function copying_cm() { + UTIL_URL=https://github.com/mosip/mosip-infra/blob/master/deployment/v3/utils/copy_cm_func.sh + COPY_UTIL=./copy_cm_func.sh + DST_NS=resident + + wget -q $UTIL_URL -O copy_cm_func.sh && chmod +x copy_cm_func.sh + + $COPY_UTIL configmap global default $DST_NS + $COPY_UTIL configmap artifactory-share artifactory $DST_NS + $COPY_UTIL configmap config-server-share config-server $DST_NS + return 0 +} + +# set commands for error handling. +set -e +set -o errexit ## set -e : exit the script if any statement returns a non-true return value +set -o nounset ## set -u : exit the script if you try to use an uninitialised variable +set -o errtrace # trace ERR through 'time command' and other functions +set -o pipefail # trace ERR through pipes +copying_cm # calling function diff --git a/deploy/copy_secrets.sh b/deploy/copy_secrets.sh new file mode 100755 index 00000000..0496d42f --- /dev/null +++ b/deploy/copy_secrets.sh @@ -0,0 +1,22 @@ +#!/bin/bash +# Copy secrets from other namespaces +# DST_NS: Destination namespace + +function copying_secrets() { + UTIL_URL=https://github.com/mosip/mosip-infra/blob/master/deployment/v3/utils/copy_cm_func.sh + COPY_UTIL=./copy_cm_func.sh + DST_NS=resident + + wget -q $UTIL_URL -O copy_cm_func.sh && chmod +x copy_cm_func.sh + + $COPY_UTIL secret keycloak-client-secrets keycloak $DST_NS + return 0 +} + +# set commands for error handling. +set -e +set -o errexit ## set -e : exit the script if any statement returns a non-true return value +set -o nounset ## set -u : exit the script if you try to use an uninitialised variable +set -o errtrace # trace ERR through 'time command' and other functions +set -o pipefail # trace ERR through pipes +copying_secrets # calling function diff --git a/deploy/delete.sh b/deploy/delete.sh new file mode 100755 index 00000000..f8fe51d1 --- /dev/null +++ b/deploy/delete.sh @@ -0,0 +1,24 @@ +#!/bin/bash +# Uninstalls resident +function deleting_resident_ui() { + NS=resident + while true; do + read -p "Are you sure you want to delete resident_ui helm chart?(Y/n) " yn + if [ $yn = "Y" ] + then + helm -n $NS delete resident-ui + break + else + break + fi + done + return 0 +} + +# set commands for error handling. +set -e +set -o errexit ## set -e : exit the script if any statement returns a non-true return value +set -o nounset ## set -u : exit the script if you try to use an uninitialised variable +set -o errtrace # trace ERR through 'time command' and other functions +set -o pipefail # trace ERR through pipes +deleting_resident_ui # calling function diff --git a/deploy/install.sh b/deploy/install.sh new file mode 100755 index 00000000..d520f718 --- /dev/null +++ b/deploy/install.sh @@ -0,0 +1,69 @@ +#!/bin/bash +# Installs resident service +## Usage: ./install.sh [kubeconfig] + +if [ $# -ge 1 ] ; then + export KUBECONFIG=$1 +fi + +NS=resident +RESIDENT_UI_CHART_VERSION=0.0.1-develop + +echo Create $NS namespace +kubectl create ns $NS + +function installing_resident_ui() { + echo Istio label + kubectl label ns $NS istio-injection=enabled --overwrite + helm repo update + + echo Copy configmaps + sed -i 's/\r$//' copy_cm.sh + ./copy_cm.sh + + echo Copy secrets + sed -i 's/\r$//' copy_secrets.sh + ./copy_secrets.sh + echo Setting up dummy values for Resident OIDC Client ID + kubectl create secret generic resident-oidc-onboarder-key -n $NS --from-literal=resident-oidc-clientid='' --dry-run=client -o yaml | kubectl apply -f - + ./copy_cm_func.sh secret resident-oidc-onboarder-key resident config-server + + kubectl -n config-server set env --keys=resident-oidc-clientid --from secret/resident-oidc-onboarder-key deployment/config-server --prefix=SPRING_CLOUD_CONFIG_SERVER_OVERRIDES_ + kubectl -n config-server get deploy -o name | xargs -n1 -t kubectl -n config-server rollout status + echo "Do you have public domain & valid SSL? (Y/n) " + echo "Y: if you have public domain & valid ssl certificate" + echo "n: If you don't have a public domain and a valid SSL certificate. Note: It is recommended to use this option only in development environments." + read -p "" flag + + if [ -z "$flag" ]; then + echo "'flag' was provided; EXITING;" + exit 1; + fi + ENABLE_INSECURE='' + if [ "$flag" = "n" ]; then + ENABLE_INSECURE='--set enable_insecure=true'; + fi + + API_HOST=$(kubectl get cm global -o jsonpath={.data.mosip-api-internal-host}) + RESIDENT_HOST=$(kubectl get cm global -o jsonpath={.data.mosip-resident-host}) + + + echo Installing Resident UI + helm -n $NS install resident-ui mosip/resident-ui --set resident.apiHost=$API_HOST --set istio.hosts\[0\]=$RESIDENT_HOST --version $RESIDENT_UI_CHART_VERSION + + kubectl -n $NS get deploy -o name | xargs -n1 -t kubectl -n $NS rollout status + + echo Installed Resident UI + + + echo "resident-ui portal URL: https://$RESIDENT_HOST/" + return 0 +} + +# set commands for error handling. +set -e +set -o errexit ## set -e : exit the script if any statement returns a non-true return value +set -o nounset ## set -u : exit the script if you try to use an uninitialised variable +set -o errtrace # trace ERR through 'time command' and other functions +set -o pipefail # trace ERR through pipes +installing_resident_ui # calling function diff --git a/deploy/restart.sh b/deploy/restart.sh new file mode 100755 index 00000000..32a0c25a --- /dev/null +++ b/deploy/restart.sh @@ -0,0 +1,25 @@ +#!/bin/bash +# Restart the resident service +## Usage: ./restart.sh [kubeconfig] + +if [ $# -ge 1 ] ; then + export KUBECONFIG=$1 +fi + +function Restarting_resident_ui() { + NS=resident + kubectl -n $NS rollout restart deploy + + kubectl -n $NS get deploy -o name | xargs -n1 -t kubectl -n $NS rollout status + + echo Restarted resident services + return 0 +} + +# set commands for error handling. +set -e +set -o errexit ## set -e : exit the script if any statement returns a non-true return value +set -o nounset ## set -u : exit the script if you try to use an uninitialised variable +set -o errtrace # trace ERR through 'time command' and other functions +set -o pipefail # trace ERR through pipes +Restarting_resident_ui # calling function From d90a589897e43a31282ed918bdf1e1819b811543 Mon Sep 17 00:00:00 2001 From: ckm007 Date: Wed, 17 Jul 2024 23:11:23 +0530 Subject: [PATCH 3/8] [MOSIP-34233] updated helm chart version for resident ui installation Signed-off-by: ckm007 --- helm/resident-ui/.gitignore | 2 + helm/resident-ui/.helmignore | 23 + helm/resident-ui/Chart.yaml | 20 + helm/resident-ui/templates/_helpers.tpl | 58 +++ helm/resident-ui/templates/configmap.yaml | 36 ++ helm/resident-ui/templates/deployment.yaml | 155 +++++++ helm/resident-ui/templates/gateway.yaml | 16 + helm/resident-ui/templates/hpa.yaml | 28 ++ helm/resident-ui/templates/ingress.yaml | 61 +++ helm/resident-ui/templates/service.yaml | 28 ++ .../resident-ui/templates/serviceaccount.yaml | 12 + .../templates/tests/test-connection.yaml | 0 .../resident-ui/templates/virtualservice.yaml | 31 ++ helm/resident-ui/values.yaml | 428 ++++++++++++++++++ 14 files changed, 898 insertions(+) create mode 100644 helm/resident-ui/.gitignore create mode 100644 helm/resident-ui/.helmignore create mode 100644 helm/resident-ui/Chart.yaml create mode 100644 helm/resident-ui/templates/_helpers.tpl create mode 100644 helm/resident-ui/templates/configmap.yaml create mode 100644 helm/resident-ui/templates/deployment.yaml create mode 100644 helm/resident-ui/templates/gateway.yaml create mode 100644 helm/resident-ui/templates/hpa.yaml create mode 100644 helm/resident-ui/templates/ingress.yaml create mode 100644 helm/resident-ui/templates/service.yaml create mode 100644 helm/resident-ui/templates/serviceaccount.yaml create mode 100644 helm/resident-ui/templates/tests/test-connection.yaml create mode 100644 helm/resident-ui/templates/virtualservice.yaml create mode 100644 helm/resident-ui/values.yaml diff --git a/helm/resident-ui/.gitignore b/helm/resident-ui/.gitignore new file mode 100644 index 00000000..fdb31a4a --- /dev/null +++ b/helm/resident-ui/.gitignore @@ -0,0 +1,2 @@ +chart/ +Charts.lock diff --git a/helm/resident-ui/.helmignore b/helm/resident-ui/.helmignore new file mode 100644 index 00000000..0e8a0eb3 --- /dev/null +++ b/helm/resident-ui/.helmignore @@ -0,0 +1,23 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/helm/resident-ui/Chart.yaml b/helm/resident-ui/Chart.yaml new file mode 100644 index 00000000..c56d9418 --- /dev/null +++ b/helm/resident-ui/Chart.yaml @@ -0,0 +1,20 @@ +apiVersion: v2 +name: resident-ui +description: A Helm chart for resident-ui +type: application +version: 0.0.1-develop +appVersion: "" +dependencies: + - name: common + repository: https://charts.bitnami.com/bitnami + tags: + - bitnami-common + version: 1.x.x +home: https://mosip.io +keywords: + - mosip + - resident-ui + - kernel +maintainers: + - email: info@mosip.io + name: MOSIP diff --git a/helm/resident-ui/templates/_helpers.tpl b/helm/resident-ui/templates/_helpers.tpl new file mode 100644 index 00000000..a0917106 --- /dev/null +++ b/helm/resident-ui/templates/_helpers.tpl @@ -0,0 +1,58 @@ +{{/* +Return the proper image name +*/}} +{{- define "resident-ui.image" -}} +{{ include "common.images.image" (dict "imageRoot" .Values.image "global" .Values.global) }} +{{- end -}} + +{{/* +Return the proper image name (for the init container volume-permissions image) +*/}} +{{- define "resident-ui.volumePermissions.image" -}} +{{- include "common.images.image" ( dict "imageRoot" .Values.volumePermissions.image "global" .Values.global ) -}} +{{- end -}} + +{{/* +Return the proper Docker Image Registry Secret Names +*/}} +{{- define "resident-ui.imagePullSecrets" -}} +{{- include "common.images.pullSecrets" (dict "images" (list .Values.image .Values.volumePermissions.image) "global" .Values.global) -}} +{{- end -}} + +{{/* +Create the name of the service account to use +*/}} +{{- define "resident-ui.serviceAccountName" -}} +{{- if .Values.serviceAccount.create -}} + {{ default (printf "%s" (include "common.names.fullname" .)) .Values.serviceAccount.name }} +{{- else -}} + {{ default "default" .Values.serviceAccount.name }} +{{- end -}} +{{- end -}} + +{{/* +Compile all warnings into a single message. +*/}} +{{- define "resident-ui.validateValues" -}} +{{- $messages := list -}} +{{- $messages := append $messages (include "resident-ui.validateValues.foo" .) -}} +{{- $messages := append $messages (include "resident-ui.validateValues.bar" .) -}} +{{- $messages := without $messages "" -}} +{{- $message := join "\n" $messages -}} + +{{- if $message -}} +{{- printf "\nVALUES VALIDATION:\n%s" $message -}} +{{- end -}} +{{- end -}} + +{{/* +Return podAnnotations +*/}} +{{- define "resident-ui.podAnnotations" -}} +{{- if .Values.podAnnotations }} +{{ include "common.tplvalues.render" (dict "value" .Values.podAnnotations "context" $) }} +{{- end }} +{{- if and .Values.metrics.enabled .Values.metrics.podAnnotations }} +{{ include "common.tplvalues.render" (dict "value" .Values.metrics.podAnnotations "context" $) }} +{{- end }} +{{- end -}} diff --git a/helm/resident-ui/templates/configmap.yaml b/helm/resident-ui/templates/configmap.yaml new file mode 100644 index 00000000..3376f35b --- /dev/null +++ b/helm/resident-ui/templates/configmap.yaml @@ -0,0 +1,36 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ template "common.names.fullname" . }} + namespace: {{ .Release.Namespace }} + labels: {{- include "common.labels.standard" . | nindent 4 }} + {{- if .Values.commonLabels }} + {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} + {{- end }} + {{- if .Values.commonAnnotations }} + annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} + {{- end }} + +data: + config.json: |- + {"baseUrl":"https://{{ .Values.resident.apiHost }}/resident/v1", + "version": "v1", + "validateToken": "admin/authorize/admin/validateToken", + "login": "/login/", + "logout": "/logout/user"} + default.conf: |- + server { + listen 8080; + server_name localhost; + add_header X-Frame-Options DENY; + + #charset koi8-r; + #access_log /var/log/nginx/host.access.log main; + #index index.html index.htm; + + location / { + root /usr/share/nginx/html; + } + } + + diff --git a/helm/resident-ui/templates/deployment.yaml b/helm/resident-ui/templates/deployment.yaml new file mode 100644 index 00000000..9855b858 --- /dev/null +++ b/helm/resident-ui/templates/deployment.yaml @@ -0,0 +1,155 @@ +apiVersion: {{ include "common.capabilities.deployment.apiVersion" . }} +kind: Deployment +metadata: + labels: {{- include "common.labels.standard" . | nindent 4 }} + {{- if .Values.commonLabels }} + {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} + {{- end }} + name: {{ template "common.names.fullname" . }} + annotations: + {{- if .Values.commonAnnotations }} + {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} + {{- end }} +spec: + replicas: {{ .Values.replicaCount }} + {{- if .Values.updateStrategy }} + strategy: {{- toYaml .Values.updateStrategy | nindent 4 }} + {{- end }} + selector: + matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }} + template: + metadata: + annotations: + {{- if or .Values.podAnnotations .Values.metrics.enabled }} + {{- include "resident-ui.podAnnotations" . | nindent 8 }} + {{- end }} + + labels: {{- include "common.labels.standard" . | nindent 8 }} + {{- if .Values.podLabels }} + {{- include "common.tplvalues.render" (dict "value" .Values.podLabels "context" $) | nindent 8 }} + {{- end }} + spec: + serviceAccountName: {{ template "resident-ui.serviceAccountName" . }} + {{- include "resident-ui.imagePullSecrets" . | nindent 6 }} + {{- if .Values.hostAliases }} + hostAliases: {{- include "common.tplvalues.render" (dict "value" .Values.hostAliases "context" $) | nindent 8 }} + {{- end }} + {{- if .Values.affinity }} + affinity: {{- include "common.tplvalues.render" ( dict "value" .Values.affinity "context" $) | nindent 8 }} + {{- else }} + affinity: + podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.podAffinityPreset "context" $) | nindent 10 }} + podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.podAntiAffinityPreset "context" $) | nindent 10 }} + nodeAffinity: {{- include "common.affinities.nodes" (dict "type" .Values.nodeAffinityPreset.type "key" .Values.nodeAffinityPreset.key "values" .Values.nodeAffinityPreset.values) | nindent 10 }} + {{- end }} + {{- if .Values.nodeSelector }} + nodeSelector: {{- include "common.tplvalues.render" ( dict "value" .Values.nodeSelector "context" $) | nindent 8 }} + {{- end }} + {{- if .Values.tolerations }} + tolerations: {{- include "common.tplvalues.render" (dict "value" .Values.tolerations "context" .) | nindent 8 }} + {{- end }} + {{- if .Values.priorityClassName }} + priorityClassName: {{ .Values.priorityClassName | quote }} + {{- end }} + {{- if .Values.podSecurityContext.enabled }} + securityContext: {{- omit .Values.podSecurityContext "enabled" | toYaml | nindent 8 }} + {{- end }} + initContainers: + {{- if and .Values.volumePermissions.enabled .Values.persistence.enabled }} + - name: volume-permissions + image: {{ include "resident-ui.volumePermissions.image" . }} + imagePullPolicy: {{ .Values.volumePermissions.image.pullPolicy | quote }} + command: + - %%commands%% + securityContext: + runAsUser: 0 + {{- if .Values.volumePermissions.resources }} + resources: {{- toYaml .Values.volumePermissions.resources | nindent 12 }} + {{- end }} + volumeMounts: + - name: foo + mountPath: bar + {{- end }} + {{- if .Values.initContainers }} + {{- include "common.tplvalues.render" (dict "value" .Values.initContainers "context" $) | nindent 8 }} + {{- end }} + containers: + - name: resident-ui + image: {{ template "resident-ui.image" . }} + imagePullPolicy: {{ .Values.image.pullPolicy }} + {{- if .Values.lifecycleHooks }} + lifecycle: {{- include "common.tplvalues.render" (dict "value" .Values.lifecycleHooks "context" $) | nindent 12 }} + {{- end }} + {{- if .Values.containerSecurityContext.enabled }} + securityContext: {{- omit .Values.containerSecurityContext "enabled" | toYaml | nindent 12 }} + {{- end }} + {{- if .Values.command }} + command: {{- include "common.tplvalues.render" (dict "value" .Values.command "context" $) | nindent 12 }} + {{- end }} + {{- if .Values.args }} + args: {{- include "common.tplvalues.render" (dict "value" .Values.args "context" $) | nindent 12 }} + {{- end }} + env: + - name: container_user + value: {{ .Values.containerSecurityContext.runAsUser }} + - name: JDK_JAVA_OPTIONS + value: {{ .Values.additionalResources.javaOpts }} + {{- if .Values.extraEnvVars }} + {{- include "common.tplvalues.render" (dict "value" .Values.extraEnvVars "context" $) | nindent 12 }} + {{- end }} + envFrom: + {{- if .Values.extraEnvVarsCM }} + {{- range .Values.extraEnvVarsCM }} + - configMapRef: + name: {{ . }} + {{- end }} + {{- end }} + {{- if .Values.extraEnvVarsSecret }} + - secretRef: + name: {{ include "common.tplvalues.render" (dict "value" .Values.extraEnvVarsSecret "context" $) }} + {{- end }} + volumeMounts: + - name: ui-config + mountPath: /usr/share/nginx/html/assets/config.json + subPath: config.json + - name: nginx-config + mountPath: /etc/nginx/conf.d/default.conf + subPath: default.conf + ports: + - name: spring-service + containerPort: {{ .Values.springServicePort }} + + {{- if .Values.resources }} + resources: {{- toYaml .Values.resources | nindent 12 }} + {{- end }} + {{- if .Values.startupProbe.enabled }} + startupProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.startupProbe "enabled") "context" $) | nindent 12 }} + {{- else if .Values.customStartupProbe }} + startupProbe: {{- include "common.tplvalues.render" (dict "value" .Values.customStartupProbe "context" $) | nindent 12 }} + {{- end }} + {{- if .Values.livenessProbe.enabled }} + livenessProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.livenessProbe "enabled") "context" $) | nindent 12 }} + {{- else if .Values.customLivenessProbe }} + livenessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.customLivenessProbe "context" $) | nindent 12 }} + {{- end }} + {{- if .Values.readinessProbe.enabled }} + readinessProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.readinessProbe "enabled") "context" $) | nindent 12 }} + {{- else if .Values.customReadinessProbe }} + readinessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.customReadinessProbe "context" $) | nindent 12 }} + {{- end }} + {{- if .Values.sidecars }} + {{- include "common.tplvalues.render" ( dict "value" .Values.sidecars "context" $) | nindent 8 }} + {{- end }} + volumes: + - name: ui-config + configMap: + name: {{ template "common.names.fullname" . }} + items: + - key: config.json + path: config.json + - name: nginx-config + configMap: + name: {{ template "common.names.fullname" . }} + items: + - key: default.conf + path: default.conf diff --git a/helm/resident-ui/templates/gateway.yaml b/helm/resident-ui/templates/gateway.yaml new file mode 100644 index 00000000..5f990d5e --- /dev/null +++ b/helm/resident-ui/templates/gateway.yaml @@ -0,0 +1,16 @@ +{{- if .Values.istio.enabled }} +apiVersion: networking.istio.io/v1alpha3 +kind: Gateway +metadata: + name: resident-ui-gateway +spec: + selector: + istio: {{ .Values.istio.ingressController.name }} + servers: + - port: + number: 80 + name: http + protocol: HTTP + hosts: + {{- include "common.tplvalues.render" ( dict "value" .Values.istio.hosts "context" $ ) | nindent 6 }} +{{- end }} diff --git a/helm/resident-ui/templates/hpa.yaml b/helm/resident-ui/templates/hpa.yaml new file mode 100644 index 00000000..ebd92ae7 --- /dev/null +++ b/helm/resident-ui/templates/hpa.yaml @@ -0,0 +1,28 @@ +{{- if .Values.autoscaling.enabled }} +apiVersion: autoscaling/v2beta1 +kind: HorizontalPodAutoscaler +metadata: + name: {{ include "resident-ui.fullname" . }} + labels: + {{- include "resident-ui.labels" . | nindent 4 }} +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ include "resident-ui.fullname" . }} + minReplicas: {{ .Values.autoscaling.minReplicas }} + maxReplicas: {{ .Values.autoscaling.maxReplicas }} + metrics: + {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} + - type: Resource + resource: + name: cpu + targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} + {{- end }} + {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} + - type: Resource + resource: + name: memory + targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} + {{- end }} +{{- end }} diff --git a/helm/resident-ui/templates/ingress.yaml b/helm/resident-ui/templates/ingress.yaml new file mode 100644 index 00000000..d6f3d3e2 --- /dev/null +++ b/helm/resident-ui/templates/ingress.yaml @@ -0,0 +1,61 @@ +{{- if .Values.ingress.enabled -}} +{{- $fullName := include "resident-ui.fullname" . -}} +{{- $svcPort := .Values.service.port -}} +{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }} + {{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }} + {{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}} + {{- end }} +{{- end }} +{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1 +{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1beta1 +{{- else -}} +apiVersion: extensions/v1beta1 +{{- end }} +kind: Ingress +metadata: + name: {{ $fullName }} + labels: + {{- include "resident-ui.labels" . | nindent 4 }} + {{- with .Values.ingress.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + {{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }} + ingressClassName: {{ .Values.ingress.className }} + {{- end }} + {{- if .Values.ingress.tls }} + tls: + {{- range .Values.ingress.tls }} + - hosts: + {{- range .hosts }} + - {{ . | quote }} + {{- end }} + secretName: {{ .secretName }} + {{- end }} + {{- end }} + rules: + {{- range .Values.ingress.hosts }} + - host: {{ .host | quote }} + http: + paths: + {{- range .paths }} + - path: {{ .path }} + {{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }} + pathType: {{ .pathType }} + {{- end }} + backend: + {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} + service: + name: {{ $fullName }} + port: + number: {{ $svcPort }} + {{- else }} + serviceName: {{ $fullName }} + servicePort: {{ $svcPort }} + {{- end }} + {{- end }} + {{- end }} +{{- end }} diff --git a/helm/resident-ui/templates/service.yaml b/helm/resident-ui/templates/service.yaml new file mode 100644 index 00000000..018e6985 --- /dev/null +++ b/helm/resident-ui/templates/service.yaml @@ -0,0 +1,28 @@ +apiVersion: v1 +kind: Service +metadata: + labels: {{- include "common.labels.standard" . | nindent 4 }} + {{- if .Values.commonLabels }} + {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} + {{- end }} + name: {{ template "common.names.fullname" . }} + annotations: + {{- if .Values.commonAnnotations }} + {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} + {{- end }} +spec: + type: {{ .Values.service.type }} + {{- if (or (eq .Values.service.type "LoadBalancer") (eq .Values.service.type "NodePort")) }} + externalTrafficPolicy: {{ .Values.service.externalTrafficPolicy | quote }} + {{- end }} + {{ if eq .Values.service.type "LoadBalancer" }} + loadBalancerSourceRanges: {{ .Values.service.loadBalancerSourceRanges }} + {{ end }} + {{- if (and (eq .Values.service.type "LoadBalancer") (not (empty .Values.service.loadBalancerIP))) }} + loadBalancerIP: {{ .Values.service.loadBalancerIP }} + {{- end }} + ports: + - port: {{ .Values.service.port }} + protocol: TCP + targetPort: {{ .Values.springServicePort }} + selector: {{- include "common.labels.matchLabels" . | nindent 4 }} diff --git a/helm/resident-ui/templates/serviceaccount.yaml b/helm/resident-ui/templates/serviceaccount.yaml new file mode 100644 index 00000000..b9d37e10 --- /dev/null +++ b/helm/resident-ui/templates/serviceaccount.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: ServiceAccount +metadata: + labels: {{- include "common.labels.standard" . | nindent 4 }} + {{- if .Values.commonLabels }} + {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} + {{- end }} + name: {{ template "resident-ui.serviceAccountName" . }} + {{- if .Values.commonAnnotations }} + annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} + {{- end }} + namespace: {{ .Release.Namespace }} diff --git a/helm/resident-ui/templates/tests/test-connection.yaml b/helm/resident-ui/templates/tests/test-connection.yaml new file mode 100644 index 00000000..e69de29b diff --git a/helm/resident-ui/templates/virtualservice.yaml b/helm/resident-ui/templates/virtualservice.yaml new file mode 100644 index 00000000..f2273ea8 --- /dev/null +++ b/helm/resident-ui/templates/virtualservice.yaml @@ -0,0 +1,31 @@ +{{- if .Values.istio.enabled }} +apiVersion: networking.istio.io/v1alpha3 +kind: VirtualService +metadata: + name: {{ template "common.names.fullname" . }} + namespace: {{ .Release.Namespace }} + labels: {{- include "common.labels.standard" . | nindent 4 }} + {{- if .Values.commonLabels }} + {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} + {{- end }} + {{- if .Values.commonAnnotations }} + annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} + {{- end }} +spec: + hosts: + - "*" + gateways: {{- include "common.tplvalues.render" ( dict "value" .Values.istio.gateways "context" $ ) | nindent 4 }} + http: + - match: + - uri: + prefix: {{ .Values.istio.prefix }} + route: + - destination: + host: {{ template "common.names.fullname" . }} + port: + number: {{ .Values.service.port }} + headers: + request: + set: + x-forwarded-proto: https +{{- end }} diff --git a/helm/resident-ui/values.yaml b/helm/resident-ui/values.yaml new file mode 100644 index 00000000..198bad06 --- /dev/null +++ b/helm/resident-ui/values.yaml @@ -0,0 +1,428 @@ +## Global Docker image parameters +## Please, note that this will override the image parameters, including dependencies, configured to use the global value +## Current available global Docker image parameters: imageRegistry and imagePullSecrets +## +# global: +# imageRegistry: myRegistryName +# imagePullSecrets: +# - myRegistryKeySecretName +# storageClass: myStorageClass + +## Add labels to all the deployed resources +## +commonLabels: + app.kubernetes.io/component: mosip + +## Add annotations to all the deployed resources +## +commonAnnotations: {} + +## Kubernetes Cluster Domain +## +clusterDomain: cluster.local + +## Extra objects to deploy (value evaluated as a template) +## +extraDeploy: [] + +## Number of nodes +## +replicaCount: 1 + +service: + type: ClusterIP + port: 8080 + ## loadBalancerIP for the SuiteCRM Service (optional, cloud specific) + ## ref: http://kubernetes.io/docs/user-guide/services/#type-loadbalancer + ## + ## loadBalancerIP: + ## + ## nodePorts: + ## http: + ## https: + ## + + nodePorts: + http: "" + https: "" + ## Enable client source IP preservation + ## ref http://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/#preserving-the-client-source-ip + ## + externalTrafficPolicy: Cluster + +image: + registry: docker.io + repository: mosipdev/resident-ui + tag: develop + ## Specify a imagePullPolicy + ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' + ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images + ## + pullPolicy: Always + ## Optionally specify an array of imagePullSecrets. + ## Secrets must be manually created in the namespace. + ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ + ## + # pullSecrets: + # - myRegistryKeySecretName + +## Port on which this particular spring service module is running. +springServicePort: 8080 + +## Configure extra options for liveness and readiness probes +## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/#configure-probes +## +startupProbe: + enabled: true + tcpSocket: + port: 8080 + initialDelaySeconds: 0 + periodSeconds: 10 + timeoutSeconds: 5 + failureThreshold: 30 + successThreshold: 1 + +livenessProbe: + enabled: true + tcpSocket: + port: 8080 + initialDelaySeconds: 20 + periodSeconds: 10 + timeoutSeconds: 5 + failureThreshold: 6 + successThreshold: 1 + +readinessProbe: + enabled: true + tcpSocket: + port: 8080 + initialDelaySeconds: 0 + periodSeconds: 10 + timeoutSeconds: 5 + failureThreshold: 6 + successThreshold: 1 + +## +# existingConfigmap: + +## Command and args for running the container (set to default if not set). Use array form +## +command: [] +args: [] + +## Deployment pod host aliases +## https://kubernetes.io/docs/concepts/services-networking/add-entries-to-pod-etc-hosts-with-host-aliases/ +## +hostAliases: [] + +## ref: http://kubernetes.io/docs/user-guide/compute-resources/ +## +resources: + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + limits: {} + # cpu: 200m + # memory: 256Mi + requests: + cpu: 200m + memory: 200Mi + +additionalResources: + ## Specify any JAVA_OPTS string here. These typically will be specified in conjunction with above resources + ## Example: java_opts: "-Xms500M -Xmx500M" + javaOpts: "" + +## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-container +## Clamav container already runs as 'mosip' user, so we may not need to enable this +containerSecurityContext: + enabled: false + runAsUser: mosip + runAsNonRoot: true + +## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod +## +podSecurityContext: + enabled: false + fsGroup: 1001 + +## Pod affinity preset +## ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity +## Allowed values: soft, hard +## +podAffinityPreset: "" + +## Pod anti-affinity preset +## Ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity +## Allowed values: soft, hard +## +podAntiAffinityPreset: soft + +## Node affinity preset +## Ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#node-affinity +## Allowed values: soft, hard +## +nodeAffinityPreset: + ## Node affinity type + ## Allowed values: soft, hard + ## + type: "" + ## Node label key to match + ## E.g. + ## key: "kubernetes.io/e2e-az-name" + ## + key: "" + ## Node label values to match + ## E.g. + ## values: + ## - e2e-az1 + ## - e2e-az2 + ## + values: [] + +## Affinity for pod assignment. Evaluated as a template. +## Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity +## +affinity: {} + +## Node labels for pod assignment. Evaluated as a template. +## ref: https://kubernetes.io/docs/user-guide/node-selection/ +## +nodeSelector: {} + +## Tolerations for pod assignment. Evaluated as a template. +## ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ +## +tolerations: [] + +## Pod extra labels +## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +## +podLabels: {} + +## Annotations for server pods. +## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +## +podAnnotations: {} + +## pods' priority. +## ref: https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/ +## +# priorityClassName: "" + +## lifecycleHooks for the container to automate configuration before or after startup. +## +lifecycleHooks: {} + +## Custom Liveness probes for +## +customLivenessProbe: {} + +## Custom Rediness probes +## +customReadinessProbe: {} + +## Update strategy - only really applicable for deployments with RWO PVs attached +## If replicas = 1, an update can get "stuck", as the previous pod remains attached to the +## PV, and the "incoming" pod can never start. Changing the strategy to "Recreate" will +## terminate the single previous pod, so that the new, incoming pod can attach to the PV +## +updateStrategy: + type: RollingUpdate + +## Additional environment variables to set +## Example: +## extraEnvVars: +## - name: FOO +## value: "bar" +## +extraEnvVars: [] + +## ConfigMap with extra environment variables that used +## +extraEnvVarsCM: + - global + - config-server-share + - artifactory-share + +## Secret with extra environment variables +## +extraEnvVarsSecret: + +## Extra volumes to add to the deployment +## +extraVolumes: [] + +## Extra volume mounts to add to the container +## +extraVolumeMounts: [] + +## Add init containers to the pods. +## Example: +## initContainers: +## - name: your-image-name +## image: your-image +## imagePullPolicy: Always +## ports: +## - name: portname +## containerPort: 1234 +## +initContainers: {} + +## Add sidecars to the pods. +## Example: +## sidecars: +## - name: your-image-name +## image: your-image +## imagePullPolicy: Always +## ports: +## - name: portname +## containerPort: 1234 +## +sidecars: {} + +persistence: + enabled: false + ## If defined, storageClassName: + ## If set to "-", storageClassName: "", which disables dynamic provisioning + ## If undefined (the default) or set to null, no storageClassName spec is + ## set, choosing the default provisioner. (gp2 on AWS, standard on + ## GKE, AWS & OpenStack). + ## + # storageClass: "-" + ## + ## If you want to reuse an existing claim, you can pass the name of the PVC using + ## the existingClaim variable + # existingClaim: your-claim + ## ReadWriteMany not supported by AWS gp2 + storageClass: + accessModes: + - ReadWriteOnce + size: 10M + existingClaim: + # Dir where config and keys are written inside container + mountDir: + +## Init containers parameters: +## volumePermissions: Change the owner and group of the persistent volume mountpoint to runAsUser:fsGroup values from the securityContext section. +## +volumePermissions: + enabled: false + image: + registry: docker.io + repository: bitnami/bitnami-shell + tag: "10" + pullPolicy: Always + ## Optionally specify an array of imagePullSecrets. + ## Secrets must be manually created in the namespace. + ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ + ## + pullSecrets: [] + ## - myRegistryKeySecretName + ## Init containers' resource requests and limits + ## ref: http://kubernetes.io/docs/user-guide/compute-resources/ + ## + resources: + ## We usually recommend not to specify default resources and to leave this as a conscious + ## choice for the user. This also increases chances charts run on environments with little + ## resources, such as Minikube. If you do want to specify resources, uncomment the following + ## lines, adjust them as necessary, and remove the curly braces after 'resources:'. + ## + limits: {} + ## cpu: 100m + ## memory: 128Mi + ## + requests: {} + ## cpu: 100m + ## memory: 128Mi + ## + +## Specifies whether RBAC resources should be created +## +rbac: + create: true + +## Specifies whether a ServiceAccount should be created +## +serviceAccount: + create: true + ## The name of the ServiceAccount to use. + ## If not set and create is true, a name is generated using the fullname template + ## + name: + +## Prometheus Metrics +## +## TODO: Enable later when monitoring is enabled. +metrics: + enabled: false + ## Prometheus pod annotations + ## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ + ## + podAnnotations: + prometheus.io/scrape: "true" + + endpointPath: /resident-ui/v1/actuator/prometheus + + ## Prometheus Service Monitor + ## ref: https://github.com/coreos/prometheus-operator + ## + serviceMonitor: + ## If the operator is installed in your cluster, set to true to create a Service Monitor Entry + ## + enabled: true + ## Specify the namespace in which the serviceMonitor resource will be created + ## + # namespace: "" + ## Specify the interval at which metrics should be scraped + ## + interval: 10s + ## Specify the timeout after which the scrape is ended + ## + # scrapeTimeout: 30s + ## Specify Metric Relabellings to add to the scrape endpoint + ## + # relabellings: + ## Specify honorLabels parameter to add the scrape endpoint + ## + honorLabels: false + ## Used to pass Labels that are used by the Prometheus installed in your cluster to select Service Monitors to work with + ## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#prometheusspec + ## + additionalLabels: {} + + ## Custom PrometheusRule to be defined + ## The value is evaluated as a template, so, for example, the value can depend on .Release or .Chart + ## ref: https://github.com/coreos/prometheus-operator#customresourcedefinitions + ## + prometheusRule: + enabled: false + additionalLabels: {} + namespace: '' + ## List of rules, used as template by Helm. + ## These are just examples rules inspired from https://awesome-prometheus-alerts.grep.to/rules.html + # rules: + # - alert: RabbitmqDown + # expr: rabbitmq_up{service="{{ template "rabbitmq.fullname" . }}"} == 0 + # for: 5m + # labels: + # severity: error + rules: [] +ingress: + enabled: false + +autoscaling: + enabled: false + +resident: + apiHost: api-internal.sandbox.xyz.net +istio: + enabled: true + ingressController: + name: ingressgateway + gateways: + - resident-ui-gateway + prefix: / + hosts: + - resident.sandbox.xyz.net From 2765b1e3c5c794aa79acc7b47bfc5984e2f3f586 Mon Sep 17 00:00:00 2001 From: MadhuMosip Date: Fri, 19 Jul 2024 17:32:34 +0530 Subject: [PATCH 4/8] MOSIP-34575 added new error code Signed-off-by: MadhuMosip --- resident-ui/src/assets/i18n/ara.json | 3 ++- resident-ui/src/assets/i18n/eng.json | 3 ++- resident-ui/src/assets/i18n/fra.json | 3 ++- resident-ui/src/assets/i18n/hin.json | 3 ++- resident-ui/src/assets/i18n/kan.json | 3 ++- resident-ui/src/assets/i18n/spa.json | 3 ++- resident-ui/src/assets/i18n/tam.json | 3 ++- 7 files changed, 14 insertions(+), 7 deletions(-) diff --git a/resident-ui/src/assets/i18n/ara.json b/resident-ui/src/assets/i18n/ara.json index ab0b918a..d9dd244f 100644 --- a/resident-ui/src/assets/i18n/ara.json +++ b/resident-ui/src/assets/i18n/ara.json @@ -713,6 +713,7 @@ "RES-SER-526": "تم تجاوز الحد الأقصى لعدد التحديثات للسمات:- %s", "RES-SER-470": "لا توجد سجلات", "RES-SER-401": "استثناء قاعدة", - "RES-SER-474": "لم يتم العثور على معرف فردي استثناء" + "RES-SER-474": "لم يتم العثور على معرف فردي استثناء", + "RES-SER-527": "الإدخال الذي أدخلته موجود بالفعل. الرجاء إدخال قيمة جديدة للمتابعة." } } \ No newline at end of file diff --git a/resident-ui/src/assets/i18n/eng.json b/resident-ui/src/assets/i18n/eng.json index c310dcf7..04c22c45 100644 --- a/resident-ui/src/assets/i18n/eng.json +++ b/resident-ui/src/assets/i18n/eng.json @@ -714,6 +714,7 @@ "RES-SER-526": "Update count limit for the attributes exceeded:- %s", "RES-SER-470": "No Record(s) found", "RES-SER-401": "Base exception.", - "RES-SER-474": "Individual ID not found exception" + "RES-SER-474": "Individual ID not found exception", + "RES-SER-527": "The input you have entered already exists. Please enter a new value to proceed." } } \ No newline at end of file diff --git a/resident-ui/src/assets/i18n/fra.json b/resident-ui/src/assets/i18n/fra.json index 8629b7d9..3db84e9c 100644 --- a/resident-ui/src/assets/i18n/fra.json +++ b/resident-ui/src/assets/i18n/fra.json @@ -714,6 +714,7 @@ "RES-SER-526": "Limite du nombre de mises à jour pour les attributs dépassée : - %s", "RES-SER-470": "Aucun enregistrement trouvé", "RES-SER-401": "Exception de base", - "RES-SER-474": "Exception d'identification individuelle introuvable" + "RES-SER-474": "Exception d'identification individuelle introuvable", + "RES-SER-527": "L'entrée que vous avez saisie existe déjà. Veuillez saisir une nouvelle valeur pour continuer." } } \ No newline at end of file diff --git a/resident-ui/src/assets/i18n/hin.json b/resident-ui/src/assets/i18n/hin.json index 52445f6a..a71e88c1 100644 --- a/resident-ui/src/assets/i18n/hin.json +++ b/resident-ui/src/assets/i18n/hin.json @@ -714,6 +714,7 @@ "RES-SER-526": "विशेषताओं के लिए अद्यतन गणना सीमा पार हो गई:- %s", "RES-SER-470": "कोई रिकॉर्ड नहीं मिला", "RES-SER-401": "आधार अपवाद", - "RES-SER-474": "व्यक्तिगत आईडी को अपवाद नहीं मिला" + "RES-SER-474": "व्यक्तिगत आईडी को अपवाद नहीं मिला", + "RES-SER-527": "आपके द्वारा दर्ज किया गया इनपुट पहले से मौजूद है। आगे बढ़ने के लिए कृपया एक नया मान दर्ज करें।" } } \ No newline at end of file diff --git a/resident-ui/src/assets/i18n/kan.json b/resident-ui/src/assets/i18n/kan.json index d1940401..f27d6d6b 100644 --- a/resident-ui/src/assets/i18n/kan.json +++ b/resident-ui/src/assets/i18n/kan.json @@ -714,6 +714,7 @@ "RES-SER-526": "ಗುಣಲಕ್ಷಣಗಳ ನವೀಕರಣ ಎಣಿಕೆ ಮಿತಿ ಮೀರಿದೆ:- %s", "RES-SER-470": "ಯಾವುದೇ ದಾಖಲೆಗಳು ಕಂಡುಬಂದಿಲ್ಲ", "RES-SER-401": "ಮೂಲ ವಿನಾಯಿತಿ", - "RES-SER-474": "ವೈಯಕ್ತಿಕ ID ವಿನಾಯಿತಿ ಕಂಡುಬಂದಿಲ್ಲ" + "RES-SER-474": "ವೈಯಕ್ತಿಕ ID ವಿನಾಯಿತಿ ಕಂಡುಬಂದಿಲ್ಲ", + "RES-SER-527": "ನೀವು ನಮೂದಿಸಿದ ಇನ್‌ಪುಟ್ ಈಗಾಗಲೇ ಅಸ್ತಿತ್ವದಲ್ಲಿದೆ. ಮುಂದುವರಿಯಲು ದಯವಿಟ್ಟು ಹೊಸ ಮೌಲ್ಯವನ್ನು ನಮೂದಿಸಿ." } } \ No newline at end of file diff --git a/resident-ui/src/assets/i18n/spa.json b/resident-ui/src/assets/i18n/spa.json index 962914e9..ef83d2ae 100644 --- a/resident-ui/src/assets/i18n/spa.json +++ b/resident-ui/src/assets/i18n/spa.json @@ -714,6 +714,7 @@ "RES-SER-526": "Límite de recuento de actualizaciones para los atributos excedidos: - %s", "RES-SER-470": "No se encontraron registros", "RES-SER-401": "Excepción básica", - "RES-SER-474": "Excepción de identificación individual no encontrada" + "RES-SER-474": "Excepción de identificación individual no encontrada", + "RES-SER-527": "La entrada que has ingresado ya existe. Ingrese un nuevo valor para continuar." } } \ No newline at end of file diff --git a/resident-ui/src/assets/i18n/tam.json b/resident-ui/src/assets/i18n/tam.json index c90f449f..a1f088d4 100644 --- a/resident-ui/src/assets/i18n/tam.json +++ b/resident-ui/src/assets/i18n/tam.json @@ -715,6 +715,7 @@ "RES-SER-526": "பண்புக்கூறுகளுக்கான புதுப்பிப்பு எண்ணிக்கை வரம்பு மீறப்பட்டது:- %s", "RES-SER-470": "எந்த பதிவுகளும் கண்டறியப்படவில்லை", "RES-SER-401": "அடிப்படை விதிவிலக்கு", - "RES-SER-474": "தனிப்பட்ட ஐடி விதிவிலக்கு இல்லை" + "RES-SER-474": "தனிப்பட்ட ஐடி விதிவிலக்கு இல்லை", + "RES-SER-527": "நீங்கள் உள்ளிட்ட உள்ளீடு ஏற்கனவே உள்ளது. தொடர புதிய மதிப்பை உள்ளிடவும்." } } \ No newline at end of file From 04d4a4b821e53bf0f70982c773698fa252ca06af Mon Sep 17 00:00:00 2001 From: MadhuMosip Date: Mon, 22 Jul 2024 13:31:48 +0530 Subject: [PATCH 5/8] MOSIP-34584 resolved security hotspots Signed-off-by: MadhuMosip --- .../center-selection.component.ts | 47 ++++++++++--------- resident-ui/src/index.html | 2 +- 2 files changed, 25 insertions(+), 24 deletions(-) diff --git a/resident-ui/src/app/feature/booking/center-selection/center-selection.component.ts b/resident-ui/src/app/feature/booking/center-selection/center-selection.component.ts index 1e64ea8e..6a862423 100644 --- a/resident-ui/src/app/feature/booking/center-selection/center-selection.component.ts +++ b/resident-ui/src/app/feature/booking/center-selection/center-selection.component.ts @@ -73,6 +73,7 @@ export class CenterSelectionComponent implements OnInit, OnDestroy { isMobileView:boolean = false; showLocationDetails:boolean = true; showBackBtn:boolean = false; + positions:any; private keyboardRef: MatKeyboardRef; @@ -265,12 +266,12 @@ export class CenterSelectionComponent implements OnInit, OnDestroy { } searchInput(){ - if(this.searchText.length > 2 && this.searchText.match(/[\p{Letter}\p{Number}\p{Mark}\s]+/gu)){ + if(this.searchText.length > 2 && this.searchText.match(/^[a-zA-Z0-9 ]*$/)){ this.isBlankSpace = false; }else{ this.isBlankSpace = true; } - if(!this.searchText.match(/[\p{Letter}\p{Number}\p{Mark}\s]+/gu)){ + if(!this.searchText.match(/^[a-zA-Z0-9 ]*$/)){ this.showWarningMsg = true; }else{ this.showWarningMsg = false; @@ -376,9 +377,10 @@ export class CenterSelectionComponent implements OnInit, OnDestroy { getLocation() { this.REGISTRATION_CENTRES = []; this.nearbyClicked = true; - if (navigator.geolocation) { + if ("geolocation" in navigator) { this.showMap = false; - navigator.geolocation.getCurrentPosition((position) => { + this.positions = navigator.geolocation; + this.positions.getCurrentPosition((position) => { const subs = this.dataService .getNearbyRegistrationCenters(position.coords) .subscribe( @@ -402,8 +404,7 @@ export class CenterSelectionComponent implements OnInit, OnDestroy { //this.showErrorMessage(error); }); this.subscriptions.push(subs); - }); - } else { + }) } } @@ -564,26 +565,26 @@ export class CenterSelectionComponent implements OnInit, OnDestroy { }) } else { if (navigator.geolocation) { - navigator.geolocation.getCurrentPosition((position) => { + this.positions.getCurrentPosition((position) => { this.dataService.nearByRegistrationCentersList(this.langCode, position.coords) - .subscribe(response =>{ - if (response.headers.get('Content-Type') === 'application/pdf') { - var fileName = ""; - const contentDisposition = response.headers.get('Content-Disposition'); - if (contentDisposition) { - const fileNameRegex = /filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/; - const matches = fileNameRegex.exec(contentDisposition); - if (matches != null && matches[1]) { - fileName = matches[1].replace(/['"]/g, ''); + .subscribe(response =>{ + if (response.headers.get('Content-Type') === 'application/pdf') { + var fileName = ""; + const contentDisposition = response.headers.get('Content-Disposition'); + if (contentDisposition) { + const fileNameRegex = /filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/; + const matches = fileNameRegex.exec(contentDisposition); + if (matches != null && matches[1]) { + fileName = matches[1].replace(/['"]/g, ''); + } + } + saveAs(response.body, fileName); + } else { + console.log(""); } - } - saveAs(response.body, fileName); - } else { - console.log(""); - } - }, error =>{ + }, error =>{ console.log(error); - }) + }) }) } } diff --git a/resident-ui/src/index.html b/resident-ui/src/index.html index 2facf202..4b59e459 100644 --- a/resident-ui/src/index.html +++ b/resident-ui/src/index.html @@ -8,7 +8,7 @@ - + From dbb197970a9135a62a3741d7399eaebfb495f4c8 Mon Sep 17 00:00:00 2001 From: MadhuMosip Date: Mon, 22 Jul 2024 19:14:46 +0530 Subject: [PATCH 6/8] MOSIP-34584 Resolved sonar major and minor bugs Signed-off-by: MadhuMosip --- resident-ui/src/app/app.component.ts | 3 --- .../center-selection.component.css | 4 +--- .../center-selection.component.html | 4 ++-- .../app/feature/booking/map/map.component.css | 2 +- .../dashboard/dashboard/dashboard.component.css | 4 ++-- .../document/document/document.component.html | 2 +- .../downloaduin/downloaduin.component.css | 4 +--- .../feature/getuin/getuin/getuin.component.css | 5 ++--- .../dashboard/dashboard.component.css | 4 ++-- .../dashboard/dashboard.component.html | 2 +- .../grievance/grievance.component.html | 6 +++--- .../lockunlockauth/lockunlockauth.component.css | 3 +-- .../lockunlockauth/lockunlockauth.component.ts | 10 +++++----- .../personalisedcard.component.css | 1 - .../personalisedcard.component.ts | 3 ++- .../physicalcard/physicalcard.component.css | 1 - .../revokevid/revokevid.component.css | 2 -- .../revokevid/revokevid.component.html | 4 ++-- .../uinservices/revokevid/revokevid.component.ts | 2 +- .../sharewithpartner.component.css | 4 ---- .../sharewithpartner.component.html | 2 +- .../sharewithpartner.component.ts | 2 +- .../trackservicerequest.component.html | 16 ++++++++-------- .../updatedemographic.component.css | 10 ++++------ .../updatedemographic.component.html | 12 ++++++------ 25 files changed, 47 insertions(+), 65 deletions(-) diff --git a/resident-ui/src/app/app.component.ts b/resident-ui/src/app/app.component.ts index e6060dd5..40513493 100644 --- a/resident-ui/src/app/app.component.ts +++ b/resident-ui/src/app/app.component.ts @@ -195,9 +195,6 @@ export class AppComponent { preventBack() { window.history.forward(); - window.onunload = function() { - null; - }; } @HostListener('document:keydown.escape', ['$event']) onKeydownHandler(event: KeyboardEvent) { diff --git a/resident-ui/src/app/feature/booking/center-selection/center-selection.component.css b/resident-ui/src/app/feature/booking/center-selection/center-selection.component.css index 323a2449..830892bb 100644 --- a/resident-ui/src/app/feature/booking/center-selection/center-selection.component.css +++ b/resident-ui/src/app/feature/booking/center-selection/center-selection.component.css @@ -301,11 +301,9 @@ input[type="radio"] { .search-card { width: 200px; height: 40px; - padding: 0; box-shadow: 4px black; border-radius: 4px !important; display: inline-flex; - display: inline-flex; padding: 7px; border: 2px solid #909090; } @@ -423,7 +421,7 @@ input[type="radio"] { font-size: var(--fs) !important; } -@media screen and ((min-width:601px) and (max-width: 780px)){ +@media screen and (min-width:601px) and (max-width: 780px){ .map{ width: 100%; } diff --git a/resident-ui/src/app/feature/booking/center-selection/center-selection.component.html b/resident-ui/src/app/feature/booking/center-selection/center-selection.component.html index 72c17998..7515a482 100644 --- a/resident-ui/src/app/feature/booking/center-selection/center-selection.component.html +++ b/resident-ui/src/app/feature/booking/center-selection/center-selection.component.html @@ -47,8 +47,8 @@ placeholder="{{ 'centerSelection.text_search' | translate }}" name="search" class="search-input" [(ngModel)]="searchText" (input)="searchInput()" (blur)="captureValue($event)" (focus)="captureVirtualKeyboard(search, 0)" id="searchLocationBox" #keyboardRef /> - keyboard + keyboard
diff --git a/resident-ui/src/app/feature/booking/map/map.component.css b/resident-ui/src/app/feature/booking/map/map.component.css index 34378abe..e9aceec5 100644 --- a/resident-ui/src/app/feature/booking/map/map.component.css +++ b/resident-ui/src/app/feature/booking/map/map.component.css @@ -4,7 +4,7 @@ height: 90%; } -@media screen and ((min-width:601px) and (max-width: 780px)){ +@media screen and (min-width:601px) and (max-width: 780px){ .map { height: 84%; } diff --git a/resident-ui/src/app/feature/dashboard/dashboard/dashboard.component.css b/resident-ui/src/app/feature/dashboard/dashboard/dashboard.component.css index 36344491..6d64325a 100644 --- a/resident-ui/src/app/feature/dashboard/dashboard/dashboard.component.css +++ b/resident-ui/src/app/feature/dashboard/dashboard/dashboard.component.css @@ -130,7 +130,7 @@ div.item-card:hover{ border-radius: 25px !important; } -@media screen and ((min-width:900px) and (max-width:1250px)){ +@media screen and (min-width:900px) and (max-width:1250px){ .main-div{ grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; @@ -141,7 +141,7 @@ div.item-card:hover{ } -@media screen and (max-width:899px){ +@media screen and (min-width:460px) and (max-width:900px){ .main-div{ grid-template-columns: 1fr; grid-template-rows: 1fr 0.4fr 0.4fr 0.4fr 0.5fr; diff --git a/resident-ui/src/app/feature/document/document/document.component.html b/resident-ui/src/app/feature/document/document/document.component.html index d7c3af50..0cf62225 100644 --- a/resident-ui/src/app/feature/document/document/document.component.html +++ b/resident-ui/src/app/feature/document/document/document.component.html @@ -13,7 +13,7 @@
- +
diff --git a/resident-ui/src/app/feature/downloaduin/downloaduin/downloaduin.component.css b/resident-ui/src/app/feature/downloaduin/downloaduin/downloaduin.component.css index 3530e909..2c5b206a 100644 --- a/resident-ui/src/app/feature/downloaduin/downloaduin/downloaduin.component.css +++ b/resident-ui/src/app/feature/downloaduin/downloaduin/downloaduin.component.css @@ -18,10 +18,8 @@ opacity: 1; background-color: transparent; text-align: left; - font: normal normal medium 16px/19px Roboto; letter-spacing: 0px; color: #909090; - opacity: 1; display: flex; align-items: center; justify-content: center; @@ -114,7 +112,7 @@ label { color: #ffffff; } -@media screen and ((min-width:530px) and (max-width:755px)){ +@media screen and (min-width:530px) and (max-width:755px){ .main-container{ padding: 0 3rem 0 3rem; } diff --git a/resident-ui/src/app/feature/getuin/getuin/getuin.component.css b/resident-ui/src/app/feature/getuin/getuin/getuin.component.css index 57b49fb7..f2d508b5 100644 --- a/resident-ui/src/app/feature/getuin/getuin/getuin.component.css +++ b/resident-ui/src/app/feature/getuin/getuin/getuin.component.css @@ -23,7 +23,6 @@ .login-heading { text-align: center; - font: normal normal medium 20px/30px Poppins; letter-spacing: 0px; color: #000000; opacity: 1; @@ -330,7 +329,7 @@ ul li:last-child hr{ } -@media screen and ((min-width:1000px) and (max-width:1450px)){ +@media screen and (min-width:1000px) and (max-width:1450px){ ul li:last-child hr{ width: 88%; left: -40%; @@ -338,7 +337,7 @@ ul li:last-child hr{ } } -@media screen and ((min-width:680px) and (max-width:999px)){ +@media screen and (min-width:680px) and (max-width:999px){ ul li:last-child hr{ width: 88%; left: -34%; diff --git a/resident-ui/src/app/feature/uinservices/dashboard/dashboard.component.css b/resident-ui/src/app/feature/uinservices/dashboard/dashboard.component.css index e9b43d37..7f0d2ca3 100644 --- a/resident-ui/src/app/feature/uinservices/dashboard/dashboard.component.css +++ b/resident-ui/src/app/feature/uinservices/dashboard/dashboard.component.css @@ -56,13 +56,13 @@ mat-card-title { width: 24.5%; } -@media screen and ((min-width:1230px) and (max-width:1900px)){ +@media screen and (min-width:1230px) and (max-width:1900px){ .each-service-card{ width: 32.5%; } } -@media screen and ((min-width:900px) and (max-width:1229px)) { +@media screen and (min-width:900px) and (max-width:1229px) { .each-service-card{ width: 48.5%; } diff --git a/resident-ui/src/app/feature/uinservices/dashboard/dashboard.component.html b/resident-ui/src/app/feature/uinservices/dashboard/dashboard.component.html index af9e05e3..8395a4a1 100644 --- a/resident-ui/src/app/feature/uinservices/dashboard/dashboard.component.html +++ b/resident-ui/src/app/feature/uinservices/dashboard/dashboard.component.html @@ -9,7 +9,7 @@

{{'dashboard.uinser
- + {{item.displayName}} {{item.description}} diff --git a/resident-ui/src/app/feature/uinservices/grievance/grievance.component.html b/resident-ui/src/app/feature/uinservices/grievance/grievance.component.html index 254b5b0b..efeb0415 100644 --- a/resident-ui/src/app/feature/uinservices/grievance/grievance.component.html +++ b/resident-ui/src/app/feature/uinservices/grievance/grievance.component.html @@ -23,7 +23,7 @@
- keyboard + keyboard
@@ -34,7 +34,7 @@
- keyboard + keyboard
@@ -46,7 +46,7 @@
- keyboard + keyboard
{{grievanceData.TotalCharacters}}: {{totalCommentCount}} {{grievanceData.remainingCharacters}}: {{remainingChars}} diff --git a/resident-ui/src/app/feature/uinservices/lockunlockauth/lockunlockauth.component.css b/resident-ui/src/app/feature/uinservices/lockunlockauth/lockunlockauth.component.css index ff8179a9..d1653e8a 100644 --- a/resident-ui/src/app/feature/uinservices/lockunlockauth/lockunlockauth.component.css +++ b/resident-ui/src/app/feature/uinservices/lockunlockauth/lockunlockauth.component.css @@ -72,7 +72,6 @@ mat-card-header, } .intro-description { - font: normal normal medium 16px/22px Montserrat Medium; letter-spacing: 0px; color: #505050; } @@ -84,7 +83,7 @@ mat-card-header, margin-bottom: 0px; } -@media screen and ((min-width:600px) and (max-width:1500px)){ +@media screen and (min-width:600px) and (max-width:1500px){ .mini-card { width: 98%; height: 180px; diff --git a/resident-ui/src/app/feature/uinservices/lockunlockauth/lockunlockauth.component.ts b/resident-ui/src/app/feature/uinservices/lockunlockauth/lockunlockauth.component.ts index 206fa4bc..0cc8ea9d 100644 --- a/resident-ui/src/app/feature/uinservices/lockunlockauth/lockunlockauth.component.ts +++ b/resident-ui/src/app/feature/uinservices/lockunlockauth/lockunlockauth.component.ts @@ -106,6 +106,7 @@ export class LockunlockauthComponent implements OnInit, OnDestroy { let authTypes = this.appConfigService.getConfig()["auth.types.allowed"].split(','); let authTypesJSON = {}; let newAuthlist = []; + console.log(authTypes) this.dataStorageService .getAuthlockStatus() .subscribe((response) => { @@ -128,17 +129,16 @@ export class LockunlockauthComponent implements OnInit, OnDestroy { authTypesJSON = {}; authTypesJSON["authType"] = authTypes[i].split('-')[0]; authTypesJSON["authSubType"] = authTypes[i].split('-')[1]; - if(authTypes[i].split('-')[1]){ - newAuthlist.find(el => { + newAuthlist.forEach(el => { if(el.authSubType === authTypes[i].split('-')[1]){ - return authTypesJSON["locked"] = el.locked; + authTypesJSON["locked"] = el.locked; } }) }else{ - newAuthlist.find(el => { + newAuthlist.forEach(el => { if(el.authType === authTypes[i]){ - return authTypesJSON["locked"] = el.locked; + authTypesJSON["locked"] = el.locked; } }) } diff --git a/resident-ui/src/app/feature/uinservices/personalisedcard/personalisedcard.component.css b/resident-ui/src/app/feature/uinservices/personalisedcard/personalisedcard.component.css index 89998e3f..39883fe5 100644 --- a/resident-ui/src/app/feature/uinservices/personalisedcard/personalisedcard.component.css +++ b/resident-ui/src/app/feature/uinservices/personalisedcard/personalisedcard.component.css @@ -1,5 +1,4 @@ .intro-description { - font: normal normal medium 16px/22px Montserrat Medium; letter-spacing: 0px; color: #505050; } diff --git a/resident-ui/src/app/feature/uinservices/personalisedcard/personalisedcard.component.ts b/resident-ui/src/app/feature/uinservices/personalisedcard/personalisedcard.component.ts index d9f9e8e3..029fb8fc 100644 --- a/resident-ui/src/app/feature/uinservices/personalisedcard/personalisedcard.component.ts +++ b/resident-ui/src/app/feature/uinservices/personalisedcard/personalisedcard.component.ts @@ -255,13 +255,14 @@ export class PersonalisedcardComponent implements OnInit, OnDestroy { if (eachItem.value === type['value']) { return eachItem['checked'] = !eachItem['checked'] } else { - return eachItem['checked'] = eachItem['checked'] + return eachItem['checked'] } }) } return item }) + if (data.attributeName === "fullAddress") { let selectedValuesCount = 0; if (type["value"] !== 'fullAddress') { diff --git a/resident-ui/src/app/feature/uinservices/physicalcard/physicalcard.component.css b/resident-ui/src/app/feature/uinservices/physicalcard/physicalcard.component.css index f3fe2380..c14b073d 100644 --- a/resident-ui/src/app/feature/uinservices/physicalcard/physicalcard.component.css +++ b/resident-ui/src/app/feature/uinservices/physicalcard/physicalcard.component.css @@ -1,5 +1,4 @@ .intro-description { - font: normal normal medium 16px/22px Montserrat Medium; letter-spacing: 0px; color: #505050; } \ No newline at end of file diff --git a/resident-ui/src/app/feature/uinservices/revokevid/revokevid.component.css b/resident-ui/src/app/feature/uinservices/revokevid/revokevid.component.css index d22bb2e0..877d1a91 100644 --- a/resident-ui/src/app/feature/uinservices/revokevid/revokevid.component.css +++ b/resident-ui/src/app/feature/uinservices/revokevid/revokevid.component.css @@ -9,7 +9,6 @@ ul, li{ background: #FAF8F8 0% 0% no-repeat padding-box; box-shadow: none; border: 1px solid silver; - background: #FAF8F8 0% 0% no-repeat padding-box; } .mat-card-header-text{ display: flex; @@ -45,7 +44,6 @@ mat-card-subtitle{ } .intro-description { - font: normal normal medium 16px/22px Montserrat Medium; letter-spacing: 0px; color: #505050; } diff --git a/resident-ui/src/app/feature/uinservices/revokevid/revokevid.component.html b/resident-ui/src/app/feature/uinservices/revokevid/revokevid.component.html index 43b614ec..b0d6b845 100644 --- a/resident-ui/src/app/feature/uinservices/revokevid/revokevid.component.html +++ b/resident-ui/src/app/feature/uinservices/revokevid/revokevid.component.html @@ -32,7 +32,7 @@

{{langJSON[p - {{list.vid}}    + {{list.vid}}    {{list.maskedVid}}   remove_red_eye @@ -61,7 +61,7 @@

{{langJSON[p NA -     +     delete diff --git a/resident-ui/src/app/feature/uinservices/revokevid/revokevid.component.ts b/resident-ui/src/app/feature/uinservices/revokevid/revokevid.component.ts index bbacb501..baf0d7b2 100644 --- a/resident-ui/src/app/feature/uinservices/revokevid/revokevid.component.ts +++ b/resident-ui/src/app/feature/uinservices/revokevid/revokevid.component.ts @@ -296,7 +296,7 @@ export class RevokevidComponent implements OnInit, OnDestroy { revokeVIDBtn(vidValue: any,vidType:any){ this.showDeleteMessage(vidType) this.newVidValue = vidValue - this.newVidType - vidType + this.newVidType = vidType } revokeVID(vidValue: any) { diff --git a/resident-ui/src/app/feature/uinservices/sharewithpartner/sharewithpartner.component.css b/resident-ui/src/app/feature/uinservices/sharewithpartner/sharewithpartner.component.css index 6ad8cc6a..9184f840 100644 --- a/resident-ui/src/app/feature/uinservices/sharewithpartner/sharewithpartner.component.css +++ b/resident-ui/src/app/feature/uinservices/sharewithpartner/sharewithpartner.component.css @@ -34,7 +34,6 @@ .success-msg-description { text-align: left; - font: normal normal medium 14px/22px Poppins; letter-spacing: 0px; color: #505050; margin-left: 1.5rem; @@ -43,7 +42,6 @@ } .success-msg-text { - font: normal normal medium 20px/20px Poppins; letter-spacing: 0px; color: #03A64A; font-size: 21px; @@ -56,7 +54,6 @@ .transaction-title { text-align: left; - font: normal normal medium 22px/24px Montserrat SemiBold; letter-spacing: 0px; color: #505050; margin-bottom: 0px; @@ -84,7 +81,6 @@ } .intro-description { - font: normal normal medium 16px/22px Montserrat Medium; letter-spacing: 0px; color: #505050; } diff --git a/resident-ui/src/app/feature/uinservices/sharewithpartner/sharewithpartner.component.html b/resident-ui/src/app/feature/uinservices/sharewithpartner/sharewithpartner.component.html index 61e027a2..5ac58125 100644 --- a/resident-ui/src/app/feature/uinservices/sharewithpartner/sharewithpartner.component.html +++ b/resident-ui/src/app/feature/uinservices/sharewithpartner/sharewithpartner.component.html @@ -117,7 +117,7 @@

{{'sharew (input)="getpurpose($event)" (blur)="getpurpose($event)" (focus)="captureVirtualKeyboard(search, 0)" #keyboardRef> - keyboard + keyboard {{'sharewithpartner.TotalCharacters' diff --git a/resident-ui/src/app/feature/uinservices/sharewithpartner/sharewithpartner.component.ts b/resident-ui/src/app/feature/uinservices/sharewithpartner/sharewithpartner.component.ts index 7e333658..34e70ca5 100644 --- a/resident-ui/src/app/feature/uinservices/sharewithpartner/sharewithpartner.component.ts +++ b/resident-ui/src/app/feature/uinservices/sharewithpartner/sharewithpartner.component.ts @@ -318,7 +318,7 @@ export class SharewithpartnerComponent implements OnInit, OnDestroy { if (item.value === type['value']) { return item['checked'] = !item['checked'] } else { - return item['checked'] = item['checked'] + return item['checked'] } }) } diff --git a/resident-ui/src/app/feature/uinservices/trackservicerequest/trackservicerequest.component.html b/resident-ui/src/app/feature/uinservices/trackservicerequest/trackservicerequest.component.html index 82870b13..aecca117 100644 --- a/resident-ui/src/app/feature/uinservices/trackservicerequest/trackservicerequest.component.html +++ b/resident-ui/src/app/feature/uinservices/trackservicerequest/trackservicerequest.component.html @@ -30,7 +30,7 @@ #keyboardRef type="number" placeholder="{{'trackservicerequest.searchPlaceholder' | translate}}" /> - keyboard + keyboard     

@@ -141,14 +141,14 @@
diff --git a/resident-ui/src/app/feature/uinservices/updatedemographic/updatedemographic.component.css b/resident-ui/src/app/feature/uinservices/updatedemographic/updatedemographic.component.css index 097e3476..416ae527 100644 --- a/resident-ui/src/app/feature/uinservices/updatedemographic/updatedemographic.component.css +++ b/resident-ui/src/app/feature/uinservices/updatedemographic/updatedemographic.component.css @@ -127,7 +127,6 @@ input.readonly{ align-items: center; border: dashed 1px #03A64A; margin-bottom: 1rem; - display: flex; flex-grow: 1; } .files-list .single-file .preview { @@ -175,7 +174,6 @@ input.readonly{ align-items: center; border: solid 1px #000000; margin-bottom: 1rem; - display: flex; flex-grow: 1; border-radius: 4px; } @@ -536,7 +534,7 @@ input.readonly{ font-size: var(--fs) !important; } -@media screen and ((min-width:950px) and (max-width:1300px)){ +@media screen and (min-width:950px) and (max-width:1300px){ .number-of-attems-main-card{ width: 80%; } @@ -551,7 +549,7 @@ input.readonly{ } } -@media screen and ((min-width:824px) and (max-width:959px)) { +@media screen and (min-width:824px) and (max-width:959px) { .main-contianer{ padding: 0.5rem 3rem 0 3rem; } @@ -579,7 +577,7 @@ input.readonly{ } } -@media screen and ((min-width:550px) and (max-width:820px)) { +@media screen and (min-width:550px) and (max-width:820px) { .contact-update-card{ flex-direction: column; } @@ -624,7 +622,7 @@ input.readonly{ } -@media screen and ((min-width:550px) and (max-width:749px)) { +@media screen and (min-width:550px) and (max-width:749px) { .width-of-input{ width: 36%; } diff --git a/resident-ui/src/app/feature/uinservices/updatedemographic/updatedemographic.component.html b/resident-ui/src/app/feature/uinservices/updatedemographic/updatedemographic.component.html index de34980b..9e0059db 100644 --- a/resident-ui/src/app/feature/uinservices/updatedemographic/updatedemographic.component.html +++ b/resident-ui/src/app/feature/uinservices/updatedemographic/updatedemographic.component.html @@ -185,8 +185,8 @@

{{'updatedem (click)="isUpdatedataInProgress($event, 'textField')" [disabled]="attributeUpdateCountRemainLimit[field.attributeName] === 0" #keyboardRef /> - keyboard + keyboard @@ -244,8 +244,8 @@

{{'updatedem (click)="isUpdatedataInProgress($event, 'textField')" [disabled]="attributeUpdateCountRemainLimit[field.attributeName] === 0" #keyboardRef /> - keyboard + keyboard @@ -424,8 +424,8 @@

{{'updatedem (blur)="captureValue($event, field.attributeName, '', '')" (focus)="captureVirtualKeyboard(field.attributeName + 'value', buildJSONData.proofOfIdentity)" #keyboardRef /> - keyboard + keyboard From f1ad6906ebf4828cd1bbcbf9e38da13663abdb06 Mon Sep 17 00:00:00 2001 From: Jayesh Kharode Date: Tue, 23 Jul 2024 11:07:22 +0530 Subject: [PATCH 7/8] MOSIP-34496 Signed-off-by: Jayesh Kharode --- .../java/io/mosip/testrig/residentui/testcase/UpdateMyData.java | 1 + 1 file changed, 1 insertion(+) diff --git a/uitest-resident/src/main/java/io/mosip/testrig/residentui/testcase/UpdateMyData.java b/uitest-resident/src/main/java/io/mosip/testrig/residentui/testcase/UpdateMyData.java index 2e456000..e221e969 100644 --- a/uitest-resident/src/main/java/io/mosip/testrig/residentui/testcase/UpdateMyData.java +++ b/uitest-resident/src/main/java/io/mosip/testrig/residentui/testcase/UpdateMyData.java @@ -15,6 +15,7 @@ public class UpdateMyData extends BaseClass { public void updateMyDataName() throws Exception { + Commons.wait(ConfigManager.packetUpdateWait()*60000); LoginTest.loginTest(); Commons.clickWebelement( driver, By.id("uinservices/updatedemographic")); Commons.enter( driver, By.id("fullName"+BaseClass.envsupportlang()), Commons.generateRandomAlphabetString()); From ac3f50da22c0e7f244e0d22b0c747552361cf922 Mon Sep 17 00:00:00 2001 From: MadhuMosip Date: Thu, 1 Aug 2024 10:56:05 +0530 Subject: [PATCH 8/8] MOSIP-34908 resovled gender dropdown issue Signed-off-by: MadhuMosip --- .../updatedemographic/updatedemographic.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resident-ui/src/app/feature/uinservices/updatedemographic/updatedemographic.component.ts b/resident-ui/src/app/feature/uinservices/updatedemographic/updatedemographic.component.ts index 995ba931..0dba94e6 100644 --- a/resident-ui/src/app/feature/uinservices/updatedemographic/updatedemographic.component.ts +++ b/resident-ui/src/app/feature/uinservices/updatedemographic/updatedemographic.component.ts @@ -690,7 +690,7 @@ export class UpdatedemographicComponent implements OnInit, OnDestroy { }) let self = this; if (formControlName !== "proofOfIdentity") { - if (event.value.toLowerCase() !== currentValueCode.toLocaleLowerCase()) { + if (event.value !== currentValueCode) { this.isSameData[formControlName] = false; this.userInfoClone[formControlName] = [] this.getUserPerfLang.forEach(item => {