forked from jsquad-consulting/openbank-jee
-
Notifications
You must be signed in to change notification settings - Fork 0
/
openbank_setup_prod.sh
executable file
·104 lines (79 loc) · 6.32 KB
/
openbank_setup_prod.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
#!/bin/bash
if [ -z "$WILDFLY_HOME" ]; then
. ./configuration/properties_prod.properties;
export jboss_admin_user=$(java -cp ~/.m2/repository/org/jasypt/jasypt/1.9.3/jasypt-1.9.3.jar \
org.jasypt.intf.cli.JasyptPBEStringDecryptionCLI \
input="$jboss_admin_user" password=$MASTER_KEY algorithm=PBEWithMD5AndDES | tail -n3 | awk 'NF')
export jboss_admin_password=$(java -cp ~/.m2/repository/org/jasypt/jasypt/1.9.3/jasypt-1.9.3.jar \
org.jasypt.intf.cli.JasyptPBEStringDecryptionCLI \
input="$jboss_admin_password" password=$MASTER_KEY algorithm=PBEWithMD5AndDES | tail -n3 | awk 'NF')
export jboss_admin_group_user=$(java -cp ~/.m2/repository/org/jasypt/jasypt/1.9.3/jasypt-1.9.3.jar \
org.jasypt.intf.cli.JasyptPBEStringDecryptionCLI \
input="$jboss_admin_group_user" password=$MASTER_KEY algorithm=PBEWithMD5AndDES | tail -n3 | awk 'NF')
export jboss_admin_group_password=$(java -cp ~/.m2/repository/org/jasypt/jasypt/1.9.3/jasypt-1.9.3.jar \
org.jasypt.intf.cli.JasyptPBEStringDecryptionCLI \
input="$jboss_admin_group_password" password=$MASTER_KEY algorithm=PBEWithMD5AndDES | tail -n3 | awk 'NF')
export jboss_customer_group_user=$(java -cp ~/.m2/repository/org/jasypt/jasypt/1.9.3/jasypt-1.9.3.jar \
org.jasypt.intf.cli.JasyptPBEStringDecryptionCLI \
input="$jboss_customer_group_user" password=$MASTER_KEY algorithm=PBEWithMD5AndDES | tail -n3 | awk 'NF')
export jboss_customer_group_password=$(java -cp ~/.m2/repository/org/jasypt/jasypt/1.9.3/jasypt-1.9.3.jar \
org.jasypt.intf.cli.JasyptPBEStringDecryptionCLI \
input="$jboss_customer_group_password" password=$MASTER_KEY algorithm=PBEWithMD5AndDES | tail -n3 | awk 'NF')
export ROOT_USER=$(java -cp ~/.m2/repository/org/jasypt/jasypt/1.9.3/jasypt-1.9.3.jar \
org.jasypt.intf.cli.JasyptPBEStringDecryptionCLI \
input="$openbank_datasource_user_encrypted" password=$MASTER_KEY algorithm=PBEWithMD5AndDES | tail -n3 | awk 'NF')
export ROOT_PASSWORD=$(java -cp ~/.m2/repository/org/jasypt/jasypt/1.9.3/jasypt-1.9.3.jar \
org.jasypt.intf.cli.JasyptPBEStringDecryptionCLI \
input="$openbank_datasource_password_encrypted" password=$MASTER_KEY algorithm=PBEWithMD5AndDES | tail -n3 | awk 'NF')
export OB_USER=$(java -cp ~/.m2/repository/org/jasypt/jasypt/1.9.3/jasypt-1.9.3.jar \
org.jasypt.intf.cli.JasyptPBEStringDecryptionCLI \
input="$openbank_datasource_obuser_encrypted" password=$MASTER_KEY algorithm=PBEWithMD5AndDES | tail -n3 | awk 'NF')
export OB_PASSWORD=$(java -cp ~/.m2/repository/org/jasypt/jasypt/1.9.3/jasypt-1.9.3.jar \
org.jasypt.intf.cli.JasyptPBEStringDecryptionCLI \
input="$openbank_datasource_obpassword_encrypted" password=$MASTER_KEY algorithm=PBEWithMD5AndDES | tail -n3 | awk 'NF')
else
. $WILDFLY_HOME/scripts/properties.properties;
export jboss_admin_user=$(java -cp $WILDFLY_HOME/scripts/repository/org/jasypt/jasypt/1.9.3/jasypt-1.9.3.jar \
org.jasypt.intf.cli.JasyptPBEStringDecryptionCLI \
input="$jboss_admin_user" password=$MASTER_KEY algorithm=PBEWithMD5AndDES | tail -n3 | awk 'NF')
export jboss_admin_password=$(java -cp $WILDFLY_HOME/scripts/repository/org/jasypt/jasypt/1.9.3/jasypt-1.9.3.jar \
org.jasypt.intf.cli.JasyptPBEStringDecryptionCLI \
input="$jboss_admin_password" password=$MASTER_KEY algorithm=PBEWithMD5AndDES | tail -n3 | awk 'NF')
export jboss_admin_group_user=$(java -cp $WILDFLY_HOME/scripts/repository/org/jasypt/jasypt/1.9.3/jasypt-1.9.3.jar \
org.jasypt.intf.cli.JasyptPBEStringDecryptionCLI \
input="$jboss_admin_group_user" password=$MASTER_KEY algorithm=PBEWithMD5AndDES | tail -n3 | awk 'NF')
export jboss_admin_group_password=$(java -cp $WILDFLY_HOME/scripts/repository/org/jasypt/jasypt/1.9.3/jasypt-1.9.3.jar \
org.jasypt.intf.cli.JasyptPBEStringDecryptionCLI \
input="$jboss_admin_group_password" password=$MASTER_KEY algorithm=PBEWithMD5AndDES | tail -n3 | awk 'NF')
export jboss_customer_group_user=$(java -cp $WILDFLY_HOME/scripts/repository/org/jasypt/jasypt/1.9.3/jasypt-1.9.3.jar \
org.jasypt.intf.cli.JasyptPBEStringDecryptionCLI \
input="$jboss_customer_group_user" password=$MASTER_KEY algorithm=PBEWithMD5AndDES | tail -n3 | awk 'NF')
export jboss_customer_group_password=$(java -cp $WILDFLY_HOME/scripts/repository/org/jasypt/jasypt/1.9.3/jasypt-1.9.3.jar \
org.jasypt.intf.cli.JasyptPBEStringDecryptionCLI \
input="$jboss_customer_group_password" password=$MASTER_KEY algorithm=PBEWithMD5AndDES | tail -n3 | awk 'NF')
export ROOT_USER=$(java -cp $WILDFLY_HOME/scripts/repository/org/jasypt/jasypt/1.9.3/jasypt-1.9.3.jar \
org.jasypt.intf.cli.JasyptPBEStringDecryptionCLI \
input="$openbank_datasource_user_encrypted" password=$MASTER_KEY algorithm=PBEWithMD5AndDES | tail -n3 | awk 'NF')
export ROOT_PASSWORD=$(java -cp $WILDFLY_HOME/scripts/repository/org/jasypt/jasypt/1.9.3/jasypt-1.9.3.jar \
org.jasypt.intf.cli.JasyptPBEStringDecryptionCLI \
input="$openbank_datasource_password_encrypted" password=$MASTER_KEY algorithm=PBEWithMD5AndDES | tail -n3 | awk 'NF')
export OB_USER=$(java -cp $WILDFLY_HOME/scripts/repository/org/jasypt/jasypt/1.9.3/jasypt-1.9.3.jar \
org.jasypt.intf.cli.JasyptPBEStringDecryptionCLI \
input="$openbank_datasource_obuser_encrypted" password=$MASTER_KEY algorithm=PBEWithMD5AndDES | tail -n3 | awk 'NF')
export OB_PASSWORD=$(java -cp $WILDFLY_HOME/scripts/repository/org/jasypt/jasypt/1.9.3/jasypt-1.9.3.jar \
org.jasypt.intf.cli.JasyptPBEStringDecryptionCLI \
input="$openbank_datasource_obpassword_encrypted" password=$MASTER_KEY algorithm=PBEWithMD5AndDES | tail -n3 | awk 'NF')
fi
export JBOSS_ROOT_USER=$jboss_admin_group_user
export JBOSS_ROOT_PASSWORD=$jboss_admin_group_password
export WEBSERVICE_WSDL_URL="http://localhost:8080/soap-webservice/GetClientService?wsdl"
export WEBSERVICE_QURL="http://jsquad.se/"
export WEBSERVICE_QSERVICE="GetClientWSService"
$WILDFLY_HOME/bin/add-user.sh --silent $jboss_admin_user $jboss_admin_password || true
$WILDFLY_HOME/bin/add-user.sh -a -g admin --silent $jboss_admin_group_user $jboss_admin_group_password || true
$WILDFLY_HOME/bin/add-user.sh -a -g customer --silent $jboss_customer_group_user $jboss_customer_group_password || true
cp $WILDFLY_HOME/scripts/standalone.xml $WILDFLY_HOME/standalone/configuration/standalone.xml || true
sed -i 's/<user-name>hidden<\/user-name>/<user-name>'"$ROOT_USER"'<\/user-name>/' \
$WILDFLY_HOME/standalone/configuration/standalone.xml || true
sed -i 's/<password>hidden<\/password>/<password>'"$ROOT_PASSWORD"'<\/password>/' \
$WILDFLY_HOME/standalone/configuration/standalone.xml || true