webfinger

pull/8/head
db0 2023-06-23 13:12:12 +02:00
parent 2b16dc6dba
commit bdc298f268
1 changed files with 23 additions and 1 deletions

View File

@ -30,3 +30,25 @@ def index():
</head> </head>
""" """
return(head + markdown(findex)) return(head + markdown(findex))
@logger.catch(reraise=True)
@OVERSEER.route('/.well-known/webfinger')
def wellknown_redirect():
query_string = request.query_string.decode()
if not query_string:
return {"message":"No user specified"},400
if query_string != "resource=acct:overseer@overseer.dbzer0.com":
return {"message":"User does not exist"},404
webfinger = {
"subject": "acct:overseer@overseer.dbzer0.com",
"links": [
{
"rel": "self",
"type": "application/activity+json",
"href": "https://overseer.dbzer0.com/actor"
}
]
}
return webfinger,200