purpleteam-labs / purpleteam

CLI component of OWASP PurpleTeam
https://owasp.org/www-project-purpleteam
Other
118 stars 15 forks source link

Environment Variables aren't being read #113

Closed ShubhamPalriwala closed 2 years ago

ShubhamPalriwala commented 2 years ago

Actual Behavior:

Screenshot_2022-02-14-02-20-31_1920x1080

It comes from here as:

config.loadFile(path.join(__dirname, `config.${process.env.NODE_ENV}.json`));

...

Expected Behavior:

The app should make use of the dotenv package and read the dotenv vars and replace the config.undefined.json accordingly!

...

Steps to Reproduce:

  1. Clone the repo and cd into it
  2. Install deps using npm i
  3. Replace ZAP API KEY with your own and then run npm start
  4. You should get the same error ...

Environment:

Additional Details:

If the problem is universal then I can open a PR introducing the dotenv package and a sample.env file!

Checklist

binarymist commented 2 years ago

Hi @ShubhamPalriwala

Is there a reason why you are trying to run the app-scanner by itself and outside of the container? Your repro steps are incorrect.

The environment variable is applied when the compose file is run.

Please read and follow the documentation before you tick the "I have read the documentation" box.