Skip to content

Commit

Permalink
chore: update make init command (#5250) (#5261)
Browse files Browse the repository at this point in the history
* chore" update make init command

* chore: fix issue related to DSO token

* chore: minor function update

* chore: remove dummy value, keep placeholder

---------

Co-authored-by: Karl Cardenas <[email protected]>
(cherry picked from commit 6316af1)

Co-authored-by: caroldelwing <[email protected]>
  • Loading branch information
1 parent e1f74af commit a9333fd
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ init: ## Initialize npm dependencies
grep -q "^ALGOLIA_APP_ID=" .env || echo "\nALGOLIA_APP_ID=1234567890" >> .env
grep -q "^ALGOLIA_SEARCH_KEY=" .env || echo "\nALGOLIA_SEARCH_KEY=1234567890" >> .env
grep -q "^ALGOLIA_INDEX_NAME=" .env || echo "\nALGOLIA_INDEX_NAME=spectrocloud" >> .env
grep -q "^DSO_AUTH_TOKEN=" .env || echo "\nDISABLE_SECURITY_INTEGRATIONS=true" >> .env
grep -q "^DSO_AUTH_TOKEN=" .env || echo "\nDISABLE_SECURITY_INTEGRATIONS=true\nDSO_AUTH_TOKEN=" >> .env
grep -q "^PALETTE_API_KEY=" .env || echo "\nDISABLE_PACKS_INTEGRATIONS=true" >> .env
npx husky install

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ Initialize the repository by issuing the following command:
make init
```

By default, the [Packs component](#packs-component) will be disabled. If you would like to enable it, then add your
Palette API key and the variable that enables the component to the `.env` file. Replace `<your-palette-api-key>` with
your Palette API key.
By default, the [Packs component](#packs-component) is disabled. If you would like to enable it, then add your Palette
API key and set `DISABLE_PACKS_INTEGRATIONS` to `false` in the `.env` file. Replace `<your-palette-api-key>` with your
Palette API key.

```shell
PALETTE_API_KEY="<your-palette-api-key>"
Expand Down
5 changes: 4 additions & 1 deletion utils/cves/requests.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ const SECURITY_BULLETIN_URL = "https://dso.teams.spectrocloud.com";

// Ensure that the authentication token is available in the environment
const authToken = process.env.DSO_AUTH_TOKEN;
if (!authToken) {
const DISABLE_SECURITY_INTEGRATIONS = process.env.DISABLE_SECURITY_INTEGRATIONS.toLowerCase();

// If the required environment variable is not set, throw an error
if (!authToken && DISABLE_SECURITY_INTEGRATIONS !== "true") {
throw new Error("DSO_AUTH_TOKEN must be set in the environment to use this plugin.");
}

Expand Down

0 comments on commit a9333fd

Please sign in to comment.