Skip to content

Configure MongoDB on Monkey Island initialization #1148

@mssalvatore

Description

@mssalvatore

Monkey Island needs to write runtime artifacts to a writable location and assume that the source code directory is read-only. Currently, MongoDB is started by the linux/run.sh, windows\run_mongodb.bat, and appimage/run_appimage.sh. These scripts do not have access to the data_dir property in server_config.json, and giving them access would add even more redundant functionality to all of these scripts.

  • Add a "mongodb" section to the server_config.json with a "start_mongodb" boolean. (0) - @VakarisZ
{
    "log_level": "debug",
    "data_dir": "$HOME/.monkey_island",
    "environment": {
        "server_config": "password",
        "deployment": "development",
        "user": "my_user",
        "password_hash": "DEADBEEF"
    }
    "mongodb" {
        "start_mongodb": true
    }
}
  • Make sure this section exists and is correct for the default server_config.json, the docker server_config.json, the windows installer server_config.json, and the AppImage server_config.json

  • If "start_mongodb": true, then monkey_island.py will start the mongodb process and set it's --dbpath argument to data_dir/db. (0d) - @VakarisZ

  • Refactor the data dir folder creation and permission setting into a separate function and re-use it to create db dir with relevant permissions as well (0d).

  • Refactor mongodb initialization to be decoupled from environment config (0d) - @VakarisZ

  • Remove the code that starts mongodb from appimage/run_appimage.sh. If this script no longer serves any purpose, remove it and modify the AppImage to run without it. (0d) - @VakarisZ

  • Remove linux/run.sh. Modify documentation with new instructions on how to start monkey island. (0d) - @VakarisZ

  • Remove code that creates db dir from deployment scripts, mongodb install scripts, docs, etc. (0) - @VakarisZ

  • Remove the code that starts mongodb from monkey_island/windows/*. If any of these scripts no longer serves a purpose, remove them.(0d) - @VakarisZ

  • Ensure the mongodb process is properly cleaned up when Monkey Island exits (0d)

  • Review PR and fix (0d)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions