diff options
author | Kegan Dougal <kegan@matrix.org> | 2014-08-18 15:01:08 +0100 |
---|---|---|
committer | Kegan Dougal <kegan@matrix.org> | 2014-08-18 17:18:54 +0100 |
commit | a18b1a649c5dd7fbb42fa2b1af0530542b8c3873 (patch) | |
tree | 1dcce57de58d3510dd5e34edc8117424906268db /synapse/app/homeserver.py | |
parent | In members list, on avatar mouseover, show a tooltip with the user matrix id (diff) | |
download | synapse-a18b1a649c5dd7fbb42fa2b1af0530542b8c3873.tar.xz |
Added /matrix/content path, HS resource_for_content_repo attribute and FileUploadResource. Added stub methods.
Diffstat (limited to 'synapse/app/homeserver.py')
-rwxr-xr-x | synapse/app/homeserver.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/synapse/app/homeserver.py b/synapse/app/homeserver.py index 3429a29a6b..e5bd13a6eb 100755 --- a/synapse/app/homeserver.py +++ b/synapse/app/homeserver.py @@ -24,9 +24,11 @@ from twisted.python.log import PythonLoggingObserver from twisted.web.resource import Resource from twisted.web.static import File from twisted.web.server import Site -from synapse.http.server import JsonResource, RootRedirect +from synapse.http.server import JsonResource, RootRedirect, FileUploadResource from synapse.http.client import TwistedHttpClient -from synapse.api.urls import CLIENT_PREFIX, FEDERATION_PREFIX, WEB_CLIENT_PREFIX +from synapse.api.urls import ( + CLIENT_PREFIX, FEDERATION_PREFIX, WEB_CLIENT_PREFIX, CONTENT_REPO_PREFIX +) from daemonize import Daemonize @@ -53,6 +55,9 @@ class SynapseHomeServer(HomeServer): def build_resource_for_web_client(self): return File("webclient") # TODO configurable? + def build_resource_for_content_repo(self): + return FileUploadResource("uploads") + def build_db_pool(self): """ Set up all the dbs. Since all the *.sql have IF NOT EXISTS, so we don't have to worry about overwriting existing content. @@ -101,7 +106,8 @@ class SynapseHomeServer(HomeServer): # [ ("/aaa/bbb/cc", Resource1), ("/aaa/dummy", Resource2) ] desired_tree = [ (CLIENT_PREFIX, self.get_resource_for_client()), - (FEDERATION_PREFIX, self.get_resource_for_federation()) + (FEDERATION_PREFIX, self.get_resource_for_federation()), + (CONTENT_REPO_PREFIX, self.get_resource_for_content_repo()) ] if web_client: logger.info("Adding the web client.") |