Implement indexing into Apache Druid #1

Closed
m wants to merge 263 commits from druid into master
2 changed files with 18 additions and 3 deletions
Showing only changes of commit 864f0904f5 - Show all commits

View File

@ -5,7 +5,7 @@ from klein import Klein
from twisted.web.server import Request
import main
from modules import chankeep, userinfo
from modules import chankeep, provision, userinfo
from utils.logging.log import warn
@ -396,10 +396,26 @@ class API(object):
if alias not in main.alias.keys():
return dumps({"success": False, "reason": "alias does not exist."})
if fields:
main.alias[alias] = fields
for field in fields:
if field in main.alias[alias]:
main.alias[alias][field] = fields[field]
if "emails" in fields:
if not fields["emails"]:
main.alias[alias]["emails"] = []
main.saveConf("alias")
return dumps({"success": True})
@app.route("/irc/auto/<net>/", methods=["POST"])
@login_required
def irc_auto_network(self, request, net):
print(repr(main.network[net].relays.keys()))
if net not in main.network.keys():
return dumps({"success": False, "reason": "no such net."})
if 1 in main.network[net].relays.keys():
return dumps({"success": False, "reason": f"First relay exists on {net}"})
num, alias = main.network[net].add_relay(1)
provision.provisionRelay(num, net)
main.saveConf("network")
return dumps({"success": True, f"message": "Created relay {num} with alias {alias} on {net}"})

View File

@ -63,7 +63,6 @@ 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,