-
Configure firebase project -
GCP_PROJECT_ID
-
Save
prime-service-account.json
in all folders where this file is added in.gitignore
. You can find these directories by executing the command:
grep -i prime-service-account $(find . -name '.gitignore') | awk -F: '{print $1}' | sort | uniq | sed 's/.gitignore//g'
- Create self-signed certificate for nginx with domain as
ocs.dev.ostelco.org
and place them at following location:- In
certs/ocs.dev.ostelco.org
, keepnginx.key
andnginx.cert
. - In
ocsgw/cert
, keepocs.cert
.
- In
cd certs/ocs.dev.ostelco.org
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout ./nginx.key -out ./nginx.crt -subj '/CN=ocs.dev.ostelco.org'
cp nginx.crt ../../ocsgw/cert/ocs.crt
``
* Set Stripe API key as env variable - `STRIPE_API_KEY`. Note: It is the key denoted as "Secret key" that shuld
be set in this env variable.
* Set Stripe Enpoint Secret (for Stripe events) as env variable - `STRIPE_ENDPOINT_SECRET`
If Stripe events is not enabled the `STRIPE_ENDPOINT_SECRET` env variable can be set to a random string.
To enable Stripe events:
1. Configure Stripe by adding Primes endpoint for Stripe events to the Stripe event configuration (webhook).
2. Set the `STRIPE_ENDPOINT_SECRET` to the secret generated by Stripe.
For dev the current configured endpoint for Stripe events is:
https://alvin-api.dev.ostelco.org/stripe/events
Endpoint for prod will be added later.
### Test acceptance-tests
```bash
cd acceptance-tests
gradlew clean build
docker-compose up --build --abort-on-container-exit
Acceptance tests will create few encrypted zip files, these can be verified by running the __testDecryption()
method in ScanInfostore.kt
.
- Download encrypted files created in the root folder of prime docker image.
- Find files by logging into the docker image
docker exec -ti prime bash
. - Copy files from docker image using
docker cp prime:/global_f1a6a509-7998-405c-b186-08983c91b422 .
- Replace the path for the input files in the method & run. It will create a
decrypted.zip
output file. - Manually decompress and verify the contents.