DockerSecurityPlayground / DSP

A Microservices-based framework for the study of Network Security and Penetration Test techniques

Home Page:https://secsi.io/docker-security-playground/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Invalid argument exception thrown during first configuration on Node 14.x

manucuf opened this issue · comments

Issue Description
Since Node.js 14.5 has been promoted to LTS, now it's the default version downloaded from 'stable' channel. Within this version, the method writeFileSync has a data mandatory argument. https://nodejs.org/api/fs.html#fs_fs_writefilesync_file_data_options
In initUserRepo function declared at app/util/project_init.js, this function (line 21) was called without this mandatory argument, causing ERR_INVALID_ARG_TYPE exception and application crash.

To Reproduce
Steps to reproduce the behavior:

  1. Remove config/config_user.json file (to initialize the application to the first usage)
  2. Start the application, compile initial configuration form and click on 'Install'
  3. The exception is shown on the terminal, as the application crashes.

Expected behavior
Docker Security Playground configuration proceeds correctly and automatically redirects to http://localhost:8080/labs

Screenshots
Screenshot from 2020-11-12 10-17-43

Desktop:

  • OS: Debian based Linux distro, macOS 10.15
  • Browser: Chrome, Safari, Firefox
  • Node.js 14.5

Hi manucuf,

I updated node to 14.5 to verify this issue and I confirm that your modification to the function in the pull request solves it
if (!fs.existsSync(dspID)) fs.writeFileSync(dspID, '');

thanks for your support

commented

Closed with #62