From e98aa81645bef1b66a65049ac8fcc4d2f5274549 Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Fri, 19 Nov 2021 08:27:44 -0500 Subject: [PATCH] Island: Remove Environment.is_debug() Environment.is_debug() is always False. --- .../monkey_island/cc/environment/__init__.py | 4 --- monkey/monkey_island/cc/server_setup.py | 27 +++++++------------ 2 files changed, 10 insertions(+), 21 deletions(-) diff --git a/monkey/monkey_island/cc/environment/__init__.py b/monkey/monkey_island/cc/environment/__init__.py index f38ed54d4..121e89399 100644 --- a/monkey/monkey_island/cc/environment/__init__.py +++ b/monkey/monkey_island/cc/environment/__init__.py @@ -12,7 +12,6 @@ logger = logging.getLogger(__name__) class Environment(object, metaclass=ABCMeta): - _DEBUG_SERVER = False _AUTH_EXPIRATION_TIME = timedelta(minutes=30) _testing = False @@ -32,8 +31,5 @@ class Environment(object, metaclass=ABCMeta): def get_config(self) -> EnvironmentConfig: return self._config - def is_debug(self): - return self._DEBUG_SERVER - def get_auth_expiration_time(self): return self._AUTH_EXPIRATION_TIME diff --git a/monkey/monkey_island/cc/server_setup.py b/monkey/monkey_island/cc/server_setup.py index 62afdd0e2..52a026fa7 100644 --- a/monkey/monkey_island/cc/server_setup.py +++ b/monkey/monkey_island/cc/server_setup.py @@ -146,23 +146,16 @@ def _start_island_server(should_setup_only, config_options: IslandConfigOptions) f"{config_options.key_path}." ) - if env_singleton.env.is_debug(): - app.run( - host="0.0.0.0", - debug=True, - ssl_context=(config_options.crt_path, config_options.key_path), - ) - else: - http_server = WSGIServer( - ("0.0.0.0", ISLAND_PORT), - app, - certfile=config_options.crt_path, - keyfile=config_options.key_path, - log=logger, - error_log=logger, - ) - _log_init_info() - http_server.serve_forever() + http_server = WSGIServer( + ("0.0.0.0", ISLAND_PORT), + app, + certfile=config_options.crt_path, + keyfile=config_options.key_path, + log=logger, + error_log=logger, + ) + _log_init_info() + http_server.serve_forever() bootloader_server_thread.join()