OWASP / threat-dragon

An open source threat modeling tool from OWASP
https://owasp.org/www-project-threat-dragon/
Apache License 2.0
902 stars 244 forks source link

Documentation for running the built docker image #586

Closed vineetpandey closed 9 months ago

vineetpandey commented 1 year ago

Describe the bug

Downloaded the beta release source and build the docker image. While running the image, got the syntax error.

Expected behaviour

Expected to run the docker image smoothly

Environment

To Reproduce

Any additional context, screenshots, etc

jgadsden commented 1 year ago

Thanks @vineetpandey , the bug is much appreciated. If you have a fix then that would be great

vineetpandey commented 1 year ago

Hi @jgadsden : thanks for your message. Not sure about the solution since setting up the image, environment and make it run on windows has already took toll and I ended up deleting the repo. Can't assure but will try luck finding the cause on weekends.

jgadsden commented 1 year ago

OK, thanks @vineetpandey It works OK on my MacOS:

docker build -t owasp-threat-dragon:dev .
docker run -it --rm -p 8080:3000 -v $(pwd)/.env:/app/.env owasp-threat-dragon:dev

I will try it on my Linux and my Windows machines later this week

vineetpandey commented 1 year ago

Great @jgadsden . If that works for windows. Please state away the steps as well please. Thanks!

jgadsden commented 1 year ago

@vineetpandey could you try the dockerhub image? That worked for me:

docker pull threatdragon/owasp-threat-dragon:v2.0.0-beta
docker run -it --rm -p 8080:3000 -v $(pwd)/.env:/app/.env threatdragon/owasp-threat-dragon:v2.0.0-beta

I think for Windows it would be as you suggest:

docker pull threatdragon/owasp-threat-dragon:v2.0.0-beta
docker run -it --rm -p 8080:3000 -v %CD%/.env:/app/.env threatdragon/owasp-threat-dragon:v2.0.0-beta
vineetpandey commented 1 year ago

Was this beta published on docker hub as well? I was checking it but couldn't find on docker hub. Though I'll give a try. Thanks for the information @jgadsden

vineetpandey commented 1 year ago

@jgadsden looks like this docker image is working fine. Though I'll check it thoroughly tomorrow. Thanks for this.

vineetpandey commented 1 year ago

@jgadsden : now able to run from docker image but another trouble came up while returning the oauth code. Below are the environment variables passed in .env file: GITHUB_CLIENT_ID=xxxxxxxxx GITHUB_CLIENT_SECRET=xxxxxxxxxxxxxxxxx GITHUB_SCOPE=repo

NODE_ENV=development SERVER_API_PROTOCOL=http

ENCRYPTION_KEYS='[{"isPrimary": true, "id": 0, "value": "xxxxxxxxxxxxxxx"}]' ENCRYPTION_JWT_SIGNING_KEY=sdfsdfs4erw45345345 ENCRYPTION_JWT_REFRESH_SIGNING_KEY=sdfsf5434r4fd4erf34dre34

And, this is the error while clicking on "Login with Github" image

jgadsden commented 1 year ago

Hello @vineetpandey

If you are running these commands:

docker pull threatdragon/owasp-threat-dragon:v2.0.0-beta
docker run -it --rm -p 8080:3000 -v %CD%/.env:/app/.env threatdragon/owasp-threat-dragon:v2.0.0-beta

then you are mapping for port 8080 on your localhost, so you should try http://localhost:8080/#/

The backend Express server is listening on port 3000 for requests from the Vue application front end or from the browser - but these requests are mapped to port 8080

vineetpandey commented 1 year ago

Hi @jgadsden : yes, I ran this URL only: http://localhost:8080/#/ while clicking on "Login with Github", let me authorize and throwing the error as shown in the image attached in my last comment. Not sure what to do, since my Github app configuration is: HomePage URL: http://localhost:8080 Callback URL: http://localhost:3000/api/oauth/return Also, I gave my discord webhook as well.

vineetpandey commented 1 year ago

Hi @jgadsden : had a chance to look into the above error?? Thanks!

jgadsden commented 10 months ago

Hello @vineetpandey , I think I need to create a step by step guide to running the docker image locally, and that should show any errors. I can put the step by step guide onto the documentation site

vineetpandey commented 10 months ago

@jgadsden appreciate it. This would be helpful and also if you can consider the deployment guidelines for gitlab as well. So that we can have an option for GitHub and gitlab both.

jgadsden commented 9 months ago

Hello @vineetpandey I have created instructions for github access, which include running the docker image locally, in the documentation pull request and can be accessed here

vineetpandey commented 9 months ago

@jgadsden thanks for this.

One more query, can we also run this in gitlab. If yes, then can you also include the step-by-step instructions for gitlab deployment since gitlab is popular alike GitHub and gives you the feasibility to host it on-premise which large organisations do prefer.