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

web_client_location documentation fix #2131

Merged
merged 3 commits into from
Apr 27, 2017
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
7 changes: 5 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -335,8 +335,11 @@ ArchLinux
---------

The quickest way to get up and running with ArchLinux is probably with the community package
https://www.archlinux.org/packages/community/any/matrix-synapse/, which should pull in all
the necessary dependencies.
https://www.archlinux.org/packages/community/any/matrix-synapse/, which should pull in most of
the necessary dependencies. If the default web client is to be served (enabled by default in
the generated config),
https://www.archlinux.org/packages/community/any/python2-matrix-angular-sdk/ will also need to
be installed.

Alternatively, to install using pip a few changes may be needed as ArchLinux
defaults to python 3, but synapse currently assumes python 2.7 by default:
Expand Down
7 changes: 2 additions & 5 deletions synapse/app/homeserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@
import synapse.config.logger
from synapse.config._base import ConfigError

from synapse.python_dependencies import (
check_requirements, DEPENDENCY_LINKS
)
from synapse.python_dependencies import check_requirements

from synapse.rest import ClientRestResource
from synapse.storage.engines import create_engine, IncorrectDatabaseSetup
Expand Down Expand Up @@ -88,11 +86,10 @@ def build_resource_for_web_client(hs):
"the location of the source to serve via the configuration\n"
"option `web_client_location`\n\n"
"To install the `matrix-angular-sdk` via pip, run:\n\n"
" pip install '%(dep)s'\n"
" pip install matrix-angular-sdk\n"
"\n"
"You can also disable hosting of the webclient via the\n"
"configuration option `web_client`\n"
% {"dep": DEPENDENCY_LINKS["matrix-angular-sdk"]}
Copy link
Contributor

Choose a reason for hiding this comment

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

String substitution could be failing because there is no key "matrix-angular-sdk" in DEPENDENCY_LINKS, see https://github.com/matrix-org/synapse/blob/master/synapse/python_dependencies.py#L76
Also it seems to be put into CONDITIONAL_REQUIREMENTS as "web_client".

I'm sort of new here so I could be wrong. 😛

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah that is exactly why the string substitution fails. But I don't understand what the purpose of DEPENDENCY_LINKS is here. It seems to be an empty array whether matrix-angular-sdk is installed or not. Do things get added into that array in the course of server initialization? Maybe the thing that adds DEPENDENCY_LINKS["matrix-angular-sdk"] should occur earlier in server initialization?

Copy link
Contributor

Choose a reason for hiding this comment

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

The purpose of DEPENDENCY_LINKS seems to be maintaining a list of all external dependencies which needs to be installed via url.
DEPENDENCY_LINKS is not initialized anywhere else afaik.
Also it seems to be static data like REQUIREMENTS & CONDITIONAL_REQUIREMENTS.

For your case you should probably link the "matrix-angular-sdk" from CONDITIONAL_REQUIREMENTS["web_client"]

)
syweb_path = os.path.dirname(syweb.__file__)
webclient_path = os.path.join(syweb_path, "webclient")
Expand Down
6 changes: 6 additions & 0 deletions synapse/config/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,12 @@ def default_config(self, server_name, **kwargs):
# Whether to serve a web client from the HTTP/HTTPS root resource.
web_client: True

# The root directory to server for the above web client.
# If left undefined, synapse will serve the matrix-angular-sdk web client.
# Make sure matrix-angular-sdk is installed with pip if web_client is True
# and web_client_location is undefined
# web_client_location: "/path/to/web/root"

# The public-facing base URL for the client API (not including _matrix/...)
# public_baseurl: https://example.com:8448/

Expand Down