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

feat(mojaloop/#2092): upgrade nodeJS version for core services #501

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
40cba34
feat(mojaloop/#2092): upgrade nodeJS version for core services
mdebarros May 19, 2022
61332ee
chore: fixed readme lint issues + removed unused files
mdebarros May 19, 2022
9faafba
ci: aligned circleci config
mdebarros May 20, 2022
cd13e3c
ci: aligned circleci config
mdebarros May 20, 2022
a11a727
ci: aligned circleci config
mdebarros May 20, 2022
0d58f0a
ci: aligned circleci config
mdebarros May 20, 2022
2ee37ac
chore: aligned circleci config & updated node to LTS
mdebarros May 20, 2022
d254e03
chore: fix for docker build
mdebarros May 20, 2022
d6de7e0
chore: fix for docker build
mdebarros May 20, 2022
744ef09
chore: fix for docker build
mdebarros May 20, 2022
6e560db
chore: fix for docker build
mdebarros May 20, 2022
a8d279d
chore: fixes for ci-cd & audit resolve
mdebarros May 20, 2022
7e6df26
chore: added nvm to ci configs & added secrets/dummy.key to test fold…
mdebarros May 20, 2022
8e8bb45
chore: updates to fix nvm install issues
mdebarros May 20, 2022
773094a
chore: updates to fix nvm install issues
mdebarros May 20, 2022
d43e703
chore: updates to fix nvm install issues
mdebarros May 20, 2022
ca2a5fa
chore: updates to fix nvm install issues
mdebarros May 20, 2022
d72a706
chore: updates to fix nvm install issues
mdebarros May 20, 2022
6f183ef
chore: updates to fix nvm install issues
mdebarros May 20, 2022
ce9649f
chore: updates to fix nvm install issues
mdebarros May 20, 2022
274b1be
chore: updates to fix nvm install issues
mdebarros May 20, 2022
7088a1f
chore: updates to fix nvm install issues
mdebarros May 20, 2022
1735be3
chore: updates to fix nvm install issues
mdebarros May 20, 2022
8b1777b
chore: cleaned up package.json, README & add nvm to CI script
mdebarros May 20, 2022
b9b8899
chore: re-aligned release script in package, and added snapshot script
mdebarros May 20, 2022
253f352
chore: fix lint
mdebarros May 20, 2022
f250fe2
chore: cleaned up package
mdebarros May 20, 2022
ecde6ad
chore: fixed audit resolve & cleaned up package
mdebarros May 20, 2022
367e56c
chore(snapshot): 14.0.0-snapshot.0
mdebarros May 20, 2022
bfad236
chore: updated publish ci jobs dependencies
mdebarros May 20, 2022
90924ab
chore(snapshot): 14.0.0-snapshot.1
mdebarros May 20, 2022
182d142
chore: fix for SLACK_RELEASE_URL on docker publish
mdebarros May 20, 2022
29b0706
chore(snapshot): 14.0.0-snapshot.2
mdebarros May 20, 2022
c214626
chore: dep update
mdebarros May 20, 2022
fb0f240
chore(snapshot): 14.0.0-snapshot.3
mdebarros May 20, 2022
cda02c9
update package-lock
mdebarros May 20, 2022
653a337
chore(snapshot): 14.0.0-snapshot.4
mdebarros May 20, 2022
6d29801
chore(snapshot): 14.0.0-snapshot.5
mdebarros May 20, 2022
43aa934
chore: fixes for SLACK_RELEASE_URL in CI publish jobs
mdebarros May 20, 2022
497d26c
chore(snapshot): 14.0.0-snapshot.6
mdebarros May 20, 2022
ada473f
chore: fixes IMAGE_DIGEST for SLACK_RELEASE_URL & fixed sed processing
mdebarros May 20, 2022
812f2cf
chore(snapshot): 14.0.0-snapshot.7
mdebarros May 20, 2022
58a9ebd
chore: removed --digest flag from IMAGE_DIGEST CI env definition
mdebarros May 20, 2022
39dd734
chore(snapshot): 14.0.0-snapshot.8
mdebarros May 20, 2022
b56cf81
chore: fix for IMAGE_DIGEST CI env definition
mdebarros May 20, 2022
3f885a0
chore(snapshot): 14.0.0-snapshot.9
mdebarros May 20, 2022
48591fe
chore: fix for IMAGE_DIGEST CI env definition
mdebarros May 20, 2022
81ec8ca
chore(snapshot): 14.0.0-snapshot.10
mdebarros May 20, 2022
39eda1b
chore: fix for IMAGE_DIGEST CI env definition
mdebarros May 20, 2022
c1764e3
chore(snapshot): 14.0.0-snapshot.11
mdebarros May 20, 2022
1055001
chore: fix for IMAGE_DIGEST CI env definition
mdebarros May 23, 2022
d838890
chore(snapshot): 14.0.0-snapshot.12
mdebarros May 23, 2022
e6bace6
chore(snapshot): 14.0.0-snapshot.13
mdebarros May 23, 2022
53dca26
chore: fix for IMAGE_DIGEST CI env definition
mdebarros May 23, 2022
3459682
chore(snapshot): 14.0.0-snapshot.14
mdebarros May 23, 2022
304d586
chore(snapshot): 14.0.0-snapshot.15
mdebarros May 23, 2022
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
437 changes: 315 additions & 122 deletions .circleci/config.yml

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions .eslintignore

This file was deleted.

31 changes: 0 additions & 31 deletions .eslintrc

This file was deleted.

7 changes: 7 additions & 0 deletions .ncurc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports = {
// Add a TODO comment indicating the reason for each rejected dependency upgrade added to this list, and what should be done to resolve it (i.e. handle it through a story, etc).
reject: [
// TODO: v6+ (ref: https://github.com/sindresorhus/get-port/releases/tag/v6.0.0) is an ESM library and thus not compatible with CommonJS. Future story needed to resolve.
"get-port"
]
}
5 changes: 0 additions & 5 deletions .ncurc.json

This file was deleted.

2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
12.16.0
16.15.0
6 changes: 3 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ All notable changes to this project will be documented in this file. See [standa

### Features

* **mojaloop/#2704:** core-services support for non-breaking backward api compatibility ([#496](https://github.com/mojaloop/ml-api-adapter/issues/496)) ([5928511](https://github.com/mojaloop/ml-api-adapter/commit/5928511dcb9780d8c9751bc22322e1f0331ef6e3)), closes [mojaloop/#2704](https://github.com/mojaloop/ml-api-adapter/issues/2704) [mojaloop/#2704](https://github.com/mojaloop/ml-api-adapter/issues/2704)
* **mojaloop/#2704:** core-services support for non-breaking backward api compatibility ([#496](https://github.com/mojaloop/ml-api-adapter/issues/496)) ([5928511](https://github.com/mojaloop/ml-api-adapter/commit/5928511dcb9780d8c9751bc22322e1f0331ef6e3)), closes [mojaloop/#2704](https://github.com/mojaloop/project/issues/\2704)

## [12.3.0](https://github.com/mojaloop/ml-api-adapter/compare/v12.2.0...v12.3.0) (2022-02-25)

Expand All @@ -68,7 +68,7 @@ All notable changes to this project will be documented in this file. See [standa

### Features

* **mojaloop/#2608:** injected resource versions config for outbound requests ([#490](https://github.com/mojaloop/ml-api-adapter/issues/490)) ([d46a05b](https://github.com/mojaloop/ml-api-adapter/commit/d46a05ba3d0573ad84beaca60667b1aa1d4b0445)), closes [mojaloop/#2608](https://github.com/mojaloop/ml-api-adapter/issues/2608)
* **mojaloop/#2608:** injected resource versions config for outbound requests ([#490](https://github.com/mojaloop/ml-api-adapter/issues/490)) ([d46a05b](https://github.com/mojaloop/ml-api-adapter/commit/d46a05ba3d0573ad84beaca60667b1aa1d4b0445)), closes [mojaloop/#2608](https://github.com/mojaloop/project/issues/\2608)

## [12.0.0](https://github.com/mojaloop/ml-api-adapter/compare/v11.2.0...v12.0.0) (2021-11-11)

Expand All @@ -80,4 +80,4 @@ All notable changes to this project will be documented in this file. See [standa
### Bug Fixes

* **#2557:** error notification to payer fsp, header for source having wrong value ([#488](https://github.com/mojaloop/ml-api-adapter/issues/488)) ([42f079f](https://github.com/mojaloop/ml-api-adapter/commit/42f079f10ab30588b9403c5fcfca5f26364701a3)), closes [#2557](https://github.com/mojaloop/ml-api-adapter/issues/2557)
* **mojaloop/#2536:** fspiop api version negotiation not handled by transfers service ([#487](https://github.com/mojaloop/ml-api-adapter/issues/487)) ([c4d6b45](https://github.com/mojaloop/ml-api-adapter/commit/c4d6b45605606f06cde0a4cbeb76a9470c76c23b)), closes [mojaloop/#2536](https://github.com/mojaloop/ml-api-adapter/issues/2536) [mojaloop/#2536](https://github.com/mojaloop/ml-api-adapter/issues/2536)
* **mojaloop/#2536:** fspiop api version negotiation not handled by transfers service ([#487](https://github.com/mojaloop/ml-api-adapter/issues/487)) ([c4d6b45](https://github.com/mojaloop/ml-api-adapter/commit/c4d6b45605606f06cde0a4cbeb76a9470c76c23b)), closes [mojaloop/#2536](https://github.com/mojaloop/project/issues/\2536)
28 changes: 14 additions & 14 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
FROM node:12.16.1-alpine as builder
FROM node:16.15.0-alpine as builder
USER root

WORKDIR /opt/ml-api-adapter
WORKDIR /opt/app

RUN apk --no-cache add git
RUN apk add --no-cache -t build-dependencies make gcc g++ python libtool libressl-dev openssl-dev autoconf automake \
RUN apk add --no-cache -t build-dependencies make gcc g++ python3 libtool libressl-dev openssl-dev autoconf automake \
&& cd $(npm root -g)/npm \
&& npm config set unsafe-perm true \
&& npm install -g node-gyp

COPY package.json package-lock.json* /opt/ml-api-adapter/
COPY package.json package-lock.json* /opt/app/

RUN npm install
RUN npm ci

COPY src /opt/ml-api-adapter/src
COPY config /opt/ml-api-adapter/config
COPY secrets /opt/ml-api-adapter/secrets
COPY src /opt/app/src
COPY config /opt/app/config

FROM node:12.16.0-alpine
FROM node:16.15.0-alpine

WORKDIR /opt/ml-api-adapter
WORKDIR /opt/app
# Create empty log file & link stdout to the application log file
RUN mkdir ./logs && touch ./logs/combined.log
RUN ln -sf /dev/stdout ./logs/combined.log

# Create a non-root user: ml-user
RUN adduser -D ml-user
USER ml-user
RUN adduser -D app-user
USER app-user

COPY --chown=ml-user --from=builder /opt/ml-api-adapter .
COPY --chown=app-user --from=builder /opt/app .
RUN npm prune --production

EXPOSE 3000
CMD ["node", "src/api/index.js"]

CMD ["npm", "start"]
20 changes: 11 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,28 @@ The ml api adapter is a series of services that facilitate clearing and settleme

The following documentation represents the services, APIs and endpoints responsible for various ledger functions.


## Contents:
## Contents

- [ml-api-adapter](#ml-api-adapter)
- [Contents:](#contents)
- [Contents](#contents)
- [Deployment](#deployment)
- [Mac users and standard Python:](#mac-users-and-standard-python)
- [Mac users and standard Python](#mac-users-and-standard-python)
- [Configuration](#configuration)
- [Environment variables](#environment-variables)
- [API](#api)
- [Logging](#logging)
- [Tests](#tests)
- [Unit Tests](#unit-tests)
- [Integration Tests](#integration-tests)
- [Auditing Dependencies](#auditing-dependencies)
- [Container Scans](#container-scans)

## Deployment

See the [Onboarding guide](Onboarding.md) for running the service locally.

#### Mac users and standard Python:
### Mac users and standard Python

There is a need to have proper version of python 3, elsewhere `npm install` command will fail. By default, on your Mac, you have python 2.7.* installed, you need to have fresh 3.* version.

```bash
Expand All @@ -47,21 +49,19 @@ For `~/.zshrc`
echo 'export PATH="/usr/local/opt/python/libexec/bin:$PATH"' >> ~/.zshrc
```


## Configuration

### Environment variables

The ml api adapter has many options that can be configured through environment variables.

| Environment variable | Description | Example values |
| -------------------- | ----------- | ------ |


## API

For endpoint documentation, see the [API documentation](API.md).


## Logging

Logs are sent to standard output by default.
Expand Down Expand Up @@ -95,11 +95,13 @@ npm run test:int
We use `npm-audit-resolver` along with `npm audit` to check dependencies for node vulnerabilities, and keep track of resolved dependencies with an `audit-resolve.json` file.

To start a new resolution process, run:

```bash
npm run audit:resolve
```

You can then check to see if the CI will pass based on the current dependencies with:

```bash
npm run audit:check
```
Expand All @@ -113,6 +115,6 @@ As part of our CI/CD process, we use anchore-cli to scan our built docker contai
If you find your release builds are failing, refer to the [container scanning](https://github.com/mojaloop/ci-config#container-scanning) in our shared Mojaloop CI config repo. There is a good chance you simply need to update the `mojaloop-policy-generator.js` file and re-run the circleci workflow.

For more information on anchore and anchore-cli, refer to:

- [Anchore CLI](https://github.com/anchore/anchore-cli)
- [Circle Orb Registry](https://circleci.com/orbs/registry/orb/anchore/anchore-engine)

Loading