Esempio n. 1
0
    def _deferred_start(self):
        ret = update_db()

        if ret == -1:
            reactor.stop()

        if ret == 0:
            init_db()

        sync_clean_untracked_files()
        sync_refresh_memory_variables()

        GLSettings.orm_tp.start()

        reactor.addSystemEventTrigger('after', 'shutdown', GLSettings.orm_tp.stop)

        arw = APIResourceWrapper()

        GLSettings.api_factory = Site(arw, logFormatter=timedLogFormatter)

        for sock in GLSettings.http_socks:
            listen_tcp_on_sock(reactor, sock.fileno(), GLSettings.api_factory)

        GLSettings.state.process_supervisor = ProcessSupervisor(GLSettings.https_socks,
                                                                '127.0.0.1',
                                                                8082)

        yield GLSettings.state.process_supervisor.maybe_launch_https_workers()

        GLSettings.start_jobs()
        GLSettings.start_services()

        GLSettings.print_listening_interfaces()
Esempio n. 2
0
    def __init__(self):
        self.state = State
        self.arw = APIResourceWrapper()
        self.api_factory = Site(self.arw, logFormatter=timedLogFormatter)

        if not Settings.devel_mode:
            self.api_factory.displayTracebacks = False
Esempio n. 3
0
    def __init__(self):
        self.state = State
        self.arw = APIResourceWrapper()

        if Settings.nodaemon:
            self.api_factory = Site(self.arw, logFormatter=logFormatter)
        else:
            self.api_factory = Site(self.arw, logPath=Settings.accesslogfile, logFormatter=logFormatter)

        if not Settings.devel_mode:
            self.api_factory.displayTracebacks = False
Esempio n. 4
0
    def __init__(self):
        set_proc_title('globaleaks')

        self.state = State
        self.arw = resource.EncodingResourceWrapper(APIResourceWrapper(), [server.GzipEncoderFactory()])

        if Settings.nodaemon:
            self.api_factory = Site(self.arw, logFormatter=logFormatter)
        else:
            self.api_factory = Site(self.arw, logPath=Settings.accesslogfile, logFormatter=logFormatter)

        self.api_factory.displayTracebacks = False
Esempio n. 5
0
    def _deferred_start(self):
        ret = update_db()

        if ret == -1:
            reactor.stop()

        if ret == 0:
            init_db()

        sync_clean_untracked_files()
        sync_refresh_memory_variables()

        GLSettings.orm_tp.start()

        reactor.addSystemEventTrigger('after', 'shutdown',
                                      GLSettings.orm_tp.stop)

        arw = APIResourceWrapper()

        GLSettings.api_factory = Site(arw, logFormatter=timedLogFormatter)

        for sock in GLSettings.http_socks:
            listen_tcp_on_sock(reactor, sock.fileno(), GLSettings.api_factory)

        GLSettings.state.process_supervisor = ProcessSupervisor(
            GLSettings.https_socks, '127.0.0.1', GLSettings.bind_port)

        yield GLSettings.state.process_supervisor.maybe_launch_https_workers()

        GLSettings.start_jobs()

        print(
            "GlobaLeaks is now running and accessible at the following urls:")

        if GLSettings.memory_copy.reachable_via_web:
            print("- http://%s:%d%s" %
                  (GLSettings.bind_address, GLSettings.bind_port,
                   GLSettings.api_prefix))
            if GLSettings.memory_copy.hostname:
                print("- http://%s:%d%s" %
                      (GLSettings.memory_copy.hostname, GLSettings.bind_port,
                       GLSettings.api_prefix))
        else:
            print("- http://127.0.0.1:%d%s" %
                  (GLSettings.bind_port, GLSettings.api_prefix))

        if GLSettings.onionservice is not None:
            print("- http://%s%s" %
                  (GLSettings.onionservice, GLSettings.api_prefix))
Esempio n. 6
0
 def __init__(self):
     self.state = State
     self.arw = APIResourceWrapper()
     self.api_factory = Site(self.arw, logFormatter=timedLogFormatter)