12
12
sys .path .insert (0 , BASE_PATH )
13
13
14
14
from monkey_island .cc .island_logger import json_setup_logging
15
+ from monkey_island .cc .consts import MONKEY_ISLAND_ABS_PATH
15
16
# This is here in order to catch EVERYTHING, some functions are being called on imports the log init needs to be on top.
16
- json_setup_logging (default_path = os .path .join (BASE_PATH , 'cc' , 'island_logger_default_config.json' ),
17
+ json_setup_logging (default_path = os .path .join (MONKEY_ISLAND_ABS_PATH , 'cc' , 'island_logger_default_config.json' ),
17
18
default_level = logging .DEBUG )
18
19
logger = logging .getLogger (__name__ )
19
20
@@ -37,12 +38,16 @@ def main():
37
38
38
39
populate_exporter_list ()
39
40
app = init_app (mongo_url )
41
+
42
+ crt_path = os .path .join (MONKEY_ISLAND_ABS_PATH , 'cc' , 'server.crt' )
43
+ key_path = os .path .join (MONKEY_ISLAND_ABS_PATH , 'cc' , 'server.key' )
44
+
40
45
if env .is_debug ():
41
- app .run (host = '0.0.0.0' , debug = True , ssl_context = ('monkey_island/cc/server.crt' , 'monkey_island/cc/server.key' ))
46
+ app .run (host = '0.0.0.0' , debug = True , ssl_context = (crt_path , key_path ))
42
47
else :
43
48
http_server = HTTPServer (WSGIContainer (app ),
44
- ssl_options = {'certfile' : os .environ .get ('SERVER_CRT' , 'monkey_island/cc/server.crt' ),
45
- 'keyfile' : os .environ .get ('SERVER_KEY' , 'monkey_island/cc/server.key' )})
49
+ ssl_options = {'certfile' : os .environ .get ('SERVER_CRT' , crt_path ),
50
+ 'keyfile' : os .environ .get ('SERVER_KEY' , key_path )})
46
51
http_server .listen (env .get_island_port ())
47
52
logger .info (
48
53
'Monkey Island Server is running on https://{}:{}' .format (local_ip_addresses ()[0 ], env .get_island_port ()))
0 commit comments