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

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into server-notice-room…
Browse files Browse the repository at this point in the history
…-avatar
  • Loading branch information
Mathieu Velten committed Dec 6, 2023
2 parents c08beed + 44377f5 commit f0e96e8
Show file tree
Hide file tree
Showing 53 changed files with 1,026 additions and 134 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docs-pr-netlify.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
path: book

- name: 📤 Deploy to Netlify
uses: matrix-org/netlify-pr-preview@v2
uses: matrix-org/netlify-pr-preview@v3
with:
path: book
owner: ${{ github.event.workflow_run.head_repository.owner.login }}
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/docs-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,30 @@ on:
- docs/**
- book.toml
- .github/workflows/docs-pr.yaml
- scripts-dev/schema_versions.py

jobs:
pages:
name: GitHub Pages
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
# Fetch all history so that the schema_versions script works.
fetch-depth: 0

- name: Setup mdbook
uses: peaceiris/actions-mdbook@adeb05db28a0c0004681db83893d56c0388ea9ea # v1.2.0
with:
mdbook-version: '0.4.17'

- name: Setup python
uses: actions/setup-python@v4
with:
python-version: "3.x"

- run: "pip install 'packaging>=20.0' 'GitPython>=3.1.20'"

- name: Build the documentation
# mdbook will only create an index.html if we're including docs/README.md in SUMMARY.md.
# However, we're using docs/README.md for other purposes and need to pick a new page
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,22 @@ jobs:
- pre
steps:
- uses: actions/checkout@v4
with:
# Fetch all history so that the schema_versions script works.
fetch-depth: 0

- name: Setup mdbook
uses: peaceiris/actions-mdbook@adeb05db28a0c0004681db83893d56c0388ea9ea # v1.2.0
with:
mdbook-version: '0.4.17'

- name: Setup python
uses: actions/setup-python@v4
with:
python-version: "3.x"

- run: "pip install 'packaging>=20.0' 'GitPython>=3.1.20'"

- name: Build the documentation
# mdbook will only create an index.html if we're including docs/README.md in SUMMARY.md.
# However, we're using docs/README.md for other purposes and need to pick a new page
Expand Down
52 changes: 52 additions & 0 deletions .github/workflows/fix_lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# A helper workflow to automatically fixup any linting errors on a PR. Must be
# triggered manually.

name: Attempt to automatically fix linting errors

on:
workflow_dispatch:

jobs:
fixup:
name: Fix up
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
# We use nightly so that `fmt` correctly groups together imports, and
# clippy correctly fixes up the benchmarks.
toolchain: nightly-2022-12-01
components: rustfmt
- uses: Swatinem/rust-cache@v2

- name: Setup Poetry
uses: matrix-org/setup-python-poetry@v1
with:
install-project: "false"

- name: Import order (isort)
continue-on-error: true
run: poetry run isort .

- name: Code style (black)
continue-on-error: true
run: poetry run black .

- name: Semantic checks (ruff)
continue-on-error: true
run: poetry run ruff --fix .

- run: cargo clippy --all-features --fix -- -D warnings
continue-on-error: true

- run: cargo fmt
continue-on-error: true

- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "Attempt to fix linting"
81 changes: 80 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Synapse 1.97.0rc1 (2023-11-21)
# Synapse 1.98.0rc1 (2023-12-05)

Synapse 1.98.0 will be the last Synapse release in 2023; the regular release cadence will resume in January 2024.

Synapse will soon be forked by Element under an AGPLv3.0 licence (with CLA, for
proprietary dual licensing). You can read more about this here:
Expand All @@ -12,6 +14,83 @@ but we are striving to make this as seamless as possible.

### Features

- Synapse now declares support for Matrix v1.7, v1.8, and v1.9. ([\#16707](https://github.com/matrix-org/synapse/issues/16707))
- Add `on_user_login` [module API](https://matrix-org.github.io/synapse/latest/modules/writing_a_module.html) callback allowing to execute custom code after (on) Auth. ([\#15207](https://github.com/matrix-org/synapse/issues/15207))
- Support [MSC4069: Inhibit profile propagation](https://github.com/matrix-org/matrix-spec-proposals/pull/4069). ([\#16636](https://github.com/matrix-org/synapse/issues/16636))
- Restore tracking of requests and monthly active users when delegating authentication via [MSC3861](https://github.com/matrix-org/synapse/pull/16672) to an OIDC provider. ([\#16672](https://github.com/matrix-org/synapse/issues/16672))
- Add an autojoin setting for server notices rooms, so users may be joined directly instead of receiving an invite. ([\#16699](https://github.com/matrix-org/synapse/issues/16699))
- Follow redirects when downloading media over federation (per [MSC3860](https://github.com/matrix-org/matrix-spec-proposals/pull/3860)). ([\#16701](https://github.com/matrix-org/synapse/issues/16701))

### Bugfixes

- Enable refreshable tokens on the admin registration endpoint. ([\#16642](https://github.com/matrix-org/synapse/issues/16642))
- Consistently bypass rate limits when using the server notice admin API. ([\#16670](https://github.com/matrix-org/synapse/issues/16670))
- Fix a bug introduced in Synapse 1.7.2 where rooms whose power levels lacked an `events` field could not be upgraded. ([\#16725](https://github.com/matrix-org/synapse/issues/16725))
- Fix `GET /_synapse/admin/v1/federation/destinations` [admin API](https://matrix-org.github.io/synapse/latest/usage/administration/admin_api/index.html) returning null (instead of 0) for `retry_last_ts` and `retry_interval`. ([\#16729](https://github.com/matrix-org/synapse/issues/16729))

### Improved Documentation

- Add schema rollback information to documentation. ([\#16661](https://github.com/matrix-org/synapse/issues/16661))
- Fix poetry version typo in the [contributors' guide](https://matrix-org.github.io/synapse/latest/development/contributing_guide.html). ([\#16695](https://github.com/matrix-org/synapse/issues/16695))
- Switch the example UNIX socket paths to `/run`. Add HAProxy example configuration for UNIX sockets. ([\#16700](https://github.com/matrix-org/synapse/issues/16700))
- Add documentation for how to validate the configuration file with `synapse.config` script. ([\#16714](https://github.com/matrix-org/synapse/issues/16714))

### Internal Changes

- Clean-up unused tables. ([\#16522](https://github.com/matrix-org/synapse/issues/16522))
- Reduce a little database load while processing state auth chains. ([\#16552](https://github.com/matrix-org/synapse/issues/16552))
- Reduce database load of pruning old `user_ips`. ([\#16667](https://github.com/matrix-org/synapse/issues/16667))
- Reduce DB load when forget on leave setting is disabled. ([\#16668](https://github.com/matrix-org/synapse/issues/16668))
- Ignore `encryption_enabled_by_default_for_room_type` setting when creating server notices room, since the notices will be send unencrypted anyway. ([\#16677](https://github.com/matrix-org/synapse/issues/16677))
- Correctly read the to-device stream ID on startup using SQLite. ([\#16682](https://github.com/matrix-org/synapse/issues/16682))
- Reoranganise test files. ([\#16684](https://github.com/matrix-org/synapse/issues/16684))
- Remove old full schema dumps which are no longer used. ([\#16697](https://github.com/matrix-org/synapse/issues/16697))
- Raise poetry-core upper bound to <=1.8.1. This allows contributors to import Synapse after `poetry install`ing with Poetry 1.6 and above. Contributed by Mo Balaa. ([\#16702](https://github.com/matrix-org/synapse/issues/16702))
- Add a workflow to try and automatically fixup linting in a PR. ([\#16704](https://github.com/matrix-org/synapse/issues/16704))


### Updates to locked dependencies

* Bump cryptography from 41.0.5 to 41.0.6. ([\#16703](https://github.com/matrix-org/synapse/issues/16703))
* Bump cryptography from 41.0.6 to 41.0.7. ([\#16721](https://github.com/matrix-org/synapse/issues/16721))
* Bump idna from 3.4 to 3.6. ([\#16720](https://github.com/matrix-org/synapse/issues/16720))
* Bump jsonschema from 4.19.1 to 4.20.0. ([\#16692](https://github.com/matrix-org/synapse/issues/16692))
* Bump matrix-org/netlify-pr-preview from 2 to 3. ([\#16719](https://github.com/matrix-org/synapse/issues/16719))
* Bump phonenumbers from 8.13.23 to 8.13.26. ([\#16722](https://github.com/matrix-org/synapse/issues/16722))
* Bump prometheus-client from 0.18.0 to 0.19.0. ([\#16691](https://github.com/matrix-org/synapse/issues/16691))
* Bump pyasn1 from 0.5.0 to 0.5.1. ([\#16689](https://github.com/matrix-org/synapse/issues/16689))
* Bump pydantic from 2.4.2 to 2.5.1. ([\#16663](https://github.com/matrix-org/synapse/issues/16663))
* Bump pyo3 (0.19.2→0.20.0), pythonize (0.19.0→0.20.0) and pyo3-log (0.8.1→0.9.0). ([\#16673](https://github.com/matrix-org/synapse/issues/16673))
* Bump pyopenssl from 23.2.0 to 23.3.0. ([\#16662](https://github.com/matrix-org/synapse/issues/16662))
* Bump ruff from 0.1.4 to 0.1.6. ([\#16690](https://github.com/matrix-org/synapse/issues/16690))
* Bump sentry-sdk from 1.32.0 to 1.35.0. ([\#16666](https://github.com/matrix-org/synapse/issues/16666))
* Bump serde from 1.0.192 to 1.0.193. ([\#16693](https://github.com/matrix-org/synapse/issues/16693))
* Bump sphinx-autodoc2 from 0.4.2 to 0.5.0. ([\#16723](https://github.com/matrix-org/synapse/issues/16723))
* Bump types-jsonschema from 4.19.0.4 to 4.20.0.0. ([\#16724](https://github.com/matrix-org/synapse/issues/16724))
* Bump types-pillow from 10.1.0.0 to 10.1.0.2. ([\#16664](https://github.com/matrix-org/synapse/issues/16664))
* Bump types-psycopg2 from 2.9.21.15 to 2.9.21.16. ([\#16665](https://github.com/matrix-org/synapse/issues/16665))
* Bump types-setuptools from 68.2.0.0 to 68.2.0.2. ([\#16688](https://github.com/matrix-org/synapse/issues/16688))

# Synapse 1.97.0 (2023-11-28)

Synapse will soon be forked by Element under an AGPLv3.0 licence (with CLA, for
proprietary dual licensing). You can read more about this here:

- https://matrix.org/blog/2023/11/06/future-of-synapse-dendrite/
- https://element.io/blog/element-to-adopt-agplv3/

The Matrix.org Foundation copy of the project will be archived. Any changes needed
by server administrators will be communicated via our usual announcements channels,
but we are striving to make this as seamless as possible.


No significant changes since 1.97.0rc1.


# Synapse 1.97.0rc1 (2023-11-21)

### Features

- Add support for asynchronous uploads as defined by [MSC2246](https://github.com/matrix-org/matrix-spec-proposals/pull/2246). Contributed by @sumnerevans at @beeper. ([\#15503](https://github.com/matrix-org/synapse/issues/15503))
- Improve the performance of some operations in multi-worker deployments. ([\#16613](https://github.com/matrix-org/synapse/issues/16613), [\#16616](https://github.com/matrix-org/synapse/issues/16616))

Expand Down
5 changes: 4 additions & 1 deletion book.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,7 @@ additional-css = [
"docs/website_files/indent-section-headers.css",
]
additional-js = ["docs/website_files/table-of-contents.js"]
theme = "docs/website_files/theme"
theme = "docs/website_files/theme"

[preprocessor.schema_versions]
command = "./scripts-dev/schema_versions.py"
1 change: 0 additions & 1 deletion changelog.d/16552.misc

This file was deleted.

1 change: 0 additions & 1 deletion changelog.d/16642.bugfix

This file was deleted.

1 change: 0 additions & 1 deletion changelog.d/16670.bugfix

This file was deleted.

1 change: 0 additions & 1 deletion changelog.d/16672.feature

This file was deleted.

1 change: 0 additions & 1 deletion changelog.d/16673.misc

This file was deleted.

1 change: 0 additions & 1 deletion changelog.d/16677.misc

This file was deleted.

1 change: 0 additions & 1 deletion changelog.d/16682.misc

This file was deleted.

1 change: 0 additions & 1 deletion changelog.d/16684.misc

This file was deleted.

1 change: 0 additions & 1 deletion changelog.d/16695.doc

This file was deleted.

1 change: 0 additions & 1 deletion changelog.d/16697.misc

This file was deleted.

12 changes: 12 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
matrix-synapse-py3 (1.98.0~rc1) stable; urgency=medium

* New Synapse release 1.98.0rc1.

-- Synapse Packaging team <[email protected]> Tue, 05 Dec 2023 13:08:42 +0000

matrix-synapse-py3 (1.97.0) stable; urgency=medium

* New Synapse release 1.97.0.

-- Synapse Packaging team <[email protected]> Tue, 28 Nov 2023 14:08:58 +0000

matrix-synapse-py3 (1.97.0~rc1) stable; urgency=medium

* New Synapse release 1.97.0rc1.
Expand Down
13 changes: 13 additions & 0 deletions docs/modules/account_validity_callbacks.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,16 @@ operations to keep track of them. (e.g. add them to a database table). The user
represented by their Matrix user ID.

If multiple modules implement this callback, Synapse runs them all in order.

### `on_user_login`

_First introduced in Synapse v1.98.0_

```python
async def on_user_login(user_id: str, auth_provider_type: str, auth_provider_id: str) -> None
```

Called after successfully login or registration of a user for cases when module needs to perform extra operations after auth.
represented by their Matrix user ID.

If multiple modules implement this callback, Synapse runs them all in order.
6 changes: 5 additions & 1 deletion docs/reverse_proxy.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,11 @@ frontend matrix-federation
backend matrix
server matrix 127.0.0.1:8008
```

Example configuration, if using a UNIX socket. The configuration lines regarding the frontends do not need to be modified.
```
backend matrix
server matrix unix@/run/synapse/main_public.sock
```

[Delegation](delegate.md) example:
```
Expand Down
3 changes: 3 additions & 0 deletions docs/server_notices.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ server_notices:
room_name: "Server Notices"
room_avatar_url: "mxc://server.com/oumMVlgDnLYFaPVkExemNVVZ"
room_topic: "Room used by your server admin to notice you of important information"
auto_join: true
```
The only compulsory setting is `system_mxid_localpart`, which defines the user
Expand All @@ -57,6 +58,8 @@ room which will be created, `room_avatar_url` its avatar and `room_topic` its to
`system_mxid_display_name` and `system_mxid_avatar_url` can be used to set the
displayname and avatar of the Server Notices user.

`auto_join` will autojoin users to the notices room instead of sending an invite.

## Sending notices

To send server notices to users you can use the
Expand Down
9 changes: 9 additions & 0 deletions docs/upgrade.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,15 @@ process, for example:
dpkg -i matrix-synapse-py3_1.3.0+stretch1_amd64.deb
```
Generally Synapse database schemas are compatible across multiple versions, once
a version of Synapse is deployed you may not be able to rollback automatically.
The following table gives the version ranges and the earliest version they can
be rolled back to. E.g. Synapse versions v1.58.0 through v1.61.1 can be rolled
back safely to v1.57.0, but starting with v1.62.0 it is only safe to rollback to
v1.61.0.
<!-- REPLACE_WITH_SCHEMA_VERSIONS -->
# Upgrading to v1.93.0
## Minimum supported Rust version
Expand Down
34 changes: 27 additions & 7 deletions docs/usage/configuration/config_documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,23 @@ In addition, configuration options referring to size use the following suffixes:
For example, setting `max_avatar_size: 10M` means that Synapse will not accept files larger than 10,485,760 bytes
for a user avatar.

## Config Validation

The configuration file can be validated with the following command:
```bash
python -m synapse.config read <config key to print> -c <path to config>
```

To validate the entire file, omit `read <config key to print>`:
```bash
python -m synapse.config -c <path to config>
```

To see how to set other options, check the help reference:
```bash
python -m synapse.config --help
```

### YAML
The configuration file is a [YAML](https://yaml.org/) file, which means that certain syntax rules
apply if you want your config file to be read properly. A few helpful things to know:
Expand Down Expand Up @@ -566,7 +583,7 @@ listeners:
# Note that x_forwarded will default to true, when using a UNIX socket. Please see
# https://matrix-org.github.io/synapse/latest/reverse_proxy.html.
#
- path: /var/run/synapse/main_public.sock
- path: /run/synapse/main_public.sock
type: http
resources:
- names: [client, federation]
Expand Down Expand Up @@ -3817,6 +3834,8 @@ Sub-options for this setting include:
* `room_name`: set the room name of the server notices room
* `room_avatar_url`: set the room avatar of the server notices room _Added in Synapse 1.98.0._
* `room_topic`: set the room topic of the server notices room _Added in Synapse 1.98.0._
* `auto_join`: boolean. If true, the user will be automatically joined to the room instead of being invited.
Defaults to false. _Added in Synapse 1.98.0._

Note that it will only be updated when a new notice event is sent.

Expand All @@ -3829,6 +3848,7 @@ server_notices:
room_name: "Server Notices"
room_avatar_url: "mxc://server.com/oumMVlgDnLYFaPVkExemNVVZ"
room_topic: "Room used by your server admin to notice you of important information"
auto_join: true
```
---
### `enable_room_list_search`
Expand Down Expand Up @@ -4221,9 +4241,9 @@ Example configuration(#2, for UNIX sockets):
```yaml
instance_map:
main:
path: /var/run/synapse/main_replication.sock
path: /run/synapse/main_replication.sock
worker1:
path: /var/run/synapse/worker1_replication.sock
path: /run/synapse/worker1_replication.sock
```
---
### `stream_writers`
Expand Down Expand Up @@ -4409,13 +4429,13 @@ Example configuration(#2, using UNIX sockets with a `replication` listener):
```yaml
worker_listeners:
- type: http
path: /var/run/synapse/worker_public.sock
path: /run/synapse/worker_replication.sock
resources:
- names: [client, federation]
- names: [replication]
- type: http
path: /var/run/synapse/worker_replication.sock
path: /run/synapse/worker_public.sock
resources:
- names: [replication]
- names: [client, federation]
```
---
### `worker_manhole`
Expand Down
Loading

0 comments on commit f0e96e8

Please sign in to comment.