Пример #1
0
def connect_to_hivemind(config=CONFIGURATION,
                        host="wss://127.0.0.1",
                        port=5678,
                        name="JarbasPTTTerminal",
                        access_key="RESISTENCEisFUTILE",
                        crypto_key="resistanceISfutile"):
    con = HiveMindConnection(host, port)

    terminal = JarbasPtTTerminal(config=config,
                                 crypto_key=crypto_key,
                                 headers=con.get_headers(name, access_key))

    con.connect(terminal)
Пример #2
0
def connect_to_hivemind(host="wss://127.0.0.1",
                        port=5678,
                        name="JarbasCliTerminal",
                        key="cli_key",
                        crypto_key="rh6K5q0FBiCzT5Wg",
                        useragent=platform):
    con = HiveMindConnection(host, port)

    terminal = JarbasCliTerminal(con.address,
                                 crypto_key=crypto_key,
                                 headers=con.get_headers(name, key),
                                 useragent=useragent)

    con.connect(terminal)
Пример #3
0
def connect_to_hivemind(config=CONFIGURATION,
                        host="wss://127.0.0.1",
                        port=5678,
                        name="JarbasVoiceTerminal",
                        key="dummy_key",
                        crypto_key=None,
                        useragent=platform):
    con = HiveMindConnection(host, port)

    terminal = JarbasVoiceTerminal(config=config,
                                   crypto_key=crypto_key,
                                   headers=con.get_headers(name, key),
                                   useragent=useragent)

    con.connect(terminal)
Пример #4
0
def connect_to_hivemind(email,
                        password,
                        access_key,
                        host="wss://127.0.0.1",
                        port=5678,
                        name="JarbasDeltaChatBridge",
                        crypto_key=None):
    con = HiveMindConnection(host, port)

    bridge = JarbasDeltaChatBridge(email,
                                   password,
                                   crypto_key=crypto_key,
                                   headers=con.get_headers(name, access_key))

    con.connect(bridge)
def connect_hackchat_to_hivemind(channel,
                                 username="******",
                                 host="wss://127.0.0.1",
                                 crypto_key=None,
                                 port=5678,
                                 name="JarbasHackChatBridge",
                                 key="unsafe",
                                 useragent=platform):
    con = HiveMindConnection(host, port)

    terminal = JarbasHackChatBridge(channel=channel,
                                    username=username,
                                    crypto_key=crypto_key,
                                    headers=con.get_headers(name, key),
                                    useragent=useragent)

    con.connect(terminal)
Пример #6
0
def connect_twitch_to_hivemind(channel,
                               oauth,
                               tags,
                               host="wss://127.0.0.1",
                               crypto_key=None,
                               port=5678,
                               name="JarbasTwitchBridge",
                               key="dummy_key",
                               useragent=platform):
    con = HiveMindConnection(host, port)

    terminal = JarbasTwitchBridge(channel=channel,
                                  oauth=oauth,
                                  tags=tags,
                                  crypto_key=crypto_key,
                                  headers=con.get_headers(name, key),
                                  useragent=useragent)

    con.connect(terminal)
Пример #7
0
def connect_mattermost_to_hivemind(mail,
                                   pswd,
                                   url,
                                   tags=None,
                                   host="127.0.0.1",
                                   crypto_key=None,
                                   port=5678,
                                   name="JarbasMattermostBridge",
                                   key="unsafe",
                                   useragent=platform):
    con = HiveMindConnection(host, port)

    terminal = JarbasMattermostBridge(mail=mail,
                                      pswd=pswd,
                                      url=url,
                                      tags=tags,
                                      crypto_key=crypto_key,
                                      headers=con.get_headers(name, key),
                                      useragent=useragent)

    con.secure_connect(terminal)
Пример #8
0
def discover_hivemind(name="JarbasPushToTalkTerminal",
                      access_key="RESISTENCEisFUTILE",
                      crypto_key="resistanceISfutile"):
    discovery = LocalDiscovery()
    headers = HiveMindConnection.get_headers(name, access_key)

    while True:
        LOG.info("Scanning...")
        for node_url in discovery.scan():
            LOG.info("Fetching Node data: {url}".format(url=node_url))
            node = discovery.nodes[node_url]
            node.connect(crypto_key=crypto_key,
                         node_type=JarbasPtTTerminal,
                         headers=headers)
        sleep(5)
Пример #9
0
def discover_hivemind(name="JarbasCliTerminal",
                      access_key="RESISTENCEisFUTILE",
                      crypto_key="resistanceISfutile",
                      curses=False):
    discovery = LocalDiscovery()
    headers = HiveMindConnection.get_headers(name, access_key)
    clazz = JarbasCursesTerminal if curses else JarbasCliTerminal
    while True:
        print("Scanning...")
        for node_url in discovery.scan():
            LOG.info("Fetching Node data: {url}".format(url=node_url))
            node = discovery.nodes[node_url]
            node.connect(crypto_key=crypto_key,
                         node_type=clazz,
                         headers=headers
                         )
        sleep(5)
Пример #10
0
def discover_hivemind(email,
                      password,
                      access_key,
                      name="JarbasDeltaChatBridge",
                      crypto_key=None):
    discovery = LocalDiscovery()
    headers = HiveMindConnection.get_headers(name, access_key)
    while True:
        print("Scanning...")
        for node_url in discovery.scan():
            LOG.info("Fetching Node data: {url}".format(url=node_url))
            node = discovery.nodes[node_url]
            node.connect(crypto_key=crypto_key,
                         node_type=JarbasDeltaChatBridge,
                         headers=headers,
                         email=email,
                         password=password)
        sleep(5)
Пример #11
0
def discover_hivemind(name="JarbasVoiceTerminal",
                      access_key="RESISTENCEisFUTILE",
                      crypto_key=None):
    discovery = LocalDiscovery()
    headers = HiveMindConnection.get_headers(name, access_key)

    while True:
        try:
            LOG.info("Scanning...")
            for node_url in discovery.scan():
                LOG.info("Fetching Node data: {url}".format(url=node_url))
                node = discovery.nodes[node_url]
                node.connect(crypto_key=crypto_key,
                             node_type=JarbasVoiceTerminal,
                             headers=headers
                             )
            sleep(5)
        except KeyboardInterrupt:
            break
Пример #12
0
def connect_to_hivemind(host="wss://127.0.0.1",
                        port=5678, name="JarbasCliTerminal",
                        access_key="erpDerPerrDurHUr",
                        crypto_key=None,
                        curses=False):
    con = HiveMindConnection(host, port)

    if curses:
        terminal = JarbasCursesTerminal(crypto_key=crypto_key,
                                        headers=con.get_headers(name, access_key))

    else:
        terminal = JarbasCliTerminal(crypto_key=crypto_key,
                                     headers=con.get_headers(name, access_key))

    con.connect(terminal)