Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 1370e7f

Browse files
committedOct 2, 2019
Initial commit
0 parents  commit 1370e7f

37 files changed

+11297
-0
lines changed
 

‎Mifos-io-environment-details.xlsx

36.2 KB
Binary file not shown.

‎MifosLab.postman_collection.json

+6,792
Large diffs are not rendered by default.

‎MifosLab.postman_environment.json

+134
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
{
2+
"id": "8506d5fd-3a36-4861-965f-54f17c8e8549",
3+
"name": "MifosLab",
4+
"values": [
5+
{
6+
"key": "HOST_QUOTING_SERVICE",
7+
"value": "http://quoting-service.local",
8+
"enabled": true
9+
},
10+
{
11+
"key": "HOST_CENTRAL_LEDGER",
12+
"value": "central-ledger.local",
13+
"enabled": true
14+
},
15+
{
16+
"key": "fsp_in01tn01_id",
17+
"value": "in01tn01",
18+
"enabled": true
19+
},
20+
{
21+
"key": "HOST_PAYMENT_HUB",
22+
"value": "http://paymenthub.mifos.io:80",
23+
"enabled": true
24+
},
25+
{
26+
"key": "fundsInPrepareTransferId",
27+
"value": "fa28728d-8413-4db8-a5aa-1b0d56eb0f64",
28+
"enabled": true
29+
},
30+
{
31+
"key": "fundsInPrepareAmount",
32+
"value": 5000,
33+
"enabled": true
34+
},
35+
{
36+
"key": "PAYMENT_HUB_IN01TN01",
37+
"value": "http://paymenthub.mifos.io:58180/switch",
38+
"enabled": true
39+
},
40+
{
41+
"key": "fsp_in01tn02_id",
42+
"value": "in01tn02",
43+
"enabled": true
44+
},
45+
{
46+
"key": "PAYMENT_HUB_IN01TN02",
47+
"value": "http://paymenthub.mifos.io:58181/switch",
48+
"enabled": true
49+
},
50+
{
51+
"key": "HOST_ACCOUNT_LOOKUP_SERVICE",
52+
"value": "http://account-lookup-service.local",
53+
"enabled": true
54+
},
55+
{
56+
"key": "participant",
57+
"value": "testfsp",
58+
"enabled": true
59+
},
60+
{
61+
"key": "HOST_ACCOUNT_TRANSFER_SERVICE",
62+
"value": "http://ml-api-adapter.local",
63+
"enabled": true
64+
},
65+
{
66+
"key": "fsp_in02tn03_id",
67+
"value": "in02tn03",
68+
"enabled": true
69+
},
70+
{
71+
"key": "fsp_in02tn04_id",
72+
"value": "in02tn04",
73+
"enabled": true
74+
},
75+
{
76+
"key": "PAYMENT_HUB_IN02TN03",
77+
"value": "http://paymenthubcn.mifos.io:58180/switch",
78+
"enabled": true
79+
},
80+
{
81+
"key": "PAYMENT_HUB_IN02TN04",
82+
"value": "http://paymenthubcn.mifos.io:58181/switch",
83+
"enabled": true
84+
},
85+
{
86+
"key": "quoteDate",
87+
"value": "Mon, 30 Sep 2019 15:45:43 GMT",
88+
"enabled": true
89+
},
90+
{
91+
"key": "quoteId",
92+
"value": "76b0ce94-8395-437f-b149-315e6dbe913b",
93+
"enabled": true
94+
},
95+
{
96+
"key": "transactionId",
97+
"value": "f1e73a99-d9a5-4355-89f3-f5ef32bc045b",
98+
"enabled": true
99+
},
100+
{
101+
"key": "transferDate",
102+
"value": "Tue, 01 Oct 2019 20:34:54 GMT",
103+
"enabled": true
104+
},
105+
{
106+
"key": "transferExpiration",
107+
"value": "2019-10-01T20:44:54.276Z",
108+
"enabled": true
109+
},
110+
{
111+
"key": "transfer_ID",
112+
"value": "61c71853-73a5-4373-9116-da575d9f1509",
113+
"enabled": true
114+
},
115+
{
116+
"key": "HOST_ACCOUNT_LOOKUP_ADMIN",
117+
"value": "http://account-lookup-service-admin.local",
118+
"enabled": true
119+
},
120+
{
121+
"key": "MOCK_PATHFINDER_SERVICE",
122+
"value": "http://moja-simulator.local/oracle",
123+
"enabled": true
124+
},
125+
{
126+
"key": "HOST_ALS_ORACLE",
127+
"value": "http://account-oracle.mifos.io:4100",
128+
"enabled": true
129+
}
130+
],
131+
"_postman_variable_scope": "environment",
132+
"_postman_exported_at": "2019-10-02T15:36:23.663Z",
133+
"_postman_exported_using": "Postman/7.7.3"
134+
}

‎account-lookup/.dockerignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules
2+
npm-debug.log

‎account-lookup/Dockerfile

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
FROM node:10
2+
3+
# Create app directory
4+
WORKDIR /usr/src/app
5+
6+
# Install app dependencies
7+
# A wildcard is used to ensure both package.json AND package-lock.json are copied
8+
# where available (npm@5+)
9+
COPY package.json ./
10+
11+
RUN npm install
12+
13+
# Bundle app source
14+
COPY . .
15+
16+
EXPOSE 4100
17+
CMD [ "node", "index.js" ]

‎account-lookup/docker-compose.yml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
#
18+
19+
version: '2'
20+
services:
21+
account-oracle:
22+
build:
23+
context: .
24+
restart: always
25+
ports:
26+
- 4100:4100

‎account-lookup/index.js

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
var express = require("express")
2+
var Participants = require("./participants.js")
3+
var app = express()
4+
var bodyParser = require('body-parser')
5+
6+
app.use(bodyParser.urlencoded({
7+
extended: false
8+
}))
9+
app.use(bodyParser.json())
10+
11+
const part = new Participants();
12+
13+
app.get("/oracle/participants/:type/:id", (req, res, next) => {
14+
const participant = part.getParticipantsByTypeId(req.params.type, req.params.id)
15+
console.log(participant)
16+
res.json(participant)
17+
});
18+
19+
app.post("/oracle/participants/:type/:id", (req, res, next) => {
20+
const newParticipant = part.createParticipantsByTypeAndId(req.params.type, req.params.id, req.body.fspId, req.body.currency, req.body.partySubIdOrType)
21+
res.send(newParticipant)
22+
res.status(201).end()
23+
});
24+
25+
app.put("/oracle/participants/:type/:id", (req, res, next) => {
26+
const participant = part.updateParticipantsByTypeAndId(req.params.type, req.params.id, req.body.fspId, req.body.currency, req.body.partySubIdOrType)
27+
res.json(participant)
28+
});
29+
30+
app.delete("/oracle/participants/:type/:id", (req, res, next) => {
31+
deleteParticipantsByTypeAndId(req.params.type, req.params.id)
32+
res.status(200).end();
33+
});
34+
35+
app.post("/oracle/participants", (req, res, next) => {
36+
// Not implemented
37+
res.status(200).end();
38+
});
39+
40+
app.get("/oracle/requests/:type/:id", (req, res, next) => {
41+
const request = getRequestsByTypeId(req.params.type, req.params.id)
42+
res.json(request)
43+
});
44+
45+
app.get("/oracle/requests/:requestId", (req, res, next) => {
46+
const request = getRequestsById(req.params.requestId)
47+
res.json(request)
48+
});
49+
50+
app.listen(4100, () => {
51+
console.log("Server running on port 4100");
52+
});

‎account-lookup/package-lock.json

+2,868
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎account-lookup/package.json

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"name": "account-lookup",
3+
"version": "1.0.0",
4+
"description": "Mock Account Lookup Utility for Fineract/Mojaloop",
5+
"main": "index.js",
6+
"scripts": {
7+
"start": "index.js",
8+
"dev": "nodemon index.js",
9+
"test": "echo \"Error: no test specified\" && exit 1"
10+
},
11+
"author": "",
12+
"license": "ISC",
13+
"dependencies": {
14+
"body-parser": "^1.19.0",
15+
"express": "^4.17.1",
16+
"node-cache": "^4.2.1"
17+
},
18+
"devDependencies": {
19+
"nodemon": "^1.19.2"
20+
}
21+
}

‎account-lookup/participants.js

+95
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
const NodeCache = require('node-cache')
2+
const participantsCache = new NodeCache()
3+
4+
class Participants {
5+
6+
getParticipantsByTypeId(type, id) {
7+
let idMap = new Map()
8+
let response
9+
if (participantsCache.get(type)) {
10+
idMap = participantsCache.get(type)
11+
if (idMap.get(id)) {
12+
response = idMap.get(id)
13+
} else {
14+
response = []
15+
}
16+
} else {
17+
response = []
18+
}
19+
return response
20+
}
21+
22+
createParticipantsByTypeAndId(type, id, fspId, currency, partySubIdOrType) {
23+
const record = {
24+
partyList: [
25+
{
26+
fspId: fspId,
27+
currency: currency || undefined,
28+
partySubIdOrType: partySubIdOrType || undefined
29+
}
30+
]
31+
}
32+
let idMap = new Map()
33+
if (participantsCache.get(type)) {
34+
idMap = participantsCache.get(type)
35+
if (idMap.get(id)) {
36+
throw new Error(`ID:${id} already exists`)
37+
} else {
38+
idMap.set(id, record)
39+
participantsCache.set(type, idMap)
40+
}
41+
} else {
42+
idMap.set(id, record)
43+
participantsCache.set(type, idMap)
44+
}
45+
46+
return record
47+
}
48+
49+
updateParticipantsByTypeAndId(type, id, fspId, currency, partySubIdOrType) {
50+
let idMap
51+
if (participantsCache.get(type)) {
52+
idMap = participantsCache.get(type)
53+
if (idMap.get(id)) {
54+
const currentRecord = idMap.get(id)
55+
if (fspId && currentRecord.partyList[0].fspId !== fspId) {
56+
currentRecord.partyList[0].fspId = fspId
57+
}
58+
if (currency && currentRecord.partyList[0].currency !== currency) {
59+
currentRecord.partyList[0].currency = currency
60+
}
61+
if (partySubIdOrType && currentRecord.partyList[0].partySubIdOrType !== partySubIdOrType) {
62+
currentRecord.partyList[0].partySubIdOrType = partySubIdOrType
63+
}
64+
idMap.set(id, currentRecord)
65+
participantsCache.set(type, idMap)
66+
} else {
67+
throw new Error(`ID:${id} not found`)
68+
}
69+
} else {
70+
throw new Error(`Type:${type} not found`)
71+
}
72+
}
73+
74+
deleteParticipantsByTypeAndId(type, id) {
75+
let idMap
76+
if (participantsCache.get(type)) {
77+
idMap = participantsCache.get(type)
78+
if (idMap.get(id)) {
79+
idMap.delete(id)
80+
participantsCache.set(type, idMap)
81+
} else {
82+
const errorObject = {
83+
errorCode: 2345,
84+
errorDescription: `ID:${id} not found`
85+
}
86+
histTimerEnd({ success: false, operation: 'deleteParticipants', source: request.headers['fspiop-source'], destination: request.headers['fspiop-destination'] })
87+
return h.response(buildErrorObject(errorObject, [])).code(400)
88+
}
89+
} else {
90+
throw new Error(`Type:${type} not found`)
91+
}
92+
}
93+
}
94+
95+
module.exports = Participants
13.8 KB
Binary file not shown.

‎docs/MifosLab Installation.docx

20.4 KB
Binary file not shown.

‎fineract-cn/base/buildAllBase.sh

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/bin/bash
2+
3+
source ../env.sh
4+
5+
echo ""
6+
echo "Building base libraries..."
7+
echo ""
8+
9+
directories=(
10+
"fineract-cn-crypto"
11+
)
12+
13+
if [ "$CLONE_REPOSITORIES" = "true" ]; then
14+
for i in "${directories[@]}"; do
15+
echo ""
16+
echo "Cloning $i..."
17+
echo ""
18+
git clone https://github.com/apache/$i
19+
done
20+
fi
21+
22+
for i in "${directories[@]}"; do
23+
echo ""
24+
echo "Building $i base library..."
25+
echo ""
26+
cd $i
27+
chmod +x gradlew
28+
./gradlew publishToMavenLocal
29+
cd ..
30+
done

‎fineract-cn/buildAll.sh

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/bin/bash
2+
3+
echo ""
4+
./cleanPackageRepository.sh
5+
echo ""
6+
7+
cd base
8+
./buildAllBase.sh
9+
cd ..
10+
11+
12+
cd core
13+
./buildAllCore.sh
14+
cd ..
15+
16+
cd libraries
17+
./buildAllLib.sh
18+
cd ..
19+
20+
21+
cd services
22+
./buildAllService.sh
23+
cd ..
24+
25+
26+
cd integration-tests
27+
./buildAllTest.sh
28+
cd ..

‎fineract-cn/cleanPackageRepository.sh

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/env bash
2+
3+
echo "Cleaning Fineract CN shared package repository..."
4+
rm -rf $HOME/.m2/repository/org/apache/fineract/cn/
5+
echo "Done."

‎fineract-cn/cloneRepos.sh

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#!/bin/bash
2+
3+
echo ""
4+
echo "Cloning repositories..."
5+
echo ""
6+
7+
directories=(
8+
"fineract-cn-crypto"
9+
"fineract-cn-lang"
10+
"fineract-cn-api"
11+
"fineract-cn-async"
12+
"fineract-cn-cassandra"
13+
"fineract-cn-mariadb"
14+
"fineract-cn-data-jpa"
15+
"fineract-cn-command"
16+
"fineract-cn-test"
17+
"fineract-cn-anubis"
18+
"fineract-cn-identity"
19+
"fineract-cn-permitted-feign-client"
20+
"fineract-cn-provisioner"
21+
"fineract-cn-rhythm"
22+
"fineract-cn-template"
23+
"fineract-cn-office"
24+
"fineract-cn-customer"
25+
"fineract-cn-group"
26+
"fineract-cn-accounting"
27+
"fineract-cn-portfolio"
28+
"fineract-cn-deposit-account-management"
29+
"fineract-cn-cheques"
30+
"fineract-cn-payroll"
31+
"fineract-cn-teller"
32+
"fineract-cn-reporting"
33+
"fineract-cn-notifications"
34+
"fineract-cn-interoperation"
35+
"fineract-cn-default-setup"
36+
"fineract-cn-service-starter"
37+
"fineract-cn-deploy-server"
38+
"fineract-cn-postgreqsql"
39+
)
40+
41+
for i in "${directories[@]}"; do
42+
echo ""
43+
echo "Cloning $i..."
44+
echo ""
45+
git clone https://github.com/apache/$i
46+
done

‎fineract-cn/core/buildAllCore.sh

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#!/bin/bash
2+
3+
source ../env.sh
4+
5+
echo ""
6+
echo "Building core libraries..."
7+
echo ""
8+
9+
directories=(
10+
"fineract-cn-lang"
11+
"fineract-cn-api"
12+
"fineract-cn-async"
13+
"fineract-cn-cassandra"
14+
"fineract-cn-mariadb"
15+
"fineract-cn-postgresql"
16+
"fineract-cn-data-jpa"
17+
"fineract-cn-command"
18+
"fineract-cn-test"
19+
)
20+
21+
if [ "$CLONE_REPOSITORIES" = "true" ]; then
22+
for i in "${directories[@]}"; do
23+
echo ""
24+
echo "Cloning $i..."
25+
echo ""
26+
git clone https://github.com/apache/$i
27+
done
28+
fi
29+
30+
for i in "${directories[@]}"; do
31+
echo ""
32+
echo "Building $i core library..."
33+
echo ""
34+
cd $i
35+
chmod +x gradlew
36+
./gradlew publishToMavenLocal
37+
cd ..
38+
done

‎fineract-cn/deploy.sh

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/usr/bin/env bash
2+
3+
source ./env.sh
4+
5+
if [ "$DEP_PROVISION" = "true" ]; then
6+
echo "-- FULL PROVISON --"
7+
else
8+
echo "-- Migration --"
9+
fi
10+
11+
echo "Is Persistent: $DEP_PERSISTENT"
12+
echo "Eureka will running on http://localhost:8761/"
13+
echo "Starting Provision App ..."
14+
15+
DEPLOY_JAR_FILE='./jars/fineract-cn-deploy-server/deploy-server-0.1.0-BUILD-SNAPSHOT.jar'
16+
JARS_DIR=`pwd`/jars
17+
18+
java -Djarsdir=$JARS_DIR \
19+
-Ddeployserver.persistent=$DEP_PERSISTENT \
20+
-Ddeployserver.provision=$DEP_PROVISION \
21+
-Dcustom.cassandra.contactPoints=$DEP_CASSANDRA_ADDR \
22+
-Dcassandra.cluster.user=$DEP_CASSANDRA_USER \
23+
-Dcassandra.cluster.pwd=$DEP_CASSANDRA_PWD \
24+
-Dcassandra.keyspace=$DEP_CASSANDRA_KEYSPACE \
25+
-Dcustom.mariadb.host=$DEP_MARIADB_HOST \
26+
-Dcustom.mariadb.port=$DEP_MARIADB_PORT \
27+
-Dcustom.mariadb.user=$DEP_MARIADB_USER \
28+
-Dcustom.mariadb.password=$DEP_MARIADB_PASS \
29+
-jar $DEPLOY_JAR_FILE

‎fineract-cn/env.sh

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/usr/bin/env bash
2+
3+
CLONE_REPOSITORIES='true'
4+
DEP_PERSISTENT='true'
5+
DEP_PROVISION='true' # if true then redeploy the full database, if false then only migrations will happen
6+
7+
DEP_CASSANDRA_ADDR='localhost:9042'
8+
DEP_CASSANDRA_USER='cassandra'
9+
DEP_CASSANDRA_PWD='password'
10+
DEP_CASSANDRA_KEYSPACE='seshat'
11+
12+
DEP_MARIADB_HOST='localhost'
13+
DEP_MARIADB_PORT='3306'
14+
DEP_MARIADB_USER='root'
15+
DEP_MARIADB_PASS='mysql'

‎fineract-cn/envServices.sh

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/usr/bin/env bash
2+
3+
EUREKA_CONFIG_PATH=`pwd`/fineract-cn-config
4+
XMX_OPT_EUREKA="512m"
5+
XMX_OPT_SVC="768m"
6+
7+
service_directories=(
8+
"fineract-cn-identity"
9+
"fineract-cn-rhythm"
10+
"fineract-cn-office"
11+
"fineract-cn-customer"
12+
"fineract-cn-accounting"
13+
"fineract-cn-deposit-account-management"
14+
"fineract-cn-interoperation"
15+
)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
#!/bin/bash
2+
deployment_jars="../deployment/jars"
3+
4+
source ../env.sh
5+
6+
echo ""
7+
echo "Building integrations tests..."
8+
echo ""
9+
10+
directories=(
11+
"fineract-cn-default-setup"
12+
"fineract-cn-service-starter"
13+
"fineract-cn-deploy-server"
14+
)
15+
16+
if [ "$CLONE_REPOSITORIES" = "true" ]; then
17+
for i in "${directories[@]}"; do
18+
echo ""
19+
echo "Cloning $i..."
20+
echo ""
21+
git clone https://github.com/apache/$i
22+
done
23+
fi
24+
25+
for i in "${directories[@]}"; do
26+
echo ""
27+
echo "Building $i test ..."
28+
echo ""
29+
cd $i
30+
chmod +x gradlew
31+
./gradlew publishToMavenLocal
32+
cd ..
33+
done
34+
35+
# Eureka and Spring cloud config
36+
service="fineract-cn-deploy-server"
37+
echo ""
38+
echo "Building $service service..."
39+
echo ""
40+
cd $service
41+
chmod +x gradlew
42+
./gradlew build
43+
cd ..
44+
if [ -d "$service/build/libs" ]; then
45+
echo "Copy runnable jar to deployment jars directory..."
46+
if [ ! -d "$deployment_jars/$service" ]; then
47+
mkdir -p $deployment_jars/$service
48+
fi
49+
cp -f $service/build/libs/*.jar $deployment_jars/$service/
50+
fi

‎fineract-cn/libraries/buildAllLib.sh

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/bin/bash
2+
3+
source ../env.sh
4+
5+
echo ""
6+
echo "Building libraries..."
7+
echo ""
8+
9+
directories=(
10+
"fineract-cn-anubis"
11+
)
12+
13+
if [ "$CLONE_REPOSITORIES" = "true" ]; then
14+
for i in "${directories[@]}"; do
15+
echo ""
16+
echo "Cloning $i..."
17+
echo ""
18+
git clone https://github.com/apache/$i
19+
done
20+
fi
21+
22+
for i in "${directories[@]}"; do
23+
echo ""
24+
echo "Building $i library..."
25+
echo ""
26+
cd $i
27+
chmod +x gradlew
28+
./gradlew publishToMavenLocal
29+
cd ..
30+
done
+73
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
#!/usr/bin/env bash
2+
3+
deployment_jars="../deployment/jars"
4+
5+
source ../env.sh
6+
7+
echo ""
8+
echo "Building services..."
9+
echo ""
10+
11+
service_directories=(
12+
"fineract-cn-identity"
13+
"fineract-cn-permitted-feign-client"
14+
"fineract-cn-provisioner"
15+
"fineract-cn-rhythm"
16+
"fineract-cn-template"
17+
"fineract-cn-office"
18+
"fineract-cn-customer"
19+
"fineract-cn-group"
20+
"fineract-cn-accounting"
21+
"fineract-cn-portfolio"
22+
"fineract-cn-deposit-account-management"
23+
"fineract-cn-cheques"
24+
"fineract-cn-payroll"
25+
"fineract-cn-teller"
26+
"fineract-cn-reporting"
27+
"fineract-cn-notifications"
28+
"fineract-cn-interoperation"
29+
)
30+
31+
if [ "$CLONE_REPOSITORIES" = "true" ]; then
32+
for i in "${directories[@]}"; do
33+
echo ""
34+
echo "Cloning $i..."
35+
echo ""
36+
git clone https://github.com/apache/$i
37+
done
38+
fi
39+
40+
for i in "${service_directories[@]}"; do
41+
echo ""
42+
echo "Building $i service..."
43+
echo ""
44+
cd $i
45+
chmod +x gradlew
46+
./gradlew publishToMavenLocal
47+
cd ..
48+
49+
if [ -d "$i/service/build/libs" ]; then
50+
echo "Copy runnable jar to deployment jars directory..."
51+
if [ ! -d "$deployment_jars/$i" ]; then
52+
mkdir -p $deployment_jars/$i
53+
fi
54+
cp -f $i/service/build/libs/*-boot.jar $deployment_jars/$i/
55+
fi
56+
done
57+
58+
# Eureka and Spring cloud config
59+
service="eureka-service"
60+
echo ""
61+
echo "Building $service service..."
62+
echo ""
63+
cd $service
64+
chmod +x gradlew
65+
./gradlew build
66+
cd ..
67+
if [ -d "$service/build/libs" ]; then
68+
echo "Copy runnable jar to deployment jars directory..."
69+
if [ ! -d "$deployment_jars/$service" ]; then
70+
mkdir -p $deployment_jars/$service
71+
fi
72+
cp -f $service/build/libs/*-boot.jar $deployment_jars/$service/
73+
fi

‎fineract-cn/startServices.sh

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#!/usr/bin/env bash
2+
3+
if [ ! -f "envServices.sh" ]; then
4+
echo "Can't start services. envServices.sh not found."
5+
exit 1
6+
fi
7+
8+
if [ -f nohup.out ]; then
9+
backup_date=`date +'%Y-%m-%d'`
10+
mv nohup.out nohup_$backup_date.bak
11+
fi
12+
13+
. envServices.sh
14+
15+
echo "Start Eureka..."
16+
nohup java -Xmx$XMX_OPT_EUREKA \
17+
-Dspring.cloud.config.server.native.searchLocations=file://$EUREKA_CONFIG_PATH \
18+
-jar jars/eureka-service/service-0.1.0-BUILD-SNAPSHOT-boot.jar 2>&1 &
19+
echo "pid: " $!
20+
echo $! > /tmp/fineract-cn-eureka.pid
21+
22+
echo "Waiting for Eureka..."
23+
sleep 30
24+
25+
echo ""
26+
echo "Starting Services..."
27+
for i in "${service_directories[@]}"; do
28+
echo ""
29+
echo "Starting $i service ..."
30+
31+
nohup java -Xmx$XMX_OPT_SVC -jar jars/$i/service-0.1.0-BUILD-SNAPSHOT-boot.jar 2>&1 &
32+
echo $! > /tmp/$i.pid
33+
echo "pid: " $!
34+
done
35+
36+
echo "Done."
37+
echo ""

‎fineract-cn/stopServices.sh

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/usr/bin/env bash
2+
3+
if [ ! -f "envServices.sh" ]; then
4+
echo "Can't start services. envServices.sh not found."
5+
exit 1
6+
fi
7+
8+
. envServices.sh
9+
10+
echo "Stopping Services..."
11+
echo ""
12+
13+
for i in "${service_directories[@]}"; do
14+
echo ""
15+
echo "Stopping $i service ..."
16+
echo ""
17+
18+
kill -9 `cat /tmp/$i.pid`
19+
rm /tmp/$i.pid
20+
done
21+
22+
echo ""
23+
echo "Stopping Eureka service ..."
24+
echo ""
25+
26+
kill -9 `cat /tmp/fineract-cn-eureka.pid`
27+
rm /tmp/fineract-cn-eureka.pid
28+
29+
echo "Done."
30+
echo ""

‎fineract1.x/Dockerfile

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
#
18+
FROM openjdk:8 AS builder
19+
20+
RUN mkdir fineract
21+
COPY . fineract
22+
23+
WORKDIR fineract
24+
ARG mysqlserver=fineractmysql
25+
RUN sed -i "s/localhost/${mysqlserver}/" ./fineract-provider/src/main/resources/sql/migrations/list_db/V1__mifos-platform-shared-tenants.sql
26+
RUN ./gradlew clean war
27+
28+
29+
FROM bitnami/tomcat:7.0.96 as fineract
30+
31+
USER root
32+
ARG mysqlserver=fineractmysql
33+
RUN apt-get update -qq && apt-get install -y wget
34+
ENV JAVA_HOME /opt/bitnami/java
35+
36+
COPY --from=builder /fineract/build/libs/fineract-provider.war /opt/bitnami/tomcat/webapps
37+
38+
#RUN keytool -genkey -keyalg RSA -alias tomcat -keystore /opt/bitnami/tomcat/tomcat.keystore -keypass xyz123 -storepass xyz123 -noprompt -dname "CN=Fineract, OU=Fineract, O=Fineract, L=Unknown, ST=Unknown, C=Unknown"
39+
COPY --from=builder /fineract/docker/mifosio.p12 /opt/bitnami/tomcat
40+
RUN keytool -importkeystore -storepass xyz123 -keypass xyz123 -keystore /opt/bitnami/tomcat/tomcat.keystore -srckeystore /opt/bitnami/tomcat/mifosio.p12 -srcstoretype PKCS12 -srcstorepass xyz123 -alias mifosio
41+
COPY ./docker/server.xml /opt/bitnami/tomcat/conf
42+
RUN sed -i "s/fineractmysql/${mysqlserver}/" /opt/bitnami/tomcat/conf/server.xml
43+
RUN chmod 664 /opt/bitnami/tomcat/conf/server.xml
44+
WORKDIR /opt/bitnami/tomcat/lib
45+
RUN wget http://central.maven.org/maven2/org/drizzle/jdbc/drizzle-jdbc/1.4/drizzle-jdbc-1.4.jar

‎fineract1.x/docker-compose.yml

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
#
18+
19+
version: '2'
20+
services:
21+
fineractmysql:
22+
image: mysql:5.7
23+
volumes:
24+
- ./fineract-db/docker:/docker-entrypoint-initdb.d
25+
- ./fineract-db/data:/var/lib/mysql
26+
restart: always
27+
environment:
28+
MYSQL_ROOT_PASSWORD: mysql
29+
ports:
30+
- "3306:3306"
31+
fineract-server:
32+
build:
33+
context: .
34+
ports:
35+
- 8443:8443
36+
extra_hosts:
37+
- "central-ledger.local:40.114.81.46"
38+
- "forensic-logging-sidecar:40.114.81.46"
39+
- "central-kms.local:40.114.81.46"
40+
- "central-settlement.local:40.114.81.46"
41+
- "central-event-processor.local:40.114.81.46"
42+
- "ml-api-adapter.local:40.114.81.46"
43+
- "email-notifier.local:40.114.81.46"
44+
- "account-lookup-service.local:40.114.81.46"
45+
- "account-lookup-service-admin.local:40.114.81.46"
46+
- "quoting-service.local:40.114.81.46"
47+
- "moja-simulator.local:40.114.81.46"
48+
restart: always
49+
depends_on:
50+
- fineractmysql

‎fineract1.x/docker/mifosio.cabundle

+92
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
-----BEGIN CERTIFICATE-----
2+
MIIGGTCCBAGgAwIBAgIQE31TnKp8MamkM3AZaIR6jTANBgkqhkiG9w0BAQwFADCB
3+
iDELMAkGA1UEBhMCVVMxEzARBgNVBAgTCk5ldyBKZXJzZXkxFDASBgNVBAcTC0pl
4+
cnNleSBDaXR5MR4wHAYDVQQKExVUaGUgVVNFUlRSVVNUIE5ldHdvcmsxLjAsBgNV
5+
BAMTJVVTRVJUcnVzdCBSU0EgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMTgx
6+
MTAyMDAwMDAwWhcNMzAxMjMxMjM1OTU5WjCBlTELMAkGA1UEBhMCR0IxGzAZBgNV
7+
BAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEYMBYGA1UE
8+
ChMPU2VjdGlnbyBMaW1pdGVkMT0wOwYDVQQDEzRTZWN0aWdvIFJTQSBPcmdh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5jJh5VkpTYghdae9C8x49OhgQ=
92+
-----END CERTIFICATE-----

‎fineract1.x/docker/mifosio.crt

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
-----BEGIN CERTIFICATE-----
2+
MIIGvDCCBaSgAwIBAgIQevYp2oS0SRXQ+0YuUr2Q0TANBgkqhkiG9w0BAQsFADCB
3+
lTELMAkGA1UEBhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4G
4+
A1UEBxMHU2FsZm9yZDEYMBYGA1UEChMPU2VjdGlnbyBMaW1pdGVkMT0wOwYDVQQD
5+
EzRTZWN0aWdvIFJTQSBPcmdhbml6YXRpb24gVmFsaWRhdGlvbiBTZWN1cmUgU2Vy
6+
dmVyIENBMB4XDTE5MDkyOTAwMDAwMFoXDTIwMTExMzIzNTk1OVowgawxCzAJBgNV
7+
BAYTAlVTMQ4wDAYDVQQREwU5ODEwNzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4G
8+
A1UEBxMHU2VhdHRsZTEYMBYGA1UECRMPMTU0NiBOVyA1NnRoIFN0MR0wGwYDVQQK
9+
ExRUaGUgTWlmb3MgSW5pdGlhdGl2ZTEZMBcGA1UECxMQTXVsdGktRG9tYWluIFNT
10+
TDESMBAGA1UEAxMJbWlmb3Mub3JnMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB
11+
CgKCAQEA8WoKUTdeysahlNF8/7IegMH74lL95ubw/vjPEzeeZXvHlC+zZejG3MCI
12+
MTDyV6arNuwo2iEWmMc8kgglnVwiKCXkAj+iDQGX1ZxWIfDzogT54LGXhgkq/Zfg
13+
UDXm/0j8g+IPMkQH8sGesWUiHud8ERfL7VjErA6+NrvT4eCK+AJ88Fq5Leux65pe
14+
ORmKww82tLE8THmVe/juCReDfbFP3pdTEtLIvJpP7lC+v2EaCwI4chR3fqx3kVrK
15+
49BRkKlHN8NwkhkidqvTsRhLiS8TVjkKS6ndN6gUXYOZw7gw9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G1hPtnzWztK6bBFP6YTdnQZbpRL
32+
RZTgZNooTBGLW2OyMA0GCSqGSIb3DQEBCwUAA4IBAQBGCmyMgJhIo4WgXrHZqJdG
33+
dnX/r+gf4C4S1hL16bplxCtrVNwd0XAnuMqFGpWLsCs8dOT7ELykMQnTzmJFvylq
34+
ay7fCpKn5lFenKbnYhQ8gWDhlr0kQW6HDDMu+Nn2C8ermiPXu1px9Mh/XaauG56Q
35+
Lk9hCJGeMl8B2una/lm2nqOmKIYnFM/trWuOXe3D+WB7QlkMUUmtfr+YhhEUQRHr
36+
LGXSYUzPX2k2AjoKC8v5abJVzVf9mWiUfIQBK4zPd9klf4Gk/0lK+Xgz/sGzKTxK
37+
JRrSDVFpGU0DOHLQKkx20YQVTJpZZjh+uBAg2Mhfd/+IxhLGEf1VC18cFsJG1SoK
38+
-----END CERTIFICATE-----

‎fineract1.x/docker/mifosio.key

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
-----BEGIN PRIVATE KEY-----
2+
MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDxagpRN17KxqGU
3+
0Xz/sh6AwfviUv3m5vD++M8TN55le8eUL7Nl6MbcwIgxMPJXpqs27CjaIRaYxzyS
4+
CCWdXCIoJeQCP6INAZfVnFYh8POiBPngsZeGCSr9l+BQNeb/SPyD4g8yRAfywZ6x
5+
ZSIe53wRF8vtWMSsDr42u9Ph4Ir4AnzwWrkt67Hrml45GYrDDza0sTxMeZV7+O4J
6+
F4N9sU/el1MS0si8mk/uUL6/YRoLAjhyFHd+rHeRWsrj0FGQqUc3w3CSGSJ2q9Ox
7+
GEuJLxNWOQpLqd03qBRdg5nDuDD1n3nHHMUxi9oGtvXAwuvGc42h5iKDCCqknHrX
8+
ZWl3YGUhAgMBAAECggEAMNZs4+U5rffk9EA0811LQmz70dtMNgv+MPaQnaigyJLz
9+
2wyTVEh1Am+InbrzK7wx4th/ozESazHTFQ/E3EKpPkn8CGBrHg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2eWkh4ezAilkKhM4BfWQkhW2iYBhWb8VyyugE4O
26+
Thoix4wB/GDrEFqkUg68buRtYt2cQtX8KbMaIasJeiYApaQMr53gfvDfQEl77PLn
27+
XgsALRtqvkVInWqYp/vxxdAz
28+
-----END PRIVATE KEY-----

‎fineract1.x/docker/mifosio.p12

7.43 KB
Binary file not shown.

‎fineract1.x/docker/root.crt

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
-----BEGIN CERTIFICATE-----
2+
MIIENjCCAx6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBvMQswCQYDVQQGEwJTRTEU
3+
MBIGA1UEChMLQWRkVHJ1c3QgQUIxJjAkBgNVBAsTHUFkZFRydXN0IEV4dGVybmFs
4+
IFRUUCBOZXR3b3JrMSIwIAYDVQQDExlBZGRUcnVzdCBFeHRlcm5hbCBDQSBSb290
5+
MB4XDTAwMDUzMDEwNDgzOFoXDTIwMDUzMDEwNDgzOFowbzELMAkGA1UEBhMCU0Ux
6+
FDASBgNVBAoTC0FkZFRydXN0IEFCMSYwJAYDVQQLEx1BZGRUcnVzdCBFeHRlcm5h
7+
bCBUVFAgTmV0d29yazEiMCAGA1UEAxMZQWRkVHJ1c3QgRXh0ZXJuYWwgQ0EgUm9v
8+
dDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALf3GjPm8gAELTngTlvt
9+
H7xsD821+iO2zt6bETOXpClMfZOfvUq8k+0DGuOPz+VtUFrWlymUWoCwSXrbLpX9
10+
uMq/NzgtHj6RQa1wVsfwTz/oMp50ysiQVOnGXw94nZpAPA6sYapeFI+eh6FqUNzX
11+
mk6vBbOmcZSccbNQYArHE504B4YCqOmoaSYYkKtMsE8jqzpPhNjfzp/haW+710LX
12+
a0Tkx63ubUFfclpxCDezeWWkWaCUN/cALw3CknLa0Dhy2xSoRcRdKn23tNbE7qzN
13+
E0S3ySvdQwAl+mG5aWpYIxG3pzOPVnVZ9c0p10a3CitlttNCbxWyuHv77+ldU9U0
14+
WicCAwEAAaOB3DCB2TAdBgNVHQ4EFgQUrb2YejS0Jvf6xCZU7wO94CTLVBowCwYD
15+
VR0PBAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wgZkGA1UdIwSBkTCBjoAUrb2YejS0
16+
Jvf6xCZU7wO94CTLVBqhc6RxMG8xCzAJBgNVBAYTAlNFMRQwEgYDVQQKEwtBZGRU
17+
cnVzdCBBQjEmMCQGA1UECxMdQWRkVHJ1c3QgRXh0ZXJuYWwgVFRQIE5ldHdvcmsx
18+
IjAgBgNVBAMTGUFkZFRydXN0IEV4dGVybmFsIENBIFJvb3SCAQEwDQYJKoZIhvcN
19+
AQEFBQADggEBALCb4IUlwtYj4g+WBpKdQZic2YR5gdkeWxQHIzZlj7DYd7usQWxH
20+
YINRsPkyPef89iYTx4AWpb9a/IfPeHmJIZriTAcKhjW88t5RxNKWt9x+Tu5w/Rw5
21+
6wwCURQtjr0W4MHfRnXnJK3s9EK0hZNwEGe6nQY1ShjTK3rMUUKhemPR5ruhxSvC
22+
Nr4TDea9Y355e6cJDUCrat2PisP29owaQgVR1EX1n6diIWgVIEM8med8vSTYqZEX
23+
c4g/VhsxOBi0cQ+azcgOno4uG+GMmIPLHzHxREzGBHNJdmAPx/i9F4BrLunMTA5a
24+
mnkPIAou1Z5jJh5VkpTYghdae9C8x49OhgQ=
25+
-----END CERTIFICATE-----

‎fineract1.x/docker/server.xml

+191
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,191 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
Licensed to the Apache Software Foundation (ASF) under one or more
4+
contributor license agreements. See the NOTICE file distributed with
5+
this work for additional information regarding copyright ownership.
6+
The ASF licenses this file to You under the Apache License, Version 2.0
7+
(the "License"); you may not use this file except in compliance with
8+
the License. You may obtain a copy of the License at
9+
10+
http://www.apache.org/licenses/LICENSE-2.0
11+
12+
Unless required by applicable law or agreed to in writing, software
13+
distributed under the License is distributed on an "AS IS" BASIS,
14+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
See the License for the specific language governing permissions and
16+
limitations under the License.
17+
-->
18+
<!-- Note: A "Server" is not itself a "Container", so you may not
19+
define subcomponents such as "Valves" at this level.
20+
Documentation at /docs/config/server.html
21+
-->
22+
<Server port="8005" shutdown="SHUTDOWN">
23+
<Listener className="org.apache.catalina.startup.VersionLoggerListener" />
24+
<!-- Security listener. Documentation at /docs/config/listeners.html
25+
<Listener className="org.apache.catalina.security.SecurityListener" />
26+
-->
27+
<!--APR library loader. Documentation at /docs/apr.html -->
28+
<Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
29+
<!-- Prevent memory leaks due to use of particular java/javax APIs-->
30+
<Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
31+
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
32+
<Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />
33+
34+
<!-- Global JNDI resources
35+
Documentation at /docs/jndi-resources-howto.html
36+
-->
37+
<GlobalNamingResources>
38+
<!-- Editable user database that can also be used by
39+
UserDatabaseRealm to authenticate users
40+
-->
41+
<Resource type="javax.sql.DataSource"
42+
name="jdbc/mifosplatform-tenants"
43+
factory="org.apache.tomcat.jdbc.pool.DataSourceFactory"
44+
driverClassName="org.drizzle.jdbc.DrizzleDriver"
45+
url="jdbc:mysql:thin://fineractmysql:3306/mifosplatform-tenants"
46+
username="root"
47+
password="mysql"
48+
initialSize="3"
49+
maxActive="10"
50+
maxIdle="6"
51+
minIdle="3"
52+
validationQuery="SELECT 1"
53+
testOnBorrow="true"
54+
testOnReturn="true"
55+
testWhileIdle="true"
56+
timeBetweenEvictionRunsMillis="30000"
57+
minEvictableIdleTimeMillis="60000"
58+
logAbandoned="true"
59+
suspectTimeout="60"
60+
/>
61+
</GlobalNamingResources>
62+
63+
<!-- A "Service" is a collection of one or more "Connectors" that share
64+
a single "Container" Note: A "Service" is not itself a "Container",
65+
so you may not define subcomponents such as "Valves" at this level.
66+
Documentation at /docs/config/service.html
67+
-->
68+
<Service name="Catalina">
69+
70+
<!--The connectors can use a shared executor, you can define one or more named thread pools-->
71+
<!--
72+
<Executor name="tomcatThreadPool" namePrefix="catalina-exec-"
73+
maxThreads="150" minSpareThreads="4"/>
74+
-->
75+
76+
77+
<!-- A "Connector" represents an endpoint by which requests are received
78+
and responses are returned. Documentation at :
79+
Java HTTP Connector: /docs/config/http.html
80+
Java AJP Connector: /docs/config/ajp.html
81+
APR (HTTP/AJP) Connector: /docs/apr.html
82+
Define a non-SSL/TLS HTTP/1.1 Connector on port 8080
83+
-->
84+
<Connector port="8080" protocol="HTTP/1.1"
85+
connectionTimeout="20000"
86+
redirectPort="8443" />
87+
<!-- A "Connector" using the shared thread pool-->
88+
<!--
89+
<Connector executor="tomcatThreadPool"
90+
port="8080" protocol="HTTP/1.1"
91+
connectionTimeout="20000"
92+
redirectPort="8443" />
93+
-->
94+
<!-- Define a SSL/TLS HTTP/1.1 Connector on port 8443
95+
This connector uses the NIO implementation. The default
96+
SSLImplementation will depend on the presence of the APR/native
97+
library and the useOpenSSL attribute of the
98+
AprLifecycleListener.
99+
Either JSSE or OpenSSL style configuration may be used regardless of
100+
the SSLImplementation selected. JSSE style configuration is used below.
101+
-->
102+
<Connector protocol="org.apache.coyote.http11.Http11Protocol"
103+
port="8443" maxThreads="200" scheme="https"
104+
secure="true" SSLEnabled="true"
105+
keystoreFile="/opt/bitnami/tomcat/tomcat.keystore"
106+
keystorePass="xyz123"
107+
clientAuth="false" sslProtocol="TLS"
108+
URIEncoding="UTF-8"
109+
compression="force"
110+
compressableMimeType="text/html,text/xml,text/plain,text/javascript,text/css"/>
111+
<!--
112+
<Connector port="8443" protocol="org.apache.coyote.http11.Http11NioProtocol"
113+
maxThreads="150" SSLEnabled="true">
114+
<SSLHostConfig>
115+
<Certificate certificateKeystoreFile="conf/localhost-rsa.jks"
116+
type="RSA" />
117+
</SSLHostConfig>
118+
</Connector>
119+
-->
120+
<!-- Define a SSL/TLS HTTP/1.1 Connector on port 8443 with HTTP/2
121+
This connector uses the APR/native implementation which always uses
122+
OpenSSL for TLS.
123+
Either JSSE or OpenSSL style configuration may be used. OpenSSL style
124+
configuration is used below.
125+
-->
126+
<!--
127+
<Connector port="8443" protocol="org.apache.coyote.http11.Http11AprProtocol"
128+
maxThreads="150" SSLEnabled="true" >
129+
<UpgradeProtocol className="org.apache.coyote.http2.Http2Protocol" />
130+
<SSLHostConfig>
131+
<Certificate certificateKeyFile="conf/localhost-rsa-key.pem"
132+
certificateFile="conf/localhost-rsa-cert.pem"
133+
certificateChainFile="conf/localhost-rsa-chain.pem"
134+
type="RSA" />
135+
</SSLHostConfig>
136+
</Connector>
137+
-->
138+
139+
<!-- Define an AJP 1.3 Connector on port 8009 -->
140+
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />
141+
142+
143+
<!-- An Engine represents the entry point (within Catalina) that processes
144+
every request. The Engine implementation for Tomcat stand alone
145+
analyzes the HTTP headers included with the request, and passes them
146+
on to the appropriate Host (virtual host).
147+
Documentation at /docs/config/engine.html -->
148+
149+
<!-- You should set jvmRoute to support load-balancing via AJP ie :
150+
<Engine name="Catalina" defaultHost="localhost" jvmRoute="jvm1">
151+
-->
152+
<Engine name="Catalina" defaultHost="localhost">
153+
154+
<!--For clustering, please take a look at documentation at:
155+
/docs/cluster-howto.html (simple how to)
156+
/docs/config/cluster.html (reference documentation) -->
157+
<!--
158+
<Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/>
159+
-->
160+
161+
<!-- Use the LockOutRealm to prevent attempts to guess user passwords
162+
via a brute-force attack -->
163+
<Realm className="org.apache.catalina.realm.LockOutRealm">
164+
<!-- This Realm uses the UserDatabase configured in the global JNDI
165+
resources under the key "UserDatabase". Any edits
166+
that are performed against this UserDatabase are immediately
167+
available for use by the Realm. -->
168+
<Realm className="org.apache.catalina.realm.UserDatabaseRealm"
169+
resourceName="UserDatabase"/>
170+
</Realm>
171+
172+
<Host name="localhost" appBase="webapps"
173+
unpackWARs="true" autoDeploy="true">
174+
175+
<!-- SingleSignOn valve, share authentication between web applications
176+
Documentation at: /docs/config/valve.html -->
177+
<!--
178+
<Valve className="org.apache.catalina.authenticator.SingleSignOn" />
179+
-->
180+
181+
<!-- Access log processes all example.
182+
Documentation at: /docs/config/valve.html
183+
Note: The pattern used is equivalent to using pattern="common" -->
184+
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
185+
prefix="localhost_access_log" suffix=".txt"
186+
pattern="%h %l %u %t &quot;%r&quot; %s %b" />
187+
188+
</Host>
189+
</Engine>
190+
</Service>
191+
</Server>

‎payment-hub/Dockerfile

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
FROM java:8
2+
WORKDIR /
3+
ADD work/payment-hub-1.0.0-SNAPSHOT.jar payment-hub-1.0.0-SNAPSHOT.jar
4+
ADD work/application.yml application.yml
5+
ADD work/jssecacerts /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/security
6+
7+
EXPOSE 80 48888 48889 58080 58180 58181
8+
CMD ["java", "-jar", "payment-hub-1.0.0-SNAPSHOT.jar"]
9+

‎payment-hub/InstallCert.java

+203
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,203 @@
1+
/*
2+
* Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
3+
*
4+
* Redistribution and use in source and binary forms, with or without
5+
* modification, are permitted provided that the following conditions
6+
* are met:
7+
*
8+
* - Redistributions of source code must retain the above copyright
9+
* notice, this list of conditions and the following disclaimer.
10+
*
11+
* - Redistributions in binary form must reproduce the above copyright
12+
* notice, this list of conditions and the following disclaimer in the
13+
* documentation and/or other materials provided with the distribution.
14+
*
15+
* - Neither the name of Sun Microsystems nor the names of its
16+
* contributors may be used to endorse or promote products derived
17+
* from this software without specific prior written permission.
18+
*
19+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
20+
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
21+
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22+
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
23+
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
24+
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
25+
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
26+
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
27+
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28+
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
29+
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30+
*/
31+
/**
32+
* Originally from:
33+
* http://blogs.sun.com/andreas/resource/InstallCert.java
34+
* Use:
35+
* java InstallCert hostname
36+
* Example:
37+
*% java InstallCert ecc.fedora.redhat.com
38+
*/
39+
40+
import javax.net.ssl.*;
41+
import java.io.*;
42+
import java.security.KeyStore;
43+
import java.security.MessageDigest;
44+
import java.security.cert.CertificateException;
45+
import java.security.cert.X509Certificate;
46+
47+
/**
48+
* Class used to add the server's certificate to the KeyStore
49+
* with your trusted certificates.
50+
*/
51+
public class InstallCert {
52+
53+
public static void main(String[] args) throws Exception {
54+
String host;
55+
int port;
56+
char[] passphrase;
57+
if ((args.length == 1) || (args.length == 2)) {
58+
String[] c = args[0].split(":");
59+
host = c[0];
60+
port = (c.length == 1) ? 443 : Integer.parseInt(c[1]);
61+
String p = (args.length == 1) ? "changeit" : args[1];
62+
passphrase = p.toCharArray();
63+
} else {
64+
System.out.println("Usage: java InstallCert <host>[:port] [passphrase]");
65+
return;
66+
}
67+
68+
File file = new File("jssecacerts");
69+
if (file.isFile() == false) {
70+
char SEP = File.separatorChar;
71+
File dir = new File(System.getProperty("java.home") + SEP
72+
+ "lib" + SEP + "security");
73+
file = new File(dir, "jssecacerts");
74+
if (file.isFile() == false) {
75+
file = new File(dir, "cacerts");
76+
}
77+
}
78+
System.out.println("Loading KeyStore " + file + "...");
79+
InputStream in = new FileInputStream(file);
80+
KeyStore ks = KeyStore.getInstance(KeyStore.getDefaultType());
81+
ks.load(in, passphrase);
82+
in.close();
83+
84+
SSLContext context = SSLContext.getInstance("TLS");
85+
TrustManagerFactory tmf =
86+
TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
87+
tmf.init(ks);
88+
X509TrustManager defaultTrustManager = (X509TrustManager) tmf.getTrustManagers()[0];
89+
SavingTrustManager tm = new SavingTrustManager(defaultTrustManager);
90+
context.init(null, new TrustManager[]{tm}, null);
91+
SSLSocketFactory factory = context.getSocketFactory();
92+
93+
System.out.println("Opening connection to " + host + ":" + port + "...");
94+
SSLSocket socket = (SSLSocket) factory.createSocket(host, port);
95+
socket.setSoTimeout(10000);
96+
try {
97+
System.out.println("Starting SSL handshake...");
98+
socket.startHandshake();
99+
socket.close();
100+
System.out.println();
101+
System.out.println("No errors, certificate is already trusted");
102+
} catch (SSLException e) {
103+
System.out.println();
104+
e.printStackTrace(System.out);
105+
}
106+
107+
X509Certificate[] chain = tm.chain;
108+
if (chain == null) {
109+
System.out.println("Could not obtain server certificate chain");
110+
return;
111+
}
112+
113+
BufferedReader reader =
114+
new BufferedReader(new InputStreamReader(System.in));
115+
116+
System.out.println();
117+
System.out.println("Server sent " + chain.length + " certificate(s):");
118+
System.out.println();
119+
MessageDigest sha1 = MessageDigest.getInstance("SHA1");
120+
MessageDigest md5 = MessageDigest.getInstance("MD5");
121+
for (int i = 0; i < chain.length; i++) {
122+
X509Certificate cert = chain[i];
123+
System.out.println
124+
(" " + (i + 1) + " Subject " + cert.getSubjectDN());
125+
System.out.println(" Issuer " + cert.getIssuerDN());
126+
sha1.update(cert.getEncoded());
127+
System.out.println(" sha1 " + toHexString(sha1.digest()));
128+
md5.update(cert.getEncoded());
129+
System.out.println(" md5 " + toHexString(md5.digest()));
130+
System.out.println();
131+
}
132+
133+
System.out.println("Enter certificate to add to trusted keystore or 'q' to quit: [1]");
134+
String line = reader.readLine().trim();
135+
int k;
136+
try {
137+
k = (line.length() == 0) ? 0 : Integer.parseInt(line) - 1;
138+
} catch (NumberFormatException e) {
139+
System.out.println("KeyStore not changed");
140+
return;
141+
}
142+
143+
X509Certificate cert = chain[k];
144+
String alias = host + "-" + (k + 1);
145+
ks.setCertificateEntry(alias, cert);
146+
147+
OutputStream out = new FileOutputStream("jssecacerts");
148+
ks.store(out, passphrase);
149+
out.close();
150+
151+
System.out.println();
152+
System.out.println(cert);
153+
System.out.println();
154+
System.out.println
155+
("Added certificate to keystore 'jssecacerts' using alias '"
156+
+ alias + "'");
157+
}
158+
159+
private static final char[] HEXDIGITS = "0123456789abcdef".toCharArray();
160+
161+
private static String toHexString(byte[] bytes) {
162+
StringBuilder sb = new StringBuilder(bytes.length * 3);
163+
for (int b : bytes) {
164+
b &= 0xff;
165+
sb.append(HEXDIGITS[b >> 4]);
166+
sb.append(HEXDIGITS[b & 15]);
167+
sb.append(' ');
168+
}
169+
return sb.toString();
170+
}
171+
172+
private static class SavingTrustManager implements X509TrustManager {
173+
174+
private final X509TrustManager tm;
175+
private X509Certificate[] chain;
176+
177+
SavingTrustManager(X509TrustManager tm) {
178+
this.tm = tm;
179+
}
180+
181+
public X509Certificate[] getAcceptedIssuers() {
182+
183+
/**
184+
* This change has been done due to the following resolution advised for Java 1.7+
185+
http://infposs.blogspot.kr/2013/06/installcert-and-java-7.html
186+
**/
187+
188+
return new X509Certificate[0];
189+
//throw new UnsupportedOperationException();
190+
}
191+
192+
public void checkClientTrusted(X509Certificate[] chain, String authType)
193+
throws CertificateException {
194+
throw new UnsupportedOperationException();
195+
}
196+
197+
public void checkServerTrusted(X509Certificate[] chain, String authType)
198+
throws CertificateException {
199+
this.chain = chain;
200+
tm.checkServerTrusted(chain, authType);
201+
}
202+
}
203+
}

‎payment-hub/application.yml

+140
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
#
2+
# This Source Code Form is subject to the terms of the Mozilla
3+
# Public License, v. 2.0. If a copy of the MPL was not distributed
4+
# with this file, You can obtain one at
5+
#
6+
# https://mozilla.org/MPL/2.0/.
7+
#
8+
9+
debug: true
10+
11+
spring:
12+
main:
13+
web-application-type: none
14+
15+
# the name of Camel
16+
camel:
17+
springboot:
18+
name: RestCamel
19+
20+
iban-settings:
21+
fsp-instance-id-first-index: 4
22+
fsp-instance-id-length: 4
23+
fsp-tenant-id-first-index: 8
24+
fsp-tenant-id-length: 4
25+
26+
hub-settings:
27+
instance: in01
28+
expiration: 30000
29+
tenants: tn01, tn02
30+
31+
channel-settings:
32+
cors-enabled: true
33+
headers:
34+
- name: tenant
35+
key: X-Tenant-Identifier
36+
operations: #hub -> channel
37+
- name: operation-basic-settings
38+
host: https://fineract.mifos.io
39+
tenants:
40+
- name: tn01
41+
port: 48888
42+
- name: tn02
43+
port: 48889
44+
- name: quotes #post notification
45+
base: interoperation/quotes
46+
- name: transfers #post notification
47+
base: interoperation/transfers
48+
- name: response #put async response
49+
base: interoperation/transactions
50+
bindings: #channel -> hub
51+
- name: binding-basic-settings
52+
host: http://0.0.0.0
53+
port: 80
54+
- name: parties
55+
base: channel/parties
56+
- name: payment #post payment request
57+
base: channel/transactions #/in01/channel/transactions
58+
- name: status #get status by hub id
59+
base: channel/transactions
60+
- name: client-status #get status by client id
61+
base: channel/transactions/client
62+
63+
fsp-settings:
64+
ilp-secret: h4on38bsDjKiat2783gnklgafikmeuu5123kpobb7jm99
65+
auth:
66+
profile: BASIC
67+
encode: NONE
68+
login-class: hu.dpc.rt.psp.dto.fsp.LoginFineractXResponseDTO
69+
headers:
70+
- name: user
71+
key: User
72+
- name: tenant
73+
key: Fineract-Platform-TenantId
74+
operations: #hub -> fsp
75+
- name: operation-basic-settings
76+
user: mifos
77+
password: password
78+
host: https://fineract.mifos.io
79+
port: 8443
80+
- name: auth #login
81+
base: fineract-provider/api/v1/authentication
82+
- name: requests
83+
base: fineract-provider/api/v1/interoperation/requests
84+
- name: parties
85+
base: fineract-provider/api/v1/interoperation/parties
86+
- name: quotes
87+
base: fineract-provider/api/v1/interoperation/quotes
88+
- name: transfers
89+
base: fineract-provider/api/v1/interoperation/transfers
90+
91+
switch-settings:
92+
integration-enabled: true
93+
headers:
94+
- name: source
95+
key: FSPIOP-Source
96+
- name: destination
97+
key: FSPIOP-Destination
98+
operations: #hub -> switch post and put
99+
- name: operation-basic-settings
100+
host: http://account-lookup-service.local
101+
port: 80
102+
- name: participants #post participant registration
103+
base: participants
104+
- name: parties #get, put parties
105+
base: parties
106+
- name: oracles #get, post oracles
107+
host: http://account-lookup-service-admin.local
108+
base: oracles
109+
- name: requests
110+
host: http://ml-api-adapter.local
111+
base: transactionRequests
112+
- name: quotes #post, put quotes
113+
host: http://quoting-service.local
114+
base: quotes
115+
- name: transfers #post, put transfers
116+
host: http://ml-api-adapter.local
117+
base: transfers
118+
bindings: #switch -> hub post and put
119+
- name: binding-basic-settings
120+
host: http://0.0.0.0
121+
tenants:
122+
- name: tn01
123+
port: 58180
124+
- name: tn02
125+
port: 58181
126+
- name: participants
127+
base: switch/participants
128+
- name: parties
129+
base: switch/parties
130+
- name: requests
131+
base: switch/transactionRequests
132+
- name: quotes
133+
base: switch/quotes
134+
- name: transfers
135+
base: switch/transfers
136+
137+
mock-settings:
138+
start-channel-consumers: false
139+
start-switch-consumers: false
140+
start-fsp-consumers: false

‎payment-hub/docker-compose.yml

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
#
18+
19+
version: '2'
20+
services:
21+
payment-hub:
22+
build:
23+
context: .
24+
restart: always
25+
ports:
26+
- 80:80
27+
- 58080:58080
28+
- 58180:58180
29+
- 58181:58181
30+
- 48888:48888
31+
- 48889:48889
32+
extra_hosts:
33+
- "central-ledger.local:40.114.81.46"
34+
- "forensic-logging-sidecar:40.114.81.46"
35+
- "central-kms.local:40.114.81.46"
36+
- "central-settlement.local:40.114.81.46"
37+
- "central-event-processor.local:40.114.81.46"
38+
- "ml-api-adapter.local:40.114.81.46"
39+
- "email-notifier.local:40.114.81.46"
40+
- "account-lookup-service.local:40.114.81.46"
41+
- "account-lookup-service-admin.local:40.114.81.46"
42+
- "quoting-service.local:40.114.81.46"
43+
- "moja-simulator.local:40.114.81.46"

0 commit comments

Comments
 (0)
Please sign in to comment.