fix(security): For bun, enforce frozen lockfile. For yarn, strongly suggest using frozen lockfile. (#5508)
* Updated docs for security information.
This commit is contained in:
parent
b517944cb5
commit
1009c60911
@ -371,7 +371,7 @@ jobs:
|
|||||||
name: Export Display Variable
|
name: Export Display Variable
|
||||||
command: export DISPLAY=:99
|
command: export DISPLAY=:99
|
||||||
- cypress/install:
|
- cypress/install:
|
||||||
install-command: yarn install --no-save
|
install-command: yarn install --frozen-lockfile --no-save
|
||||||
- cypress/run-tests:
|
- cypress/run-tests:
|
||||||
cypress-command: |
|
cypress-command: |
|
||||||
npx wait-on@latest http://localhost:3000 && cd platform/app && npx cypress run --record --parallel
|
npx wait-on@latest http://localhost:3000 && cd platform/app && npx cypress run --record --parallel
|
||||||
|
|||||||
@ -19,7 +19,7 @@ echo 'Web application built and copied'
|
|||||||
|
|
||||||
# Build && Move Docusaurus Output (for the docs themselves)
|
# Build && Move Docusaurus Output (for the docs themselves)
|
||||||
cd platform/docs
|
cd platform/docs
|
||||||
yarn install
|
yarn install --frozen-lockfile
|
||||||
yarn run build
|
yarn run build
|
||||||
cd ../..
|
cd ../..
|
||||||
mkdir -p ./.netlify/www/docs
|
mkdir -p ./.netlify/www/docs
|
||||||
|
|||||||
11
README.md
11
README.md
@ -147,7 +147,14 @@ Here is a schematic representation of our development workflow:
|
|||||||
3. Navigate to the cloned project's directory
|
3. Navigate to the cloned project's directory
|
||||||
4. Add this repo as a `remote` named `upstream`
|
4. Add this repo as a `remote` named `upstream`
|
||||||
- `git remote add upstream https://github.com/OHIF/Viewers.git`
|
- `git remote add upstream https://github.com/OHIF/Viewers.git`
|
||||||
5. `yarn install` to restore dependencies and link projects
|
5. `yarn install --frozen-lockfile` to restore dependencies and link projects
|
||||||
|
|
||||||
|
:::danger
|
||||||
|
In general run `yarn install` with the `--frozen-lockfile` flag to help avoid
|
||||||
|
supply chain attacks by enforcing reproducible dependencies. That is, if the
|
||||||
|
`yarn.lock` file is clean and does NOT reference compromised packages, then
|
||||||
|
no compromised packages should land on your machine by using this flag.
|
||||||
|
:::
|
||||||
|
|
||||||
#### To Develop
|
#### To Develop
|
||||||
|
|
||||||
@ -158,7 +165,7 @@ _From this repository's root directory:_
|
|||||||
yarn config set workspaces-experimental true
|
yarn config set workspaces-experimental true
|
||||||
|
|
||||||
# Restore dependencies
|
# Restore dependencies
|
||||||
yarn install
|
yarn install --frozen-lockfile
|
||||||
```
|
```
|
||||||
|
|
||||||
## Commands
|
## Commands
|
||||||
|
|||||||
2
bunfig.toml
Normal file
2
bunfig.toml
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
[install]
|
||||||
|
frozenLockfile = true
|
||||||
2
bunfig.update-lockfile.toml
Normal file
2
bunfig.update-lockfile.toml
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
[install]
|
||||||
|
frozenLockfile = false
|
||||||
@ -45,7 +45,10 @@
|
|||||||
"dev:dcm4chee": "lerna run dev:dcm4chee --stream",
|
"dev:dcm4chee": "lerna run dev:dcm4chee --stream",
|
||||||
"dev:static": "lerna run dev:static --stream",
|
"dev:static": "lerna run dev:static --stream",
|
||||||
"orthanc:up": "docker compose -f platform/app/.recipes/Nginx-Orthanc/docker-compose.yml up",
|
"orthanc:up": "docker compose -f platform/app/.recipes/Nginx-Orthanc/docker-compose.yml up",
|
||||||
"install:dev": "cp -f yarn.lock addOns/yarn.lock && cd addOns && yarn install --modules-folder ../node_modules",
|
"install:dev": "cp -f yarn.lock addOns/yarn.lock && cd addOns && yarn install --frozen-lockfile --modules-folder ../node_modules",
|
||||||
|
"install:update-lockfile": "yarn install && bun install --config=./bunfig.update-lockfile.toml",
|
||||||
|
"install:yarn:frozen-lockfile": "yarn install --frozen-lockfile",
|
||||||
|
"audit": "yarn audit || bun audit",
|
||||||
"preinstall": "node preinstall.js",
|
"preinstall": "node preinstall.js",
|
||||||
"start": "yarn run dev",
|
"start": "yarn run dev",
|
||||||
"test": "yarn run test:unit",
|
"test": "yarn run test:unit",
|
||||||
|
|||||||
@ -13,7 +13,7 @@ COPY ./ /usr/src/app/
|
|||||||
|
|
||||||
# Install node dependencies
|
# Install node dependencies
|
||||||
RUN yarn config set workspaces-experimental true
|
RUN yarn config set workspaces-experimental true
|
||||||
RUN yarn install
|
RUN yarn install --frozen-lockfile
|
||||||
|
|
||||||
# Set the environment for the build
|
# Set the environment for the build
|
||||||
ENV APP_CONFIG=config/docker-nginx-dcm4chee-keycloak.js
|
ENV APP_CONFIG=config/docker-nginx-dcm4chee-keycloak.js
|
||||||
|
|||||||
@ -16,7 +16,7 @@ COPY ./ /usr/src/app/
|
|||||||
|
|
||||||
# Install node dependencies
|
# Install node dependencies
|
||||||
RUN yarn config set workspaces-experimental true
|
RUN yarn config set workspaces-experimental true
|
||||||
RUN yarn install
|
RUN yarn install --frozen-lockfile
|
||||||
|
|
||||||
# Copy the rest of the application code
|
# Copy the rest of the application code
|
||||||
|
|
||||||
|
|||||||
@ -19,7 +19,7 @@ COPY ./ /usr/src/app/
|
|||||||
|
|
||||||
# Install node dependencies
|
# Install node dependencies
|
||||||
RUN yarn config set workspaces-experimental true
|
RUN yarn config set workspaces-experimental true
|
||||||
RUN yarn install
|
RUN yarn install --frozen-lockfile
|
||||||
|
|
||||||
# Copy the rest of the application code
|
# Copy the rest of the application code
|
||||||
|
|
||||||
|
|||||||
@ -16,7 +16,7 @@ COPY ./ /usr/src/app/
|
|||||||
|
|
||||||
# Install node dependencies
|
# Install node dependencies
|
||||||
RUN yarn config set workspaces-experimental true
|
RUN yarn config set workspaces-experimental true
|
||||||
RUN yarn install
|
RUN yarn install --frozen-lockfile
|
||||||
|
|
||||||
# Copy the rest of the application code
|
# Copy the rest of the application code
|
||||||
|
|
||||||
|
|||||||
@ -80,7 +80,7 @@ In your cloned repository's root folder, run:
|
|||||||
|
|
||||||
```js
|
```js
|
||||||
// Restore dependencies
|
// Restore dependencies
|
||||||
yarn install
|
yarn install --frozen-lockfile
|
||||||
|
|
||||||
// Stands up local server to host Viewer.
|
// Stands up local server to host Viewer.
|
||||||
// Viewer connects to our public cloud PACS by default
|
// Viewer connects to our public cloud PACS by default
|
||||||
|
|||||||
@ -156,7 +156,7 @@ program
|
|||||||
unlinkExtension(extensionName, { viewerDirectory });
|
unlinkExtension(extensionName, { viewerDirectory });
|
||||||
console.log(
|
console.log(
|
||||||
chalk.green(
|
chalk.green(
|
||||||
`Successfully unlinked Extension ${extensionName} from the Viewer, don't forget to run yarn install --force`
|
`Successfully unlinked Extension ${extensionName} from the Viewer, don't forget to run yarn install --frozen-lockfile --force`
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
@ -179,7 +179,7 @@ program
|
|||||||
unlinkMode(modeName, { viewerDirectory });
|
unlinkMode(modeName, { viewerDirectory });
|
||||||
console.log(
|
console.log(
|
||||||
chalk.green(
|
chalk.green(
|
||||||
`Successfully unlinked Mode ${modeName} from the Viewer, don't forget to run yarn install --force`
|
`Successfully unlinked Mode ${modeName} from the Viewer, don't forget to run yarn install --frozen-lockfile --force`
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|||||||
@ -80,7 +80,7 @@ to program in isolation without a complex setup, and has the added benefit of
|
|||||||
producing well-tested business logic.
|
producing well-tested business logic.
|
||||||
|
|
||||||
1. Clone this repository
|
1. Clone this repository
|
||||||
2. Navigate to the project directory, and `yarn install`
|
2. Navigate to the project directory, and `yarn install --frozen-lockfile`
|
||||||
3. To begin making changes, `yarn run dev`
|
3. To begin making changes, `yarn run dev`
|
||||||
4. To commit changes, run `yarn run cm`
|
4. To commit changes, run `yarn run cm`
|
||||||
|
|
||||||
|
|||||||
@ -5,7 +5,7 @@ This website is built using [Docusaurus 2](https://docusaurus.io/), a modern sta
|
|||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
```console
|
```console
|
||||||
yarn install
|
yarn install --frozen-lockfile
|
||||||
```
|
```
|
||||||
|
|
||||||
## Local Development
|
## Local Development
|
||||||
|
|||||||
@ -156,7 +156,7 @@ inside your `public` folder. Since files are served from your local server the
|
|||||||
the dicom files will be
|
the dicom files will be
|
||||||
`dicomweb:http://localhost:3000/LIDC-IDRI-0001/01-01-2000-30178/3000566.000000-03192/1-001.dcm`.
|
`dicomweb:http://localhost:3000/LIDC-IDRI-0001/01-01-2000-30178/3000566.000000-03192/1-001.dcm`.
|
||||||
|
|
||||||
After `yarn install` and running `yarn dev` and opening the browser at
|
After `yarn install --frozen-lockfile` and running `yarn dev` and opening the browser at
|
||||||
`http://localhost:3000/viewer/dicomjson?url=http://localhost:3000/LIDC-IDRI-0001.json`
|
`http://localhost:3000/viewer/dicomjson?url=http://localhost:3000/LIDC-IDRI-0001.json`
|
||||||
will display the viewer.
|
will display the viewer.
|
||||||
|
|
||||||
|
|||||||
@ -88,7 +88,7 @@ this repository's root directory, and run:
|
|||||||
yarn config set workspaces-experimental true
|
yarn config set workspaces-experimental true
|
||||||
|
|
||||||
# Restore dependencies
|
# Restore dependencies
|
||||||
yarn install
|
yarn install --frozen-lockfile
|
||||||
|
|
||||||
# Run our dev command, but with the local orthanc config
|
# Run our dev command, but with the local orthanc config
|
||||||
yarn run dev:orthanc
|
yarn run dev:orthanc
|
||||||
|
|||||||
@ -37,7 +37,7 @@ This project contains two main components:
|
|||||||
2. **Install Dependencies:**
|
2. **Install Dependencies:**
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
yarn install
|
yarn install --frozen-lockfile
|
||||||
```
|
```
|
||||||
|
|
||||||
## Generating Static DICOMweb Files
|
## Generating Static DICOMweb Files
|
||||||
|
|||||||
@ -162,7 +162,7 @@ Update the data source configuration file with your Azure Healthcare APIs detail
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
cd OHIFViewer
|
cd OHIFViewer
|
||||||
yarn install
|
yarn install --frozen-lockfile
|
||||||
APP_CONFIG=config/azure.js yarn run dev
|
APP_CONFIG=config/azure.js yarn run dev
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -175,4 +175,3 @@ Update the data source configuration file with your Azure Healthcare APIs detail
|
|||||||
- The `qidoRoot`, `wadoUriRoot`, and `wadoRoot` should point to your Azure DICOM service URL. Replace `{your-dicom-instance}` with your actual instance name.
|
- The `qidoRoot`, `wadoUriRoot`, and `wadoRoot` should point to your Azure DICOM service URL. Replace `{your-dicom-instance}` with your actual instance name.
|
||||||
|
|
||||||
This setup allows OHIF to interact seamlessly with Azure's Healthcare APIs, enabling robust DICOM management and visualization.
|
This setup allows OHIF to interact seamlessly with Azure's Healthcare APIs, enabling robust DICOM management and visualization.
|
||||||
|
|
||||||
|
|||||||
@ -38,7 +38,7 @@ Next run these commands:
|
|||||||
yarn config set workspaces-experimental true
|
yarn config set workspaces-experimental true
|
||||||
|
|
||||||
# Restore dependencies
|
# Restore dependencies
|
||||||
yarn install
|
yarn install --frozen-lockfile
|
||||||
|
|
||||||
# Build source code for production
|
# Build source code for production
|
||||||
yarn run build
|
yarn run build
|
||||||
|
|||||||
@ -127,7 +127,7 @@ Images can even be transcoded on the fly if this is desired.
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
cd OHIFViewer
|
cd OHIFViewer
|
||||||
yarn install
|
yarn install --frozen-lockfile
|
||||||
APP_CONFIG=config/google.js yarn run dev
|
APP_CONFIG=config/google.js yarn run dev
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@ -80,11 +80,17 @@ following commands:
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Restore dependencies
|
# Restore dependencies
|
||||||
yarn install
|
yarn install --frozen-lockfile
|
||||||
|
|
||||||
# Start local development server
|
# Start local development server
|
||||||
yarn run dev
|
yarn run dev
|
||||||
```
|
```
|
||||||
|
:::danger
|
||||||
|
In general run `yarn install` with the `--frozen-lockfile` flag to help avoid
|
||||||
|
supply chain attacks by enforcing reproducible dependencies. That is, if the
|
||||||
|
`yarn.lock` file is clean and does NOT reference compromised packages, then
|
||||||
|
no compromised packages should land on your machine by using this flag.
|
||||||
|
:::
|
||||||
|
|
||||||
You should see the following output:
|
You should see the following output:
|
||||||
|
|
||||||
@ -113,6 +119,31 @@ You should see the following output:
|
|||||||
yarn run build
|
yarn run build
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Updating Dependencies
|
||||||
|
In general you will typically not be updating the various `package.json` files.
|
||||||
|
But for the case when you do, you will have to also update the various OHIF lock files
|
||||||
|
and as such you will have to do both a `yarn` and `bun` `install` without
|
||||||
|
the `--frozen-lockfile` flag.
|
||||||
|
|
||||||
|
:::danger
|
||||||
|
Updating the package.json must be done with care so as to avoid incorporating
|
||||||
|
vulnerable, third-party packages and/or versions. Please research the added
|
||||||
|
packages and/or versions for vulnerabilities.
|
||||||
|
|
||||||
|
Here is what you should do when adding new packages and/or versions prior to
|
||||||
|
committing and pushing your code:
|
||||||
|
1. Do your due diligence researching the added packages and/or versions for vulnerabilities.
|
||||||
|
2. Update the `package.json` files.
|
||||||
|
3. Execute `yarn run install:update-lockfile`. This updates both the `yarn.lock` and
|
||||||
|
the `bun.lock` files.
|
||||||
|
4. Execute `yarn run audit` for a last security check. This runs both `yarn audit` and
|
||||||
|
`bun audit`.
|
||||||
|
6. Include both the `yarn.lock` and `bun.lock` files as part of your commit.
|
||||||
|
|
||||||
|
If any of your research or auditing for vulnerabilities find HIGH risk vulnerabilities
|
||||||
|
do NOT commit or push your changes! Low and moderate risk vulnerabilities are acceptable.
|
||||||
|
:::
|
||||||
|
|
||||||
## Troubleshooting
|
## Troubleshooting
|
||||||
|
|
||||||
- If you receive a _"No Studies Found"_ message and do not see your studies, try
|
- If you receive a _"No Studies Found"_ message and do not see your studies, try
|
||||||
|
|||||||
@ -20,7 +20,7 @@ To run the unit test:
|
|||||||
yarn run test:unit:ci
|
yarn run test:unit:ci
|
||||||
```
|
```
|
||||||
|
|
||||||
Note: You should have already installed all the packages with `yarn install`.
|
Note: You should have already installed all the packages with `yarn install --frozen-lockfile`.
|
||||||
|
|
||||||
Running unit test will generate a report at the end showing the successful and
|
Running unit test will generate a report at the end showing the successful and
|
||||||
unsuccessful tests with detailed explanations.
|
unsuccessful tests with detailed explanations.
|
||||||
|
|||||||
@ -57,7 +57,7 @@ yarn run dev
|
|||||||
|
|
||||||
After:
|
After:
|
||||||
```bash
|
```bash
|
||||||
yarn install
|
yarn install --frozen-lockfile
|
||||||
yarn run dev
|
yarn run dev
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@ -88,7 +88,7 @@ this repository's root directory, and run:
|
|||||||
yarn config set workspaces-experimental true
|
yarn config set workspaces-experimental true
|
||||||
|
|
||||||
# Restore dependencies
|
# Restore dependencies
|
||||||
yarn install
|
yarn install --frozen-lockfile
|
||||||
|
|
||||||
# Run our dev command, but with the local orthanc config
|
# Run our dev command, but with the local orthanc config
|
||||||
yarn run dev:orthanc
|
yarn run dev:orthanc
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user