cynic 3 years ago
commit 128e190336
  1. 3
      cathedral.py
  2. 3
      config.json
  3. 4
      towers/fiefdom.py

@ -12,8 +12,7 @@ class cathedral():
async def handle_http(self, r):
for t in self.towers:
for h in t.hooks:
print(str(r.host)[str(r.host).find(self.cfg.get("host")):])
if compile(h.replace("$HOST", str(r.host)[str(r.host).find(self.cfg.get("host")):])).match(str(r.url)):
if compile(h.replace("$HOST", str(r.host)[str(r.host).find(self.cfg.get("base")):])).match(str(r.url)):
return web.Response(**t.run(self, r))
return web.Response(body=f"usergroup homepage")
async def start_http(self):

@ -1,5 +1,6 @@
{
"host": "localhost",
"base": "f.q.d.n",
"port": 1337,
"PLUGIN_PATH": "./towers"
}
}

@ -9,7 +9,7 @@ def run(ctx, r):
if not(user in ctx.auth.get_real_users()):
return {
"body": f"<h3>404! no such user!</h3><br>consult <b>users.{ctx.cfg.get('host')}</b> to see all registered users",
"body": f"<h3>404! no such user!</h3><br>consult <b>users.{ctx.cfg.get('base')}</b> to see all registered users",
"status": 404, "content_type": "text/html"
}
@ -32,4 +32,4 @@ def run(ctx, r):
return {
"content_type": "text/html",
"body": f
}
}

Loading…
Cancel
Save