--- /dev/null
+import tornado.ioloop
+import tornado.web
+import os
+import tornado.httpserver
+class XrdHandler(tornado.web.RequestHandler):
+ def get(self):
+ self.render("templates/xrd.xml", hostname="ronin.local", url="https://ronin.local")
+
+class UserHandler(tornado.web.RequestHandler):
+ def get(self, user):
+ #user = self.get_argument("user")
+ self.render("templates/user.xml", user=user)
+
+application = tornado.web.Application([
+ (r"/.well-known/host-meta", XrdHandler),
+ (r"/user/(.+)", UserHandler),
+ ],debug=True,
+
+)
+srv = tornado.httpserver.HTTPServer(application, ssl_options={
+ "certfile": "ronin.local.pem",
+ "keyfile": "ronin.local.key",
+ })
+
+
+if __name__ == "__main__":
+ srv.listen(443)
+ tornado.ioloop.IOLoop.instance().start()
\ No newline at end of file
--- /dev/null
+<?xml version='1.0' encoding='UTF-8'?>
+<XRD xmlns='http://docs.oasis-open.org/ns/xri/xrd-1.0'>
+ <Subject>{{user}}</Subject>
+</XRD>
--- /dev/null
+<?xml version='1.0' encoding='UTF-8'?>
+<XRD xmlns='http://docs.oasis-open.org/ns/xri/xrd-1.0'
+ xmlns:hm='http://host-meta.net/xrd/1.0'>
+
+ <hm:Host>{{hostname}}</hm:Host>
+
+ <Link rel='lrdd'
+ template='{{ url }}/user/{uri}'>
+ <Title>Resource Descriptor</Title>
+ </Link>
+</XRD>
--- /dev/null
+from distutils.core import setup
+
+setup(
+ name='friends',
+ version='0.1.0',
+ author='Mikael Frykholm',
+ author_email='mikael@frykholm.com',
+ packages=['friends'],
+
+ url='https://github.com/mikaelfrykholm/friends/',
+ license='LICENSE.txt',
+ description='Ostatus app.',
+ long_description=open('README.md').read(),
+ install_requires=[
+ "tornadoweb >= 3.1",
+ ],
+)