3 from . import app, CONFIG
4 from .database import DATABASE
6 host = CONFIG['ap']['host']
9 inboxes = DATABASE.get('relay-list', [])
11 async def default(request):
12 targets = '<br>'.join([urllib.parse.urlsplit(target).hostname for target in inboxes])
13 return aiohttp.web.Response(
15 content_type="text/html",
17 text="""<!doctype html>
19 <title>ActivityPub Relay at {host}</title>
21 p {{ color: #FFFFFF; font-family: monospace, arial; font-size: 100%; }}
22 body {{ background-color: #000000; }}
26 <p>This is an Activity Relay for fediverse instances.</p>
28 <p>For Mastodon instances, you may subscribe to this relay with the address: <a href="https://{host}/inbox">https://{host}/inbox</a></p>
29 <p>For Pleroma and other instances, you may subscribe to this relay with the address: <a href="https://{host}/actor">https://{host}/actor</a></p>
30 <p>To host your own relay, you may download the code at this address: <a href="https://git.pleroma.social/pleroma/relay">https://git.pleroma.social/pleroma/relay</a></p>
31 <br><p>List of {count} registered instances:<br>{targets}</p>
34 """.format(host=host, note=note,targets=targets,count=len(inboxes)))
36 app.router.add_get('/', default)