Implement indexing into Apache Druid #1

Closed
m wants to merge 263 commits from druid into master
2 changed files with 12 additions and 7 deletions
Showing only changes of commit 2022ab985b - Show all commits

View File

@ -7,7 +7,7 @@ from utils.logging.log import warn
def provisionUserNetworkData( def provisionUserNetworkData(
num, nick, altnick, ident, realname, emails, network, host, port, security, auth, password num, nick, altnick, ident, realname, network, host, port, security
): ):
commands = {} commands = {}
stage2commands = {} stage2commands = {}
@ -37,7 +37,7 @@ def provisionUserNetworkData(
deliverRelayCommands(num, commands, stage2=[[user + "/" + network, stage2commands]]) deliverRelayCommands(num, commands, stage2=[[user + "/" + network, stage2commands]])
def provisionAuthenticationData(num, nick, network, security, auth, password): def provisionAuthenticationData(num, nick, network, auth, password):
commands = {} commands = {}
commands["status"] = [] commands["status"] = []
user = nick.lower() user = nick.lower()
@ -63,15 +63,20 @@ def provisionAuthenticationData(num, nick, network, security, auth, password):
def provisionRelay(num, network): # provision user and network data def provisionRelay(num, network): # provision user and network data
aliasObj = main.alias[num] aliasObj = main.alias[num]
# alias = aliasObj["nick"] # alias = aliasObj["nick"]
nick = aliasObj["nick"]
altnick = aliasObj["altnick"]
ident = aliasObj["ident"]
realname = aliasObj["realname"]
provisionUserNetworkData( provisionUserNetworkData(
num, num,
*aliasObj.values(), nick,
altnick,
ident,
realname,
network, network,
main.network[network].host, main.network[network].host,
main.network[network].port, main.network[network].port,
main.network[network].security, main.network[network].security,
main.network[network].auth,
main.network[network].aliases[num]["password"],
) )
if main.config["ConnectOnCreate"]: if main.config["ConnectOnCreate"]:
reactor.callLater(10, main.network[network].start_bot, num) reactor.callLater(10, main.network[network].start_bot, num)

View File

@ -120,6 +120,7 @@ def attemptManualAuthentication(net, num):
identifymsg = sinst["identifymsg"] identifymsg = sinst["identifymsg"]
entity = sinst["entity"] entity = sinst["entity"]
name = f"{net}{num}" name = f"{net}{num}"
print(f"SENDING `{identifymsg}` TO `{entity}` ON {name}")
if name not in main.IRCPool: if name not in main.IRCPool:
return return
main.IRCPool[name].msg(entity, identifymsg) main.IRCPool[name].msg(entity, identifymsg)
@ -127,14 +128,13 @@ def attemptManualAuthentication(net, num):
def enableAuthentication(net, num, jump=True, run_now=False): def enableAuthentication(net, num, jump=True, run_now=False):
obj = main.network[net] obj = main.network[net]
nick = main.alias[num]["nick"] nick = main.alias[num]["nick"]
security = obj.security
auth = obj.auth auth = obj.auth
name = f"{net}{num}" name = f"{net}{num}"
if name not in main.IRCPool: if name not in main.IRCPool:
return return
# uname = main.alias[num]["nick"] + "/" + net # uname = main.alias[num]["nick"] + "/" + net
password = main.network[net].aliases[num]["password"] password = main.network[net].aliases[num]["password"]
provision.provisionAuthenticationData(num, nick, net, security, auth, password) # Set up for auth provision.provisionAuthenticationData(num, nick, net, auth, password) # Set up for auth
if jump: if jump:
main.IRCPool[name].msg(main.config["Tweaks"]["ZNC"]["Prefix"] + "status", "Jump") main.IRCPool[name].msg(main.config["Tweaks"]["ZNC"]["Prefix"] + "status", "Jump")
if run_now: if run_now: