Example #1
0
 def __init__(self):
     self.CoTService = None
     self.TCPDataPackageService = None
     self.UserCommand = None
     self.killSwitch = False
     self.ReceiveConnectionsReset = None
     self.CoTPoisonPill = None
     self.ClientDataPipe = None
     self.SSLClientDataPipe = None
     self.clientArray = []
     self.socketCount = 0
     self.pipeList = {}
     self.FilterGroup = FilterGroup()
     self.FTSServiceStartupConfigObject = FTSObj()
     self.dbController = DatabaseController()
     logger.propagate = True
     logger.info('something')
Example #2
0
    def startup(self,
                CoTPort,
                CoTIP,
                DataPackagePort,
                DataPackageIP,
                SSLDataPackagePort,
                SSLDataPackageIP,
                RestAPIPort,
                RestAPIIP,
                SSLCoTPort,
                SSLCoTIP,
                AutoStart,
                firstStart=False,
                UI="False"):
        try:
            self.dbController.remove_user()
            self.FTSServiceStartupConfigObject.RestAPIService.RestAPIServiceStatus = 'start'
            self.FTSServiceStartupConfigObject.RestAPIService.RestAPIServicePort = RestAPIPort
            self.FTSServiceStartupConfigObject.RestAPIServiceIP = RestAPIIP
            if firstStart:
                from datetime import datetime as dt
                self.StartupTime = dt.now()
            else:
                pass
            if AutoStart == 'False':
                StartupObject = FTSObj()
                StartupObject.RestAPIService.RestAPIServicePort = RestAPIPort
                StartupObject.RestAPIService.RestAPIServiceIP = RestAPIIP
                StartupObject.RestAPIService.RestAPIServiceStatus = 'start'
                self.start_restAPI_service(StartupObject)

            else:
                StartupObject = FTSObj()
                StartupObject.CoTService.CoTServiceIP = CoTIP
                StartupObject.CoTService.CoTServicePort = CoTPort
                StartupObject.CoTService.CoTServiceStatus = 'start'

                StartupObject.TCPDataPackageService.TCPDataPackageServiceIP = DataPackageIP
                StartupObject.TCPDataPackageService.TCPDataPackageServicePort = DataPackagePort
                StartupObject.TCPDataPackageService.TCPDataPackageServiceStatus = 'start'

                StartupObject.SSLDataPackageService.SSLDataPackageServiceIP = SSLDataPackageIP
                StartupObject.SSLDataPackageService.SSLDataPackageServicePort = SSLDataPackagePort
                StartupObject.SSLDataPackageService.SSLDataPackageServiceStatus = 'start'

                StartupObject.RestAPIService.RestAPIServicePort = RestAPIPort
                StartupObject.RestAPIService.RestAPIServiceIP = RestAPIIP
                StartupObject.RestAPIService.RestAPIServiceStatus = 'start'

                StartupObject.FederationClientService.FederationClientServiceStatus = 'start'

                #StartupObject.FederationServerService.FederationServerServiceStatus = ''

                StartupObject.SSLCoTService.SSLCoTServiceStatus = 'start'
                StartupObject.SSLCoTService.SSLCoTServiceIP = SSLCoTIP
                StartupObject.SSLCoTService.SSLCoTServicePort = SSLCoTPort
                self.start_restAPI_service(StartupObject)

                self.start_all(StartupObject)

            while True:
                time.sleep(MainConfig.MainLoopDelay / 1000)
                try:
                    self.checkPipes()
                except Exception as e:
                    logger.error("error in core FTS process Data Pipe " +
                                 str(e))
                try:
                    self.clientArray = self.receive_data_froCoT_service_thread(
                        self.ClientDataPipe, self.clientArray)
                except Exception as e:
                    logger.error(
                        "error thrown receiving clients from tcp CoT pipe " +
                        str(e))
                try:
                    self.clientArray = self.receive_data_froCoT_service_thread(
                        self.SSLClientDataPipe, self.clientArray)
                except Exception as e:
                    logger.error(
                        "error thrown receiving clients from SSL CoT pipe " +
                        str(e))
        except Exception as e:
            logger.error('exception in the startup of FTS ' + str(e))
Example #3
0

if __name__ == "__main__":
    """import importlib
    conf = importlib.import_module("FreeTAKServer-UI")
    FreeTAKServerUI = importlib.import_module("FreeTAKServer-UI.app", "run")
    y = FreeTAKServerUI.create_app()
    UIProc = multiprocessing.Process(target=FreeTAKServerUI.app, args=())
    UIProc.start()"""
    try:
        parser = argparse.ArgumentParser(
            description=OrchestratorConstants().FULLDESC)
        parser.add_argument('-CoTPort',
                            type=int,
                            help=OrchestratorConstants().COTPORTDESC,
                            default=FTSObj().CoTService.CoTServicePort)
        parser.add_argument('-CoTIP',
                            type=str,
                            help=OrchestratorConstants().COTIPDESC,
                            default=FTSObj().CoTService.CoTServiceIP)
        parser.add_argument('-SSLCoTPort',
                            type=int,
                            help=OrchestratorConstants().SSLCOTPORTDESC,
                            default=FTSObj().SSLCoTService.SSLCoTServicePort)
        parser.add_argument('-SSLCoTIP',
                            type=str,
                            help=OrchestratorConstants().SSLCOTIPDESC,
                            default=FTSObj().SSLCoTService.SSLCoTServiceIP)
        parser.add_argument(
            '-DataPackagePort',
            type=int,