Implement indexing into Apache Druid #1

Closed
m wants to merge 263 commits from druid into master
3 changed files with 27 additions and 7 deletions
Showing only changes of commit 4734a271a1 - Show all commits

View File

@ -658,6 +658,9 @@ class IRCBot(IRCClient):
if self.authenticated:
return
sinst = regproc.substitute(self.net, self.num)
if not sinst:
error(f"Registration ping failed for {self.net} - {self.num}")
return
if not self._negativePass == True:
if negativepass == False:
self._negativePass = False

View File

@ -5,7 +5,12 @@ from twisted.internet import reactor
import modules.regproc
def provisionUserNetworkData(num, nick, altnick, emails, ident, realname, network, host, port, security, auth, password):
def provisionUserNetworkData(num, nick, altnick, ident, realname, emails, network, host, port, security, auth, password):
print("nick", nick)
print("altnick", altnick)
print("emails", emails)
print("ident", ident)
print("realname", realname)
commands = {}
stage2commands = {}
stage2commands["status"] = []
@ -56,6 +61,7 @@ def provisionAuthenticationData(num, nick, network, security, auth, password):
def provisionRelay(num, network): # provision user and network data
aliasObj = main.alias[num]
print("ALIASOBJ FALUES", aliasObj.values())
alias = aliasObj["nick"]
provisionUserNetworkData(
num,

View File

@ -28,13 +28,21 @@ def selectInst(net):
def substitute(net, num, token=None):
inst = selectInst(net)
alias = main.alias[num]
if "emails" in inst:
gotemail = False
if "emails" in alias:
# First priority is explicit email lists
email = choice(alias["emails"])
elif "domains" in inst:
domain = choice(inst["domains"])
email = f"{alias['nickname']}@{domain}"
print("Constructed email: {email}")
if alias["emails"]:
email = choice(alias["emails"])
gotemail = True
if "domains" in inst:
if inst["domains"]:
if not gotemail:
domain = choice(inst["domains"])
email = f"{alias['nickname']}@{domain}"
gotemail = True
if not gotemail:
error(f"Could not get email for {net} - {num}")
return False
nickname = alias["nick"]
username = nickname + "/" + net
password = main.network[net].aliases[num]["password"]
@ -53,6 +61,9 @@ def substitute(net, num, token=None):
def registerAccount(net, num):
debug("Attempting to register: %s - %i" % (net, num))
sinst = substitute(net, num)
if not sinst:
error(f"Register account failed for {net} - {num}")
return
if not sinst["register"]:
error("Cannot register for %s: function disabled" % (net))
return False