Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MOSIP-32901] Merging changes from release back to develop #951

Closed
wants to merge 112 commits into from
Closed
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
112 commits
Select commit Hold shift + click to select a range
15d8242
[DSD-6382] updated chart version in helm and deployment scripts
ckm007 Oct 4, 2024
1013b06
[DSD-6382] updated changes as reported during dev round
ckm007 Oct 4, 2024
4fa1c67
Merge pull request #932 from mosip/DSD-6382
ckm007 Oct 4, 2024
576292d
[DSD-6382] adding fixes for issues reported during dev round
ckm007 Oct 4, 2024
7a751a0
[DSD-6382] removing swp file added by mistake
ckm007 Oct 4, 2024
20e7552
Merge pull request #933 from mosip/DSD-6382
ckm007 Oct 4, 2024
db488a1
[DSD-6382] increased initialDelaySeconds in esignet helm
ckm007 Oct 4, 2024
3c3e3ad
[DSD-6382] updated healthcheck configurations
ckm007 Oct 4, 2024
8d373b4
[DSD-6382] removed unused clusterrolebinding
ckm007 Oct 4, 2024
e2c2b5c
Merge pull request #935 from mosip/DSD-6382
ckm007 Oct 4, 2024
e0461c8
Updated readme, pom.xml. Added NoOpKeyBinder default implementation
ase-101 Oct 6, 2024
80a65e8
Merge pull request #936 from ase-101/release-1.5.x
ckm007 Oct 6, 2024
f0640fa
[DSD-6382] updated correct onboarder chart version
ckm007 Oct 7, 2024
8f4233e
[DSD-6382] removed not required enabled params from realm attribute
ckm007 Oct 7, 2024
68fd2fb
[DSD-6382] added misp key update part
ckm007 Oct 7, 2024
8b96f25
[DSD-6382] updated message
ckm007 Oct 7, 2024
1ae3f87
Merge pull request #938 from ckm007/release-1.5.x
ckm007 Oct 7, 2024
d60c127
MOSIP-36454 - fixed build issue by adding suite setup in runner file …
mohanachandran-s Oct 9, 2024
264c510
[DSD-6382] added captcha secret update part to initialisation script …
ckm007 Oct 15, 2024
0120dcf
[ES-842] Updated the stoplight (#944) (#945)
ase-101 Oct 15, 2024
2988440
ES-842 Using mulitple profiles to avoid duplicate configuration
ase-101 Oct 15, 2024
b82cffd
Merge pull request #957 from ase-101/release-1.5.x
ckm007 Oct 16, 2024
e1d9b82
Delete .github/workflows/codeql-analysis.yml (#965)
rajapandi1234 Oct 18, 2024
0c670bf
ES-1807 & updated postman collection (#964)
ase-101 Oct 18, 2024
dbeb9d7
[DSD-6445] (#974)
ckm007 Oct 23, 2024
3391008
[DSD-6445] Updated esignet-global-cm.yaml.sample
abhishek8shankar Oct 25, 2024
acb8ca7
[DSD-6445] Updated esignet-global-cm.yaml.sample (#977)
abhishek8shankar Oct 28, 2024
317ddfd
Merge branch 'mosip:release-1.5.x' into release-1.5.x
abhishek8shankar Oct 28, 2024
267d23e
[DSD-6445] Updated install.sh scripts for softhsm .
abhishek8shankar Oct 28, 2024
933ce96
Merge pull request #981 from abhishek8shankar/release-1.5.x
ckm007 Oct 28, 2024
d33db4f
[DSD-6445]Updated application-default.properties
Rakshitha650 Oct 30, 2024
7ff5b1c
Merge pull request #982 from Rakshitha650/patch-1
ckm007 Oct 30, 2024
4e7e59a
[ES-1892] [ES-1358] i18n translation changes and minor UI changes. (#…
gk-4VII Nov 4, 2024
6a2503f
ES-842
ase-101 Nov 3, 2024
3acb544
Merge pull request #985 from ase-101/release-1.5.x
ckm007 Nov 6, 2024
b4d66f7
MOSIP-37214
nandhu-kumar Nov 6, 2024
bdea2d4
Merge pull request #989 from nandhu-kumar/release-1.5.x
ckm007 Nov 6, 2024
f5d82e8
MOSIP-37214
nandhu-kumar Nov 11, 2024
e5dcf40
Merge remote-tracking branch 'upstream/release-1.5.x' into release-1.5.x
nandhu-kumar Nov 11, 2024
ce928f1
MOSIP-37214
nandhu-kumar Nov 11, 2024
bc6e8f8
Merge pull request #994 from nandhu-kumar/release-1.5.x
ckm007 Nov 11, 2024
f7bff95
MOSIP-37214 | Syncing changes from develop to Release 1.5.x
nandhu-kumar Nov 12, 2024
18ad7d7
Merge pull request #996 from nandhu-kumar/release-1.5.x
ckm007 Nov 13, 2024
580c7c7
[MOSIP-37447] restructured postgres
bhumi46 Nov 13, 2024
d83bc1f
[MOSIP-37447] restructured postgres
bhumi46 Nov 13, 2024
a1b823b
[MOSIP-37447] restructured postgres
bhumi46 Nov 13, 2024
85ffb1e
[MOSIP-37447] restructured postgres
bhumi46 Nov 13, 2024
35fbef0
MOSIP-37214
nandhu-kumar Nov 13, 2024
47547a2
Merge remote-tracking branch 'upstream/release-1.5.x' into release-1.5.x
nandhu-kumar Nov 13, 2024
c4ce474
MOSIP-37214
nandhu-kumar Nov 13, 2024
6ecfe85
[MOSIP-37447] restructured postgres
bhumi46 Nov 13, 2024
4c1d0c0
MOSIP-37214
nandhu-kumar Nov 13, 2024
0ce6bdd
MOSIP-37214
nandhu-kumar Nov 14, 2024
6891001
MOSIP-37476 - updated the docker file for jdk version
mohanachandran-s Nov 14, 2024
e186562
MOSIP-37214
nandhu-kumar Nov 14, 2024
159390b
MOSIP-37214
nandhu-kumar Nov 14, 2024
147ad04
Merge pull request #1002 from mohanachandran-s/patch-2
ckm007 Nov 14, 2024
6cbb5b4
Merge remote-tracking branch 'upstream/release-1.5.x' into release-1.5.x
nandhu-kumar Nov 14, 2024
29ab4fc
[DSD-6445] Updated install.sh for opting plugings
abhishek8shankar Nov 14, 2024
bb78dd7
MOSIP-37214
nandhu-kumar Nov 14, 2024
4b9cb29
[MOSIP-37447] added nfs helm changes for apitestrig
bhumi46 Nov 14, 2024
09d83d2
MOSIP-37214
nandhu-kumar Nov 15, 2024
1c841ed
Merge pull request #998 from nandhu-kumar/release-1.5.x
ckm007 Nov 15, 2024
6d5c3cf
Merge pull request #1004 from abhishek8shankar/release-1.5.x
ckm007 Nov 15, 2024
7e63ff6
[ES-1553] Hidden the language dropdown in the claim-details screen. (…
gk-4VII Nov 18, 2024
a71d5ef
ES-1929 (#1007)
ase-101 Nov 18, 2024
25f3b48
[MOSIP-37447] restructured postgres
bhumi46 Nov 19, 2024
4e69170
[MOSIP-37447] restructured postgres
bhumi46 Nov 19, 2024
f442fb7
[MOSIP-37447] restructured postgres
bhumi46 Nov 20, 2024
a51b904
[MOSIP-37447] restructured postgres
bhumi46 Nov 20, 2024
a4d0f56
[MOSIP-37447] restructured postgres
bhumi46 Nov 25, 2024
f8d1c21
Merge pull request #997 from bhumi46/release-1.5.x
ckm007 Nov 27, 2024
81e5a59
MOSIP-37793 - Updated the Readme file
mohanachandran-s Nov 28, 2024
08d9be8
Merge pull request #1019 from mohanachandran-s/patch-2
ckm007 Nov 29, 2024
32df861
[MOSIP-37815] Added Unique Config as User input (#1017)
VSIVAKALYAN Nov 29, 2024
409fc2e
[DSD-6742] updated/restructured install scripts for fixes
ckm007 Nov 29, 2024
54980e2
Merge pull request #1022 from shubham17998/release-1.5.x
ckm007 Nov 29, 2024
63bf6a4
Merge pull request #1020 from VSIVAKALYAN/release-1.5.x
ckm007 Nov 29, 2024
ca8db25
MOSIP-36485
nandhu-kumar Dec 4, 2024
fbe159f
MOSIP-36485
nandhu-kumar Dec 4, 2024
a93b85d
ES-1987
nandhu-kumar Dec 4, 2024
d11f9a8
Merge pull request #1025 from nandhu-kumar/release-1.5.x
ckm007 Dec 5, 2024
0435933
MOSIP-36485 (#1028)
nandhu-kumar Dec 5, 2024
cefe1a8
MOSIP-36485 | changes validation message (#1031)
nandhu-kumar Dec 6, 2024
2781a9b
ES-1856 updated Readme file as per review comments (#1023)
ase-101 Dec 10, 2024
053bf8d
[DSD-6742] Updated values.yaml
shubham17998 Dec 11, 2024
9a02050
[DSD-6742] Updated install.sh replaced global cm as esignet-global
shubham17998 Dec 11, 2024
85f1cd8
[DSD-6742] Updated apitestrig README
ckm007 Dec 11, 2024
15724e8
[DSD-6742] Updated Env variables in values.yaml
ckm007 Dec 11, 2024
74aba18
Merge pull request #1039 from shubham17998/release-1.5.x
ckm007 Dec 11, 2024
bb62027
[DSD-6742] removed unwanted Env variables in values.yaml
ckm007 Dec 11, 2024
cc8cc32
Merge pull request #1041 from shubham17998/release-1.5.x
ckm007 Dec 11, 2024
500f8d8
[DSD-6742] updated README
ckm007 Dec 12, 2024
ec90140
ES-842 (#1046)
ase-101 Dec 12, 2024
d51fea5
Merge pull request #1043 from shubham17998/release-1.5.x
ckm007 Dec 12, 2024
8a72bdf
Updated postman collection & docker compose (#1048)
ase-101 Dec 13, 2024
9d8c405
ES-842 Update esignet-openapi.yaml
ase-101 Dec 16, 2024
02d18f8
Merge pull request #1050 from mosip/ase-101-patch-4
ckm007 Dec 16, 2024
7aab66a
[DSD-6888]Update push-trigger.yml to check results for release. (#1051)
Mahesh-Binayak Dec 17, 2024
835a3f3
[DSD-6888]Update push-trigger.yml reverting changes for sonar test (#…
Mahesh-Binayak Dec 17, 2024
ef0ae97
Update README.md
Rakshitha650 Dec 17, 2024
0978270
Merge pull request #1053 from Rakshitha650/patch-2
ckm007 Dec 17, 2024
c1ed8e5
Update Dockerfile (#1057)
Prafulrakhade Dec 18, 2024
06e992d
MOSIP-36485 | Updated the commons released version in pom.xml (#1056)
nandhu-kumar Dec 18, 2024
dec7af1
[MOSIP-36849]updated README.md (#1055)
Rakshitha650 Dec 18, 2024
639edbe
[DSD-6742] Updated Install script for istio (#1063)
shubham17998 Dec 20, 2024
7a3a9ae
[DSD-6742] Updated esignet-global-cm.yaml.sample
shubham17998 Dec 20, 2024
024ea4d
Merge pull request #1068 from shubham17998/release-1.5.x
ckm007 Dec 20, 2024
1ac9cce
Update Dockerfile
ase-101 Dec 20, 2024
5382b72
Merge pull request #1071 from ase-101/release-1.5.x
ckm007 Dec 23, 2024
39ef8e0
[DSD-6742] Updated init_values.yaml
shubham17998 Dec 24, 2024
71be1ee
Merge pull request #1077 from shubham17998/release-1.5.x
ckm007 Dec 24, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import java.util.Map;
import java.util.Properties;

import org.apache.log4j.Level;
import org.apache.log4j.Logger;
import org.bouncycastle.openssl.jcajce.JcaPEMWriter;
import org.testng.TestNG;
Expand All @@ -24,10 +25,9 @@
import io.mosip.testrig.apirig.dataprovider.BiometricDataProvider;
import io.mosip.testrig.apirig.dbaccess.DBManager;
import io.mosip.testrig.apirig.utils.AdminTestUtil;
import io.mosip.testrig.apirig.utils.AuthTestsUtil;
import io.mosip.testrig.apirig.utils.CertificateGenerationUtil;
import io.mosip.testrig.apirig.utils.CertsUtil;
import io.mosip.testrig.apirig.utils.ConfigManager;
import io.mosip.testrig.apirig.utils.EncryptionDecrptionUtil;
import io.mosip.testrig.apirig.utils.EsignetConfigManager;
import io.mosip.testrig.apirig.utils.EsignetUtil;
import io.mosip.testrig.apirig.utils.GlobalConstants;
Expand Down Expand Up @@ -60,7 +60,6 @@ public class MosipTestRunner {
public static void main(String[] arg) {

try {

Map<String, String> envMap = System.getenv();
LOGGER.info("** ------------- Get ALL ENV varibales --------------------------------------------- **");
for (String envName : envMap.keySet()) {
Expand All @@ -74,8 +73,9 @@ public static void main(String[] arg) {
} else {
ExtractResource.copyCommonResources();
}
AdminTestUtil.init();
EsignetConfigManager.init();
BaseTestCase.suiteSetup(getRunType());
suiteSetup(getRunType());
SkipTestCaseHandler.loadTestcaseToBeSkippedList("testCaseSkippedList.txt");
setLogLevels();

Expand Down Expand Up @@ -127,14 +127,41 @@ public static void main(String[] arg) {
} catch (Exception e) {
LOGGER.error("Exception " + e.getMessage());
}

OTPListener.bTerminate = true;

HealthChecker.bTerminate = true;

System.exit(0);

}

public static void suiteSetup(String runType) {
if (EsignetConfigManager.IsDebugEnabled())
LOGGER.setLevel(Level.ALL);
else
LOGGER.info("Test Framework for Mosip api Initialized");
BaseTestCase.initialize();
LOGGER.info("Done with BeforeSuite and test case setup! su TEST EXECUTION!\n\n");

if (!runType.equalsIgnoreCase("JAR")) {
AuthTestsUtil.removeOldMosipTempTestResource();
}
BaseTestCase.currentModule = GlobalConstants.ESIGNET;
BaseTestCase.certsForModule = GlobalConstants.ESIGNET;
DBManager.executeDBQueries(EsignetConfigManager.getKMDbUrl(), EsignetConfigManager.getKMDbUser(),
EsignetConfigManager.getKMDbPass(), EsignetConfigManager.getKMDbSchema(),
getGlobalResourcePath() + "/" + "config/keyManagerDataDeleteQueriesForEsignet.txt");
DBManager.executeDBQueries(EsignetConfigManager.getIdaDbUrl(), EsignetConfigManager.getIdaDbUser(),
EsignetConfigManager.getPMSDbPass(), EsignetConfigManager.getIdaDbSchema(),
getGlobalResourcePath() + "/" + "config/idaDeleteQueriesForEsignet.txt");
DBManager.executeDBQueries(EsignetConfigManager.getMASTERDbUrl(), EsignetConfigManager.getMasterDbUser(),
EsignetConfigManager.getMasterDbPass(), EsignetConfigManager.getMasterDbSchema(),
getGlobalResourcePath() + "/" + "config/masterDataDeleteQueriesForEsignet.txt");
BaseTestCase.setReportName(GlobalConstants.ESIGNET);
AdminTestUtil.initiateesignetTest();
BaseTestCase.otpListener = new OTPListener();
BaseTestCase.otpListener.run();
}

private static void setLogLevels() {
AdminTestUtil.setLogLevel();
Expand All @@ -155,7 +182,6 @@ public static void startTestRunner() {
File homeDir = null;
TestNG runner = new TestNG();
List<String> suitefiles = new ArrayList<>();
List<String> modulesToRun = BaseTestCase.listOfModules;
String os = System.getProperty("os.name");
LOGGER.info(os);
if (getRunType().contains("IDE") || os.toLowerCase().contains("windows")) {
Expand All @@ -167,12 +193,8 @@ public static void startTestRunner() {
LOGGER.info("ELSE :" + homeDir);
}
for (File file : homeDir.listFiles()) {
for (String fileName : modulesToRun) {
if (file.getName().toLowerCase().contains(fileName)) {
suitefiles.add(file.getAbsolutePath());
} else if (fileName.equals("all") && file.getName().toLowerCase().contains("testng")) {
suitefiles.add(file.getAbsolutePath());
}
if (file.getName().toLowerCase().contains(GlobalConstants.ESIGNET)) {
suitefiles.add(file.getAbsolutePath());
}
}
runner.setTestSuites(suitefiles);
Expand All @@ -181,25 +203,6 @@ public static void startTestRunner() {
runner.run();
}

/**
* The method to return class loader resource path
*
* @return String
* @throws IOException
*/
/*
* public static String getGlobalResourcePath() { if
* (checkRunType().equalsIgnoreCase("JAR")) { return new
* File(jarUrl).getParentFile().getAbsolutePath() +
* "/MosipTestResource/MosipTemporaryTestResource"; } else if
* (checkRunType().equalsIgnoreCase("IDE")) { String path = new
* File(MosipTestRunner.class.getClassLoader().getResource("").getPath()).
* getAbsolutePath() + "/MosipTestResource/MosipTemporaryTestResource"; if
* (path.contains(GlobalConstants.TESTCLASSES)) path =
* path.replace(GlobalConstants.TESTCLASSES, "classes"); return path; } return
* "Global Resource File Path Not Found"; }
*/

public static String getGlobalResourcePath() {
if (cachedPath != null) {
return cachedPath;
Expand All @@ -225,15 +228,6 @@ public static String getGlobalResourcePath() {

public static String getResourcePath() {
return getGlobalResourcePath();
// if (checkRunType().equalsIgnoreCase("JAR")) {
// return new File(jarUrl).getParentFile().getAbsolutePath();
// } else if (checkRunType().equalsIgnoreCase("IDE")) {
// String path = new File(MosipTestRunner.class.getClassLoader().getResource("").getPath()).getAbsolutePath();
// if (path.contains(GlobalConstants.TESTCLASSES))
// path = path.replace(GlobalConstants.TESTCLASSES, "classes");
// return path;
// }
// return "Global Resource File Path Not Found";
}

public static String generatePulicKey() {
Expand Down Expand Up @@ -334,4 +328,4 @@ public static String getRunType() {
return "IDE";
}

}
}
1 change: 1 addition & 0 deletions deploy/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
esignet-global-cm.yaml
10 changes: 7 additions & 3 deletions deploy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,13 @@
* __Logging__ : Setup logging as per [steps](https://github.com/mosip/k8s-infra/tree/v1.2.0.2/logging).
* __Monitoring__ : Setup monitoring consisting elasticsearch, kibana, grafana using [steps](https://github.com/mosip/k8s-infra/tree/v1.2.0.2/monitoring).
### Install Pre-requisites
```
./install-prereq.sh
```
* `esignet-global` configmap: For eSignet K8's env, `esignet-global` configmap in `esignet` namespace contains Domain related information. Follow below steps to add domain details for `esignet-global` configmap.
* Copy `esignet-global-cm.yaml.sample` to `esignet-global-cm.yaml`.
* Update the domain names in `esignet-global-cm.yaml` correctly for your environment.
* Install pre-requisites
```
./install-prereq.sh
```
### Initialise pre-requisites
* Update values file for postgres init [here](postgres/init_values.yaml).
* Execute `initialise-prereq.sh` script to initialise postgres and keycloak and set esignet captcha.
Expand Down
21 changes: 18 additions & 3 deletions deploy/captcha/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,25 @@ fi
NS=captcha
CHART_VERSION=0.1.0-develop

echo Create $NS namespace
kubectl create ns $NS

function installing_captcha() {

while true; do
read -p "Do you want to continue installing captcha validation service? (y/n): " ans
if [ "$ans" = "Y" ] || [ "$ans" = "y" ]; then
break
elif [ "$ans" = "N" ] || [ "$ans" = "n" ]; then
exit 1
else
echo "Please provide a correct option (Y or N)"
fi
done

NS=captcha
CHART_VERSION=0.1.0-develop

echo Create $NS namespace
kubectl create ns $NS || true

echo Istio label

kubectl label ns $NS istio-injection=disabled --overwrite
Expand Down
15 changes: 8 additions & 7 deletions deploy/config-server/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,18 @@ if [ $# -ge 1 ] ; then
export KUBECONFIG=$1
fi

# 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

NS=esignet
CHART_VERSION=0.0.1-develop

echo Create $NS namespace
kubectl create ns $NS
# 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
kubectl create ns $NS || true

echo Istio label
kubectl label ns $NS istio-injection=enabled --overwrite
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ metadata:
namespace: esignet
data:
mosip-version: develop
imstallation-domain: sandbox.xyz.net
ase-101 marked this conversation as resolved.
Show resolved Hide resolved
mosip-api-host: api.sandbox.xyz.net
mosip-iam-external-host: iam.sandbox.xyz.net
mosip-api-internal-host: api-internal.sandbox.xyz.net
Expand Down
25 changes: 20 additions & 5 deletions deploy/esignet/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,31 @@ if [ $# -ge 1 ] ; then
export KUBECONFIG=$1
fi

NS=esignet
CHART_VERSION=0.0.1-test

ESIGNET_HOST=$(kubectl -n esignet get cm esignet-global -o jsonpath={.data.mosip-esignet-host})

echo Create $NS namespace
kubectl create ns $NS

function installing_esignet() {

while true; do
read -p "Do you want to continue installing esignet services? (y/n): " ans
if [ "$ans" = "Y" ] || [ "$ans" = "y" ]; then
break
elif [ "$ans" = "N" ] || [ "$ans" = "n" ]; then
exit 1
else
echo "Please provide a correct option (Y or N)"
fi
done


NS=esignet
CHART_VERSION=1.5.0-develop

ESIGNET_HOST=$(kubectl -n esignet get cm esignet-global -o jsonpath={.data.mosip-esignet-host})

echo Create $NS namespace
kubectl create ns $NS || true

echo Istio label
helm repo add mosip https://mosip.github.io/mosip-helm
helm repo update
Expand Down
44 changes: 36 additions & 8 deletions deploy/initialise-prereq.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,44 @@ function initialising_Prerequisites() {
prompt_for_initialisation "$module" "${prompts[$module]}"
done

ESIGNET_HOST=$(kubectl -n esignet get cm esignet-global -o jsonpath={.data.mosip-esignet-host})
echo Please enter the recaptcha admin site key for domain $ESIGNET_HOST
read ESITE_KEY
echo Please enter the recaptcha admin secret key for domain $ESIGNET_HOST
read ESECRET_KEY
while true; do
read -p "Do you want to continue configuring Captcha secrets for esignet ? (y/n) : " ans
if [ $ans='Y' ] || [ $ans='y' ]; then
echo "Please create captcha site and secret key for esignet domain: esignet.sandbox.xyz.net"

echo Setting up captcha secrets
kubectl -n $NS create secret generic esignet-captcha --from-literal=esignet-captcha-site-key=$ESITE_KEY --from-literal=esignet-captcha-secret-key=$ESECRET_KEY --dry-run=client -o yaml | kubectl apply -f -
ESIGNET_HOST=$(kubectl -n esignet get cm esignet-global -o jsonpath={.data.mosip-esignet-host})
echo Please enter the recaptcha admin site key for domain $ESIGNET_HOST
read ESITE_KEY
echo Please enter the recaptcha admin secret key for domain $ESIGNET_HOST
read ESECRET_KEY

echo Setting up dummy values for esignet misp license key
echo "Setting up captcha secrets"
kubectl -n $NS create secret generic esignet-captcha --from-literal=esignet-captcha-site-key=$ESITE_KEY --from-literal=esignet-captcha-secret-key=$ESECRET_KEY --dry-run=client -o yaml | kubectl apply -f -
echo "Captcha secrets for esignet configured sucessfully"

./copy_cm_func.sh secret esignet-captcha $NS captcha

# Check if the second environment variable exists
ENV_VAR_EXISTS=$(kubectl -n captcha get deployment captcha -o jsonpath="{.spec.template.spec.containers[0].env[?(@.name=='MOSIP_CAPTCHA_SECRET_ESIGNET')].name}")

if [[ -z "$ENV_VAR_EXISTS" ]]; then
# If the environment variable does not exist, add it
echo "Environment variable 'MOSIP_CAPTCHA_SECRET_ESIGNET' does not exist. Adding it..."
kubectl patch deployment -n captcha captcha --type='json' -p='[{"op": "add", "path": "/spec/template/spec/containers/0/env/-", "value": {"name": "MOSIP_CAPTCHA_SECRET_ESIGNET", "valueFrom": {"secretKeyRef": {"name": "esignet-captcha", "key": "esignet-captcha-secret-key"}}}}]'
else
# If the environment variable exists, update it
echo "Environment variable 'MOSIP_CAPTCHA_SECRET_ESIGNET' exists. Updating it..."
kubectl patch deployment -n captcha captcha --type='json' -p='[{"op": "replace", "path": "/spec/template/spec/containers/0/env[?(@.name==\"MOSIP_CAPTCHA_SECRET_ESIGNET\")]", "value": {"name": "MOSIP_CAPTCHA_SECRET_ESIGNET", "valueFrom": {"secretKeyRef": {"name": "esignet-captcha", "key": "esignet-captcha-secret-key"}}}}]'
fi

elif [ "$ans" = "N" ] || [ "$ans" = "n" ]; then
exit 1
else
echo "Please provide a correct option (Y or N)"
fi
done

echo "Setting up dummy values for esignet misp license key"
kubectl -n $NS create secret generic esignet-misp-onboarder-key --from-literal=mosip-esignet-misp-key='' --dry-run=client -o yaml | kubectl apply -f -

echo "All prerequisite services initialised successfully."
Expand Down
31 changes: 9 additions & 22 deletions deploy/install-prereq.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ if [ $# -ge 1 ]; then
fi

ROOT_DIR=$(pwd)
SOFTHSM_NS=softhsm
SOFTHSM_CHART_VERSION=12.0.1

function prompt_for_deployment() {
local module_name=$1
Expand All @@ -30,36 +28,25 @@ function prompt_for_deployment() {

function installing_prerequisites() {

helm repo add mosip https://mosip.github.io/mosip-helm
helm repo update

# Create esignet, softhsm namespace if not present
kubectl create ns esignet || true
kubectl create ns "$SOFTHSM_NS" || true

# Apply esignet-global config-map
kubectl apply -f esignet-global-cm.yaml

echo "Istio label"
kubectl label ns "$SOFTHSM_NS" istio-injection=enabled --overwrite

# Deploy Softhsm for Esignet.
echo "Installing Softhsm for esignet"
helm -n "$SOFTHSM_NS" install esignet-softhsm mosip/softhsm -f softhsm-values.yaml --version "$SOFTHSM_CHART_VERSION" --wait
echo "Installed Softhsm for esignet"
echo "Creating esignet-global configmap in esignet namespace"
kubectl -n esignet apply -f esignet-global-cm.yaml

declare -a modules=("istio-gateway" "postgres" "keycloak" "kafka" "redis")
declare -a modules=("istio-gateway" "postgres" "keycloak" "kafka" "redis" "softhsm")
declare -A prompts=(
["keycloak"]="Do you want to deploy keycloak in the keycloak namespace?"
["kafka"]="Do you want to deploy Kafka in the kafka namespace?"
["softhsm"]="Do you want to install softhsm for esignet service in softhsm namespace? Opt "n" in case it already exists in Softhsm namespace: "
["keycloak"]="Do you want to deploy keycloak in the keycloak namespace? Opt "n" in case it already exists in keycloak namespace : "
["kafka"]="Do you want to deploy Kafka in the kafka namespace? Opt "n" in case it already exists in kafka namespace : "
)

echo "Installing prerequisite services"

for module in "${modules[@]}"; do
if [ "$module" == "istio-gateway" ] || [ "$module" == "redis" ] || [ "$module" == "postgres" ]; then
if [ "$module" == "istio-gateway" ] || [ "$module" == "postgres" ] || [ "$module" == "redis" ]; then
cd "$ROOT_DIR/$module"
./install.sh
elif [[ -n "${prompts[$module]}" ]]; then
prompt_for_deployment "$module" "${prompts[$module]}"
fi
done
echo "All prerequisite services deployed successfully."
Expand Down
2 changes: 0 additions & 2 deletions deploy/keycloak/keycloak-init-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ keycloak:
"actionTokenGeneratedByUserLifespan": 300
"passwordPolicy": "length(8)"
"resetPasswordAllowed": 'True'
"registrationAllowed": 'True'
"verifyEmail": 'True'
"bruteForceProtected": 'True'
"permanentLockout": 'False'
"maxFailureWaitSeconds": 900
Expand Down
Loading
Loading