1717from watchdog .observers import Observer
1818
1919from nebula .addons .env import check_environment
20- from nebula .controller .controller import TermEscapeCodeFormatter
20+ from nebula .controller .web_app_controller import TermEscapeCodeFormatter
2121from nebula .controller .scenarios import ScenarioManagement
2222from nebula .utils import DockerUtils , FileUtils , SocketUtils
2323
@@ -637,6 +637,16 @@ def __init__(self, args):
637637 logging .exception (warning_msg )
638638 sys .exit (1 )
639639
640+ self .controller_port = int (args .controllerport ) if hasattr (args , "controllerport" ) else 5050
641+ self .federation_controller_port = int (args .federationcontrollerport ) if hasattr (args , "federationcontrollerport" ) else 5051
642+ self .waf_port = int (args .wafport ) if hasattr (args , "wafport" ) else 6000
643+ self .frontend_port = int (args .webport ) if hasattr (args , "webport" ) else 6060
644+ self .grafana_port = int (args .grafanaport ) if hasattr (args , "grafanaport" ) else 6040
645+ self .loki_port = int (args .lokiport ) if hasattr (args , "lokiport" ) else 6010
646+ self .statistics_port = int (args .statsport ) if hasattr (args , "statsport" ) else 8080
647+ self .production = args .production if hasattr (args , "production" ) else False
648+ self .dev = args .developement if hasattr (args , "developement" ) else False
649+ self .advanced_analytics = args .advanced_analytics if hasattr (args , "advanced_analytics" ) else False
640650 self .databases_dir = args .databases if hasattr (args , "databases" ) else "/nebula/app/databases"
641651 self .config_dir = args .config
642652 self .log_dir = args .logs
@@ -843,6 +853,9 @@ def start(self):
843853 # Check ports available
844854 if not SocketUtils .is_port_open (self .controller_port ):
845855 self .controller_port = SocketUtils .find_free_port (start_port = self .controller_port )
856+
857+ if not SocketUtils .is_port_open (self .federation_controller_port ):
858+ self .federation_controller_port = SocketUtils .find_free_port (start_port = self .federation_controller_port )
846859
847860 if not SocketUtils .is_port_open (self .frontend_port ):
848861 self .frontend_port = SocketUtils .find_free_port (start_port = self .frontend_port )
@@ -1110,11 +1123,13 @@ def run_controller(self):
11101123 "NEBULA_ROOT_HOST" : self .root_path ,
11111124 "NEBULA_DATABASES_DIR" : "/nebula/app/databases" ,
11121125 "NEBULA_CONTROLLER_LOG" : "/nebula/app/logs/controller.log" ,
1126+ "NEBULA_FEDERATION_CONTROLLER_LOG" : "/nebula/app/logs/federation.log" ,
11131127 "NEBULA_CONFIG_DIR" : "/nebula/app/config/" ,
11141128 "NEBULA_LOGS_DIR" : "/nebula/app/logs/" ,
11151129 "NEBULA_CERTS_DIR" : "/nebula/app/certs/" ,
11161130 "NEBULA_HOST_PLATFORM" : self .host_platform ,
11171131 "NEBULA_CONTROLLER_PORT" : self .controller_port ,
1132+ "NEBULA_FEDERATION_CONTROLLER_PORT" : self .federation_controller_port ,
11181133 "NEBULA_CONTROLLER_HOST" : self .controller_host ,
11191134 "NEBULA_FRONTEND_PORT" : self .frontend_port ,
11201135 "DB_HOST" : self .get_container_name ("nebula-database" ),
@@ -1126,7 +1141,7 @@ def run_controller(self):
11261141
11271142 volumes = ["/nebula" , "/var/run/docker.sock" ]
11281143
1129- ports = [self .controller_port ]
1144+ ports = [self .controller_port , self . federation_controller_port ]
11301145
11311146 host_config = client .api .create_host_config (
11321147 binds = [
@@ -1135,16 +1150,15 @@ def run_controller(self):
11351150 f"{ self .databases_dir } :/nebula/app/databases" ,
11361151 ],
11371152 extra_hosts = {"host.docker.internal" : "host-gateway" },
1138- port_bindings = {self .controller_port : self .controller_port },
1139- device_requests = [
1140- {
1141- "Driver" : "nvidia" ,
1142- "Count" : - 1 ,
1143- "Capabilities" : [["gpu" ]],
1144- }
1145- ]
1146- if self .gpu_available
1147- else None ,
1153+ port_bindings = {
1154+ self .controller_port : self .controller_port ,
1155+ self .federation_controller_port : self .federation_controller_port
1156+ },
1157+ device_requests = [{
1158+ "Driver" : "nvidia" ,
1159+ "Count" : - 1 ,
1160+ "Capabilities" : [["gpu" ]],
1161+ }] if self .gpu_available else None ,
11481162 )
11491163
11501164 networking_config = client .api .create_networking_config ({
0 commit comments