Skip to content

Commit 8dce205

Browse files
Package vulnerability audit dec 2024 (#190)
* Updated python docker images to gracefuly stop since they now start in the primary process in a container, through taking over execution of the entrypoint script via a command; * Increased python-multipart pacakge version to avoid vulnerability; * increased eslint's version to remove dependency which has vulnerability; this required upgrading the eslint configuration within rosalution to use the new flat file configuration. It is temporarily tuned to be close to the existing code base linting however, the team will review and revise linting guidelines when we gather soon. * @stylistic/eslint-plugin-js@2.12.1 requires 20.9 & higher; after investigating, in order to avoid the vulnerably also being inside the docker images, need to upgrade to both alpine3.21 & 23.4.; * Linting upgrade for eslint to 9.16 for system tests & some updates to corresponding tests. * Resolved unit test text formatting issue; updated system test package.json to indicate its of type module for JavaScript. * Updated system test with finicky rendering of context menus for test * Upping vite to 6.0.3 to resolve vulnerabilities and update its dependencies that have vulnerabilities * Updated to support attaching genbank .gb files * Forced package resolutions to avoid the vulnerabilities
1 parent ca8a2a0 commit 8dce205

40 files changed

Lines changed: 1255 additions & 1021 deletions

β€Ž.github/workflows/nodejs.ymlβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414

1515
strategy:
1616
matrix:
17-
node-version: [20.8]
17+
node-version: [23.4]
1818

1919
steps:
2020
- uses: actions/checkout@v4

β€ŽCHANGELOG.mdβ€Ž

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,17 @@ using OpenCravat. VCF string provided by Ensembl's API is cached in the MongoDB
1212
Variant annotations were rendering vertically and it was taking too much space.
1313
- Analyses have a version manifest of annotation's dataset, source, and version
1414
- Increased VueJS version to 3.5.12 to use TemplateRef as a feature
15+
- Added support for attaching genbank (.gb) files for supporting evidence attachments
16+
17+
### Development
18+
19+
- Minimum NodeJS version increased to v23.4 to support upgrading package dependencies to avoid reported vulnerabilities
20+
- ESlint upgrade to 9 and migrating configuration to flat file config
1521

1622
### Bugs
1723

1824
- Fixed developer API endpoint so that existing analyses can queue their annotations to be rendered again if desired.
25+
- Backend starts takes over the shell process allowing it to receive SIGTERM for graceful shutdown
1926

2027
## 0.7.0
2128

β€ŽREADME.mdβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ The following pre-requisites are required to be installed in the target *NIX env
5656
deploying and testing Rosalution. Install environment dependencies below using
5757
the respective installation instructions for your target environment.
5858

59-
- [Node.JS 20.8+](https://nodejs.org/en/) & [Classic Yarn](https://classic.yarnpkg.com/en/)
59+
- [Node.JS 23.4+](https://nodejs.org/en/) & [Classic Yarn](https://classic.yarnpkg.com/en/)
6060
- Node.JS recommends managing Node.JS installations with [nvm](https://www.npmjs.com/package/npx) - [install](https://github.com/nvm-sh/nvm#install--update-script)
6161
- Yarn is not included with Node.JS with `nvm`. Run `npm install --global yarn` once Node.JS is installed. - [install](https://classic.yarnpkg.com/en/docs/install)
6262
- [Python 3.11+](https://www.python.org/) - [Install](https://www.python.org/downloads/)

β€Žbackend/Dockerfileβ€Ž

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ WORKDIR /app
44
COPY requirements.txt /app/requirements.txt
55
RUN pip install --no-cache-dir --upgrade -r /app/requirements.txt
66
COPY ./src /app/src
7-
ENTRYPOINT ["/bin/sh", "-c", "uvicorn src.main:app --host 0.0.0.0 --port 8000 --log-level info --reload"]
7+
CMD ["uvicorn", "src.main:app", "--host", "0.0.0.0", "--port", "8000", "--log-level", "info", "--reload"]
88

99
# Production Build Stage
1010
FROM python:3.11-slim-bookworm AS production-stage
@@ -15,4 +15,4 @@ RUN pip install --no-cache-dir -r /app/requirements.txt
1515
COPY ./src /app/src
1616
COPY etc/entrypoint-init.sh /app/entrypoint-init.sh
1717
RUN rm /app/src/routers/dev_router.py
18-
ENTRYPOINT ["/bin/sh", "-c", "uvicorn src.main:app --host 0.0.0.0 --port 8000 --log-level info"]
18+
CMD ["uvicorn", "src.main:app", "--host", "0.0.0.0", "--port", "8000", "--log-level", "info"]

β€Žbackend/etc/entrypoint-init.shβ€Ž

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,6 @@ if [ "$ROSALUTION_ENV" = "production" ]; then
66
DEBUG='-O'
77
fi
88

9-
ROSALUTION_KEY="$(< /dev/urandom tr -dc A-Za-z0-9 | head -c 65)" && export ROSALUTION_KEY && \
10-
python $DEBUG -m uvicorn src.main:app --host 0.0.0.0 --port 8000 --log-level info "$@"
9+
ROSALUTION_KEY="$(< /dev/urandom tr -dc A-Za-z0-9 | head -c 65)" && export ROSALUTION_KEY
10+
11+
exec python $DEBUG -m uvicorn src.main:app --host 0.0.0.0 --port 8000 --log-level info "$@"

β€Žbackend/requirements.txtβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ itsdangerous==2.1.2
55
pymongo==4.6.3
66
jq==1.6.0
77

8-
python-multipart==0.0.7
8+
python-multipart==0.0.18
99
PyJWT[crypto]==2.8.0
1010
bcrypt==4.2.0
1111

β€Ždocker-compose.local-production.ymlβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ services:
5252
environment:
5353
- ROSALUTION_ENV=production
5454
- MONGODB_HOST=rosalution-db
55-
entrypoint: ['/bin/sh', '-c', './entrypoint-init.sh']
55+
command: ['./etc/entrypoint-init.sh']
5656
labels:
5757
- "traefik.enable=true"
5858
- "traefik.docker.network=rosalution-network"

β€Ždocker-compose.staging.ymlβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ services:
2424
- ROSALUTION_ENV=production
2525
- MONGODB_HOST=rosalution-db
2626
- CAS_LOGIN_ENABLE=True
27-
entrypoint: ['/bin/sh', '-c', './entrypoint-init.sh']
27+
command: ['./etc/entrypoint-init.sh']
2828
deploy:
2929
labels:
3030
- "traefik.enable=true"

β€Ždocker-compose.ymlβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ services:
5757
- ./backend:/app
5858
environment:
5959
- MONGODB_HOST=rosalution-db
60-
entrypoint: ['/bin/sh', '-c', './etc/entrypoint-init.sh --reload']
60+
command: ['./etc/entrypoint-init.sh', '--reload']
6161
networks:
6262
- rosalution-network
6363
labels:
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
FROM mongo:5.0.9 as production-stage
1+
FROM mongo:5.0.9 AS production-stage
22
COPY --chmod=0777 ./initial-seed/initial-db-seed.sh /docker-entrypoint-initdb.d/initial-db-seed.sh
33
COPY ./initial-seed/ /tmp/fixtures/initial-seed/

0 commit comments

Comments
Β (0)