Skip to content

Commit

Permalink
removed pip stuff; please retest if password hash function is correct…
Browse files Browse the repository at this point in the history
…ly found
  • Loading branch information
927589452 authored and 927589452 committed Jun 27, 2019
1 parent d58900d commit f55b3fd
Showing 1 changed file with 18 additions and 49 deletions.
67 changes: 18 additions & 49 deletions source/guide_synapse.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ All relevant legal information can be found here
Prerequisites
=============

You need a running :lab:`Postgresql <guide_postgresql>` database server, a dedicated user with a secure password and database for synape.
You need a running :lab:`Postgresql <guide_postgresql>` database server, a dedicated user with a secure password and database for Synapse_.

.. code-block:: console
Expand All @@ -51,27 +51,19 @@ You need a running :lab:`Postgresql <guide_postgresql>` database server, a dedic
Installation
============

We will install synapse using pip, which makes it quite easy,
but we start with creating a virtual environment for synapse to run in.
We will install synapse using pip, which makes it quite easy:

.. code-block:: console
:emphasize-lines: 1,2,8,18,27,37
[isabell@stardust ~]$ mkdir -p ~/synapse
[isabell@stardust ~]$ virtualenv -p python3.6 ~/synapse/env
Running virtualenv with interpreter /usr/bin/python3.6
Using base prefix '/usr'
New python executable in /home/matrites/synapse/env/bin/python3.6
Also creating executable in /home/matrites/synapse/env/bin/python
Installing setuptools, pip, wheel...done.
[isabell@stardust ~]$ source ~/synapse/env/bin/activate
(env) [isabell@stardust ~]$ pip install jinja2
[isabell@stardust ~]$ pip install jinja2
Collecting jinja2
Using cached https://files.pythonhosted.org/packages/1d/e7/fd8b501e7a6dfe492a433deb7b9d833d39ca74916fa8bc63dd1a4947a671/Jinja2-2.10.1-py2.py3-none-any.whl
Requirement already satisfied: MarkupSafe>=0.23 in ./synapse/env/lib/python3.6/site-packages (from jinja2) (1.1.1)
Installing collected packages: jinja2
Successfully installed jinja2-2.10.1
(env) [isabell@stardust ~]$ pip install matrix-synapse
[isabell@stardust ~]$ pip install matrix-synapse
Collecting matrix-synapse
Collecting pyasn1-modules>=0.0.7 (from matrix-synapse)
Using cached https://files.pythonhosted.org/packages/91/f0/b03e00ce9fddf4827c42df1c3ce10c74eadebfb706231e8d6d1c356a4062/pyasn1_modules-0.2.5-py2.py3-none-any.whl
Expand Down Expand Up @@ -153,14 +145,7 @@ but we start with creating a virtual environment for synapse to run in.
Using cached https://files.pythonhosted.org/packages/e6/60/247f23a7121ae632d62811ba7f273d0e58972d75e58a94d329d51550a47d/urllib3-1.25.3-py2.py3-none-any.whl
Installing collected packages: pyasn1, pyasn1-modules, attrs, constantly, idna, hyperlink, zope.interface, six, Automat, PyHamcrest, incremental, Twisted, msgpack, simplejson, frozendict, canonicaljson, sortedcontainers, pyyaml, pycparser, cffi, pynacl, asn1crypto, cryptography, service-identity, unpaddedbase64, signedjson, pillow, daemonize, chardet, certifi, urllib3, requests, treq, bcrypt, pymacaroons, pyopenssl, psutil, pyrsistent, jsonschema, netaddr, phonenumbers, prometheus-client, matrix-synapse
Successfully installed Automat-0.7.0 PyHamcrest-1.9.0 Twisted-19.2.1 asn1crypto-0.24.0 attrs-19.1.0 bcrypt-3.1.6 canonicaljson-1.1.4 certifi-2019.6.16 cffi-1.12.3 chardet-3.0.4 constantly-15.1.0 cryptography-2.7 daemonize-2.5.0 frozendict-1.2 hyperlink-19.0.0 idna-2.8 incremental-17.5.0 jsonschema-3.0.1 matrix-synapse-1.0.0 msgpack-0.6.1 netaddr-0.7.19 phonenumbers-8.10.13 pillow-6.0.0 prometheus-client-0.3.1 psutil-5.6.3 pyasn1-0.4.5 pyasn1-modules-0.2.5 pycparser-2.19 pymacaroons-0.13.0 pynacl-1.3.0 pyopenssl-19.0.0 pyrsistent-0.15.2 pyyaml-5.1.1 requests-2.22.0 service-identity-18.1.0 signedjson-1.0.0 simplejson-3.16.0 six-1.12.0 sortedcontainers-2.1.0 treq-18.6.0 unpaddedbase64-1.1.0 urllib3-1.25.3 zope.interface-4.6.0
(env) [isabell@stardust ~]$ pip install jinja2
Collecting jinja2
Using cached https://files.pythonhosted.org/packages/1d/e7/fd8b501e7a6dfe492a433deb7b9d833d39ca74916fa8bc63dd1a4947a671/Jinja2-2.10.1-py2.py3-none-any.whl
Collecting MarkupSafe>=0.23 (from jinja2)
Using cached https://files.pythonhosted.org/packages/b2/5f/23e0023be6bb885d00ffbefad2942bc51a620328ee910f64abe5a8d18dd1/MarkupSafe-1.1.1-cp36-cp36m-manylinux1_x86_64.whl
Installing collected packages: MarkupSafe, jinja2
Successfully installed MarkupSafe-1.1.1 jinja2-2.10.1
(env) [isabell@stardust ~]$ pip install psycopg2
[isabell@stardust ~]$ pip install psycopg2
Collecting psycopg2
Downloading https://files.pythonhosted.org/packages/5c/1c/6997288da181277a0c29bc39a5f9143ff20b8c99f2a7d059cfb55163e165/psycopg2-2.8.3.tar.gz (377kB)
|████████████████████████████████| 378kB 21.4MB/s
Expand All @@ -171,7 +156,7 @@ but we start with creating a virtual environment for synapse to run in.
Installing collected packages: psycopg2
Successfully installed psycopg2-2.8.3
(env) [isabell@stardust ~]$
[isabell@stardust ~]$
Configuration
Expand All @@ -183,16 +168,15 @@ Generate standard config
Generate a config file ``~/synapse/homeserver.yaml`` and replace my.domain.name with the real domain you want your matrix username to end in.

.. code-block:: console
:emphasize-lines: 7
:emphasize-lines: 3,6
[isabell@stardust ~]$ source ~/synapse/env/bin/activate
(env) [isabell@stardust ~]$ cd ~/synapse
(env) [isabell@stardust synapse]$ python -m synapse.app.homeserver \
[isabell@stardust ~]$ cd ~/synapse
[isabell@stardust synapse]$ python -m synapse.app.homeserver \
--server-name my.domain.name \
--config-path homeserver.yaml \
--generate-config \
--report-stats=[yes|no]
(env) [isabell@stardust ~]$
[isabell@stardust ~]$
Set the Synapse_ to listen for federation and clients on the correct localhost without encryption in the config file ``~/synapse/homeserver.yaml``. To do this, locate the `listeners:` section and modify the entry with `port: 8008`:
.. code-block:: yaml
Expand Down Expand Up @@ -298,30 +282,17 @@ Create ``~/etc/services.d/synapse.ini`` with the following content:
.. code-block:: ini
[program:synapse]
command=%(ENV_HOME)s/synapse/env/bin/python3.6 -m synapse.app.homeserver -c %(ENV_HOME)s/synapse/homeserver.yaml
command=python3.6 -m synapse.app.homeserver -c %(ENV_HOME)s/synapse/homeserver.yaml
autostart=yes
autorestart=yes
environment=
PATH="/home/matrites/synapse/env/bin:%(ENV_HOME)s/opt/postgresql/bin/:$PATH",
PATH="%(ENV_HOME)s/opt/postgresql/bin/:$PATH",
LD_LIBRARY_PATH="$LD_LIBRARY_PATH:%(ENV_HOME)s/opt/postgresql/lib",
PGPASSFILE=%(ENV_HOME)s/.pgpass,
PGHOST=localhost,
PGPORT=5432
Tell :manual:`supervisord <daemons-supervisord>` to refresh its configuration and start the service:

.. code-block:: console
[isabell@stardust ~]$ supervisorctl reread
synapse: available
[isabell@stardust ~]$ supervisorctl update
synapse: added process group
[isabell@stardust ~]$ supervisorctl status
synapse RUNNING pid 26020, uptime 0:03:14
[isabell@stardust ~]$
If it's not in state RUNNING, check your configuration.
.. include:: includes/supervisord.rst

Updates
=======
Expand All @@ -330,8 +301,7 @@ Watch MatrixRSS_ to be notified of upgrades and if there is a update, use pip to

.. code-block:: console
[isabell@stardust ~]$ source ~/synapse/env/bin/activate
(env) [isabell@stardust ~]$ pip install -U matrix-synapse
[isabell@stardust ~]$ pip install -U matrix-synapse
[isabell@stardust ~]$
Expand All @@ -345,16 +315,15 @@ Users can be added from the CLI:

.. code-block:: console
[isabell@stardust ~]$ source ~/synapse/env/bin/activate
(env) [isabell@stardust ~]$ cd ~/synapse
(env) [isabell@stardust synape]$ register_new_matrix_user -c homeserver.yaml https://my.domain.name:PORT
[isabell@stardust ~]$ cd ~/synapse
[isabell@stardust synape]$ register_new_matrix_user -c homeserver.yaml https://my.domain.name:PORT
New user localpart [isabell]: USER
Password:
Confirm password:
Make admin [no]: no
Sending registration request...
Success!
(env) [isabell@stardust synapse]$
[isabell@stardust synapse]$
Password reset
--------------
Expand All @@ -363,7 +332,7 @@ Passwords can be reset using the cli; first generate the hash of the new passwor

.. code-block:: console
[isabell@stardust ~]$ ~/synapse/env/bin/hash_password
[isabell@stardust ~]$ hash_password
Password:
Confirm password:
$2b$12$yK16TMDMnvj97GFBoxF9QeP2N.U8oadindcjB0Uo9TkSI3CsgwV02
Expand Down

0 comments on commit f55b3fd

Please sign in to comment.