Revert "expose the list of registered targets to default page"
[relay.git/.git] / relay / default.py
1 import aiohttp.web
2 from . import app, CONFIG
3
4 host = CONFIG['ap']['host']
5 note = CONFIG['note']
6
7 async def default(request):
8     return aiohttp.web.Response(
9         status=200,
10         content_type="text/html",
11         charset="utf-8",
12         text="""
13 <html><head>
14  <title>ActivityPub Relay at {host}</title>
15  <style>
16   p {{ color: #FFFFFF; font-family: monospace, arial; font-size: 100%; }}
17   body {{ background-color: #000000; }}
18   </style>
19 </head>
20 <body>
21 <p>This is an Activity Relay for fediverse instances.</p>
22 <p>{note}</p>
23 <p>For Mastodon instances, you may subscribe to this relay with the address: <a href="https://{host}/inbox">https://{host}/inbox</a></p>
24 <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>
25 <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>
26 </body></html>
27
28 """.format(host=host, note=note))
29
30 app.router.add_get('/', default)