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

Commit

Permalink
Add a welcome page to the static resources
Browse files Browse the repository at this point in the history
This is largely a precursor for the removal of the bundled webclient. The idea
is to present a page at / which reassures people that something is working, and
to give them some links for next steps.

The welcome page lives at `/_matrix/static/`, so is enabled alongside the other
`static` resources (which, in practice, means the client API is enabled). We'll
redirect to it from `/` if we have nothing better to display there.

It would be nice to have a way to disable it (in the same way that you might
disable the nginx welcome page), but I can't really think of a good way to do
that without a load of ickiness.

It's based on the work done by @krombel for #2601.
  • Loading branch information
richvdh committed Dec 11, 2018
1 parent a2ed0f2 commit f537432
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
1 change: 1 addition & 0 deletions changelog.d/4289.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add a welcome page for the client API port. Credit to @krombel!
3 changes: 3 additions & 0 deletions synapse/app/homeserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,11 @@ def _listener_http(self, config, listener_config):
handler = handler_cls(config, module_api)
resources[path] = AdditionalResource(self, handler.handle_request)

# try to find something useful to redirect '/' to
if WEB_CLIENT_PREFIX in resources:
root_resource = RootRedirect(WEB_CLIENT_PREFIX)
elif STATIC_PREFIX in resources:
root_resource = RootRedirect(STATIC_PREFIX)
else:
root_resource = NoResource()

Expand Down
26 changes: 26 additions & 0 deletions synapse/static/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<html>
<head>
<title>Synapse is running</title>
<style>
body {
width: 30em;
margin: 0 auto;
font-family: Tahoma, Verdana, Arial, sans-serif;
}
h1 {
text-align: center;
}
</style>
</head>
<body>
<h1>Synapse is running</h1>
<p>Congratulations!</p>
<p>Your Synapse server is listening on this port and is ready for messages.</p>
<p>To use this server you'll need a client - e.g. one of
<a href="https://matrix.org/docs/projects/try-matrix-now.html#clients">this list of Matrix clients</a>.</p>
<p>You can find (federated) rooms that might be of interest to you on
<a href="https://view.matrix.org/">view.matrix.org</a>.</p>
<p>Or you just start creating your own rooms with your friends.</p>
<p>Welcome to the Matrix universe :)</p>
</body>
</html>

0 comments on commit f537432

Please sign in to comment.