Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Allow specifying a directory to host a web client from #245

Merged
merged 5 commits into from
Aug 25, 2015
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions synapse/app/homeserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,18 @@ def build_resource_for_federation(self):
return JsonResource(self)

def build_resource_for_web_client(self):
import syweb
syweb_path = os.path.dirname(syweb.__file__)
webclient_path = os.path.join(syweb_path, "webclient")
webclient_path = self.get_config().web_client_location
if not webclient_path:
try:
import syweb
except ImportError:
quit_with_error(
"Could not find a webclient. Please either install syweb\n"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be "matrix-angular-sdk" rather than syweb? Should we include specific instructions on how to pip install syweb.

"or configure the location of the source to server via\n"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"source to server"

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shhh

"the config option `web_client_location`"
)
syweb_path = os.path.dirname(syweb.__file__)
webclient_path = os.path.join(syweb_path, "webclient")
# GZip is disabled here due to
# https://twistedmatrix.com/trac/ticket/7678
# (It can stay enabled for the API resources: they call
Expand Down
1 change: 1 addition & 0 deletions synapse/config/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ def read_config(self, config):
self.server_name = config["server_name"]
self.pid_file = self.abspath(config.get("pid_file"))
self.web_client = config["web_client"]
self.web_client_location = config.get("web_client_location", None)
self.soft_file_limit = config["soft_file_limit"]
self.daemonize = config.get("daemonize")
self.print_pidfile = config.get("print_pidfile")
Expand Down
6 changes: 1 addition & 5 deletions synapse/python_dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,7 @@
"blist": ["blist"],
"pysaml2": ["saml2"],
}
CONDITIONAL_REQUIREMENTS = {
"web_client": {
"matrix_angular_sdk>=0.6.6": ["syweb>=0.6.6"],
}
}
CONDITIONAL_REQUIREMENTS = {}


def requirements(config=None, include_conditional=False):
Expand Down