The pre-release repo for synapse from git.openmarket.com/tng/synapse
  • Python 92.9%
  • JavaScript 4.9%
  • HTML 1.6%
  • CSS 0.5%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2024-05-10 17:32:07 +01:00
cmdclient cmdclient: Added complete_usernames support for the 'login' command. 2014-08-11 17:40:50 +01:00
demo Add missing DIR definition in demo/stop.sh 2014-08-05 11:26:54 +01:00
docs s/sy\./m\./g across all the docs 2014-08-11 15:27:12 +01:00
example Move http client and server out of utils and into an http package 2014-07-25 10:42:24 +01:00
graph Make graph.py not explode on missing state pdu 2014-08-05 13:41:00 +01:00
synapse Remember to update the client-side REST APIs that the profile handler currently hacks in to fetch displaynames/avatar URLs for remote users 2014-08-11 18:02:48 +01:00
tests Remember to update the client-side REST APIs that the profile handler currently hacks in to fetch displaynames/avatar URLs for remote users 2014-08-11 18:02:48 +01:00
webclient s/synapse/matrix 2014-08-11 18:40:06 +02:00
.gitignore Ignore .log and .db in the demo/ dir 2014-07-31 14:08:04 +01:00
database-save.sh A useful script for saving local users' tables when splatting homeserver.db 2014-08-05 16:38:28 +01:00
LICENSE add license and add archaeological notes 2024-05-10 17:32:07 +01:00
MANIFEST.in Update MANIFEST.in to point to the correct schema location. 2014-07-16 09:55:48 +01:00
README.rst add license and add archaeological notes 2024-05-10 17:32:07 +01:00
setup.cfg move example/run_synapse.py to synapse/app/homeserver.py and add it as an "entry_point" script 2014-07-03 17:58:33 +01:00
setup.py update setup.py with name of the readme file 2014-08-11 19:30:01 +01:00
sphinx_api_docs.sh Update sphinx docs 2014-07-09 14:58:50 +01:00

About
=====

This is the pre-release git repository of Synapse, the original Matrix.org
homeserver implementation.  This repository was then flattened to create the
initial public repository for Synapse_ on Aug 12th 2014.

It is provided here STRICTLY for the archaeological interest and curiousity of
future generations of Matrix historians.  Please do not actually try running
this or reusing its code - it will not work with today's Matrix network, and
will be full of security holes.

For the commit history to make sense, it's worth understanding that the Matrix
project was originally codenamed Synapse, so almost all of the history here
uses that name. The name Synapse then continued as the name of the initial
implementation.

-- Matthew (May 10th 2024)


The original README is as follows:

Installation
============

[TODO(kegan): I also needed libffi-dev, which I don't think is included in build-essential.]

First, the dependencies need to be installed. Start by installing 'python-dev'
and the various tools of the compiler toolchain:

  Installing prerequisites on ubuntu::

    $ sudo apt-get install build-essential python-dev

  Installing prerequisites on Mac OS X::

    $ xcode-select --install

The homeserver has a number of external dependencies, that are easiest
to install by making setup.py do so, in --user mode::

    $ python setup.py develop --user

This will run a process of downloading and installing into your
user's .local/lib directory all of the required dependencies that are
missing.

Once this is done, you may wish to run the homeserver's unit tests, to
check that everything is installed as it should be::

    $ python setup.py test

This should end with a 'PASSED' result::

    Ran 143 tests in 0.601s

    PASSED (successes=143)


Running The Home Server
=======================

In order for other home servers to send messages to your server, they will need
to know its host name. You have two choices here, which will influence the form
of your user IDs:

 1) Use the machine's own hostname as available on public DNS in the form of its
    A or AAAA records. This is easier to set up initially, perhaps for testing,
    but lacks the flexibility of SRV.

 2) Set up a SRV record for your domain name. This requires you create a SRV
    record in DNS, but gives the flexibility to run the server on your own
    choice of TCP port, on a machine that might not be the same name as the
    domain name.

For the first form, simply pass the required hostname (of the machine) as the
--host parameter::

    $ python synapse/app/homeserver.py --host machine.my.domain.name

For the second form, first create your SRV record and publish it in DNS. This
needs to be named _matrix._tcp.YOURDOMAIN, and point at at least one hostname
and port where the server is running. (At the current time we only support a
single server, but we may at some future point support multiple servers, for
backup failover or load-balancing purposes). The DNS record would then look
something like::

    _matrix._tcp    IN      SRV     10 0 8448 machine.my.domain.name.

At this point, you should then run the homeserver with the hostname of this
SRV record, as that is the name other machines will expect it to have::

    $ python synapse/app/homeserver.py --host my.domain.name --port 8448

You may additionally want to pass one or more "-v" options, in order to
increase the verbosity of logging output; at least for initial testing.


Running The Web Client
======================

At the present time, the web client is not directly served by the homeserver's
HTTP server. To serve this in a form the web browser can reach, arrange for the
'webclient' sub-directory to be made available by any sort of HTTP server that
can serve static files. For example, python's SimpleHTTPServer will suffice::

    $ cd webclient
    $ python -m SimpleHTTPServer

You can now point your browser at  http://localhost:8000/  to find the client.

If this is the first time you have used the client from that browser (it uses
HTML5 local storage to remember its config), you will need to log in to your
account. If you don't yet have an account, because you've just started the
homeserver for the first time, then you'll need to register one.

Registering A New Account
-------------------------

Your new user name will be formed partly from the hostname your server is
running as, and partly from a localpart you specify when you create the
account. Your name will take the form of::

    @localpart:my.domain.here
         (pronounced "at localpart on my dot domain dot here")

Specify your desired localpart in the topmost box of the "Register for an
account" form, and click the "Register" button.

Logging In To An Existing Account
---------------------------------

[[TODO(paul): It seems the current web client still requests an access_token -
  I suspect this part will need updating before we can point people at how to
  perform e.g. user+password or 3PID authenticated login]]


Building Documentation
======================

Before building documentation install spinx and sphinxcontrib-napoleon::

    $ pip install sphinx
    $ pip install sphinxcontrib-napoleon

Building documentation::

    $ python setup.py build_sphinx

.. _Synapse: https://github.com/element-hq/synapse/commits/4f475c7697722e946e39e42f38f3dd03a95d8765