island: Pass data_dir to main()

This commit is contained in:
Mike Salvatore 2021-05-11 14:56:50 -04:00
parent c832738a8a
commit b4dfba294b
2 changed files with 6 additions and 3 deletions

View File

@ -32,4 +32,4 @@ if "__main__" == __name__:
from monkey_island.cc.main import main # noqa: E402 from monkey_island.cc.main import main # noqa: E402
main(island_args.setup_only, island_args.server_config) main(config["data_dir"], island_args.setup_only, island_args.server_config)

View File

@ -34,10 +34,13 @@ from monkey_island.cc.setup import setup # noqa: E402
MINIMUM_MONGO_DB_VERSION_REQUIRED = "4.2.0" MINIMUM_MONGO_DB_VERSION_REQUIRED = "4.2.0"
def main(should_setup_only=False, server_config_filename=DEFAULT_SERVER_CONFIG_PATH): def main(
data_dir,
should_setup_only=False,
server_config_filename=DEFAULT_SERVER_CONFIG_PATH,
):
logger.info("Starting bootloader server") logger.info("Starting bootloader server")
data_dir = env_singleton.env.get_config().data_dir_abs_path
env_singleton.initialize_from_file(server_config_filename) env_singleton.initialize_from_file(server_config_filename)
initialize_encryptor(data_dir) initialize_encryptor(data_dir)
initialize_services(data_dir) initialize_services(data_dir)