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

Commit 4294ed1

Browse files
committed
Merge branch 'develop' of github.com:matrix-org/synapse into anoa/async_is_server_admin_user_can_delete_alias
* 'develop' of github.com:matrix-org/synapse: (382 commits) Convert http.HTTPStatus objects to their int equivalent (#7188) Reduce the number of calls to `resource.getrusage` (#7183) Remove some `run_in_background` calls in replication code (#7203) Revert "Revert "Merge pull request #7153 from matrix-org/babolivier/sso_whitelist_login_fallback"" Revert "Revert "Improve the UX of the login fallback when using SSO (#7152)"" Revert "Merge pull request #7153 from matrix-org/babolivier/sso_whitelist_login_fallback" Revert "Improve the UX of the login fallback when using SSO (#7152)" tweak changelog 1.12.3 Update docstring per review comments Fix device list update stream ids going backward (#7158) Fix the debian build in a better way. (#7212) Fix changelog wording 1.12.2 Pin Pillow>=4.3.0,<7.1.0 to fix dep issue 1.12.1 review comment 1.12.1 Support SAML in the user interactive authentication workflow. (#7102) Allow admins to create aliases when they are not in the room (#7191) ...
2 parents dd03599 + 07b88c5 commit 4294ed1

File tree

361 files changed

+12863
-7815
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

361 files changed

+12863
-7815
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
3+
# this script is run by buildkite in a plain `xenial` container; it installs the
4+
# minimal requirements for tox and hands over to the py35-old tox environment.
5+
6+
set -ex
7+
8+
apt-get update
9+
apt-get install -y python3.5 python3.5-dev python3-pip libxml2-dev libxslt-dev zlib1g-dev tox
10+
11+
export LANG="C.UTF-8"
12+
13+
exec tox -e py35-old,combine

.buildkite/worker-blacklist

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,5 @@ Server correctly handles incoming m.device_list_update
3939

4040
# this fails reliably with a torture level of 100 due to https://github.com/matrix-org/synapse/issues/6536
4141
Outbound federation requests missing prev_events and then asks for /state_ids and resolves the state
42+
43+
Can get rooms/{roomId}/members at a given point

CHANGES.md

Lines changed: 337 additions & 2 deletions
Large diffs are not rendered by default.

CONTRIBUTING.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ python 3.6 and to install each tool:
6060

6161
```
6262
# Install the dependencies
63-
pip install -U black flake8 isort
63+
pip install -U black flake8 flake8-comprehensions isort
6464
6565
# Run the linter script
6666
./scripts-dev/lint.sh
@@ -200,6 +200,20 @@ Git allows you to add this signoff automatically when using the `-s`
200200
flag to `git commit`, which uses the name and email set in your
201201
`user.name` and `user.email` git configs.
202202

203+
## Merge Strategy
204+
205+
We use the commit history of develop/master extensively to identify
206+
when regressions were introduced and what changes have been made.
207+
208+
We aim to have a clean merge history, which means we normally squash-merge
209+
changes into develop. For small changes this means there is no need to rebase
210+
to clean up your PR before merging. Larger changes with an organised set of
211+
commits may be merged as-is, if the history is judged to be useful.
212+
213+
This use of squash-merging will mean PRs built on each other will be hard to
214+
merge. We suggest avoiding these where possible, and if required, ensuring
215+
each PR has a tidy set of commits to ease merging.
216+
203217
## Conclusion
204218

205219
That's it! Matrix is a very open and collaborative project as you might expect

INSTALL.md

Lines changed: 68 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
- [Installing Synapse](#installing-synapse)
33
- [Installing from source](#installing-from-source)
44
- [Platform-Specific Instructions](#platform-specific-instructions)
5-
- [Troubleshooting Installation](#troubleshooting-installation)
65
- [Prebuilt packages](#prebuilt-packages)
76
- [Setting up Synapse](#setting-up-synapse)
87
- [TLS certificates](#tls-certificates)
98
- [Email](#email)
109
- [Registering a user](#registering-a-user)
1110
- [Setting up a TURN server](#setting-up-a-turn-server)
1211
- [URL previews](#url-previews)
12+
- [Troubleshooting Installation](#troubleshooting-installation)
1313

1414
# Choosing your server name
1515

@@ -36,7 +36,7 @@ that your email address is probably `[email protected]` rather than
3636
System requirements:
3737

3838
- POSIX-compliant system (tested on Linux & OS X)
39-
- Python 3.5, 3.6, 3.7 or 3.8.
39+
- Python 3.5.2 or later, up to Python 3.8.
4040
- At least 1GB of free RAM if you want to join large public rooms like #matrix:matrix.org
4141

4242
Synapse is written in Python but some of the libraries it uses are written in
@@ -70,7 +70,7 @@ pip install -U matrix-synapse
7070
```
7171

7272
Before you can start Synapse, you will need to generate a configuration
73-
file. To do this, run (in your virtualenv, as before)::
73+
file. To do this, run (in your virtualenv, as before):
7474

7575
```
7676
cd ~/synapse
@@ -84,22 +84,24 @@ python -m synapse.app.homeserver \
8484
... substituting an appropriate value for `--server-name`.
8585

8686
This command will generate you a config file that you can then customise, but it will
87-
also generate a set of keys for you. These keys will allow your Home Server to
88-
identify itself to other Home Servers, so don't lose or delete them. It would be
87+
also generate a set of keys for you. These keys will allow your homeserver to
88+
identify itself to other homeserver, so don't lose or delete them. It would be
8989
wise to back them up somewhere safe. (If, for whatever reason, you do need to
90-
change your Home Server's keys, you may find that other Home Servers have the
90+
change your homeserver's keys, you may find that other homeserver have the
9191
old key cached. If you update the signing key, you should change the name of the
9292
key in the `<server name>.signing.key` file (the second word) to something
9393
different. See the
9494
[spec](https://matrix.org/docs/spec/server_server/latest.html#retrieving-server-keys)
95-
for more information on key management.)
95+
for more information on key management).
9696

9797
To actually run your new homeserver, pick a working directory for Synapse to
98-
run (e.g. `~/synapse`), and::
98+
run (e.g. `~/synapse`), and:
9999

100-
cd ~/synapse
101-
source env/bin/activate
102-
synctl start
100+
```
101+
cd ~/synapse
102+
source env/bin/activate
103+
synctl start
104+
```
103105

104106
### Platform-Specific Instructions
105107

@@ -110,7 +112,7 @@ Installing prerequisites on Ubuntu or Debian:
110112
```
111113
sudo apt-get install build-essential python3-dev libffi-dev \
112114
python3-pip python3-setuptools sqlite3 \
113-
libssl-dev python3-virtualenv libjpeg-dev libxslt1-dev
115+
libssl-dev virtualenv libjpeg-dev libxslt1-dev
114116
```
115117

116118
#### ArchLinux
@@ -124,12 +126,21 @@ sudo pacman -S base-devel python python-pip \
124126

125127
#### CentOS/Fedora
126128

127-
Installing prerequisites on CentOS 7 or Fedora 25:
129+
Installing prerequisites on CentOS 8 or Fedora>26:
130+
131+
```
132+
sudo dnf install libtiff-devel libjpeg-devel libzip-devel freetype-devel \
133+
libwebp-devel tk-devel redhat-rpm-config \
134+
python3-virtualenv libffi-devel openssl-devel
135+
sudo dnf groupinstall "Development Tools"
136+
```
137+
138+
Installing prerequisites on CentOS 7 or Fedora<=25:
128139

129140
```
130141
sudo yum install libtiff-devel libjpeg-devel libzip-devel freetype-devel \
131142
lcms2-devel libwebp-devel tcl-devel tk-devel redhat-rpm-config \
132-
python-virtualenv libffi-devel openssl-devel
143+
python3-virtualenv libffi-devel openssl-devel
133144
sudo yum groupinstall "Development Tools"
134145
```
135146

@@ -179,15 +190,15 @@ doas pkg_add python libffi py-pip py-setuptools sqlite3 py-virtualenv \
179190
There is currently no port for OpenBSD. Additionally, OpenBSD's security
180191
settings require a slightly more difficult installation process.
181192

182-
XXX: I suspect this is out of date.
193+
(XXX: I suspect this is out of date)
183194

184195
1. Create a new directory in `/usr/local` called `_synapse`. Also, create a
185196
new user called `_synapse` and set that directory as the new user's home.
186197
This is required because, by default, OpenBSD only allows binaries which need
187198
write and execute permissions on the same memory space to be run from
188199
`/usr/local`.
189200
2. `su` to the new `_synapse` user and change to their home directory.
190-
3. Create a new virtualenv: `virtualenv -p python2.7 ~/.synapse`
201+
3. Create a new virtualenv: `virtualenv -p python3 ~/.synapse`
191202
4. Source the virtualenv configuration located at
192203
`/usr/local/_synapse/.synapse/bin/activate`. This is done in `ksh` by
193204
using the `.` command, rather than `bash`'s `source`.
@@ -208,45 +219,6 @@ be found at https://docs.microsoft.com/en-us/windows/wsl/install-win10 for
208219
Windows 10 and https://docs.microsoft.com/en-us/windows/wsl/install-on-server
209220
for Windows Server.
210221

211-
### Troubleshooting Installation
212-
213-
XXX a bunch of this is no longer relevant.
214-
215-
Synapse requires pip 8 or later, so if your OS provides too old a version you
216-
may need to manually upgrade it::
217-
218-
sudo pip install --upgrade pip
219-
220-
Installing may fail with `Could not find any downloads that satisfy the requirement pymacaroons-pynacl (from matrix-synapse==0.12.0)`.
221-
You can fix this by manually upgrading pip and virtualenv::
222-
223-
sudo pip install --upgrade virtualenv
224-
225-
You can next rerun `virtualenv -p python3 synapse` to update the virtual env.
226-
227-
Installing may fail during installing virtualenv with `InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.`
228-
You can fix this by manually installing ndg-httpsclient::
229-
230-
pip install --upgrade ndg-httpsclient
231-
232-
Installing may fail with `mock requires setuptools>=17.1. Aborting installation`.
233-
You can fix this by upgrading setuptools::
234-
235-
pip install --upgrade setuptools
236-
237-
If pip crashes mid-installation for reason (e.g. lost terminal), pip may
238-
refuse to run until you remove the temporary installation directory it
239-
created. To reset the installation::
240-
241-
rm -rf /tmp/pip_install_matrix
242-
243-
pip seems to leak *lots* of memory during installation. For instance, a Linux
244-
host with 512MB of RAM may run out of memory whilst installing Twisted. If this
245-
happens, you will have to individually install the dependencies which are
246-
failing, e.g.::
247-
248-
pip install twisted
249-
250222
## Prebuilt packages
251223

252224
As an alternative to installing from source, prebuilt packages are available
@@ -305,7 +277,7 @@ For `buster` and `sid`, Synapse is available in the Debian repositories and
305277
it should be possible to install it with simply:
306278

307279
```
308-
sudo apt install matrix-synapse
280+
sudo apt install matrix-synapse
309281
```
310282

311283
There is also a version of `matrix-synapse` in `stretch-backports`. Please see
@@ -366,15 +338,17 @@ sudo pip install py-bcrypt
366338

367339
Synapse can be found in the void repositories as 'synapse':
368340

369-
xbps-install -Su
370-
xbps-install -S synapse
341+
```
342+
xbps-install -Su
343+
xbps-install -S synapse
344+
```
371345

372346
### FreeBSD
373347

374348
Synapse can be installed via FreeBSD Ports or Packages contributed by Brendan Molloy from:
375349

376350
- Ports: `cd /usr/ports/net-im/py-matrix-synapse && make install clean`
377-
- Packages: `pkg install py27-matrix-synapse`
351+
- Packages: `pkg install py37-matrix-synapse`
378352

379353

380354
### NixOS
@@ -388,15 +362,17 @@ Once you have installed synapse as above, you will need to configure it.
388362

389363
## TLS certificates
390364

391-
The default configuration exposes a single HTTP port: http://localhost:8008. It
392-
is suitable for local testing, but for any practical use, you will either need
393-
to enable a reverse proxy, or configure Synapse to expose an HTTPS port.
365+
The default configuration exposes a single HTTP port on the local
366+
interface: `http://localhost:8008`. It is suitable for local testing,
367+
but for any practical use, you will need Synapse's APIs to be served
368+
over HTTPS.
394369

395-
For information on using a reverse proxy, see
370+
The recommended way to do so is to set up a reverse proxy on port
371+
`8448`. You can find documentation on doing so in
396372
[docs/reverse_proxy.md](docs/reverse_proxy.md).
397373

398-
To configure Synapse to expose an HTTPS port, you will need to edit
399-
`homeserver.yaml`, as follows:
374+
Alternatively, you can configure Synapse to expose an HTTPS port. To do
375+
so, you will need to edit `homeserver.yaml`, as follows:
400376

401377
* First, under the `listeners` section, uncomment the configuration for the
402378
TLS-enabled listener. (Remove the hash sign (`#`) at the start of
@@ -409,19 +385,23 @@ To configure Synapse to expose an HTTPS port, you will need to edit
409385
resources:
410386
- names: [client, federation]
411387
```
388+
412389
* You will also need to uncomment the `tls_certificate_path` and
413390
`tls_private_key_path` lines under the `TLS` section. You can either
414391
point these settings at an existing certificate and key, or you can
415392
enable Synapse's built-in ACME (Let's Encrypt) support. Instructions
416393
for having Synapse automatically provision and renew federation
417-
certificates through ACME can be found at [ACME.md](docs/ACME.md). If you
418-
are using your own certificate, be sure to use a `.pem` file that includes
419-
the full certificate chain including any intermediate certificates (for
420-
instance, if using certbot, use `fullchain.pem` as your certificate, not
394+
certificates through ACME can be found at [ACME.md](docs/ACME.md).
395+
Note that, as pointed out in that document, this feature will not
396+
work with installs set up after November 2019.
397+
398+
If you are using your own certificate, be sure to use a `.pem` file that
399+
includes the full certificate chain including any intermediate certificates
400+
(for instance, if using certbot, use `fullchain.pem` as your certificate, not
421401
`cert.pem`).
422402

423403
For a more detailed guide to configuring your server for federation, see
424-
[federate.md](docs/federate.md)
404+
[federate.md](docs/federate.md).
425405

426406

427407
## Email
@@ -468,7 +448,7 @@ on your server even if `enable_registration` is `false`.
468448
## Setting up a TURN server
469449

470450
For reliable VoIP calls to be routed via this homeserver, you MUST configure
471-
a TURN server. See [docs/turn-howto.md](docs/turn-howto.md) for details.
451+
a TURN server. See [docs/turn-howto.md](docs/turn-howto.md) for details.
472452

473453
## URL previews
474454

@@ -477,10 +457,24 @@ turn it on you must enable the `url_preview_enabled: True` config parameter
477457
and explicitly specify the IP ranges that Synapse is not allowed to spider for
478458
previewing in the `url_preview_ip_range_blacklist` configuration parameter.
479459
This is critical from a security perspective to stop arbitrary Matrix users
480-
spidering 'internal' URLs on your network. At the very least we recommend that
460+
spidering 'internal' URLs on your network. At the very least we recommend that
481461
your loopback and RFC1918 IP addresses are blacklisted.
482462

483-
This also requires the optional lxml and netaddr python dependencies to be
484-
installed. This in turn requires the libxml2 library to be available - on
463+
This also requires the optional `lxml` and `netaddr` python dependencies to be
464+
installed. This in turn requires the `libxml2` library to be available - on
485465
Debian/Ubuntu this means `apt-get install libxml2-dev`, or equivalent for
486466
your OS.
467+
468+
# Troubleshooting Installation
469+
470+
`pip` seems to leak *lots* of memory during installation. For instance, a Linux
471+
host with 512MB of RAM may run out of memory whilst installing Twisted. If this
472+
happens, you will have to individually install the dependencies which are
473+
failing, e.g.:
474+
475+
```
476+
pip install twisted
477+
```
478+
479+
If you have any other problems, feel free to ask in
480+
[#synapse:matrix.org](https://matrix.to/#/#synapse:matrix.org).

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ to install using pip and a virtualenv::
272272

273273
virtualenv -p python3 env
274274
source env/bin/activate
275-
python -m pip install --no-use-pep517 -e .[all]
275+
python -m pip install --no-use-pep517 -e ".[all]"
276276

277277
This will run a process of downloading and installing all the needed
278278
dependencies into a virtual env.

changelog.d/6573.bugfix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Don't attempt to use an invalid sqlite config if no database configuration is provided. Contributed by @nekatak.

changelog.d/6634.bugfix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix single-sign on with CAS systems: pass the same service URL when requesting the CAS ticket and when calling the `proxyValidate` URL. Contributed by @Naugrimm.

changelog.d/6639.bugfix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix missing field `default` when fetching user-defined push rules.

changelog.d/6825.bugfix

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)