Azure / Stormspotter

Azure Red Team tool for graphing Azure and Azure Active Directory objects
MIT License
1.51k stars 202 forks source link

[frontend] - SyntaxError: Unexpected reserved word - on docker #80

Open giupo opened 1 year ago

giupo commented 1 year ago

on the following system:

Cloning the repository and typing

docker compose up 

Produces the following output:

[+] Running 3/3
 ⠿ Container stormspotter-stormspotter-neo4j-1     Recreated                                                                                   1.0s
 ⠿ Container stormspotter-stormspotter-backend-1   Recreated                                                                                   1.4s 
 ⠿ Container stormspotter-stormspotter-frontend-1  Recreated                                                                                   1.3s 
Attaching to stormspotter-stormspotter-backend-1, stormspotter-stormspotter-frontend-1, stormspotter-stormspotter-neo4j-1                           
stormspotter-stormspotter-frontend-1  | file:///usr/local/lib/node_modules/@quasar/cli/bin/quasar.js:43
stormspotter-stormspotter-frontend-1  |   const { getProjectRoot } = await import('../lib/get-project-root.js')
stormspotter-stormspotter-frontend-1  |                              ^^^^^
stormspotter-stormspotter-frontend-1  | 
stormspotter-stormspotter-frontend-1  | SyntaxError: Unexpected reserved word
stormspotter-stormspotter-frontend-1  |     at Loader.moduleStrategy (internal/modules/esm/translators.js:140:18)
stormspotter-stormspotter-frontend-1  |     at async link (internal/modules/esm/module_job.js:42:21)
stormspotter-stormspotter-backend-1   | INFO:     Started server process [1]
stormspotter-stormspotter-backend-1   | INFO:     Waiting for application startup.
stormspotter-stormspotter-backend-1   | INFO:     Application startup complete.
stormspotter-stormspotter-backend-1   | INFO:     Uvicorn running on http://0.0.0.0:9090 (Press CTRL+C to quit)
stormspotter-stormspotter-frontend-1 exited with code 1

A quick fix would be to pin NodeJS to an higher version than 12 in frontend/dockerfile (I know this is quite "generic", but even pinning to latest fixed the issue)

jdouliez commented 1 year ago

I confirm the bug AND the proposed solution. Thanks @giupo

RedTeamMagic commented 6 months ago

For those of you who don't speak simple docker like myself - to break down guipo's fix:

  1. in your /Stormspotter/frondend/dockerfile file modify the first line to become From node:latest
  2. Save the changes
  3. Rebuild the docker container with docker-compose up --build
  4. The frontend should now be working and accessible at http://localhost:90901

Thanks @giupo