Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b9c5d133b1 | |||
| b7041386a4 |
@@ -21,7 +21,7 @@ python -m synapse.app.homeserver --generate-keys -c .ci/sqlite-config.yaml
|
|||||||
echo "--- Prepare test database"
|
echo "--- Prepare test database"
|
||||||
|
|
||||||
# Make sure the SQLite3 database is using the latest schema and has no pending background update.
|
# Make sure the SQLite3 database is using the latest schema and has no pending background update.
|
||||||
update_synapse_database --database-config .ci/sqlite-config.yaml --run-background-updates
|
scripts/update_synapse_database --database-config .ci/sqlite-config.yaml --run-background-updates
|
||||||
|
|
||||||
# Run the export-data command on the sqlite test database
|
# Run the export-data command on the sqlite test database
|
||||||
python -m synapse.app.admin_cmd -c .ci/sqlite-config.yaml export-data @anon-20191002_181700-832:localhost:8800 \
|
python -m synapse.app.admin_cmd -c .ci/sqlite-config.yaml export-data @anon-20191002_181700-832:localhost:8800 \
|
||||||
@@ -41,7 +41,7 @@ fi
|
|||||||
|
|
||||||
# Port the SQLite databse to postgres so we can check command works against postgres
|
# Port the SQLite databse to postgres so we can check command works against postgres
|
||||||
echo "+++ Port SQLite3 databse to postgres"
|
echo "+++ Port SQLite3 databse to postgres"
|
||||||
synapse_port_db --sqlite-database .ci/test_db.db --postgres-config .ci/postgres-config.yaml
|
scripts/synapse_port_db --sqlite-database .ci/test_db.db --postgres-config .ci/postgres-config.yaml
|
||||||
|
|
||||||
# Run the export-data command on postgres database
|
# Run the export-data command on postgres database
|
||||||
python -m synapse.app.admin_cmd -c .ci/postgres-config.yaml export-data @anon-20191002_181700-832:localhost:8800 \
|
python -m synapse.app.admin_cmd -c .ci/postgres-config.yaml export-data @anon-20191002_181700-832:localhost:8800 \
|
||||||
|
|||||||
@@ -1,20 +1,16 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
# this script is run by GitHub Actions in a plain `focal` container; it installs the
|
|
||||||
# minimal requirements for tox and hands over to the py3-old tox environment.
|
|
||||||
|
|
||||||
# Prevent tzdata from asking for user input
|
# this script is run by GitHub Actions in a plain `bionic` container; it installs the
|
||||||
export DEBIAN_FRONTEND=noninteractive
|
# minimal requirements for tox and hands over to the py3-old tox environment.
|
||||||
|
|
||||||
set -ex
|
set -ex
|
||||||
|
|
||||||
apt-get update
|
apt-get update
|
||||||
apt-get install -y \
|
apt-get install -y python3 python3-dev python3-pip libxml2-dev libxslt-dev xmlsec1 zlib1g-dev tox
|
||||||
python3 python3-dev python3-pip python3-venv \
|
|
||||||
libxml2-dev libxslt-dev xmlsec1 zlib1g-dev tox libjpeg-dev libwebp-dev
|
|
||||||
|
|
||||||
export LANG="C.UTF-8"
|
export LANG="C.UTF-8"
|
||||||
|
|
||||||
# Prevent virtualenv from auto-updating pip to an incompatible version
|
# Prevent virtualenv from auto-updating pip to an incompatible version
|
||||||
export VIRTUALENV_NO_DOWNLOAD=1
|
export VIRTUALENV_NO_DOWNLOAD=1
|
||||||
|
|
||||||
exec tox -e py3-old
|
exec tox -e py3-old,combine
|
||||||
|
|||||||
@@ -25,19 +25,17 @@ python -m synapse.app.homeserver --generate-keys -c .ci/sqlite-config.yaml
|
|||||||
echo "--- Prepare test database"
|
echo "--- Prepare test database"
|
||||||
|
|
||||||
# Make sure the SQLite3 database is using the latest schema and has no pending background update.
|
# Make sure the SQLite3 database is using the latest schema and has no pending background update.
|
||||||
update_synapse_database --database-config .ci/sqlite-config.yaml --run-background-updates
|
scripts/update_synapse_database --database-config .ci/sqlite-config.yaml --run-background-updates
|
||||||
|
|
||||||
# Create the PostgreSQL database.
|
# Create the PostgreSQL database.
|
||||||
.ci/scripts/postgres_exec.py "CREATE DATABASE synapse"
|
.ci/scripts/postgres_exec.py "CREATE DATABASE synapse"
|
||||||
|
|
||||||
echo "+++ Run synapse_port_db against test database"
|
echo "+++ Run synapse_port_db against test database"
|
||||||
# TODO: this invocation of synapse_port_db (and others below) used to be prepended with `coverage run`,
|
coverage run scripts/synapse_port_db --sqlite-database .ci/test_db.db --postgres-config .ci/postgres-config.yaml
|
||||||
# but coverage seems unable to find the entrypoints installed by `pip install -e .`.
|
|
||||||
synapse_port_db --sqlite-database .ci/test_db.db --postgres-config .ci/postgres-config.yaml
|
|
||||||
|
|
||||||
# We should be able to run twice against the same database.
|
# We should be able to run twice against the same database.
|
||||||
echo "+++ Run synapse_port_db a second time"
|
echo "+++ Run synapse_port_db a second time"
|
||||||
synapse_port_db --sqlite-database .ci/test_db.db --postgres-config .ci/postgres-config.yaml
|
coverage run scripts/synapse_port_db --sqlite-database .ci/test_db.db --postgres-config .ci/postgres-config.yaml
|
||||||
|
|
||||||
#####
|
#####
|
||||||
|
|
||||||
@@ -48,7 +46,7 @@ echo "--- Prepare empty SQLite database"
|
|||||||
# we do this by deleting the sqlite db, and then doing the same again.
|
# we do this by deleting the sqlite db, and then doing the same again.
|
||||||
rm .ci/test_db.db
|
rm .ci/test_db.db
|
||||||
|
|
||||||
update_synapse_database --database-config .ci/sqlite-config.yaml --run-background-updates
|
scripts/update_synapse_database --database-config .ci/sqlite-config.yaml --run-background-updates
|
||||||
|
|
||||||
# re-create the PostgreSQL database.
|
# re-create the PostgreSQL database.
|
||||||
.ci/scripts/postgres_exec.py \
|
.ci/scripts/postgres_exec.py \
|
||||||
@@ -56,4 +54,4 @@ update_synapse_database --database-config .ci/sqlite-config.yaml --run-backgroun
|
|||||||
"CREATE DATABASE synapse"
|
"CREATE DATABASE synapse"
|
||||||
|
|
||||||
echo "+++ Run synapse_port_db against empty database"
|
echo "+++ Run synapse_port_db against empty database"
|
||||||
synapse_port_db --sqlite-database .ci/test_db.db --postgres-config .ci/postgres-config.yaml
|
coverage run scripts/synapse_port_db --sqlite-database .ci/test_db.db --postgres-config .ci/postgres-config.yaml
|
||||||
|
|||||||
@@ -3,9 +3,11 @@
|
|||||||
|
|
||||||
# things to include
|
# things to include
|
||||||
!docker
|
!docker
|
||||||
|
!scripts
|
||||||
!synapse
|
!synapse
|
||||||
!MANIFEST.in
|
!MANIFEST.in
|
||||||
!README.rst
|
!README.rst
|
||||||
!setup.py
|
!setup.py
|
||||||
|
!synctl
|
||||||
|
|
||||||
**/__pycache__
|
**/__pycache__
|
||||||
|
|||||||
@@ -1,11 +0,0 @@
|
|||||||
# TODO: incorporate this into pyproject.toml if flake8 supports it in the future.
|
|
||||||
# See https://github.com/PyCQA/flake8/issues/234
|
|
||||||
[flake8]
|
|
||||||
# see https://pycodestyle.readthedocs.io/en/latest/intro.html#error-codes
|
|
||||||
# for error codes. The ones we ignore are:
|
|
||||||
# W503: line break before binary operator
|
|
||||||
# W504: line break after binary operator
|
|
||||||
# E203: whitespace before ':' (which is contrary to pep8?)
|
|
||||||
# E731: do not assign a lambda expression, use a def
|
|
||||||
# E501: Line too long (black enforces this for us)
|
|
||||||
ignore=W503,W504,E203,E731,E501
|
|
||||||
@@ -8,7 +8,6 @@
|
|||||||
- Use markdown where necessary, mostly for `code blocks`.
|
- Use markdown where necessary, mostly for `code blocks`.
|
||||||
- End with either a period (.) or an exclamation mark (!).
|
- End with either a period (.) or an exclamation mark (!).
|
||||||
- Start with a capital letter.
|
- Start with a capital letter.
|
||||||
- Feel free to credit yourself, by adding a sentence "Contributed by @github_username." or "Contributed by [Your Name]." to the end of the entry.
|
|
||||||
* [ ] Pull request includes a [sign off](https://matrix-org.github.io/synapse/latest/development/contributing_guide.html#sign-off)
|
* [ ] Pull request includes a [sign off](https://matrix-org.github.io/synapse/latest/development/contributing_guide.html#sign-off)
|
||||||
* [ ] [Code style](https://matrix-org.github.io/synapse/latest/code_style.html) is correct
|
* [ ] [Code style](https://matrix-org.github.io/synapse/latest/code_style.html) is correct
|
||||||
(run the [linters](https://matrix-org.github.io/synapse/latest/development/contributing_guide.html#run-the-linters))
|
(run the [linters](https://matrix-org.github.io/synapse/latest/development/contributing_guide.html#run-the-linters))
|
||||||
|
|||||||
@@ -34,8 +34,6 @@ jobs:
|
|||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
|
||||||
# TODO: consider using https://github.com/docker/metadata-action instead of this
|
|
||||||
# custom magic
|
|
||||||
- name: Calculate docker image tag
|
- name: Calculate docker image tag
|
||||||
id: set-tag
|
id: set-tag
|
||||||
run: |
|
run: |
|
||||||
@@ -55,6 +53,18 @@ jobs:
|
|||||||
esac
|
esac
|
||||||
echo "::set-output name=tag::$tag"
|
echo "::set-output name=tag::$tag"
|
||||||
|
|
||||||
|
# for release builds, we want to get the amd64 image out asap, so first
|
||||||
|
# we do an amd64-only build, before following up with a multiarch build.
|
||||||
|
- name: Build and push amd64
|
||||||
|
uses: docker/build-push-action@v2
|
||||||
|
if: "${{ startsWith(github.ref, 'refs/tags/v') }}"
|
||||||
|
with:
|
||||||
|
push: true
|
||||||
|
labels: "gitsha1=${{ github.sha }}"
|
||||||
|
tags: "matrixdotorg/synapse:${{ steps.set-tag.outputs.tag }}"
|
||||||
|
file: "docker/Dockerfile"
|
||||||
|
platforms: linux/amd64
|
||||||
|
|
||||||
- name: Build and push all platforms
|
- name: Build and push all platforms
|
||||||
uses: docker/build-push-action@v2
|
uses: docker/build-push-action@v2
|
||||||
with:
|
with:
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ on:
|
|||||||
# of things breaking (but only build one set of debs)
|
# of things breaking (but only build one set of debs)
|
||||||
pull_request:
|
pull_request:
|
||||||
push:
|
push:
|
||||||
branches: ["develop", "release-*"]
|
branches: ["develop"]
|
||||||
|
|
||||||
# we do the full build on tags.
|
# we do the full build on tags.
|
||||||
tags: ["v*"]
|
tags: ["v*"]
|
||||||
@@ -31,7 +31,7 @@ jobs:
|
|||||||
# if we're running from a tag, get the full list of distros; otherwise just use debian:sid
|
# if we're running from a tag, get the full list of distros; otherwise just use debian:sid
|
||||||
dists='["debian:sid"]'
|
dists='["debian:sid"]'
|
||||||
if [[ $GITHUB_REF == refs/tags/* ]]; then
|
if [[ $GITHUB_REF == refs/tags/* ]]; then
|
||||||
dists=$(scripts-dev/build_debian_packages.py --show-dists-json)
|
dists=$(scripts-dev/build_debian_packages --show-dists-json)
|
||||||
fi
|
fi
|
||||||
echo "::set-output name=distros::$dists"
|
echo "::set-output name=distros::$dists"
|
||||||
# map the step outputs to job outputs
|
# map the step outputs to job outputs
|
||||||
@@ -74,7 +74,7 @@ jobs:
|
|||||||
# see https://github.com/docker/build-push-action/issues/252
|
# see https://github.com/docker/build-push-action/issues/252
|
||||||
# for the cache magic here
|
# for the cache magic here
|
||||||
run: |
|
run: |
|
||||||
./src/scripts-dev/build_debian_packages.py \
|
./src/scripts-dev/build_debian_packages \
|
||||||
--docker-build-arg=--cache-from=type=local,src=/tmp/.buildx-cache \
|
--docker-build-arg=--cache-from=type=local,src=/tmp/.buildx-cache \
|
||||||
--docker-build-arg=--cache-to=type=local,mode=max,dest=/tmp/.buildx-cache-new \
|
--docker-build-arg=--cache-to=type=local,mode=max,dest=/tmp/.buildx-cache-new \
|
||||||
--docker-build-arg=--progress=plain \
|
--docker-build-arg=--progress=plain \
|
||||||
@@ -91,7 +91,17 @@ jobs:
|
|||||||
|
|
||||||
build-sdist:
|
build-sdist:
|
||||||
name: "Build pypi distribution files"
|
name: "Build pypi distribution files"
|
||||||
uses: "matrix-org/backend-meta/.github/workflows/packaging.yml@v1"
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- uses: actions/setup-python@v2
|
||||||
|
- run: pip install wheel
|
||||||
|
- run: |
|
||||||
|
python setup.py sdist bdist_wheel
|
||||||
|
- uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: python-dist
|
||||||
|
path: dist/*
|
||||||
|
|
||||||
# if it's a tag, create a release and attach the artifacts to it
|
# if it's a tag, create a release and attach the artifacts to it
|
||||||
attach-assets:
|
attach-assets:
|
||||||
@@ -112,8 +122,7 @@ jobs:
|
|||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
with:
|
with:
|
||||||
files: |
|
files: |
|
||||||
Sdist/*
|
python-dist/*
|
||||||
Wheel/*
|
|
||||||
debs.tar.xz
|
debs.tar.xz
|
||||||
# if it's not already published, keep the release as a draft.
|
# if it's not already published, keep the release as a draft.
|
||||||
draft: true
|
draft: true
|
||||||
|
|||||||
+56
-48
@@ -10,20 +10,12 @@ concurrency:
|
|||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
check-sampleconfig:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
- uses: actions/setup-python@v2
|
|
||||||
- run: pip install -e .
|
|
||||||
- run: scripts-dev/generate_sample_config.sh --check
|
|
||||||
- run: scripts-dev/config-lint.sh
|
|
||||||
|
|
||||||
lint:
|
lint:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
toxenv:
|
toxenv:
|
||||||
|
- "check-sampleconfig"
|
||||||
- "check_codestyle"
|
- "check_codestyle"
|
||||||
- "check_isort"
|
- "check_isort"
|
||||||
- "mypy"
|
- "mypy"
|
||||||
@@ -51,15 +43,29 @@ jobs:
|
|||||||
ref: ${{ github.event.pull_request.head.sha }}
|
ref: ${{ github.event.pull_request.head.sha }}
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- uses: actions/setup-python@v2
|
- uses: actions/setup-python@v2
|
||||||
- run: "pip install 'towncrier>=18.6.0rc1'"
|
- run: pip install tox
|
||||||
- run: scripts-dev/check-newsfragment.sh
|
- run: scripts-dev/check-newsfragment
|
||||||
env:
|
env:
|
||||||
PULL_REQUEST_NUMBER: ${{ github.event.number }}
|
PULL_REQUEST_NUMBER: ${{ github.event.number }}
|
||||||
|
|
||||||
|
lint-sdist:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- uses: actions/setup-python@v2
|
||||||
|
with:
|
||||||
|
python-version: "3.x"
|
||||||
|
- run: pip install wheel
|
||||||
|
- run: python setup.py sdist bdist_wheel
|
||||||
|
- uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: Python Distributions
|
||||||
|
path: dist/*
|
||||||
|
|
||||||
# Dummy step to gate other tests on without repeating the whole list
|
# Dummy step to gate other tests on without repeating the whole list
|
||||||
linting-done:
|
linting-done:
|
||||||
if: ${{ !cancelled() }} # Run this even if prior jobs were skipped
|
if: ${{ !cancelled() }} # Run this even if prior jobs were skipped
|
||||||
needs: [lint, lint-crlf, lint-newsfile, check-sampleconfig]
|
needs: [lint, lint-crlf, lint-newsfile, lint-sdist]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- run: "true"
|
- run: "true"
|
||||||
@@ -135,7 +141,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: Test with old deps
|
- name: Test with old deps
|
||||||
uses: docker://ubuntu:focal # For old python and sqlite
|
uses: docker://ubuntu:bionic # For old python and sqlite
|
||||||
with:
|
with:
|
||||||
workdir: /github/workspace
|
workdir: /github/workspace
|
||||||
entrypoint: .ci/scripts/test_old_deps.sh
|
entrypoint: .ci/scripts/test_old_deps.sh
|
||||||
@@ -207,15 +213,15 @@ jobs:
|
|||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- sytest-tag: focal
|
- sytest-tag: bionic
|
||||||
|
|
||||||
- sytest-tag: focal
|
- sytest-tag: bionic
|
||||||
postgres: postgres
|
postgres: postgres
|
||||||
|
|
||||||
- sytest-tag: testing
|
- sytest-tag: testing
|
||||||
postgres: postgres
|
postgres: postgres
|
||||||
|
|
||||||
- sytest-tag: focal
|
- sytest-tag: bionic
|
||||||
postgres: multi-postgres
|
postgres: multi-postgres
|
||||||
workers: workers
|
workers: workers
|
||||||
|
|
||||||
@@ -317,29 +323,24 @@ jobs:
|
|||||||
if: ${{ !failure() && !cancelled() }}
|
if: ${{ !failure() && !cancelled() }}
|
||||||
needs: linting-done
|
needs: linting-done
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
container:
|
||||||
|
# https://github.com/matrix-org/complement/blob/master/dockerfiles/ComplementCIBuildkite.Dockerfile
|
||||||
|
image: matrixdotorg/complement:latest
|
||||||
|
env:
|
||||||
|
CI: true
|
||||||
|
ports:
|
||||||
|
- 8448:8448
|
||||||
|
volumes:
|
||||||
|
- /var/run/docker.sock:/var/run/docker.sock
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
# The path is set via a file given by $GITHUB_PATH. We need both Go 1.17 and GOPATH on the path to run Complement.
|
|
||||||
# See https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#adding-a-system-path
|
|
||||||
- name: "Set Go Version"
|
|
||||||
run: |
|
|
||||||
# Add Go 1.17 to the PATH: see https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu2004-Readme.md#environment-variables-2
|
|
||||||
echo "$GOROOT_1_17_X64/bin" >> $GITHUB_PATH
|
|
||||||
# Add the Go path to the PATH: We need this so we can call gotestfmt
|
|
||||||
echo "~/go/bin" >> $GITHUB_PATH
|
|
||||||
|
|
||||||
- name: "Install Complement Dependencies"
|
|
||||||
run: |
|
|
||||||
sudo apt-get update && sudo apt-get install -y libolm3 libolm-dev
|
|
||||||
go get -v github.com/haveyoudebuggedit/gotestfmt/v2/cmd/gotestfmt@latest
|
|
||||||
|
|
||||||
- name: Run actions/checkout@v2 for synapse
|
- name: Run actions/checkout@v2 for synapse
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
path: synapse
|
path: synapse
|
||||||
|
|
||||||
# Attempt to check out the same branch of Complement as the PR. If it
|
# Attempt to check out the same branch of Complement as the PR. If it
|
||||||
# doesn't exist, fallback to HEAD.
|
# doesn't exist, fallback to master.
|
||||||
- name: Checkout complement
|
- name: Checkout complement
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
@@ -352,8 +353,8 @@ jobs:
|
|||||||
# for pull requests, otherwise GITHUB_REF).
|
# for pull requests, otherwise GITHUB_REF).
|
||||||
# 2. Attempt to use the base branch, e.g. when merging into release-vX.Y
|
# 2. Attempt to use the base branch, e.g. when merging into release-vX.Y
|
||||||
# (GITHUB_BASE_REF for pull requests).
|
# (GITHUB_BASE_REF for pull requests).
|
||||||
# 3. Use the default complement branch ("HEAD").
|
# 3. Use the default complement branch ("master").
|
||||||
for BRANCH_NAME in "$GITHUB_HEAD_REF" "$GITHUB_BASE_REF" "${GITHUB_REF#refs/heads/}" "HEAD"; do
|
for BRANCH_NAME in "$GITHUB_HEAD_REF" "$GITHUB_BASE_REF" "${GITHUB_REF#refs/heads/}" "master"; do
|
||||||
# Skip empty branch names and merge commits.
|
# Skip empty branch names and merge commits.
|
||||||
if [[ -z "$BRANCH_NAME" || $BRANCH_NAME =~ ^refs/pull/.* ]]; then
|
if [[ -z "$BRANCH_NAME" || $BRANCH_NAME =~ ^refs/pull/.* ]]; then
|
||||||
continue
|
continue
|
||||||
@@ -365,8 +366,6 @@ jobs:
|
|||||||
# Build initial Synapse image
|
# Build initial Synapse image
|
||||||
- run: docker build -t matrixdotorg/synapse:latest -f docker/Dockerfile .
|
- run: docker build -t matrixdotorg/synapse:latest -f docker/Dockerfile .
|
||||||
working-directory: synapse
|
working-directory: synapse
|
||||||
env:
|
|
||||||
DOCKER_BUILDKIT: 1
|
|
||||||
|
|
||||||
# Build a ready-to-run Synapse image based on the initial image above.
|
# Build a ready-to-run Synapse image based on the initial image above.
|
||||||
# This new image includes a config file, keys for signing and TLS, and
|
# This new image includes a config file, keys for signing and TLS, and
|
||||||
@@ -375,11 +374,7 @@ jobs:
|
|||||||
working-directory: complement/dockerfiles
|
working-directory: complement/dockerfiles
|
||||||
|
|
||||||
# Run Complement
|
# Run Complement
|
||||||
- run: |
|
- run: go test -v -tags synapse_blacklist,msc2403 ./tests/...
|
||||||
set -o pipefail
|
|
||||||
go test -v -json -p 1 -tags synapse_blacklist,msc2403,msc2716,msc3030 ./tests/... 2>&1 | gotestfmt
|
|
||||||
shell: bash
|
|
||||||
name: Run Complement Tests
|
|
||||||
env:
|
env:
|
||||||
COMPLEMENT_BASE_IMAGE: complement-synapse:latest
|
COMPLEMENT_BASE_IMAGE: complement-synapse:latest
|
||||||
working-directory: complement
|
working-directory: complement
|
||||||
@@ -388,22 +383,35 @@ jobs:
|
|||||||
tests-done:
|
tests-done:
|
||||||
if: ${{ always() }}
|
if: ${{ always() }}
|
||||||
needs:
|
needs:
|
||||||
- check-sampleconfig
|
|
||||||
- lint
|
- lint
|
||||||
- lint-crlf
|
- lint-crlf
|
||||||
- lint-newsfile
|
- lint-newsfile
|
||||||
|
- lint-sdist
|
||||||
- trial
|
- trial
|
||||||
- trial-olddeps
|
- trial-olddeps
|
||||||
- sytest
|
- sytest
|
||||||
- export-data
|
|
||||||
- portdb
|
- portdb
|
||||||
- complement
|
- complement
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: matrix-org/done-action@v2
|
- name: Set build result
|
||||||
with:
|
env:
|
||||||
needs: ${{ toJSON(needs) }}
|
NEEDS_CONTEXT: ${{ toJSON(needs) }}
|
||||||
|
# the `jq` incantation dumps out a series of "<job> <result>" lines.
|
||||||
|
# we set it to an intermediate variable to avoid a pipe, which makes it
|
||||||
|
# hard to set $rc.
|
||||||
|
run: |
|
||||||
|
rc=0
|
||||||
|
results=$(jq -r 'to_entries[] | [.key,.value.result] | join(" ")' <<< $NEEDS_CONTEXT)
|
||||||
|
while read job result ; do
|
||||||
|
# The newsfile lint may be skipped on non PR builds
|
||||||
|
if [ $result == "skipped" ] && [ $job == "lint-newsfile" ]; then
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
# The newsfile lint may be skipped on non PR builds
|
if [ "$result" != "success" ]; then
|
||||||
skippable:
|
echo "::set-failed ::Job $job returned $result"
|
||||||
lint-newsfile
|
rc=1
|
||||||
|
fi
|
||||||
|
done <<< $results
|
||||||
|
exit $rc
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ jobs:
|
|||||||
- run: sudo apt-get -qq install xmlsec1
|
- run: sudo apt-get -qq install xmlsec1
|
||||||
- uses: actions/setup-python@v2
|
- uses: actions/setup-python@v2
|
||||||
with:
|
with:
|
||||||
python-version: 3.7
|
python-version: 3.6
|
||||||
- run: .ci/patch_for_twisted_trunk.sh
|
- run: .ci/patch_for_twisted_trunk.sh
|
||||||
- run: pip install tox
|
- run: pip install tox
|
||||||
- run: tox -e py
|
- run: tox -e py
|
||||||
|
|||||||
@@ -50,7 +50,3 @@ __pycache__/
|
|||||||
|
|
||||||
# docs
|
# docs
|
||||||
book/
|
book/
|
||||||
|
|
||||||
# complement
|
|
||||||
/complement-*
|
|
||||||
/master.tar.gz
|
|
||||||
|
|||||||
-393
@@ -1,399 +1,6 @@
|
|||||||
Synapse 1.54.0 (2022-03-08)
|
|
||||||
===========================
|
|
||||||
|
|
||||||
Please note that this will be the last release of Synapse that is compatible with Mjolnir 1.3.1 and earlier.
|
|
||||||
Administrators of servers which have the Mjolnir module installed are advised to upgrade Mjolnir to version 1.3.2 or later.
|
|
||||||
|
|
||||||
|
|
||||||
Bugfixes
|
|
||||||
--------
|
|
||||||
|
|
||||||
- Fix a bug introduced in Synapse 1.54.0rc1 preventing the new module callbacks introduced in this release from being registered by modules. ([\#12141](https://github.com/matrix-org/synapse/issues/12141))
|
|
||||||
- Fix a bug introduced in Synapse 1.54.0rc1 where runtime dependency version checks would mistakenly check development dependencies if they were present and would not accept pre-release versions of dependencies. ([\#12129](https://github.com/matrix-org/synapse/issues/12129), [\#12177](https://github.com/matrix-org/synapse/issues/12177))
|
|
||||||
|
|
||||||
|
|
||||||
Internal Changes
|
|
||||||
----------------
|
|
||||||
|
|
||||||
- Update release script to insert the previous version when writing "No significant changes" line in the changelog. ([\#12127](https://github.com/matrix-org/synapse/issues/12127))
|
|
||||||
- Relax the version guard for "packaging" added in [\#12088](https://github.com/matrix-org/synapse/issues/12088). ([\#12166](https://github.com/matrix-org/synapse/issues/12166))
|
|
||||||
|
|
||||||
|
|
||||||
Synapse 1.54.0rc1 (2022-03-02)
|
|
||||||
==============================
|
|
||||||
|
|
||||||
|
|
||||||
Features
|
|
||||||
--------
|
|
||||||
|
|
||||||
- Add support for [MSC3202](https://github.com/matrix-org/matrix-doc/pull/3202): sending one-time key counts and fallback key usage states to Application Services. ([\#11617](https://github.com/matrix-org/synapse/issues/11617))
|
|
||||||
- Improve the generated URL previews for some web pages. Contributed by @AndrewRyanChama. ([\#11985](https://github.com/matrix-org/synapse/issues/11985))
|
|
||||||
- Track cache invalidations in Prometheus metrics, as already happens for cache eviction based on size or time. ([\#12000](https://github.com/matrix-org/synapse/issues/12000))
|
|
||||||
- Implement experimental support for [MSC3720](https://github.com/matrix-org/matrix-doc/pull/3720) (account status endpoints). ([\#12001](https://github.com/matrix-org/synapse/issues/12001), [\#12067](https://github.com/matrix-org/synapse/issues/12067))
|
|
||||||
- Enable modules to set a custom display name when registering a user. ([\#12009](https://github.com/matrix-org/synapse/issues/12009))
|
|
||||||
- Advertise Matrix 1.1 and 1.2 support on `/_matrix/client/versions`. ([\#12020](https://github.com/matrix-org/synapse/issues/12020), ([\#12022](https://github.com/matrix-org/synapse/issues/12022))
|
|
||||||
- Support only the stable identifier for [MSC3069](https://github.com/matrix-org/matrix-doc/pull/3069)'s `is_guest` on `/_matrix/client/v3/account/whoami`. ([\#12021](https://github.com/matrix-org/synapse/issues/12021))
|
|
||||||
- Use room version 9 as the default room version (per [MSC3589](https://github.com/matrix-org/matrix-doc/pull/3589)). ([\#12058](https://github.com/matrix-org/synapse/issues/12058))
|
|
||||||
- Add module callbacks to react to user deactivation status changes (i.e. deactivations and reactivations) and profile updates. ([\#12062](https://github.com/matrix-org/synapse/issues/12062))
|
|
||||||
|
|
||||||
|
|
||||||
Bugfixes
|
|
||||||
--------
|
|
||||||
|
|
||||||
- Fix a bug introduced in Synapse 1.48.0 where an edit of the latest event in a thread would not be properly applied to the thread summary. ([\#11992](https://github.com/matrix-org/synapse/issues/11992))
|
|
||||||
- Fix long-standing bug where the `get_rooms_for_user` cache was not correctly invalidated for remote users when the server left a room. ([\#11999](https://github.com/matrix-org/synapse/issues/11999))
|
|
||||||
- Fix a 500 error with Postgres when looking backwards with the [MSC3030](https://github.com/matrix-org/matrix-doc/pull/3030) `/timestamp_to_event?dir=b` endpoint. ([\#12024](https://github.com/matrix-org/synapse/issues/12024))
|
|
||||||
- Properly fix a long-standing bug where wrong data could be inserted into the `event_search` table when using SQLite. This could block running `synapse_port_db` with an `argument of type 'int' is not iterable` error. This bug was partially fixed by a change in Synapse 1.44.0. ([\#12037](https://github.com/matrix-org/synapse/issues/12037))
|
|
||||||
- Fix slow performance of `/logout` in some cases where refresh tokens are in use. The slowness existed since the initial implementation of refresh tokens in version 1.38.0. ([\#12056](https://github.com/matrix-org/synapse/issues/12056))
|
|
||||||
- Fix a long-standing bug where Synapse would make additional failing requests over federation for missing data. ([\#12077](https://github.com/matrix-org/synapse/issues/12077))
|
|
||||||
- Fix occasional `Unhandled error in Deferred` error message. ([\#12089](https://github.com/matrix-org/synapse/issues/12089))
|
|
||||||
- Fix a bug introduced in Synapse 1.51.0 where incoming federation transactions containing at least one EDU would be dropped if debug logging was enabled for `synapse.8631_debug`. ([\#12098](https://github.com/matrix-org/synapse/issues/12098))
|
|
||||||
- Fix a long-standing bug which could cause push notifications to malfunction if `use_frozen_dicts` was set in the configuration. ([\#12100](https://github.com/matrix-org/synapse/issues/12100))
|
|
||||||
- Fix an extremely rare, long-standing bug in `ReadWriteLock` that would cause an error when a newly unblocked writer completes instantly. ([\#12105](https://github.com/matrix-org/synapse/issues/12105))
|
|
||||||
- Make a `POST` to `/rooms/<room_id>/receipt/m.read/<event_id>` only trigger a push notification if the count of unread messages is different to the one in the last successfully sent push. This reduces server load and load on the receiving device. ([\#11835](https://github.com/matrix-org/synapse/issues/11835))
|
|
||||||
|
|
||||||
|
|
||||||
Updates to the Docker image
|
|
||||||
---------------------------
|
|
||||||
|
|
||||||
- The Docker image no longer automatically creates a temporary volume at `/data`. This is not expected to affect normal usage. ([\#11997](https://github.com/matrix-org/synapse/issues/11997))
|
|
||||||
- Use Python 3.9 in Docker images by default. ([\#12112](https://github.com/matrix-org/synapse/issues/12112))
|
|
||||||
|
|
||||||
|
|
||||||
Improved Documentation
|
|
||||||
----------------------
|
|
||||||
|
|
||||||
- Document support for the `to_device`, `account_data`, `receipts`, and `presence` stream writers for workers. ([\#11599](https://github.com/matrix-org/synapse/issues/11599))
|
|
||||||
- Explain the meaning of spam checker callbacks' return values. ([\#12003](https://github.com/matrix-org/synapse/issues/12003))
|
|
||||||
- Clarify information about external Identity Provider IDs. ([\#12004](https://github.com/matrix-org/synapse/issues/12004))
|
|
||||||
|
|
||||||
|
|
||||||
Deprecations and Removals
|
|
||||||
-------------------------
|
|
||||||
|
|
||||||
- Deprecate using `synctl` with the config option `synctl_cache_factor` and print a warning if a user still uses this option. ([\#11865](https://github.com/matrix-org/synapse/issues/11865))
|
|
||||||
- Remove support for the legacy structured logging configuration (please see the the [upgrade notes](https://matrix-org.github.io/synapse/develop/upgrade#legacy-structured-logging-configuration-removal) if you are using `structured: true` in the Synapse configuration). ([\#12008](https://github.com/matrix-org/synapse/issues/12008))
|
|
||||||
- Drop support for [MSC3283](https://github.com/matrix-org/matrix-doc/pull/3283) unstable flags now that the stable flags are supported. ([\#12018](https://github.com/matrix-org/synapse/issues/12018))
|
|
||||||
- Remove the unstable `/spaces` endpoint from [MSC2946](https://github.com/matrix-org/matrix-doc/pull/2946). ([\#12073](https://github.com/matrix-org/synapse/issues/12073))
|
|
||||||
|
|
||||||
|
|
||||||
Internal Changes
|
|
||||||
----------------
|
|
||||||
|
|
||||||
- Make the `get_room_version` method use `get_room_version_id` to benefit from caching. ([\#11808](https://github.com/matrix-org/synapse/issues/11808))
|
|
||||||
- Remove unnecessary condition on knock -> leave auth rule check. ([\#11900](https://github.com/matrix-org/synapse/issues/11900))
|
|
||||||
- Add tests for device list changes between local users. ([\#11972](https://github.com/matrix-org/synapse/issues/11972))
|
|
||||||
- Optimise calculating `device_list` changes in `/sync`. ([\#11974](https://github.com/matrix-org/synapse/issues/11974))
|
|
||||||
- Add missing type hints to storage classes. ([\#11984](https://github.com/matrix-org/synapse/issues/11984))
|
|
||||||
- Refactor the search code for improved readability. ([\#11991](https://github.com/matrix-org/synapse/issues/11991))
|
|
||||||
- Move common deduplication code down into `_auth_and_persist_outliers`. ([\#11994](https://github.com/matrix-org/synapse/issues/11994))
|
|
||||||
- Limit concurrent joins from applications services. ([\#11996](https://github.com/matrix-org/synapse/issues/11996))
|
|
||||||
- Preparation for faster-room-join work: when parsing the `send_join` response, get the `m.room.create` event from `state`, not `auth_chain`. ([\#12005](https://github.com/matrix-org/synapse/issues/12005), [\#12039](https://github.com/matrix-org/synapse/issues/12039))
|
|
||||||
- Preparation for faster-room-join work: parse MSC3706 fields in send_join response. ([\#12011](https://github.com/matrix-org/synapse/issues/12011))
|
|
||||||
- Preparation for faster-room-join work: persist information on which events and rooms have partial state to the database. ([\#12012](https://github.com/matrix-org/synapse/issues/12012))
|
|
||||||
- Preparation for faster-room-join work: Support for calling `/federation/v1/state` on a remote server. ([\#12013](https://github.com/matrix-org/synapse/issues/12013))
|
|
||||||
- Configure `tox` to use `venv` rather than `virtualenv`. ([\#12015](https://github.com/matrix-org/synapse/issues/12015))
|
|
||||||
- Fix bug in `StateFilter.return_expanded()` and add some tests. ([\#12016](https://github.com/matrix-org/synapse/issues/12016))
|
|
||||||
- Use Matrix v1.1 endpoints (`/_matrix/client/v3/auth/...`) in fallback auth HTML forms. ([\#12019](https://github.com/matrix-org/synapse/issues/12019))
|
|
||||||
- Update the `olddeps` CI job to use an old version of `markupsafe`. ([\#12025](https://github.com/matrix-org/synapse/issues/12025))
|
|
||||||
- Upgrade Mypy to version 0.931. ([\#12030](https://github.com/matrix-org/synapse/issues/12030))
|
|
||||||
- Remove legacy `HomeServer.get_datastore()`. ([\#12031](https://github.com/matrix-org/synapse/issues/12031), [\#12070](https://github.com/matrix-org/synapse/issues/12070))
|
|
||||||
- Minor typing fixes. ([\#12034](https://github.com/matrix-org/synapse/issues/12034), [\#12069](https://github.com/matrix-org/synapse/issues/12069))
|
|
||||||
- After joining a room, create a dedicated logcontext to process the queued events. ([\#12041](https://github.com/matrix-org/synapse/issues/12041))
|
|
||||||
- Tidy up GitHub Actions config which builds distributions for PyPI. ([\#12051](https://github.com/matrix-org/synapse/issues/12051))
|
|
||||||
- Move configuration out of `setup.cfg`. ([\#12052](https://github.com/matrix-org/synapse/issues/12052), [\#12059](https://github.com/matrix-org/synapse/issues/12059))
|
|
||||||
- Fix error message when a worker process fails to talk to another worker process. ([\#12060](https://github.com/matrix-org/synapse/issues/12060))
|
|
||||||
- Fix using the `complement.sh` script without specifying a directory or a branch. Contributed by Nico on behalf of Famedly. ([\#12063](https://github.com/matrix-org/synapse/issues/12063))
|
|
||||||
- Add type hints to `tests/rest/client`. ([\#12066](https://github.com/matrix-org/synapse/issues/12066), [\#12072](https://github.com/matrix-org/synapse/issues/12072), [\#12084](https://github.com/matrix-org/synapse/issues/12084), [\#12094](https://github.com/matrix-org/synapse/issues/12094))
|
|
||||||
- Add some logging to `/sync` to try and track down #11916. ([\#12068](https://github.com/matrix-org/synapse/issues/12068))
|
|
||||||
- Inspect application dependencies using `importlib.metadata` or its backport. ([\#12088](https://github.com/matrix-org/synapse/issues/12088))
|
|
||||||
- Use `assertEqual` instead of the deprecated `assertEquals` in test code. ([\#12092](https://github.com/matrix-org/synapse/issues/12092))
|
|
||||||
- Move experimental support for [MSC3440](https://github.com/matrix-org/matrix-doc/pull/3440) to `/versions`. ([\#12099](https://github.com/matrix-org/synapse/issues/12099))
|
|
||||||
- Add `stop_cancellation` utility function to stop `Deferred`s from being cancelled. ([\#12106](https://github.com/matrix-org/synapse/issues/12106))
|
|
||||||
- Improve exception handling for concurrent execution. ([\#12109](https://github.com/matrix-org/synapse/issues/12109))
|
|
||||||
- Advertise support for Python 3.10 in packaging files. ([\#12111](https://github.com/matrix-org/synapse/issues/12111))
|
|
||||||
- Move CI checks out of tox, to facilitate a move to using poetry. ([\#12119](https://github.com/matrix-org/synapse/issues/12119))
|
|
||||||
|
|
||||||
|
|
||||||
Synapse 1.53.0 (2022-02-22)
|
|
||||||
===========================
|
|
||||||
|
|
||||||
No significant changes since 1.53.0rc1.
|
|
||||||
|
|
||||||
|
|
||||||
Synapse 1.53.0rc1 (2022-02-15)
|
|
||||||
==============================
|
|
||||||
|
|
||||||
Features
|
|
||||||
--------
|
|
||||||
|
|
||||||
- Add experimental support for sending to-device messages to application services, as specified by [MSC2409](https://github.com/matrix-org/matrix-doc/pull/2409). ([\#11215](https://github.com/matrix-org/synapse/issues/11215), [\#11966](https://github.com/matrix-org/synapse/issues/11966))
|
|
||||||
- Add a background database update to purge account data for deactivated users. ([\#11655](https://github.com/matrix-org/synapse/issues/11655))
|
|
||||||
- Experimental support for [MSC3666](https://github.com/matrix-org/matrix-doc/pull/3666): including bundled aggregations in server side search results. ([\#11837](https://github.com/matrix-org/synapse/issues/11837))
|
|
||||||
- Enable cache time-based expiry by default. The `expiry_time` config flag has been superseded by `expire_caches` and `cache_entry_ttl`. ([\#11849](https://github.com/matrix-org/synapse/issues/11849))
|
|
||||||
- Add a callback to allow modules to allow or forbid a 3PID (email address, phone number) from being associated to a local account. ([\#11854](https://github.com/matrix-org/synapse/issues/11854))
|
|
||||||
- Stabilize support and remove unstable endpoints for [MSC3231](https://github.com/matrix-org/matrix-doc/pull/3231). Clients must switch to the stable identifier and endpoint. See the [upgrade notes](https://matrix-org.github.io/synapse/develop/upgrade#stablisation-of-msc3231) for more information. ([\#11867](https://github.com/matrix-org/synapse/issues/11867))
|
|
||||||
- Allow modules to retrieve the current instance's server name and worker name. ([\#11868](https://github.com/matrix-org/synapse/issues/11868))
|
|
||||||
- Use a dedicated configurable rate limiter for 3PID invites. ([\#11892](https://github.com/matrix-org/synapse/issues/11892))
|
|
||||||
- Support the stable API endpoint for [MSC3283](https://github.com/matrix-org/matrix-doc/pull/3283): new settings in `/capabilities` endpoint. ([\#11933](https://github.com/matrix-org/synapse/issues/11933), [\#11989](https://github.com/matrix-org/synapse/issues/11989))
|
|
||||||
- Support the `dir` parameter on the `/relations` endpoint, per [MSC3715](https://github.com/matrix-org/matrix-doc/pull/3715). ([\#11941](https://github.com/matrix-org/synapse/issues/11941))
|
|
||||||
- Experimental implementation of [MSC3706](https://github.com/matrix-org/matrix-doc/pull/3706): extensions to `/send_join` to support reduced response size. ([\#11967](https://github.com/matrix-org/synapse/issues/11967))
|
|
||||||
|
|
||||||
|
|
||||||
Bugfixes
|
|
||||||
--------
|
|
||||||
|
|
||||||
- Fix [MSC2716](https://github.com/matrix-org/matrix-doc/pull/2716) historical messages backfilling in random order on remote homeservers. ([\#11114](https://github.com/matrix-org/synapse/issues/11114))
|
|
||||||
- Fix a bug introduced in Synapse 1.51.0 where incoming federation transactions containing at least one EDU would be dropped if debug logging was enabled for `synapse.8631_debug`. ([\#11890](https://github.com/matrix-org/synapse/issues/11890))
|
|
||||||
- Fix a long-standing bug where some unknown endpoints would return HTML error pages instead of JSON `M_UNRECOGNIZED` errors. ([\#11930](https://github.com/matrix-org/synapse/issues/11930))
|
|
||||||
- Implement an allow list of content types for which we will attempt to preview a URL. This prevents Synapse from making useless longer-lived connections to streaming media servers. ([\#11936](https://github.com/matrix-org/synapse/issues/11936))
|
|
||||||
- Fix a long-standing bug where pagination tokens from `/sync` and `/messages` could not be provided to the `/relations` API. ([\#11952](https://github.com/matrix-org/synapse/issues/11952))
|
|
||||||
- Require that modules register their callbacks using keyword arguments. ([\#11975](https://github.com/matrix-org/synapse/issues/11975))
|
|
||||||
- Fix a long-standing bug where `M_WRONG_ROOM_KEYS_VERSION` errors would not include the specced `current_version` field. ([\#11988](https://github.com/matrix-org/synapse/issues/11988))
|
|
||||||
|
|
||||||
|
|
||||||
Improved Documentation
|
|
||||||
----------------------
|
|
||||||
|
|
||||||
- Fix typo in User Admin API: unpind -> unbind. ([\#11859](https://github.com/matrix-org/synapse/issues/11859))
|
|
||||||
- Document images returned by the User List Media Admin API can include those generated by URL previews. ([\#11862](https://github.com/matrix-org/synapse/issues/11862))
|
|
||||||
- Remove outdated MSC1711 FAQ document. ([\#11907](https://github.com/matrix-org/synapse/issues/11907))
|
|
||||||
- Correct the structured logging configuration example. Contributed by Brad Jones. ([\#11946](https://github.com/matrix-org/synapse/issues/11946))
|
|
||||||
- Add information on the Synapse release cycle. ([\#11954](https://github.com/matrix-org/synapse/issues/11954))
|
|
||||||
- Fix broken link in the README to the admin API for password reset. ([\#11955](https://github.com/matrix-org/synapse/issues/11955))
|
|
||||||
|
|
||||||
|
|
||||||
Deprecations and Removals
|
|
||||||
-------------------------
|
|
||||||
|
|
||||||
- Drop support for `webclient` listeners and configuring `web_client_location` to a non-HTTP(S) URL. Deprecated configurations are a configuration error. ([\#11895](https://github.com/matrix-org/synapse/issues/11895))
|
|
||||||
- Remove deprecated `user_may_create_room_with_invites` spam checker callback. See the [upgrade notes](https://matrix-org.github.io/synapse/latest/upgrade.html#removal-of-user_may_create_room_with_invites) for more information. ([\#11950](https://github.com/matrix-org/synapse/issues/11950))
|
|
||||||
- No longer build `.deb` packages for Ubuntu 21.04 Hirsute Hippo, which has now EOLed. ([\#11961](https://github.com/matrix-org/synapse/issues/11961))
|
|
||||||
|
|
||||||
|
|
||||||
Internal Changes
|
|
||||||
----------------
|
|
||||||
|
|
||||||
- Enhance user registration test helpers to make them more useful for tests involving application services and devices. ([\#11615](https://github.com/matrix-org/synapse/issues/11615), [\#11616](https://github.com/matrix-org/synapse/issues/11616))
|
|
||||||
- Improve performance when fetching bundled aggregations for multiple events. ([\#11660](https://github.com/matrix-org/synapse/issues/11660), [\#11752](https://github.com/matrix-org/synapse/issues/11752))
|
|
||||||
- Fix type errors introduced by new annotations in the Prometheus Client library. ([\#11832](https://github.com/matrix-org/synapse/issues/11832))
|
|
||||||
- Add missing type hints to replication code. ([\#11856](https://github.com/matrix-org/synapse/issues/11856), [\#11938](https://github.com/matrix-org/synapse/issues/11938))
|
|
||||||
- Ensure that `opentracing` scopes are activated and closed at the right time. ([\#11869](https://github.com/matrix-org/synapse/issues/11869))
|
|
||||||
- Improve opentracing for incoming federation requests. ([\#11870](https://github.com/matrix-org/synapse/issues/11870))
|
|
||||||
- Improve internal docstrings in `synapse.util.caches`. ([\#11876](https://github.com/matrix-org/synapse/issues/11876))
|
|
||||||
- Do not needlessly clear the `get_users_in_room` and `get_users_in_room_with_profiles` caches when any room state changes. ([\#11878](https://github.com/matrix-org/synapse/issues/11878))
|
|
||||||
- Convert `ApplicationServiceTestCase` to use `simple_async_mock`. ([\#11880](https://github.com/matrix-org/synapse/issues/11880))
|
|
||||||
- Remove experimental changes to the default push rules which were introduced in Synapse 1.19.0 but never enabled. ([\#11884](https://github.com/matrix-org/synapse/issues/11884))
|
|
||||||
- Disable coverage calculation for olddeps build. ([\#11888](https://github.com/matrix-org/synapse/issues/11888))
|
|
||||||
- Preparation to support sending device list updates to application services. ([\#11905](https://github.com/matrix-org/synapse/issues/11905))
|
|
||||||
- Add a test that checks users receive their own device list updates down `/sync`. ([\#11909](https://github.com/matrix-org/synapse/issues/11909))
|
|
||||||
- Run Complement tests sequentially. ([\#11910](https://github.com/matrix-org/synapse/issues/11910))
|
|
||||||
- Various refactors to the application service notifier code. ([\#11911](https://github.com/matrix-org/synapse/issues/11911), [\#11912](https://github.com/matrix-org/synapse/issues/11912))
|
|
||||||
- Tests: replace mocked `Authenticator` with the real thing. ([\#11913](https://github.com/matrix-org/synapse/issues/11913))
|
|
||||||
- Various refactors to the typing notifications code. ([\#11914](https://github.com/matrix-org/synapse/issues/11914))
|
|
||||||
- Use the proper type for the `Content-Length` header in the `UploadResource`. ([\#11927](https://github.com/matrix-org/synapse/issues/11927))
|
|
||||||
- Remove an unnecessary ignoring of type hints due to fixes in upstream packages. ([\#11939](https://github.com/matrix-org/synapse/issues/11939))
|
|
||||||
- Add missing type hints. ([\#11953](https://github.com/matrix-org/synapse/issues/11953))
|
|
||||||
- Fix an import cycle in `synapse.event_auth`. ([\#11965](https://github.com/matrix-org/synapse/issues/11965))
|
|
||||||
- Unpin `frozendict` but exclude the known bad version 2.1.2. ([\#11969](https://github.com/matrix-org/synapse/issues/11969))
|
|
||||||
- Prepare for rename of default Complement branch. ([\#11971](https://github.com/matrix-org/synapse/issues/11971))
|
|
||||||
- Fetch Synapse's version using a helper from `matrix-common`. ([\#11979](https://github.com/matrix-org/synapse/issues/11979))
|
|
||||||
|
|
||||||
|
|
||||||
Synapse 1.52.0 (2022-02-08)
|
|
||||||
===========================
|
|
||||||
|
|
||||||
No significant changes since 1.52.0rc1.
|
|
||||||
|
|
||||||
Note that [Twisted 22.1.0](https://github.com/twisted/twisted/releases/tag/twisted-22.1.0)
|
|
||||||
has recently been released, which fixes a [security issue](https://github.com/twisted/twisted/security/advisories/GHSA-92x2-jw7w-xvvx)
|
|
||||||
within the Twisted library. We do not believe Synapse is affected by this vulnerability,
|
|
||||||
though we advise server administrators who installed Synapse via pip to upgrade Twisted
|
|
||||||
with `pip install --upgrade Twisted treq` as a matter of good practice. The Docker image
|
|
||||||
`matrixdotorg/synapse` and the Debian packages from `packages.matrix.org` are using the
|
|
||||||
updated library.
|
|
||||||
|
|
||||||
|
|
||||||
Synapse 1.52.0rc1 (2022-02-01)
|
|
||||||
==============================
|
|
||||||
|
|
||||||
Features
|
|
||||||
--------
|
|
||||||
|
|
||||||
- Remove account data (including client config, push rules and ignored users) upon user deactivation. ([\#11621](https://github.com/matrix-org/synapse/issues/11621), [\#11788](https://github.com/matrix-org/synapse/issues/11788), [\#11789](https://github.com/matrix-org/synapse/issues/11789))
|
|
||||||
- Add an admin API to reset connection timeouts for remote server. ([\#11639](https://github.com/matrix-org/synapse/issues/11639))
|
|
||||||
- Add an admin API to get a list of rooms that federate with a given remote homeserver. ([\#11658](https://github.com/matrix-org/synapse/issues/11658))
|
|
||||||
- Add a config flag to inhibit `M_USER_IN_USE` during registration. ([\#11743](https://github.com/matrix-org/synapse/issues/11743))
|
|
||||||
- Add a module callback to set username at registration. ([\#11790](https://github.com/matrix-org/synapse/issues/11790))
|
|
||||||
- Allow configuring a maximum file size as well as a list of allowed content types for avatars. ([\#11846](https://github.com/matrix-org/synapse/issues/11846))
|
|
||||||
|
|
||||||
|
|
||||||
Bugfixes
|
|
||||||
--------
|
|
||||||
|
|
||||||
- Include the bundled aggregations in the `/sync` response, per [MSC2675](https://github.com/matrix-org/matrix-doc/pull/2675). ([\#11612](https://github.com/matrix-org/synapse/issues/11612))
|
|
||||||
- Fix a long-standing bug when previewing Reddit URLs which do not contain an image. ([\#11767](https://github.com/matrix-org/synapse/issues/11767))
|
|
||||||
- Fix a long-standing bug that media streams could cause long-lived connections when generating URL previews. ([\#11784](https://github.com/matrix-org/synapse/issues/11784))
|
|
||||||
- Include a `prev_content` field in state events sent to Application Services. Contributed by @totallynotvaishnav. ([\#11798](https://github.com/matrix-org/synapse/issues/11798))
|
|
||||||
- Fix a bug introduced in Synapse 0.33.3 causing requests to sometimes log strings such as `HTTPStatus.OK` instead of integer status codes. ([\#11827](https://github.com/matrix-org/synapse/issues/11827))
|
|
||||||
|
|
||||||
|
|
||||||
Improved Documentation
|
|
||||||
----------------------
|
|
||||||
|
|
||||||
- Update pypi installation docs to indicate that we now support Python 3.10. ([\#11820](https://github.com/matrix-org/synapse/issues/11820))
|
|
||||||
- Add missing steps to the contribution submission process in the documentation. Contributed by @sequentialread. ([\#11821](https://github.com/matrix-org/synapse/issues/11821))
|
|
||||||
- Remove not needed old table of contents in documentation. ([\#11860](https://github.com/matrix-org/synapse/issues/11860))
|
|
||||||
- Consolidate the `access_token` information at the top of each relevant page in the Admin API documentation. ([\#11861](https://github.com/matrix-org/synapse/issues/11861))
|
|
||||||
|
|
||||||
|
|
||||||
Deprecations and Removals
|
|
||||||
-------------------------
|
|
||||||
|
|
||||||
- Drop support for Python 3.6, which is EOL. ([\#11683](https://github.com/matrix-org/synapse/issues/11683))
|
|
||||||
- Remove the `experimental_msc1849_support_enabled` flag as the features are now stable. ([\#11843](https://github.com/matrix-org/synapse/issues/11843))
|
|
||||||
|
|
||||||
|
|
||||||
Internal Changes
|
|
||||||
----------------
|
|
||||||
|
|
||||||
- Preparation for database schema simplifications: add `state_key` and `rejection_reason` columns to `events` table. ([\#11792](https://github.com/matrix-org/synapse/issues/11792))
|
|
||||||
- Add `FrozenEvent.get_state_key` and use it in a couple of places. ([\#11793](https://github.com/matrix-org/synapse/issues/11793))
|
|
||||||
- Preparation for database schema simplifications: stop reading from `event_reference_hashes`. ([\#11794](https://github.com/matrix-org/synapse/issues/11794))
|
|
||||||
- Drop unused table `public_room_list_stream`. ([\#11795](https://github.com/matrix-org/synapse/issues/11795))
|
|
||||||
- Preparation for reducing Postgres serialization errors: allow setting transaction isolation level. Contributed by Nick @ Beeper. ([\#11799](https://github.com/matrix-org/synapse/issues/11799), [\#11847](https://github.com/matrix-org/synapse/issues/11847))
|
|
||||||
- Docker: skip the initial amd64-only build and go straight to multiarch. ([\#11810](https://github.com/matrix-org/synapse/issues/11810))
|
|
||||||
- Run Complement on the Github Actions VM and not inside a Docker container. ([\#11811](https://github.com/matrix-org/synapse/issues/11811))
|
|
||||||
- Log module names at startup. ([\#11813](https://github.com/matrix-org/synapse/issues/11813))
|
|
||||||
- Improve type safety of bundled aggregations code. ([\#11815](https://github.com/matrix-org/synapse/issues/11815))
|
|
||||||
- Correct a type annotation in the event validation logic. ([\#11817](https://github.com/matrix-org/synapse/issues/11817), [\#11830](https://github.com/matrix-org/synapse/issues/11830))
|
|
||||||
- Minor updates and documentation for database schema delta files. ([\#11823](https://github.com/matrix-org/synapse/issues/11823))
|
|
||||||
- Workaround a type annotation problem in `prometheus_client` 0.13.0. ([\#11834](https://github.com/matrix-org/synapse/issues/11834))
|
|
||||||
- Minor performance improvement in room state lookup. ([\#11836](https://github.com/matrix-org/synapse/issues/11836))
|
|
||||||
- Fix some indentation inconsistencies in the sample config. ([\#11838](https://github.com/matrix-org/synapse/issues/11838))
|
|
||||||
- Add type hints to `tests/rest/admin`. ([\#11851](https://github.com/matrix-org/synapse/issues/11851))
|
|
||||||
|
|
||||||
|
|
||||||
Synapse 1.51.0 (2022-01-25)
|
|
||||||
===========================
|
|
||||||
|
|
||||||
No significant changes since 1.51.0rc2.
|
|
||||||
|
|
||||||
Synapse 1.51.0 deprecates `webclient` listeners and non-HTTP(S) `web_client_location`s. Support for these will be removed in Synapse 1.53.0, at which point Synapse will not be capable of directly serving a web client for Matrix. See the [upgrade notes](https://matrix-org.github.io/synapse/develop/upgrade#upgrading-to-v1510).
|
|
||||||
|
|
||||||
Synapse 1.51.0rc2 (2022-01-24)
|
|
||||||
==============================
|
|
||||||
|
|
||||||
Bugfixes
|
|
||||||
--------
|
|
||||||
|
|
||||||
- Fix a bug introduced in Synapse 1.40.0 that caused Synapse to fail to process incoming federation traffic after handling a large amount of events in a v1 room. ([\#11806](https://github.com/matrix-org/synapse/issues/11806))
|
|
||||||
|
|
||||||
|
|
||||||
Synapse 1.50.2 (2022-01-24)
|
|
||||||
===========================
|
|
||||||
|
|
||||||
This release includes the same bugfix as Synapse 1.51.0rc2.
|
|
||||||
|
|
||||||
Bugfixes
|
|
||||||
--------
|
|
||||||
|
|
||||||
- Fix a bug introduced in Synapse 1.40.0 that caused Synapse to fail to process incoming federation traffic after handling a large amount of events in a v1 room. ([\#11806](https://github.com/matrix-org/synapse/issues/11806))
|
|
||||||
|
|
||||||
|
|
||||||
Synapse 1.51.0rc1 (2022-01-21)
|
|
||||||
==============================
|
|
||||||
|
|
||||||
Features
|
|
||||||
--------
|
|
||||||
|
|
||||||
- Add `track_puppeted_user_ips` config flag to record client IP addresses against puppeted users, and include the puppeted users in monthly active user counts. ([\#11561](https://github.com/matrix-org/synapse/issues/11561), [\#11749](https://github.com/matrix-org/synapse/issues/11749), [\#11757](https://github.com/matrix-org/synapse/issues/11757))
|
|
||||||
- Include whether the requesting user has participated in a thread when generating a summary for [MSC3440](https://github.com/matrix-org/matrix-doc/pull/3440). ([\#11577](https://github.com/matrix-org/synapse/issues/11577))
|
|
||||||
- Return an `M_FORBIDDEN` error code instead of `M_UNKNOWN` when a spam checker module prevents a user from creating a room. ([\#11672](https://github.com/matrix-org/synapse/issues/11672))
|
|
||||||
- Add a flag to the `synapse_review_recent_signups` script to ignore and filter appservice users. ([\#11675](https://github.com/matrix-org/synapse/issues/11675), [\#11770](https://github.com/matrix-org/synapse/issues/11770))
|
|
||||||
|
|
||||||
|
|
||||||
Bugfixes
|
|
||||||
--------
|
|
||||||
|
|
||||||
- Fix a long-standing issue which could cause Synapse to incorrectly accept data in the unsigned field of events
|
|
||||||
received over federation. ([\#11530](https://github.com/matrix-org/synapse/issues/11530))
|
|
||||||
- Fix a long-standing bug where Synapse wouldn't cache a response indicating that a remote user has no devices. ([\#11587](https://github.com/matrix-org/synapse/issues/11587))
|
|
||||||
- Fix an error that occurs whilst trying to get the federation status of a destination server that was working normally. This admin API was newly introduced in Synapse v1.49.0. ([\#11593](https://github.com/matrix-org/synapse/issues/11593))
|
|
||||||
- Fix bundled aggregations not being included in the `/sync` response, per [MSC2675](https://github.com/matrix-org/matrix-doc/pull/2675). ([\#11612](https://github.com/matrix-org/synapse/issues/11612), [\#11659](https://github.com/matrix-org/synapse/issues/11659), [\#11791](https://github.com/matrix-org/synapse/issues/11791))
|
|
||||||
- Fix the `/_matrix/client/v1/room/{roomId}/hierarchy` endpoint returning incorrect fields which have been present since Synapse 1.49.0. ([\#11667](https://github.com/matrix-org/synapse/issues/11667))
|
|
||||||
- Fix preview of some GIF URLs (like tenor.com). Contributed by Philippe Daouadi. ([\#11669](https://github.com/matrix-org/synapse/issues/11669))
|
|
||||||
- Fix a bug where only the first 50 rooms from a space were returned from the `/hierarchy` API. This has existed since the introduction of the API in Synapse v1.41.0. ([\#11695](https://github.com/matrix-org/synapse/issues/11695))
|
|
||||||
- Fix a bug introduced in Synapse v1.18.0 where password reset and address validation emails would not be sent if their subject was configured to use the 'app' template variable. Contributed by @br4nnigan. ([\#11710](https://github.com/matrix-org/synapse/issues/11710), [\#11745](https://github.com/matrix-org/synapse/issues/11745))
|
|
||||||
- Make the 'List Rooms' Admin API sort stable. Contributed by Daniël Sonck. ([\#11737](https://github.com/matrix-org/synapse/issues/11737))
|
|
||||||
- Fix a long-standing bug where space hierarchy over federation would only work correctly some of the time. ([\#11775](https://github.com/matrix-org/synapse/issues/11775))
|
|
||||||
- Fix a bug introduced in Synapse v1.46.0 that prevented `on_logged_out` module callbacks from being correctly awaited by Synapse. ([\#11786](https://github.com/matrix-org/synapse/issues/11786))
|
|
||||||
|
|
||||||
|
|
||||||
Improved Documentation
|
|
||||||
----------------------
|
|
||||||
|
|
||||||
- Warn against using a Let's Encrypt certificate for TLS/DTLS TURN server client connections, and suggest using ZeroSSL certificate instead. This works around client-side connectivity errors caused by WebRTC libraries that reject Let's Encrypt certificates. Contibuted by @AndrewFerr. ([\#11686](https://github.com/matrix-org/synapse/issues/11686))
|
|
||||||
- Document the new `SYNAPSE_TEST_PERSIST_SQLITE_DB` environment variable in the contributing guide. ([\#11715](https://github.com/matrix-org/synapse/issues/11715))
|
|
||||||
- Document that the minimum supported PostgreSQL version is now 10. ([\#11725](https://github.com/matrix-org/synapse/issues/11725))
|
|
||||||
- Fix typo in demo docs: differnt. ([\#11735](https://github.com/matrix-org/synapse/issues/11735))
|
|
||||||
- Update room spec URL in config files. ([\#11739](https://github.com/matrix-org/synapse/issues/11739))
|
|
||||||
- Mention `python3-venv` and `libpq-dev` dependencies in the contribution guide. ([\#11740](https://github.com/matrix-org/synapse/issues/11740))
|
|
||||||
- Update documentation for configuring login with Facebook. ([\#11755](https://github.com/matrix-org/synapse/issues/11755))
|
|
||||||
- Update installation instructions to note that Python 3.6 is no longer supported. ([\#11781](https://github.com/matrix-org/synapse/issues/11781))
|
|
||||||
|
|
||||||
|
|
||||||
Deprecations and Removals
|
|
||||||
-------------------------
|
|
||||||
|
|
||||||
- Remove the unstable `/send_relation` endpoint. ([\#11682](https://github.com/matrix-org/synapse/issues/11682))
|
|
||||||
- Remove `python_twisted_reactor_pending_calls` Prometheus metric. ([\#11724](https://github.com/matrix-org/synapse/issues/11724))
|
|
||||||
- Remove the `password_hash` field from the response dictionaries of the [Users Admin API](https://matrix-org.github.io/synapse/latest/admin_api/user_admin_api.html). ([\#11576](https://github.com/matrix-org/synapse/issues/11576))
|
|
||||||
- **Deprecate support for `webclient` listeners and non-HTTP(S) `web_client_location` configuration. ([\#11774](https://github.com/matrix-org/synapse/issues/11774), [\#11783](https://github.com/matrix-org/synapse/issues/11783))**
|
|
||||||
|
|
||||||
|
|
||||||
Internal Changes
|
|
||||||
----------------
|
|
||||||
|
|
||||||
- Run `pyupgrade --py37-plus --keep-percent-format` on Synapse. ([\#11685](https://github.com/matrix-org/synapse/issues/11685))
|
|
||||||
- Use buildkit's cache feature to speed up docker builds. ([\#11691](https://github.com/matrix-org/synapse/issues/11691))
|
|
||||||
- Use `auto_attribs` and native type hints for attrs classes. ([\#11692](https://github.com/matrix-org/synapse/issues/11692), [\#11768](https://github.com/matrix-org/synapse/issues/11768))
|
|
||||||
- Remove debug logging for #4422, which has been closed since Synapse 0.99. ([\#11693](https://github.com/matrix-org/synapse/issues/11693))
|
|
||||||
- Remove fallback code for Python 2. ([\#11699](https://github.com/matrix-org/synapse/issues/11699))
|
|
||||||
- Add a test for [an edge case](https://github.com/matrix-org/synapse/pull/11532#discussion_r769104461) in the `/sync` logic. ([\#11701](https://github.com/matrix-org/synapse/issues/11701))
|
|
||||||
- Add the option to write SQLite test dbs to disk when running tests. ([\#11702](https://github.com/matrix-org/synapse/issues/11702))
|
|
||||||
- Improve Complement test output for Gitub Actions. ([\#11707](https://github.com/matrix-org/synapse/issues/11707))
|
|
||||||
- Fix docstring on `add_account_data_for_user`. ([\#11716](https://github.com/matrix-org/synapse/issues/11716))
|
|
||||||
- Complement environment variable name change and update `.gitignore`. ([\#11718](https://github.com/matrix-org/synapse/issues/11718))
|
|
||||||
- Simplify calculation of Prometheus metrics for garbage collection. ([\#11723](https://github.com/matrix-org/synapse/issues/11723))
|
|
||||||
- Improve accuracy of `python_twisted_reactor_tick_time` Prometheus metric. ([\#11724](https://github.com/matrix-org/synapse/issues/11724), [\#11771](https://github.com/matrix-org/synapse/issues/11771))
|
|
||||||
- Minor efficiency improvements when inserting many values into the database. ([\#11742](https://github.com/matrix-org/synapse/issues/11742))
|
|
||||||
- Invite PR authors to give themselves credit in the changelog. ([\#11744](https://github.com/matrix-org/synapse/issues/11744))
|
|
||||||
- Add optional debugging to investigate [issue 8631](https://github.com/matrix-org/synapse/issues/8631). ([\#11760](https://github.com/matrix-org/synapse/issues/11760))
|
|
||||||
- Remove `log_function` utility function and its uses. ([\#11761](https://github.com/matrix-org/synapse/issues/11761))
|
|
||||||
- Add a unit test that checks both `client` and `webclient` resources will function when simultaneously enabled. ([\#11765](https://github.com/matrix-org/synapse/issues/11765))
|
|
||||||
- Allow overriding complement commit using `COMPLEMENT_REF`. ([\#11766](https://github.com/matrix-org/synapse/issues/11766))
|
|
||||||
- Add some comments and type annotations for `_update_outliers_txn`. ([\#11776](https://github.com/matrix-org/synapse/issues/11776))
|
|
||||||
|
|
||||||
|
|
||||||
Synapse 1.50.1 (2022-01-18)
|
|
||||||
===========================
|
|
||||||
|
|
||||||
This release fixes a bug in Synapse 1.50.0 that could prevent clients from being able to connect to Synapse if the `webclient` resource was enabled. Further details are available in [this issue](https://github.com/matrix-org/synapse/issues/11763).
|
|
||||||
|
|
||||||
Bugfixes
|
|
||||||
--------
|
|
||||||
|
|
||||||
- Fix a bug introduced in Synapse 1.50.0rc1 that could cause Matrix clients to be unable to connect to Synapse instances with the `webclient` resource enabled. ([\#11764](https://github.com/matrix-org/synapse/issues/11764))
|
|
||||||
|
|
||||||
|
|
||||||
Synapse 1.50.0 (2022-01-18)
|
Synapse 1.50.0 (2022-01-18)
|
||||||
===========================
|
===========================
|
||||||
|
|
||||||
**This release contains a critical bug that may prevent clients from being able to connect.
|
|
||||||
As such, it is not recommended to upgrade to 1.50.0. Instead, please upgrade straight to
|
|
||||||
to 1.50.1. Further details are available in [this issue](https://github.com/matrix-org/synapse/issues/11763).**
|
|
||||||
|
|
||||||
Please note that we now only support Python 3.7+ and PostgreSQL 10+ (if applicable), because Python 3.6 and PostgreSQL 9.6 have reached end-of-life.
|
Please note that we now only support Python 3.7+ and PostgreSQL 10+ (if applicable), because Python 3.6 and PostgreSQL 9.6 have reached end-of-life.
|
||||||
|
|
||||||
No significant changes since 1.50.0rc2.
|
No significant changes since 1.50.0rc2.
|
||||||
|
|||||||
+3
-1
@@ -1,3 +1,4 @@
|
|||||||
|
include synctl
|
||||||
include LICENSE
|
include LICENSE
|
||||||
include VERSION
|
include VERSION
|
||||||
include *.rst
|
include *.rst
|
||||||
@@ -16,6 +17,7 @@ recursive-include synapse/storage *.txt
|
|||||||
recursive-include synapse/storage *.md
|
recursive-include synapse/storage *.md
|
||||||
|
|
||||||
recursive-include docs *
|
recursive-include docs *
|
||||||
|
recursive-include scripts *
|
||||||
recursive-include scripts-dev *
|
recursive-include scripts-dev *
|
||||||
recursive-include synapse *.pyi
|
recursive-include synapse *.pyi
|
||||||
recursive-include tests *.py
|
recursive-include tests *.py
|
||||||
@@ -43,7 +45,6 @@ include book.toml
|
|||||||
include pyproject.toml
|
include pyproject.toml
|
||||||
recursive-include changelog.d *
|
recursive-include changelog.d *
|
||||||
|
|
||||||
include .flake8
|
|
||||||
prune .circleci
|
prune .circleci
|
||||||
prune .github
|
prune .github
|
||||||
prune .ci
|
prune .ci
|
||||||
@@ -51,4 +52,5 @@ prune contrib
|
|||||||
prune debian
|
prune debian
|
||||||
prune demo/etc
|
prune demo/etc
|
||||||
prune docker
|
prune docker
|
||||||
|
prune snap
|
||||||
prune stubs
|
prune stubs
|
||||||
|
|||||||
+1
-4
@@ -246,7 +246,7 @@ Password reset
|
|||||||
==============
|
==============
|
||||||
|
|
||||||
Users can reset their password through their client. Alternatively, a server admin
|
Users can reset their password through their client. Alternatively, a server admin
|
||||||
can reset a users password using the `admin API <docs/admin_api/user_admin_api.md#reset-password>`_
|
can reset a users password using the `admin API <docs/admin_api/user_admin_api.rst#reset-password>`_
|
||||||
or by directly editing the database as shown below.
|
or by directly editing the database as shown below.
|
||||||
|
|
||||||
First calculate the hash of the new password::
|
First calculate the hash of the new password::
|
||||||
@@ -312,9 +312,6 @@ We recommend using the demo which starts 3 federated instances running on ports
|
|||||||
|
|
||||||
(to stop, you can use `./demo/stop.sh`)
|
(to stop, you can use `./demo/stop.sh`)
|
||||||
|
|
||||||
See the [demo documentation](https://matrix-org.github.io/synapse/develop/development/demo.html)
|
|
||||||
for more information.
|
|
||||||
|
|
||||||
If you just want to start a single instance of the app and run it directly::
|
If you just want to start a single instance of the app and run it directly::
|
||||||
|
|
||||||
# Create the homeserver.yaml config once
|
# Create the homeserver.yaml config once
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ site-url = "/synapse/"
|
|||||||
additional-css = [
|
additional-css = [
|
||||||
"docs/website_files/table-of-contents.css",
|
"docs/website_files/table-of-contents.css",
|
||||||
"docs/website_files/remove-nav-buttons.css",
|
"docs/website_files/remove-nav-buttons.css",
|
||||||
"docs/website_files/section-headers.css",
|
"docs/website_files/indent-section-headers.css",
|
||||||
]
|
]
|
||||||
additional-js = ["docs/website_files/table-of-contents.js"]
|
additional-js = ["docs/website_files/table-of-contents.js"]
|
||||||
theme = "docs/website_files/theme"
|
theme = "docs/website_files/theme"
|
||||||
@@ -1 +0,0 @@
|
|||||||
Remove workaround introduced in Synapse 1.50.0 for Mjolnir compatibility. Breaks compatibility with Mjolnir 1.3.1 and earlier.
|
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
Add a unit test that checks both `client` and `webclient` resources will function when simultaneously enabled.
|
||||||
@@ -1 +0,0 @@
|
|||||||
Simplify the `ApplicationService` class' set of public methods related to interest checking.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Fix complexity checking config example in [Resource Constrained Devices](https://matrix-org.github.io/synapse/v1.54/other/running_synapse_on_single_board_computers.html) docs page.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Add third-party rules rules callbacks `check_can_shutdown_room` and `check_can_deactivate_user`.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Correct type hints for txredis.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Use the proper serialization format for bundled thread aggregations. The bug has existed since Synapse v1.48.0.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Limit the size of `aggregation_key` on annotations.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Add type hints to `tests/rest/client`.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Fix a long-standing bug when redacting events with relations.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Move scripts to Synapse package and expose as setuptools entry points.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Fix a long-standing bug when redacting events with relations.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Fix data validation to compare to lists, not sequences.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Fix a long-standing bug when redacting events with relations.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Fix CI not attaching source distributions and wheels to the GitHub releases.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Improve performance of logging in for large accounts.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Add experimental env var `SYNAPSE_ASYNC_IO_REACTOR` that causes Synapse to use the asyncio reactor for Twisted.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Remove unused mocks from `test_typing`.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Give `scripts-dev` scripts suffixes for neater CI config.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Remove backwards compatibilty with pagination tokens from the `/relations` and `/aggregations` endpoints generated from Synapse < v1.52.0.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Move `synctl` into `synapse._scripts` and expose as an entry point.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Move the snapcraft configuration file to `contrib`.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Improve documentation for demo scripts.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Enable [MSC3030](https://github.com/matrix-org/matrix-doc/pull/3030) Complement tests in CI.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Enable [MSC2716](https://github.com/matrix-org/matrix-doc/pull/2716) Complement tests in CI.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Add type hints to `tests/rest`.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Add test for `ObservableDeferred`'s cancellation behaviour.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Use `ParamSpec` in type hints for `synapse.logging.context`.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Support the stable identifiers from [MSC3440](https://github.com/matrix-org/matrix-doc/pull/3440): threads.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Prune unused jobs from `tox` config.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Move CI checks out of tox, to facilitate a move to using poetry.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Avoid generating state groups for local out-of-band leaves.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Avoid trying to calculate the state at outlier events.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Fix some type annotations.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Fix a bug introduced in #4864 whereby background updates are never run with the default background batch size.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Add type hints for `ObservableDeferred` attributes.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Use a prebuilt Action for the `tests-done` CI job.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Reduce number of DB queries made during processing of `/sync`.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Avoid trying to calculate the state at outlier events.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Fix a bug where non-standard information was returned from the `/hierarchy` API. Introduced in Synapse v1.41.0.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Updates to the Room DAG concepts development document.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Retry HTTP replication failures, this should prevent 502's when restarting stateful workers (main, event persisters, stream writers). Contributed by Nick @ Beeper.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Remove unused variables.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Fix a long-standing bug when redacting events with relations.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Rename `HomeServer.get_tcp_replication` to `get_replication_command_handler`.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Remove some dead code.
|
|
||||||
@@ -92,6 +92,22 @@ new PromConsole.Graph({
|
|||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<h3>Pending calls per tick</h3>
|
||||||
|
<div id="reactor_pending_calls"></div>
|
||||||
|
<script>
|
||||||
|
new PromConsole.Graph({
|
||||||
|
node: document.querySelector("#reactor_pending_calls"),
|
||||||
|
expr: "rate(python_twisted_reactor_pending_calls_sum[30s]) / rate(python_twisted_reactor_pending_calls_count[30s])",
|
||||||
|
name: "[[job]]-[[index]]",
|
||||||
|
min: 0,
|
||||||
|
renderer: "line",
|
||||||
|
height: 150,
|
||||||
|
yAxisFormatter: PromConsole.NumberFormatter.humanize,
|
||||||
|
yHoverFormatter: PromConsole.NumberFormatter.humanize,
|
||||||
|
yTitle: "Pending Calls"
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
<h1>Storage</h1>
|
<h1>Storage</h1>
|
||||||
|
|
||||||
<h3>Queries</h3>
|
<h3>Queries</h3>
|
||||||
|
|||||||
Vendored
-66
@@ -1,69 +1,3 @@
|
|||||||
matrix-synapse-py3 (1.54.0) stable; urgency=medium
|
|
||||||
|
|
||||||
* New synapse release 1.54.0.
|
|
||||||
|
|
||||||
-- Synapse Packaging team <packages@matrix.org> Tue, 08 Mar 2022 10:54:52 +0000
|
|
||||||
|
|
||||||
matrix-synapse-py3 (1.54.0~rc1) stable; urgency=medium
|
|
||||||
|
|
||||||
* New synapse release 1.54.0~rc1.
|
|
||||||
|
|
||||||
-- Synapse Packaging team <packages@matrix.org> Wed, 02 Mar 2022 10:43:22 +0000
|
|
||||||
|
|
||||||
matrix-synapse-py3 (1.53.0) stable; urgency=medium
|
|
||||||
|
|
||||||
* New synapse release 1.53.0.
|
|
||||||
|
|
||||||
-- Synapse Packaging team <packages@matrix.org> Tue, 22 Feb 2022 11:32:06 +0000
|
|
||||||
|
|
||||||
matrix-synapse-py3 (1.53.0~rc1) stable; urgency=medium
|
|
||||||
|
|
||||||
* New synapse release 1.53.0~rc1.
|
|
||||||
|
|
||||||
-- Synapse Packaging team <packages@matrix.org> Tue, 15 Feb 2022 10:40:50 +0000
|
|
||||||
|
|
||||||
matrix-synapse-py3 (1.52.0) stable; urgency=medium
|
|
||||||
|
|
||||||
* New synapse release 1.52.0.
|
|
||||||
|
|
||||||
-- Synapse Packaging team <packages@matrix.org> Tue, 08 Feb 2022 11:34:54 +0000
|
|
||||||
|
|
||||||
matrix-synapse-py3 (1.52.0~rc1) stable; urgency=medium
|
|
||||||
|
|
||||||
* New synapse release 1.52.0~rc1.
|
|
||||||
|
|
||||||
-- Synapse Packaging team <packages@matrix.org> Tue, 01 Feb 2022 11:04:09 +0000
|
|
||||||
|
|
||||||
matrix-synapse-py3 (1.51.0) stable; urgency=medium
|
|
||||||
|
|
||||||
* New synapse release 1.51.0.
|
|
||||||
|
|
||||||
-- Synapse Packaging team <packages@matrix.org> Tue, 25 Jan 2022 11:28:51 +0000
|
|
||||||
|
|
||||||
matrix-synapse-py3 (1.51.0~rc2) stable; urgency=medium
|
|
||||||
|
|
||||||
* New synapse release 1.51.0~rc2.
|
|
||||||
|
|
||||||
-- Synapse Packaging team <packages@matrix.org> Mon, 24 Jan 2022 12:25:00 +0000
|
|
||||||
|
|
||||||
matrix-synapse-py3 (1.51.0~rc1) stable; urgency=medium
|
|
||||||
|
|
||||||
* New synapse release 1.51.0~rc1.
|
|
||||||
|
|
||||||
-- Synapse Packaging team <packages@matrix.org> Fri, 21 Jan 2022 10:46:02 +0000
|
|
||||||
|
|
||||||
matrix-synapse-py3 (1.50.2) stable; urgency=medium
|
|
||||||
|
|
||||||
* New synapse release 1.50.2.
|
|
||||||
|
|
||||||
-- Synapse Packaging team <packages@matrix.org> Mon, 24 Jan 2022 13:37:11 +0000
|
|
||||||
|
|
||||||
matrix-synapse-py3 (1.50.1) stable; urgency=medium
|
|
||||||
|
|
||||||
* New synapse release 1.50.1.
|
|
||||||
|
|
||||||
-- Synapse Packaging team <packages@matrix.org> Tue, 18 Jan 2022 16:06:26 +0000
|
|
||||||
|
|
||||||
matrix-synapse-py3 (1.50.0) stable; urgency=medium
|
matrix-synapse-py3 (1.50.0) stable; urgency=medium
|
||||||
|
|
||||||
* New synapse release 1.50.0.
|
* New synapse release 1.50.0.
|
||||||
|
|||||||
+7
-4
@@ -1,4 +1,7 @@
|
|||||||
# Ignore all the temporary files from the demo servers.
|
*.db
|
||||||
8080/
|
*.log
|
||||||
8081/
|
*.log.*
|
||||||
8082/
|
*.pid
|
||||||
|
|
||||||
|
/media_store.*
|
||||||
|
/etc
|
||||||
|
|||||||
+26
@@ -0,0 +1,26 @@
|
|||||||
|
DO NOT USE THESE DEMO SERVERS IN PRODUCTION
|
||||||
|
|
||||||
|
Requires you to have done:
|
||||||
|
python setup.py develop
|
||||||
|
|
||||||
|
|
||||||
|
The demo start.sh will start three synapse servers on ports 8080, 8081 and 8082, with host names localhost:$port. This can be easily changed to `hostname`:$port in start.sh if required.
|
||||||
|
|
||||||
|
To enable the servers to communicate untrusted ssl certs are used. In order to do this the servers do not check the certs
|
||||||
|
and are configured in a highly insecure way. Do not use these configuration files in production.
|
||||||
|
|
||||||
|
stop.sh will stop the synapse servers and the webclient.
|
||||||
|
|
||||||
|
clean.sh will delete the databases and log files.
|
||||||
|
|
||||||
|
To start a completely new set of servers, run:
|
||||||
|
|
||||||
|
./demo/stop.sh; ./demo/clean.sh && ./demo/start.sh
|
||||||
|
|
||||||
|
|
||||||
|
Logs and sqlitedb will be stored in demo/808{0,1,2}.{log,db}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Also note that when joining a public room on a differnt HS via "#foo:bar.net", then you are (in the current impl) joining a room with room_id "foo". This means that it won't work if your HS already has a room with that name.
|
||||||
|
|
||||||
@@ -4,9 +4,6 @@ set -e
|
|||||||
|
|
||||||
DIR="$( cd "$( dirname "$0" )" && pwd )"
|
DIR="$( cd "$( dirname "$0" )" && pwd )"
|
||||||
|
|
||||||
# Ensure that the servers are stopped.
|
|
||||||
$DIR/stop.sh
|
|
||||||
|
|
||||||
PID_FILE="$DIR/servers.pid"
|
PID_FILE="$DIR/servers.pid"
|
||||||
|
|
||||||
if [ -f "$PID_FILE" ]; then
|
if [ -f "$PID_FILE" ]; then
|
||||||
|
|||||||
+36
-33
@@ -6,6 +6,8 @@ CWD=$(pwd)
|
|||||||
|
|
||||||
cd "$DIR/.." || exit
|
cd "$DIR/.." || exit
|
||||||
|
|
||||||
|
mkdir -p demo/etc
|
||||||
|
|
||||||
PYTHONPATH=$(readlink -f "$(pwd)")
|
PYTHONPATH=$(readlink -f "$(pwd)")
|
||||||
export PYTHONPATH
|
export PYTHONPATH
|
||||||
|
|
||||||
@@ -19,26 +21,22 @@ for port in 8080 8081 8082; do
|
|||||||
mkdir -p demo/$port
|
mkdir -p demo/$port
|
||||||
pushd demo/$port || exit
|
pushd demo/$port || exit
|
||||||
|
|
||||||
# Generate the configuration for the homeserver at localhost:848x.
|
#rm $DIR/etc/$port.config
|
||||||
python3 -m synapse.app.homeserver \
|
python3 -m synapse.app.homeserver \
|
||||||
--generate-config \
|
--generate-config \
|
||||||
--server-name "localhost:$port" \
|
-H "localhost:$https_port" \
|
||||||
--config-path "$port.config" \
|
--config-path "$DIR/etc/$port.config" \
|
||||||
--report-stats no
|
--report-stats no
|
||||||
|
|
||||||
if ! grep -F "Customisation made by demo/start.sh" -q "$port.config"; then
|
if ! grep -F "Customisation made by demo/start.sh" -q "$DIR/etc/$port.config"; then
|
||||||
# Generate TLS keys.
|
# Generate tls keys
|
||||||
openssl req -x509 -newkey rsa:4096 \
|
openssl req -x509 -newkey rsa:4096 -keyout "$DIR/etc/localhost:$https_port.tls.key" -out "$DIR/etc/localhost:$https_port.tls.crt" -days 365 -nodes -subj "/O=matrix"
|
||||||
-keyout "localhost:$port.tls.key" \
|
|
||||||
-out "localhost:$port.tls.crt" \
|
|
||||||
-days 365 -nodes -subj "/O=matrix"
|
|
||||||
|
|
||||||
# Add customisations to the configuration.
|
# Regenerate configuration
|
||||||
{
|
{
|
||||||
printf '\n\n# Customisation made by demo/start.sh\n\n'
|
printf '\n\n# Customisation made by demo/start.sh\n'
|
||||||
echo "public_baseurl: http://localhost:$port/"
|
echo "public_baseurl: http://localhost:$port/"
|
||||||
echo 'enable_registration: true'
|
echo 'enable_registration: true'
|
||||||
echo ''
|
|
||||||
|
|
||||||
# Warning, this heredoc depends on the interaction of tabs and spaces.
|
# Warning, this heredoc depends on the interaction of tabs and spaces.
|
||||||
# Please don't accidentaly bork me with your fancy settings.
|
# Please don't accidentaly bork me with your fancy settings.
|
||||||
@@ -65,34 +63,38 @@ for port in 8080 8081 8082; do
|
|||||||
|
|
||||||
echo "${listeners}"
|
echo "${listeners}"
|
||||||
|
|
||||||
# Disable TLS for the servers
|
# Disable tls for the servers
|
||||||
printf '\n\n# Disable TLS for the servers.'
|
printf '\n\n# Disable tls on the servers.'
|
||||||
echo '# DO NOT USE IN PRODUCTION'
|
echo '# DO NOT USE IN PRODUCTION'
|
||||||
echo 'use_insecure_ssl_client_just_for_testing_do_not_use: true'
|
echo 'use_insecure_ssl_client_just_for_testing_do_not_use: true'
|
||||||
echo 'federation_verify_certificates: false'
|
echo 'federation_verify_certificates: false'
|
||||||
|
|
||||||
# Set paths for the TLS certificates.
|
# Set tls paths
|
||||||
echo "tls_certificate_path: \"$DIR/$port/localhost:$port.tls.crt\""
|
echo "tls_certificate_path: \"$DIR/etc/localhost:$https_port.tls.crt\""
|
||||||
echo "tls_private_key_path: \"$DIR/$port/localhost:$port.tls.key\""
|
echo "tls_private_key_path: \"$DIR/etc/localhost:$https_port.tls.key\""
|
||||||
|
|
||||||
# Ignore keys from the trusted keys server
|
# Ignore keys from the trusted keys server
|
||||||
echo '# Ignore keys from the trusted keys server'
|
echo '# Ignore keys from the trusted keys server'
|
||||||
echo 'trusted_key_servers:'
|
echo 'trusted_key_servers:'
|
||||||
echo ' - server_name: "matrix.org"'
|
echo ' - server_name: "matrix.org"'
|
||||||
echo ' accept_keys_insecurely: true'
|
echo ' accept_keys_insecurely: true'
|
||||||
echo ''
|
|
||||||
|
|
||||||
# Allow the servers to communicate over localhost.
|
# Reduce the blacklist
|
||||||
allow_list=$(cat <<-ALLOW_LIST
|
blacklist=$(cat <<-BLACK
|
||||||
# Allow the servers to communicate over localhost.
|
# Set the blacklist so that it doesn't include 127.0.0.1, ::1
|
||||||
ip_range_whitelist:
|
federation_ip_range_blacklist:
|
||||||
- '127.0.0.1/8'
|
- '10.0.0.0/8'
|
||||||
- '::1/128'
|
- '172.16.0.0/12'
|
||||||
ALLOW_LIST
|
- '192.168.0.0/16'
|
||||||
|
- '100.64.0.0/10'
|
||||||
|
- '169.254.0.0/16'
|
||||||
|
- 'fe80::/64'
|
||||||
|
- 'fc00::/7'
|
||||||
|
BLACK
|
||||||
)
|
)
|
||||||
|
|
||||||
echo "${allow_list}"
|
echo "${blacklist}"
|
||||||
} >> "$port.config"
|
} >> "$DIR/etc/$port.config"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check script parameters
|
# Check script parameters
|
||||||
@@ -139,18 +141,19 @@ for port in 8080 8081 8082; do
|
|||||||
burst_count: 1000
|
burst_count: 1000
|
||||||
RC
|
RC
|
||||||
)
|
)
|
||||||
echo "${ratelimiting}" >> "$port.config"
|
echo "${ratelimiting}" >> "$DIR/etc/$port.config"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Always disable reporting of stats if the option is not there.
|
if ! grep -F "full_twisted_stacktraces" -q "$DIR/etc/$port.config"; then
|
||||||
if ! grep -F "report_stats" -q "$port.config" ; then
|
echo "full_twisted_stacktraces: true" >> "$DIR/etc/$port.config"
|
||||||
echo "report_stats: false" >> "$port.config"
|
fi
|
||||||
|
if ! grep -F "report_stats" -q "$DIR/etc/$port.config" ; then
|
||||||
|
echo "report_stats: false" >> "$DIR/etc/$port.config"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Run the homeserver in the background.
|
|
||||||
python3 -m synapse.app.homeserver \
|
python3 -m synapse.app.homeserver \
|
||||||
--config-path "$port.config" \
|
--config-path "$DIR/etc/$port.config" \
|
||||||
-D \
|
-D \
|
||||||
|
|
||||||
popd || exit
|
popd || exit
|
||||||
|
|||||||
+10
-23
@@ -1,20 +1,17 @@
|
|||||||
# Dockerfile to build the matrixdotorg/synapse docker images.
|
# Dockerfile to build the matrixdotorg/synapse docker images.
|
||||||
#
|
#
|
||||||
# Note that it uses features which are only available in BuildKit - see
|
|
||||||
# https://docs.docker.com/go/buildkit/ for more information.
|
|
||||||
#
|
|
||||||
# To build the image, run `docker build` command from the root of the
|
# To build the image, run `docker build` command from the root of the
|
||||||
# synapse repository:
|
# synapse repository:
|
||||||
#
|
#
|
||||||
# DOCKER_BUILDKIT=1 docker build -f docker/Dockerfile .
|
# docker build -f docker/Dockerfile .
|
||||||
#
|
#
|
||||||
# There is an optional PYTHON_VERSION build argument which sets the
|
# There is an optional PYTHON_VERSION build argument which sets the
|
||||||
# version of python to build against: for example:
|
# version of python to build against: for example:
|
||||||
#
|
#
|
||||||
# DOCKER_BUILDKIT=1 docker build -f docker/Dockerfile --build-arg PYTHON_VERSION=3.10 .
|
# docker build -f docker/Dockerfile --build-arg PYTHON_VERSION=3.6 .
|
||||||
#
|
#
|
||||||
|
|
||||||
ARG PYTHON_VERSION=3.9
|
ARG PYTHON_VERSION=3.8
|
||||||
|
|
||||||
###
|
###
|
||||||
### Stage 0: builder
|
### Stage 0: builder
|
||||||
@@ -22,16 +19,7 @@ ARG PYTHON_VERSION=3.9
|
|||||||
FROM docker.io/python:${PYTHON_VERSION}-slim as builder
|
FROM docker.io/python:${PYTHON_VERSION}-slim as builder
|
||||||
|
|
||||||
# install the OS build deps
|
# install the OS build deps
|
||||||
#
|
RUN apt-get update && apt-get install -y \
|
||||||
# RUN --mount is specific to buildkit and is documented at
|
|
||||||
# https://github.com/moby/buildkit/blob/master/frontend/dockerfile/docs/syntax.md#build-mounts-run---mount.
|
|
||||||
# Here we use it to set up a cache for apt, to improve rebuild speeds on
|
|
||||||
# slow connections.
|
|
||||||
#
|
|
||||||
RUN \
|
|
||||||
--mount=type=cache,target=/var/cache/apt,sharing=locked \
|
|
||||||
--mount=type=cache,target=/var/lib/apt,sharing=locked \
|
|
||||||
apt-get update && apt-get install -y \
|
|
||||||
build-essential \
|
build-essential \
|
||||||
libffi-dev \
|
libffi-dev \
|
||||||
libjpeg-dev \
|
libjpeg-dev \
|
||||||
@@ -46,7 +34,8 @@ RUN \
|
|||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
# Copy just what we need to pip install
|
# Copy just what we need to pip install
|
||||||
COPY MANIFEST.in README.rst setup.py /synapse/
|
COPY scripts /synapse/scripts/
|
||||||
|
COPY MANIFEST.in README.rst setup.py synctl /synapse/
|
||||||
COPY synapse/__init__.py /synapse/synapse/__init__.py
|
COPY synapse/__init__.py /synapse/synapse/__init__.py
|
||||||
COPY synapse/python_dependencies.py /synapse/synapse/python_dependencies.py
|
COPY synapse/python_dependencies.py /synapse/synapse/python_dependencies.py
|
||||||
|
|
||||||
@@ -55,8 +44,7 @@ COPY synapse/python_dependencies.py /synapse/synapse/python_dependencies.py
|
|||||||
# used while you develop on the source
|
# used while you develop on the source
|
||||||
#
|
#
|
||||||
# This is aiming at installing the `install_requires` and `extras_require` from `setup.py`
|
# This is aiming at installing the `install_requires` and `extras_require` from `setup.py`
|
||||||
RUN --mount=type=cache,target=/root/.cache/pip \
|
RUN pip install --prefix="/install" --no-warn-script-location \
|
||||||
pip install --prefix="/install" --no-warn-script-location \
|
|
||||||
/synapse[all]
|
/synapse[all]
|
||||||
|
|
||||||
# Copy over the rest of the project
|
# Copy over the rest of the project
|
||||||
@@ -78,10 +66,7 @@ LABEL org.opencontainers.image.documentation='https://github.com/matrix-org/syna
|
|||||||
LABEL org.opencontainers.image.source='https://github.com/matrix-org/synapse.git'
|
LABEL org.opencontainers.image.source='https://github.com/matrix-org/synapse.git'
|
||||||
LABEL org.opencontainers.image.licenses='Apache-2.0'
|
LABEL org.opencontainers.image.licenses='Apache-2.0'
|
||||||
|
|
||||||
RUN \
|
RUN apt-get update && apt-get install -y \
|
||||||
--mount=type=cache,target=/var/cache/apt,sharing=locked \
|
|
||||||
--mount=type=cache,target=/var/lib/apt,sharing=locked \
|
|
||||||
apt-get update && apt-get install -y \
|
|
||||||
curl \
|
curl \
|
||||||
gosu \
|
gosu \
|
||||||
libjpeg62-turbo \
|
libjpeg62-turbo \
|
||||||
@@ -97,6 +82,8 @@ COPY --from=builder /install /usr/local
|
|||||||
COPY ./docker/start.py /start.py
|
COPY ./docker/start.py /start.py
|
||||||
COPY ./docker/conf /conf
|
COPY ./docker/conf /conf
|
||||||
|
|
||||||
|
VOLUME ["/data"]
|
||||||
|
|
||||||
EXPOSE 8008/tcp 8009/tcp 8448/tcp
|
EXPOSE 8008/tcp 8009/tcp 8448/tcp
|
||||||
|
|
||||||
ENTRYPOINT ["/start.py"]
|
ENTRYPOINT ["/start.py"]
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# Use the Sytest image that comes with a lot of the build dependencies
|
# Use the Sytest image that comes with a lot of the build dependencies
|
||||||
# pre-installed
|
# pre-installed
|
||||||
FROM matrixdotorg/sytest:focal
|
FROM matrixdotorg/sytest:bionic
|
||||||
|
|
||||||
# The Sytest image doesn't come with python, so install that
|
# The Sytest image doesn't come with python, so install that
|
||||||
RUN apt-get update && apt-get -qq install -y python3 python3-dev python3-pip
|
RUN apt-get update && apt-get -qq install -y python3 python3-dev python3-pip
|
||||||
|
|||||||
@@ -16,4 +16,4 @@ sudo -u postgres /usr/lib/postgresql/10/bin/pg_ctl -w -D /var/lib/postgresql/dat
|
|||||||
# Run the tests
|
# Run the tests
|
||||||
cd /src
|
cd /src
|
||||||
export TRIAL_FLAGS="-j 4"
|
export TRIAL_FLAGS="-j 4"
|
||||||
tox --workdir=./.tox-pg-container -e py37-postgres "$@"
|
tox --workdir=./.tox-pg-container -e py36-postgres "$@"
|
||||||
|
|||||||
@@ -0,0 +1,335 @@
|
|||||||
|
# MSC1711 Certificates FAQ
|
||||||
|
|
||||||
|
## Historical Note
|
||||||
|
This document was originally written to guide server admins through the upgrade
|
||||||
|
path towards Synapse 1.0. Specifically,
|
||||||
|
[MSC1711](https://github.com/matrix-org/matrix-doc/blob/main/proposals/1711-x509-for-federation.md)
|
||||||
|
required that all servers present valid TLS certificates on their federation
|
||||||
|
API. Admins were encouraged to achieve compliance from version 0.99.0 (released
|
||||||
|
in February 2019) ahead of version 1.0 (released June 2019) enforcing the
|
||||||
|
certificate checks.
|
||||||
|
|
||||||
|
Much of what follows is now outdated since most admins will have already
|
||||||
|
upgraded, however it may be of use to those with old installs returning to the
|
||||||
|
project.
|
||||||
|
|
||||||
|
If you are setting up a server from scratch you almost certainly should look at
|
||||||
|
the [installation guide](setup/installation.md) instead.
|
||||||
|
|
||||||
|
## Introduction
|
||||||
|
The goal of Synapse 0.99.0 is to act as a stepping stone to Synapse 1.0.0. It
|
||||||
|
supports the r0.1 release of the server to server specification, but is
|
||||||
|
compatible with both the legacy Matrix federation behaviour (pre-r0.1) as well
|
||||||
|
as post-r0.1 behaviour, in order to allow for a smooth upgrade across the
|
||||||
|
federation.
|
||||||
|
|
||||||
|
The most important thing to know is that Synapse 1.0.0 will require a valid TLS
|
||||||
|
certificate on federation endpoints. Self signed certificates will not be
|
||||||
|
sufficient.
|
||||||
|
|
||||||
|
Synapse 0.99.0 makes it easy to configure TLS certificates and will
|
||||||
|
interoperate with both >= 1.0.0 servers as well as existing servers yet to
|
||||||
|
upgrade.
|
||||||
|
|
||||||
|
**It is critical that all admins upgrade to 0.99.0 and configure a valid TLS
|
||||||
|
certificate.** Admins will have 1 month to do so, after which 1.0.0 will be
|
||||||
|
released and those servers without a valid certificate will not longer be able
|
||||||
|
to federate with >= 1.0.0 servers.
|
||||||
|
|
||||||
|
Full details on how to carry out this configuration change is given
|
||||||
|
[below](#configuring-certificates-for-compatibility-with-synapse-100). A
|
||||||
|
timeline and some frequently asked questions are also given below.
|
||||||
|
|
||||||
|
For more details and context on the release of the r0.1 Server/Server API and
|
||||||
|
imminent Matrix 1.0 release, you can also see our
|
||||||
|
[main talk from FOSDEM 2019](https://matrix.org/blog/2019/02/04/matrix-at-fosdem-2019/).
|
||||||
|
|
||||||
|
## Contents
|
||||||
|
* Timeline
|
||||||
|
* Configuring certificates for compatibility with Synapse 1.0
|
||||||
|
* FAQ
|
||||||
|
* Synapse 0.99.0 has just been released, what do I need to do right now?
|
||||||
|
* How do I upgrade?
|
||||||
|
* What will happen if I do not set up a valid federation certificate
|
||||||
|
immediately?
|
||||||
|
* What will happen if I do nothing at all?
|
||||||
|
* When do I need a SRV record or .well-known URI?
|
||||||
|
* Can I still use an SRV record?
|
||||||
|
* I have created a .well-known URI. Do I still need an SRV record?
|
||||||
|
* It used to work just fine, why are you breaking everything?
|
||||||
|
* Can I manage my own certificates rather than having Synapse renew
|
||||||
|
certificates itself?
|
||||||
|
* Do you still recommend against using a reverse proxy on the federation port?
|
||||||
|
* Do I still need to give my TLS certificates to Synapse if I am using a
|
||||||
|
reverse proxy?
|
||||||
|
* Do I need the same certificate for the client and federation port?
|
||||||
|
* How do I tell Synapse to reload my keys/certificates after I replace them?
|
||||||
|
|
||||||
|
## Timeline
|
||||||
|
|
||||||
|
**5th Feb 2019 - Synapse 0.99.0 is released.**
|
||||||
|
|
||||||
|
All server admins are encouraged to upgrade.
|
||||||
|
|
||||||
|
0.99.0:
|
||||||
|
|
||||||
|
- provides support for ACME to make setting up Let's Encrypt certs easy, as
|
||||||
|
well as .well-known support.
|
||||||
|
|
||||||
|
- does not enforce that a valid CA cert is present on the federation API, but
|
||||||
|
rather makes it easy to set one up.
|
||||||
|
|
||||||
|
- provides support for .well-known
|
||||||
|
|
||||||
|
Admins should upgrade and configure a valid CA cert. Homeservers that require a
|
||||||
|
.well-known entry (see below), should retain their SRV record and use it
|
||||||
|
alongside their .well-known record.
|
||||||
|
|
||||||
|
**10th June 2019 - Synapse 1.0.0 is released**
|
||||||
|
|
||||||
|
1.0.0 is scheduled for release on 10th June. In
|
||||||
|
accordance with the the [S2S spec](https://matrix.org/docs/spec/server_server/r0.1.0.html)
|
||||||
|
1.0.0 will enforce certificate validity. This means that any homeserver without a
|
||||||
|
valid certificate after this point will no longer be able to federate with
|
||||||
|
1.0.0 servers.
|
||||||
|
|
||||||
|
## Configuring certificates for compatibility with Synapse 1.0.0
|
||||||
|
|
||||||
|
### If you do not currently have an SRV record
|
||||||
|
|
||||||
|
In this case, your `server_name` points to the host where your Synapse is
|
||||||
|
running. There is no need to create a `.well-known` URI or an SRV record, but
|
||||||
|
you will need to give Synapse a valid, signed, certificate.
|
||||||
|
|
||||||
|
### If you do have an SRV record currently
|
||||||
|
|
||||||
|
If you are using an SRV record, your matrix domain (`server_name`) may not
|
||||||
|
point to the same host that your Synapse is running on (the 'target
|
||||||
|
domain'). (If it does, you can follow the recommendation above; otherwise, read
|
||||||
|
on.)
|
||||||
|
|
||||||
|
Let's assume that your `server_name` is `example.com`, and your Synapse is
|
||||||
|
hosted at a target domain of `customer.example.net`. Currently you should have
|
||||||
|
an SRV record which looks like:
|
||||||
|
|
||||||
|
```
|
||||||
|
_matrix._tcp.example.com. IN SRV 10 5 8000 customer.example.net.
|
||||||
|
```
|
||||||
|
|
||||||
|
In this situation, you have three choices for how to proceed:
|
||||||
|
|
||||||
|
#### Option 1: give Synapse a certificate for your matrix domain
|
||||||
|
|
||||||
|
Synapse 1.0 will expect your server to present a TLS certificate for your
|
||||||
|
`server_name` (`example.com` in the above example). You can achieve this by acquiring a
|
||||||
|
certificate for the `server_name` yourself (for example, using `certbot`), and giving it
|
||||||
|
and the key to Synapse via `tls_certificate_path` and `tls_private_key_path`.
|
||||||
|
|
||||||
|
#### Option 2: run Synapse behind a reverse proxy
|
||||||
|
|
||||||
|
If you have an existing reverse proxy set up with correct TLS certificates for
|
||||||
|
your domain, you can simply route all traffic through the reverse proxy by
|
||||||
|
updating the SRV record appropriately (or removing it, if the proxy listens on
|
||||||
|
8448).
|
||||||
|
|
||||||
|
See [the reverse proxy documentation](reverse_proxy.md) for information on setting up a
|
||||||
|
reverse proxy.
|
||||||
|
|
||||||
|
#### Option 3: add a .well-known file to delegate your matrix traffic
|
||||||
|
|
||||||
|
This will allow you to keep Synapse on a separate domain, without having to
|
||||||
|
give it a certificate for the matrix domain.
|
||||||
|
|
||||||
|
You can do this with a `.well-known` file as follows:
|
||||||
|
|
||||||
|
1. Keep the SRV record in place - it is needed for backwards compatibility
|
||||||
|
with Synapse 0.34 and earlier.
|
||||||
|
|
||||||
|
2. Give Synapse a certificate corresponding to the target domain
|
||||||
|
(`customer.example.net` in the above example). You can do this by acquire a
|
||||||
|
certificate for the target domain and giving it to Synapse via `tls_certificate_path`
|
||||||
|
and `tls_private_key_path`.
|
||||||
|
|
||||||
|
3. Restart Synapse to ensure the new certificate is loaded.
|
||||||
|
|
||||||
|
4. Arrange for a `.well-known` file at
|
||||||
|
`https://<server_name>/.well-known/matrix/server` with contents:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{"m.server": "<target server name>"}
|
||||||
|
```
|
||||||
|
|
||||||
|
where the target server name is resolved as usual (i.e. SRV lookup, falling
|
||||||
|
back to talking to port 8448).
|
||||||
|
|
||||||
|
In the above example, where synapse is listening on port 8000,
|
||||||
|
`https://example.com/.well-known/matrix/server` should have `m.server` set to one of:
|
||||||
|
|
||||||
|
1. `customer.example.net` ─ with a SRV record on
|
||||||
|
`_matrix._tcp.customer.example.com` pointing to port 8000, or:
|
||||||
|
|
||||||
|
2. `customer.example.net` ─ updating synapse to listen on the default port
|
||||||
|
8448, or:
|
||||||
|
|
||||||
|
3. `customer.example.net:8000` ─ ensuring that if there is a reverse proxy
|
||||||
|
on `customer.example.net:8000` it correctly handles HTTP requests with
|
||||||
|
Host header set to `customer.example.net:8000`.
|
||||||
|
|
||||||
|
## FAQ
|
||||||
|
|
||||||
|
### Synapse 0.99.0 has just been released, what do I need to do right now?
|
||||||
|
|
||||||
|
Upgrade as soon as you can in preparation for Synapse 1.0.0, and update your
|
||||||
|
TLS certificates as [above](#configuring-certificates-for-compatibility-with-synapse-100).
|
||||||
|
|
||||||
|
### What will happen if I do not set up a valid federation certificate immediately?
|
||||||
|
|
||||||
|
Nothing initially, but once 1.0.0 is in the wild it will not be possible to
|
||||||
|
federate with 1.0.0 servers.
|
||||||
|
|
||||||
|
### What will happen if I do nothing at all?
|
||||||
|
|
||||||
|
If the admin takes no action at all, and remains on a Synapse < 0.99.0 then the
|
||||||
|
homeserver will be unable to federate with those who have implemented
|
||||||
|
.well-known. Then, as above, once the month upgrade window has expired the
|
||||||
|
homeserver will not be able to federate with any Synapse >= 1.0.0
|
||||||
|
|
||||||
|
### When do I need a SRV record or .well-known URI?
|
||||||
|
|
||||||
|
If your homeserver listens on the default federation port (8448), and your
|
||||||
|
`server_name` points to the host that your homeserver runs on, you do not need an
|
||||||
|
SRV record or `.well-known/matrix/server` URI.
|
||||||
|
|
||||||
|
For instance, if you registered `example.com` and pointed its DNS A record at a
|
||||||
|
fresh Upcloud VPS or similar, you could install Synapse 0.99 on that host,
|
||||||
|
giving it a server_name of `example.com`, and it would automatically generate a
|
||||||
|
valid TLS certificate for you via Let's Encrypt and no SRV record or
|
||||||
|
`.well-known` URI would be needed.
|
||||||
|
|
||||||
|
This is the common case, although you can add an SRV record or
|
||||||
|
`.well-known/matrix/server` URI for completeness if you wish.
|
||||||
|
|
||||||
|
**However**, if your server does not listen on port 8448, or if your `server_name`
|
||||||
|
does not point to the host that your homeserver runs on, you will need to let
|
||||||
|
other servers know how to find it.
|
||||||
|
|
||||||
|
In this case, you should see ["If you do have an SRV record
|
||||||
|
currently"](#if-you-do-have-an-srv-record-currently) above.
|
||||||
|
|
||||||
|
### Can I still use an SRV record?
|
||||||
|
|
||||||
|
Firstly, if you didn't need an SRV record before (because your server is
|
||||||
|
listening on port 8448 of your server_name), you certainly don't need one now:
|
||||||
|
the defaults are still the same.
|
||||||
|
|
||||||
|
If you previously had an SRV record, you can keep using it provided you are
|
||||||
|
able to give Synapse a TLS certificate corresponding to your server name. For
|
||||||
|
example, suppose you had the following SRV record, which directs matrix traffic
|
||||||
|
for example.com to matrix.example.com:443:
|
||||||
|
|
||||||
|
```
|
||||||
|
_matrix._tcp.example.com. IN SRV 10 5 443 matrix.example.com
|
||||||
|
```
|
||||||
|
|
||||||
|
In this case, Synapse must be given a certificate for example.com - or be
|
||||||
|
configured to acquire one from Let's Encrypt.
|
||||||
|
|
||||||
|
If you are unable to give Synapse a certificate for your server_name, you will
|
||||||
|
also need to use a .well-known URI instead. However, see also "I have created a
|
||||||
|
.well-known URI. Do I still need an SRV record?".
|
||||||
|
|
||||||
|
### I have created a .well-known URI. Do I still need an SRV record?
|
||||||
|
|
||||||
|
As of Synapse 0.99, Synapse will first check for the existence of a `.well-known`
|
||||||
|
URI and follow any delegation it suggests. It will only then check for the
|
||||||
|
existence of an SRV record.
|
||||||
|
|
||||||
|
That means that the SRV record will often be redundant. However, you should
|
||||||
|
remember that there may still be older versions of Synapse in the federation
|
||||||
|
which do not understand `.well-known` URIs, so if you removed your SRV record you
|
||||||
|
would no longer be able to federate with them.
|
||||||
|
|
||||||
|
It is therefore best to leave the SRV record in place for now. Synapse 0.34 and
|
||||||
|
earlier will follow the SRV record (and not care about the invalid
|
||||||
|
certificate). Synapse 0.99 and later will follow the .well-known URI, with the
|
||||||
|
correct certificate chain.
|
||||||
|
|
||||||
|
### It used to work just fine, why are you breaking everything?
|
||||||
|
|
||||||
|
We have always wanted Matrix servers to be as easy to set up as possible, and
|
||||||
|
so back when we started federation in 2014 we didn't want admins to have to go
|
||||||
|
through the cumbersome process of buying a valid TLS certificate to run a
|
||||||
|
server. This was before Let's Encrypt came along and made getting a free and
|
||||||
|
valid TLS certificate straightforward. So instead, we adopted a system based on
|
||||||
|
[Perspectives](https://en.wikipedia.org/wiki/Convergence_(SSL)): an approach
|
||||||
|
where you check a set of "notary servers" (in practice, homeservers) to vouch
|
||||||
|
for the validity of a certificate rather than having it signed by a CA. As long
|
||||||
|
as enough different notaries agree on the certificate's validity, then it is
|
||||||
|
trusted.
|
||||||
|
|
||||||
|
However, in practice this has never worked properly. Most people only use the
|
||||||
|
default notary server (matrix.org), leading to inadvertent centralisation which
|
||||||
|
we want to eliminate. Meanwhile, we never implemented the full consensus
|
||||||
|
algorithm to query the servers participating in a room to determine consensus
|
||||||
|
on whether a given certificate is valid. This is fiddly to get right
|
||||||
|
(especially in face of sybil attacks), and we found ourselves questioning
|
||||||
|
whether it was worth the effort to finish the work and commit to maintaining a
|
||||||
|
secure certificate validation system as opposed to focusing on core Matrix
|
||||||
|
development.
|
||||||
|
|
||||||
|
Meanwhile, Let's Encrypt came along in 2016, and put the final nail in the
|
||||||
|
coffin of the Perspectives project (which was already pretty dead). So, the
|
||||||
|
Spec Core Team decided that a better approach would be to mandate valid TLS
|
||||||
|
certificates for federation alongside the rest of the Web. More details can be
|
||||||
|
found in
|
||||||
|
[MSC1711](https://github.com/matrix-org/matrix-doc/blob/main/proposals/1711-x509-for-federation.md#background-the-failure-of-the-perspectives-approach).
|
||||||
|
|
||||||
|
This results in a breaking change, which is disruptive, but absolutely critical
|
||||||
|
for the security model. However, the existence of Let's Encrypt as a trivial
|
||||||
|
way to replace the old self-signed certificates with valid CA-signed ones helps
|
||||||
|
smooth things over massively, especially as Synapse can now automate Let's
|
||||||
|
Encrypt certificate generation if needed.
|
||||||
|
|
||||||
|
### Can I manage my own certificates rather than having Synapse renew certificates itself?
|
||||||
|
|
||||||
|
Yes, you are welcome to manage your certificates yourself. Synapse will only
|
||||||
|
attempt to obtain certificates from Let's Encrypt if you configure it to do
|
||||||
|
so.The only requirement is that there is a valid TLS cert present for
|
||||||
|
federation end points.
|
||||||
|
|
||||||
|
### Do you still recommend against using a reverse proxy on the federation port?
|
||||||
|
|
||||||
|
We no longer actively recommend against using a reverse proxy. Many admins will
|
||||||
|
find it easier to direct federation traffic to a reverse proxy and manage their
|
||||||
|
own TLS certificates, and this is a supported configuration.
|
||||||
|
|
||||||
|
See [the reverse proxy documentation](reverse_proxy.md) for information on setting up a
|
||||||
|
reverse proxy.
|
||||||
|
|
||||||
|
### Do I still need to give my TLS certificates to Synapse if I am using a reverse proxy?
|
||||||
|
|
||||||
|
Practically speaking, this is no longer necessary.
|
||||||
|
|
||||||
|
If you are using a reverse proxy for all of your TLS traffic, then you can set
|
||||||
|
`no_tls: True`. In that case, the only reason Synapse needs the certificate is
|
||||||
|
to populate a legacy 'tls_fingerprints' field in the federation API. This is
|
||||||
|
ignored by Synapse 0.99.0 and later, and the only time pre-0.99 Synapses will
|
||||||
|
check it is when attempting to fetch the server keys - and generally this is
|
||||||
|
delegated via `matrix.org`, which is on 0.99.0.
|
||||||
|
|
||||||
|
However, there is a bug in Synapse 0.99.0
|
||||||
|
[4554](<https://github.com/matrix-org/synapse/issues/4554>) which prevents
|
||||||
|
Synapse from starting if you do not give it a TLS certificate. To work around
|
||||||
|
this, you can give it any TLS certificate at all. This will be fixed soon.
|
||||||
|
|
||||||
|
### Do I need the same certificate for the client and federation port?
|
||||||
|
|
||||||
|
No. There is nothing stopping you from using different certificates,
|
||||||
|
particularly if you are using a reverse proxy. However, Synapse will use the
|
||||||
|
same certificate on any ports where TLS is configured.
|
||||||
|
|
||||||
|
### How do I tell Synapse to reload my keys/certificates after I replace them?
|
||||||
|
|
||||||
|
Synapse will reload the keys and certificates when it receives a SIGHUP - for
|
||||||
|
example `kill -HUP $(cat homeserver.pid)`. Alternatively, simply restart
|
||||||
|
Synapse, though this will result in downtime while it restarts.
|
||||||
+2
-3
@@ -13,6 +13,7 @@
|
|||||||
|
|
||||||
# Upgrading
|
# Upgrading
|
||||||
- [Upgrading between Synapse Versions](upgrade.md)
|
- [Upgrading between Synapse Versions](upgrade.md)
|
||||||
|
- [Upgrading from pre-Synapse 1.0](MSC1711_certificates_FAQ.md)
|
||||||
|
|
||||||
# Usage
|
# Usage
|
||||||
- [Federation](federate.md)
|
- [Federation](federate.md)
|
||||||
@@ -71,7 +72,7 @@
|
|||||||
- [Understanding Synapse Through Grafana Graphs](usage/administration/understanding_synapse_through_grafana_graphs.md)
|
- [Understanding Synapse Through Grafana Graphs](usage/administration/understanding_synapse_through_grafana_graphs.md)
|
||||||
- [Useful SQL for Admins](usage/administration/useful_sql_for_admins.md)
|
- [Useful SQL for Admins](usage/administration/useful_sql_for_admins.md)
|
||||||
- [Database Maintenance Tools](usage/administration/database_maintenance_tools.md)
|
- [Database Maintenance Tools](usage/administration/database_maintenance_tools.md)
|
||||||
- [State Groups](usage/administration/state_groups.md)
|
- [State Groups](usage/administration/state_groups.md)
|
||||||
- [Request log format](usage/administration/request_log.md)
|
- [Request log format](usage/administration/request_log.md)
|
||||||
- [Admin FAQ](usage/administration/admin_faq.md)
|
- [Admin FAQ](usage/administration/admin_faq.md)
|
||||||
- [Scripts]()
|
- [Scripts]()
|
||||||
@@ -79,10 +80,8 @@
|
|||||||
# Development
|
# Development
|
||||||
- [Contributing Guide](development/contributing_guide.md)
|
- [Contributing Guide](development/contributing_guide.md)
|
||||||
- [Code Style](code_style.md)
|
- [Code Style](code_style.md)
|
||||||
- [Release Cycle](development/releases.md)
|
|
||||||
- [Git Usage](development/git.md)
|
- [Git Usage](development/git.md)
|
||||||
- [Testing]()
|
- [Testing]()
|
||||||
- [Demo scripts](development/demo.md)
|
|
||||||
- [OpenTracing](opentracing.md)
|
- [OpenTracing](opentracing.md)
|
||||||
- [Database Schemas](development/database_schema.md)
|
- [Database Schemas](development/database_schema.md)
|
||||||
- [Experimental features](development/experimental_features.md)
|
- [Experimental features](development/experimental_features.md)
|
||||||
|
|||||||
@@ -4,9 +4,6 @@ This API allows a server administrator to manage the validity of an account. To
|
|||||||
use it, you must enable the account validity feature (under
|
use it, you must enable the account validity feature (under
|
||||||
`account_validity`) in Synapse's configuration.
|
`account_validity`) in Synapse's configuration.
|
||||||
|
|
||||||
To use it, you will need to authenticate by providing an `access_token`
|
|
||||||
for a server admin: see [Admin API](../usage/administration/admin_api).
|
|
||||||
|
|
||||||
## Renew account
|
## Renew account
|
||||||
|
|
||||||
This API extends the validity of an account by as much time as configured in the
|
This API extends the validity of an account by as much time as configured in the
|
||||||
|
|||||||
@@ -4,11 +4,11 @@ This API lets a server admin delete a local group. Doing so will kick all
|
|||||||
users out of the group so that their clients will correctly handle the group
|
users out of the group so that their clients will correctly handle the group
|
||||||
being deleted.
|
being deleted.
|
||||||
|
|
||||||
To use it, you will need to authenticate by providing an `access_token`
|
|
||||||
for a server admin: see [Admin API](../usage/administration/admin_api).
|
|
||||||
|
|
||||||
The API is:
|
The API is:
|
||||||
|
|
||||||
```
|
```
|
||||||
POST /_synapse/admin/v1/delete_group/<group_id>
|
POST /_synapse/admin/v1/delete_group/<group_id>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
To use it, you will need to authenticate by providing an `access_token` for a
|
||||||
|
server admin: see [Admin API](../usage/administration/admin_api).
|
||||||
|
|||||||
@@ -2,13 +2,12 @@
|
|||||||
|
|
||||||
This API returns information about reported events.
|
This API returns information about reported events.
|
||||||
|
|
||||||
To use it, you will need to authenticate by providing an `access_token`
|
|
||||||
for a server admin: see [Admin API](../usage/administration/admin_api).
|
|
||||||
|
|
||||||
The api is:
|
The api is:
|
||||||
```
|
```
|
||||||
GET /_synapse/admin/v1/event_reports?from=0&limit=10
|
GET /_synapse/admin/v1/event_reports?from=0&limit=10
|
||||||
```
|
```
|
||||||
|
To use it, you will need to authenticate by providing an `access_token` for a
|
||||||
|
server admin: see [Admin API](../usage/administration/admin_api).
|
||||||
|
|
||||||
It returns a JSON body like the following:
|
It returns a JSON body like the following:
|
||||||
|
|
||||||
@@ -95,6 +94,8 @@ The api is:
|
|||||||
```
|
```
|
||||||
GET /_synapse/admin/v1/event_reports/<report_id>
|
GET /_synapse/admin/v1/event_reports/<report_id>
|
||||||
```
|
```
|
||||||
|
To use it, you will need to authenticate by providing an `access_token` for a
|
||||||
|
server admin: see [Admin API](../usage/administration/admin_api).
|
||||||
|
|
||||||
It returns a JSON body like the following:
|
It returns a JSON body like the following:
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +1,24 @@
|
|||||||
|
# Contents
|
||||||
|
- [Querying media](#querying-media)
|
||||||
|
* [List all media in a room](#list-all-media-in-a-room)
|
||||||
|
* [List all media uploaded by a user](#list-all-media-uploaded-by-a-user)
|
||||||
|
- [Quarantine media](#quarantine-media)
|
||||||
|
* [Quarantining media by ID](#quarantining-media-by-id)
|
||||||
|
* [Remove media from quarantine by ID](#remove-media-from-quarantine-by-id)
|
||||||
|
* [Quarantining media in a room](#quarantining-media-in-a-room)
|
||||||
|
* [Quarantining all media of a user](#quarantining-all-media-of-a-user)
|
||||||
|
* [Protecting media from being quarantined](#protecting-media-from-being-quarantined)
|
||||||
|
* [Unprotecting media from being quarantined](#unprotecting-media-from-being-quarantined)
|
||||||
|
- [Delete local media](#delete-local-media)
|
||||||
|
* [Delete a specific local media](#delete-a-specific-local-media)
|
||||||
|
* [Delete local media by date or size](#delete-local-media-by-date-or-size)
|
||||||
|
* [Delete media uploaded by a user](#delete-media-uploaded-by-a-user)
|
||||||
|
- [Purge Remote Media API](#purge-remote-media-api)
|
||||||
|
|
||||||
# Querying media
|
# Querying media
|
||||||
|
|
||||||
These APIs allow extracting media information from the homeserver.
|
These APIs allow extracting media information from the homeserver.
|
||||||
|
|
||||||
Details about the format of the `media_id` and storage of the media in the file system
|
|
||||||
are documented under [media repository](../media_repository.md).
|
|
||||||
|
|
||||||
To use it, you will need to authenticate by providing an `access_token`
|
|
||||||
for a server admin: see [Admin API](../usage/administration/admin_api).
|
|
||||||
|
|
||||||
## List all media in a room
|
## List all media in a room
|
||||||
|
|
||||||
This API gets a list of known media in a room.
|
This API gets a list of known media in a room.
|
||||||
@@ -17,6 +28,8 @@ The API is:
|
|||||||
```
|
```
|
||||||
GET /_synapse/admin/v1/room/<room_id>/media
|
GET /_synapse/admin/v1/room/<room_id>/media
|
||||||
```
|
```
|
||||||
|
To use it, you will need to authenticate by providing an `access_token` for a
|
||||||
|
server admin: see [Admin API](../usage/administration/admin_api).
|
||||||
|
|
||||||
The API returns a JSON body like the following:
|
The API returns a JSON body like the following:
|
||||||
```json
|
```json
|
||||||
@@ -304,5 +317,8 @@ The following fields are returned in the JSON response body:
|
|||||||
|
|
||||||
* `deleted`: integer - The number of media items successfully deleted
|
* `deleted`: integer - The number of media items successfully deleted
|
||||||
|
|
||||||
|
To use it, you will need to authenticate by providing an `access_token` for a
|
||||||
|
server admin: see [Admin API](../usage/administration/admin_api).
|
||||||
|
|
||||||
If the user re-requests purged remote media, synapse will re-request the media
|
If the user re-requests purged remote media, synapse will re-request the media
|
||||||
from the originating server.
|
from the originating server.
|
||||||
|
|||||||
@@ -10,15 +10,15 @@ paginate further back in the room from the point being purged from.
|
|||||||
Note that Synapse requires at least one message in each room, so it will never
|
Note that Synapse requires at least one message in each room, so it will never
|
||||||
delete the last message in a room.
|
delete the last message in a room.
|
||||||
|
|
||||||
To use it, you will need to authenticate by providing an `access_token`
|
|
||||||
for a server admin: see [Admin API](../usage/administration/admin_api).
|
|
||||||
|
|
||||||
The API is:
|
The API is:
|
||||||
|
|
||||||
```
|
```
|
||||||
POST /_synapse/admin/v1/purge_history/<room_id>[/<event_id>]
|
POST /_synapse/admin/v1/purge_history/<room_id>[/<event_id>]
|
||||||
```
|
```
|
||||||
|
|
||||||
|
To use it, you will need to authenticate by providing an `access_token` for a
|
||||||
|
server admin: [Admin API](../usage/administration/admin_api)
|
||||||
|
|
||||||
By default, events sent by local users are not deleted, as they may represent
|
By default, events sent by local users are not deleted, as they may represent
|
||||||
the only copies of this content in existence. (Events sent by remote users are
|
the only copies of this content in existence. (Events sent by remote users are
|
||||||
deleted.)
|
deleted.)
|
||||||
@@ -57,6 +57,9 @@ It is possible to poll for updates on recent purges with a second API;
|
|||||||
GET /_synapse/admin/v1/purge_history_status/<purge_id>
|
GET /_synapse/admin/v1/purge_history_status/<purge_id>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Again, you will need to authenticate by providing an `access_token` for a
|
||||||
|
server admin.
|
||||||
|
|
||||||
This API returns a JSON body like the following:
|
This API returns a JSON body like the following:
|
||||||
|
|
||||||
```json
|
```json
|
||||||
|
|||||||
@@ -5,9 +5,6 @@ to a room with a given `room_id_or_alias`. You can only modify the membership of
|
|||||||
local users. The server administrator must be in the room and have permission to
|
local users. The server administrator must be in the room and have permission to
|
||||||
invite users.
|
invite users.
|
||||||
|
|
||||||
To use it, you will need to authenticate by providing an `access_token`
|
|
||||||
for a server admin: see [Admin API](../usage/administration/admin_api).
|
|
||||||
|
|
||||||
## Parameters
|
## Parameters
|
||||||
|
|
||||||
The following parameters are available:
|
The following parameters are available:
|
||||||
@@ -26,6 +23,9 @@ POST /_synapse/admin/v1/join/<room_id_or_alias>
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
To use it, you will need to authenticate by providing an `access_token` for a
|
||||||
|
server admin: see [Admin API](../usage/administration/admin_api).
|
||||||
|
|
||||||
Response:
|
Response:
|
||||||
|
|
||||||
```json
|
```json
|
||||||
|
|||||||
+18
-3
@@ -1,12 +1,24 @@
|
|||||||
|
# Contents
|
||||||
|
- [List Room API](#list-room-api)
|
||||||
|
- [Room Details API](#room-details-api)
|
||||||
|
- [Room Members API](#room-members-api)
|
||||||
|
- [Room State API](#room-state-api)
|
||||||
|
- [Block Room API](#block-room-api)
|
||||||
|
- [Delete Room API](#delete-room-api)
|
||||||
|
* [Version 1 (old version)](#version-1-old-version)
|
||||||
|
* [Version 2 (new version)](#version-2-new-version)
|
||||||
|
* [Status of deleting rooms](#status-of-deleting-rooms)
|
||||||
|
* [Undoing room shutdowns](#undoing-room-shutdowns)
|
||||||
|
- [Make Room Admin API](#make-room-admin-api)
|
||||||
|
- [Forward Extremities Admin API](#forward-extremities-admin-api)
|
||||||
|
- [Event Context API](#event-context-api)
|
||||||
|
|
||||||
# List Room API
|
# List Room API
|
||||||
|
|
||||||
The List Room admin API allows server admins to get a list of rooms on their
|
The List Room admin API allows server admins to get a list of rooms on their
|
||||||
server. There are various parameters available that allow for filtering and
|
server. There are various parameters available that allow for filtering and
|
||||||
sorting the returned list. This API supports pagination.
|
sorting the returned list. This API supports pagination.
|
||||||
|
|
||||||
To use it, you will need to authenticate by providing an `access_token`
|
|
||||||
for a server admin: see [Admin API](../usage/administration/admin_api).
|
|
||||||
|
|
||||||
**Parameters**
|
**Parameters**
|
||||||
|
|
||||||
The following query parameters are available:
|
The following query parameters are available:
|
||||||
@@ -481,6 +493,9 @@ several minutes or longer.
|
|||||||
The local server will only have the power to move local user and room aliases to
|
The local server will only have the power to move local user and room aliases to
|
||||||
the new room. Users on other servers will be unaffected.
|
the new room. Users on other servers will be unaffected.
|
||||||
|
|
||||||
|
To use it, you will need to authenticate by providing an ``access_token`` for a
|
||||||
|
server admin: see [Admin API](../usage/administration/admin_api).
|
||||||
|
|
||||||
## Version 1 (old version)
|
## Version 1 (old version)
|
||||||
|
|
||||||
This version works synchronously. That means you only get the response once the server has
|
This version works synchronously. That means you only get the response once the server has
|
||||||
|
|||||||
@@ -3,15 +3,15 @@
|
|||||||
Returns information about all local media usage of users. Gives the
|
Returns information about all local media usage of users. Gives the
|
||||||
possibility to filter them by time and user.
|
possibility to filter them by time and user.
|
||||||
|
|
||||||
To use it, you will need to authenticate by providing an `access_token`
|
|
||||||
for a server admin: see [Admin API](../usage/administration/admin_api).
|
|
||||||
|
|
||||||
The API is:
|
The API is:
|
||||||
|
|
||||||
```
|
```
|
||||||
GET /_synapse/admin/v1/statistics/users/media
|
GET /_synapse/admin/v1/statistics/users/media
|
||||||
```
|
```
|
||||||
|
|
||||||
|
To use it, you will need to authenticate by providing an `access_token`
|
||||||
|
for a server admin: see [Admin API](../usage/administration/admin_api).
|
||||||
|
|
||||||
A response body like the following is returned:
|
A response body like the following is returned:
|
||||||
|
|
||||||
```json
|
```json
|
||||||
|
|||||||
@@ -1,8 +1,5 @@
|
|||||||
# User Admin API
|
# User Admin API
|
||||||
|
|
||||||
To use it, you will need to authenticate by providing an `access_token`
|
|
||||||
for a server admin: see [Admin API](../usage/administration/admin_api).
|
|
||||||
|
|
||||||
## Query User Account
|
## Query User Account
|
||||||
|
|
||||||
This API returns information about a specific user account.
|
This API returns information about a specific user account.
|
||||||
@@ -13,12 +10,14 @@ The api is:
|
|||||||
GET /_synapse/admin/v2/users/<user_id>
|
GET /_synapse/admin/v2/users/<user_id>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
To use it, you will need to authenticate by providing an `access_token` for a
|
||||||
|
server admin: [Admin API](../usage/administration/admin_api)
|
||||||
|
|
||||||
It returns a JSON body like the following:
|
It returns a JSON body like the following:
|
||||||
|
|
||||||
```jsonc
|
```json
|
||||||
{
|
{
|
||||||
"name": "@user:example.com",
|
"displayname": "User",
|
||||||
"displayname": "User", // can be null if not set
|
|
||||||
"threepids": [
|
"threepids": [
|
||||||
{
|
{
|
||||||
"medium": "email",
|
"medium": "email",
|
||||||
@@ -33,11 +32,11 @@ It returns a JSON body like the following:
|
|||||||
"validated_at": 1586458409743
|
"validated_at": 1586458409743
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"avatar_url": "<avatar_url>", // can be null if not set
|
"avatar_url": "<avatar_url>",
|
||||||
"is_guest": 0,
|
|
||||||
"admin": 0,
|
"admin": 0,
|
||||||
"deactivated": 0,
|
"deactivated": 0,
|
||||||
"shadow_banned": 0,
|
"shadow_banned": 0,
|
||||||
|
"password_hash": "$2b$12$p9B4GkqYdRTPGD",
|
||||||
"creation_ts": 1560432506,
|
"creation_ts": 1560432506,
|
||||||
"appservice_id": null,
|
"appservice_id": null,
|
||||||
"consent_server_notice_sent": null,
|
"consent_server_notice_sent": null,
|
||||||
@@ -104,6 +103,9 @@ with a body of:
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
To use it, you will need to authenticate by providing an `access_token` for a
|
||||||
|
server admin: [Admin API](../usage/administration/admin_api)
|
||||||
|
|
||||||
Returns HTTP status code:
|
Returns HTTP status code:
|
||||||
- `201` - When a new user object was created.
|
- `201` - When a new user object was created.
|
||||||
- `200` - When a user was modified.
|
- `200` - When a user was modified.
|
||||||
@@ -126,8 +128,7 @@ Body parameters:
|
|||||||
[Sample Configuration File](../usage/configuration/homeserver_sample_config.html)
|
[Sample Configuration File](../usage/configuration/homeserver_sample_config.html)
|
||||||
section `sso` and `oidc_providers`.
|
section `sso` and `oidc_providers`.
|
||||||
- `auth_provider` - string. ID of the external identity provider. Value of `idp_id`
|
- `auth_provider` - string. ID of the external identity provider. Value of `idp_id`
|
||||||
in the homeserver configuration. Note that no error is raised if the provided
|
in homeserver configuration.
|
||||||
value is not in the homeserver configuration.
|
|
||||||
- `external_id` - string, user ID in the external identity provider.
|
- `external_id` - string, user ID in the external identity provider.
|
||||||
- `avatar_url` - string, optional, must be a
|
- `avatar_url` - string, optional, must be a
|
||||||
[MXC URI](https://matrix.org/docs/spec/client_server/r0.6.0#matrix-content-mxc-uris).
|
[MXC URI](https://matrix.org/docs/spec/client_server/r0.6.0#matrix-content-mxc-uris).
|
||||||
@@ -154,6 +155,9 @@ By default, the response is ordered by ascending user ID.
|
|||||||
GET /_synapse/admin/v2/users?from=0&limit=10&guests=false
|
GET /_synapse/admin/v2/users?from=0&limit=10&guests=false
|
||||||
```
|
```
|
||||||
|
|
||||||
|
To use it, you will need to authenticate by providing an `access_token` for a
|
||||||
|
server admin: [Admin API](../usage/administration/admin_api)
|
||||||
|
|
||||||
A response body like the following is returned:
|
A response body like the following is returned:
|
||||||
|
|
||||||
```json
|
```json
|
||||||
@@ -273,6 +277,9 @@ GET /_matrix/client/r0/admin/whois/<userId>
|
|||||||
See also: [Client Server
|
See also: [Client Server
|
||||||
API Whois](https://matrix.org/docs/spec/client_server/r0.6.1#get-matrix-client-r0-admin-whois-userid).
|
API Whois](https://matrix.org/docs/spec/client_server/r0.6.1#get-matrix-client-r0-admin-whois-userid).
|
||||||
|
|
||||||
|
To use it, you will need to authenticate by providing an `access_token` for a
|
||||||
|
server admin: [Admin API](../usage/administration/admin_api)
|
||||||
|
|
||||||
It returns a JSON body like the following:
|
It returns a JSON body like the following:
|
||||||
|
|
||||||
```json
|
```json
|
||||||
@@ -327,12 +334,15 @@ with a body of:
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
To use it, you will need to authenticate by providing an `access_token` for a
|
||||||
|
server admin: [Admin API](../usage/administration/admin_api)
|
||||||
|
|
||||||
The erase parameter is optional and defaults to `false`.
|
The erase parameter is optional and defaults to `false`.
|
||||||
An empty body may be passed for backwards compatibility.
|
An empty body may be passed for backwards compatibility.
|
||||||
|
|
||||||
The following actions are performed when deactivating an user:
|
The following actions are performed when deactivating an user:
|
||||||
|
|
||||||
- Try to unbind 3PIDs from the identity server
|
- Try to unpind 3PIDs from the identity server
|
||||||
- Remove all 3PIDs from the homeserver
|
- Remove all 3PIDs from the homeserver
|
||||||
- Delete all devices and E2EE keys
|
- Delete all devices and E2EE keys
|
||||||
- Delete all access tokens
|
- Delete all access tokens
|
||||||
@@ -342,11 +352,6 @@ The following actions are performed when deactivating an user:
|
|||||||
- Remove the user from the user directory
|
- Remove the user from the user directory
|
||||||
- Reject all pending invites
|
- Reject all pending invites
|
||||||
- Remove all account validity information related to the user
|
- Remove all account validity information related to the user
|
||||||
- Remove the arbitrary data store known as *account data*. For example, this includes:
|
|
||||||
- list of ignored users;
|
|
||||||
- push rules;
|
|
||||||
- secret storage keys; and
|
|
||||||
- cross-signing keys.
|
|
||||||
|
|
||||||
The following additional actions are performed during deactivation if `erase`
|
The following additional actions are performed during deactivation if `erase`
|
||||||
is set to `true`:
|
is set to `true`:
|
||||||
@@ -360,6 +365,7 @@ The following actions are **NOT** performed. The list may be incomplete.
|
|||||||
- Remove mappings of SSO IDs
|
- Remove mappings of SSO IDs
|
||||||
- [Delete media uploaded](#delete-media-uploaded-by-a-user) by user (included avatar images)
|
- [Delete media uploaded](#delete-media-uploaded-by-a-user) by user (included avatar images)
|
||||||
- Delete sent and received messages
|
- Delete sent and received messages
|
||||||
|
- Delete E2E cross-signing keys
|
||||||
- Remove the user's creation (registration) timestamp
|
- Remove the user's creation (registration) timestamp
|
||||||
- [Remove rate limit overrides](#override-ratelimiting-for-users)
|
- [Remove rate limit overrides](#override-ratelimiting-for-users)
|
||||||
- Remove from monthly active users
|
- Remove from monthly active users
|
||||||
@@ -383,6 +389,9 @@ with a body of:
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
To use it, you will need to authenticate by providing an `access_token` for a
|
||||||
|
server admin: [Admin API](../usage/administration/admin_api)
|
||||||
|
|
||||||
The parameter `new_password` is required.
|
The parameter `new_password` is required.
|
||||||
The parameter `logout_devices` is optional and defaults to `true`.
|
The parameter `logout_devices` is optional and defaults to `true`.
|
||||||
|
|
||||||
@@ -395,6 +404,9 @@ The api is:
|
|||||||
GET /_synapse/admin/v1/users/<user_id>/admin
|
GET /_synapse/admin/v1/users/<user_id>/admin
|
||||||
```
|
```
|
||||||
|
|
||||||
|
To use it, you will need to authenticate by providing an `access_token` for a
|
||||||
|
server admin: [Admin API](../usage/administration/admin_api)
|
||||||
|
|
||||||
A response body like the following is returned:
|
A response body like the following is returned:
|
||||||
|
|
||||||
```json
|
```json
|
||||||
@@ -422,6 +434,10 @@ with a body of:
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
To use it, you will need to authenticate by providing an `access_token` for a
|
||||||
|
server admin: [Admin API](../usage/administration/admin_api)
|
||||||
|
|
||||||
|
|
||||||
## List room memberships of a user
|
## List room memberships of a user
|
||||||
|
|
||||||
Gets a list of all `room_id` that a specific `user_id` is member.
|
Gets a list of all `room_id` that a specific `user_id` is member.
|
||||||
@@ -432,6 +448,9 @@ The API is:
|
|||||||
GET /_synapse/admin/v1/users/<user_id>/joined_rooms
|
GET /_synapse/admin/v1/users/<user_id>/joined_rooms
|
||||||
```
|
```
|
||||||
|
|
||||||
|
To use it, you will need to authenticate by providing an `access_token` for a
|
||||||
|
server admin: [Admin API](../usage/administration/admin_api)
|
||||||
|
|
||||||
A response body like the following is returned:
|
A response body like the following is returned:
|
||||||
|
|
||||||
```json
|
```json
|
||||||
@@ -540,11 +559,6 @@ The following fields are returned in the JSON response body:
|
|||||||
|
|
||||||
### List media uploaded by a user
|
### List media uploaded by a user
|
||||||
Gets a list of all local media that a specific `user_id` has created.
|
Gets a list of all local media that a specific `user_id` has created.
|
||||||
These are media that the user has uploaded themselves
|
|
||||||
([local media](../media_repository.md#local-media)), as well as
|
|
||||||
[URL preview images](../media_repository.md#url-previews) requested by the user if the
|
|
||||||
[feature is enabled](../development/url_previews.md).
|
|
||||||
|
|
||||||
By default, the response is ordered by descending creation date and ascending media ID.
|
By default, the response is ordered by descending creation date and ascending media ID.
|
||||||
The newest media is on top. You can change the order with parameters
|
The newest media is on top. You can change the order with parameters
|
||||||
`order_by` and `dir`.
|
`order_by` and `dir`.
|
||||||
@@ -555,6 +569,9 @@ The API is:
|
|||||||
GET /_synapse/admin/v1/users/<user_id>/media
|
GET /_synapse/admin/v1/users/<user_id>/media
|
||||||
```
|
```
|
||||||
|
|
||||||
|
To use it, you will need to authenticate by providing an `access_token` for a
|
||||||
|
server admin: [Admin API](../usage/administration/admin_api)
|
||||||
|
|
||||||
A response body like the following is returned:
|
A response body like the following is returned:
|
||||||
|
|
||||||
```json
|
```json
|
||||||
@@ -641,9 +658,7 @@ The following fields are returned in the JSON response body:
|
|||||||
Media objects contain the following fields:
|
Media objects contain the following fields:
|
||||||
- `created_ts` - integer - Timestamp when the content was uploaded in ms.
|
- `created_ts` - integer - Timestamp when the content was uploaded in ms.
|
||||||
- `last_access_ts` - integer - Timestamp when the content was last accessed in ms.
|
- `last_access_ts` - integer - Timestamp when the content was last accessed in ms.
|
||||||
- `media_id` - string - The id used to refer to the media. Details about the format
|
- `media_id` - string - The id used to refer to the media.
|
||||||
are documented under
|
|
||||||
[media repository](../media_repository.md).
|
|
||||||
- `media_length` - integer - Length of the media in bytes.
|
- `media_length` - integer - Length of the media in bytes.
|
||||||
- `media_type` - string - The MIME-type of the media.
|
- `media_type` - string - The MIME-type of the media.
|
||||||
- `quarantined_by` - string - The user ID that initiated the quarantine request
|
- `quarantined_by` - string - The user ID that initiated the quarantine request
|
||||||
@@ -671,6 +686,9 @@ The API is:
|
|||||||
DELETE /_synapse/admin/v1/users/<user_id>/media
|
DELETE /_synapse/admin/v1/users/<user_id>/media
|
||||||
```
|
```
|
||||||
|
|
||||||
|
To use it, you will need to authenticate by providing an `access_token` for a
|
||||||
|
server admin: [Admin API](../usage/administration/admin_api)
|
||||||
|
|
||||||
A response body like the following is returned:
|
A response body like the following is returned:
|
||||||
|
|
||||||
```json
|
```json
|
||||||
@@ -743,6 +761,9 @@ The API is:
|
|||||||
GET /_synapse/admin/v2/users/<user_id>/devices
|
GET /_synapse/admin/v2/users/<user_id>/devices
|
||||||
```
|
```
|
||||||
|
|
||||||
|
To use it, you will need to authenticate by providing an `access_token` for a
|
||||||
|
server admin: [Admin API](../usage/administration/admin_api)
|
||||||
|
|
||||||
A response body like the following is returned:
|
A response body like the following is returned:
|
||||||
|
|
||||||
```json
|
```json
|
||||||
@@ -808,6 +829,9 @@ POST /_synapse/admin/v2/users/<user_id>/delete_devices
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
To use it, you will need to authenticate by providing an `access_token` for a
|
||||||
|
server admin: [Admin API](../usage/administration/admin_api)
|
||||||
|
|
||||||
An empty JSON dict is returned.
|
An empty JSON dict is returned.
|
||||||
|
|
||||||
**Parameters**
|
**Parameters**
|
||||||
@@ -829,6 +853,9 @@ The API is:
|
|||||||
GET /_synapse/admin/v2/users/<user_id>/devices/<device_id>
|
GET /_synapse/admin/v2/users/<user_id>/devices/<device_id>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
To use it, you will need to authenticate by providing an `access_token` for a
|
||||||
|
server admin: [Admin API](../usage/administration/admin_api)
|
||||||
|
|
||||||
A response body like the following is returned:
|
A response body like the following is returned:
|
||||||
|
|
||||||
```json
|
```json
|
||||||
@@ -874,6 +901,9 @@ PUT /_synapse/admin/v2/users/<user_id>/devices/<device_id>
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
To use it, you will need to authenticate by providing an `access_token` for a
|
||||||
|
server admin: [Admin API](../usage/administration/admin_api)
|
||||||
|
|
||||||
An empty JSON dict is returned.
|
An empty JSON dict is returned.
|
||||||
|
|
||||||
**Parameters**
|
**Parameters**
|
||||||
@@ -900,6 +930,9 @@ DELETE /_synapse/admin/v2/users/<user_id>/devices/<device_id>
|
|||||||
{}
|
{}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
To use it, you will need to authenticate by providing an `access_token` for a
|
||||||
|
server admin: [Admin API](../usage/administration/admin_api)
|
||||||
|
|
||||||
An empty JSON dict is returned.
|
An empty JSON dict is returned.
|
||||||
|
|
||||||
**Parameters**
|
**Parameters**
|
||||||
@@ -918,6 +951,9 @@ The API is:
|
|||||||
GET /_synapse/admin/v1/users/<user_id>/pushers
|
GET /_synapse/admin/v1/users/<user_id>/pushers
|
||||||
```
|
```
|
||||||
|
|
||||||
|
To use it, you will need to authenticate by providing an `access_token` for a
|
||||||
|
server admin: [Admin API](../usage/administration/admin_api)
|
||||||
|
|
||||||
A response body like the following is returned:
|
A response body like the following is returned:
|
||||||
|
|
||||||
```json
|
```json
|
||||||
@@ -1012,6 +1048,9 @@ To un-shadow-ban a user the API is:
|
|||||||
DELETE /_synapse/admin/v1/users/<user_id>/shadow_ban
|
DELETE /_synapse/admin/v1/users/<user_id>/shadow_ban
|
||||||
```
|
```
|
||||||
|
|
||||||
|
To use it, you will need to authenticate by providing an `access_token` for a
|
||||||
|
server admin: [Admin API](../usage/administration/admin_api)
|
||||||
|
|
||||||
An empty JSON dict is returned in both cases.
|
An empty JSON dict is returned in both cases.
|
||||||
|
|
||||||
**Parameters**
|
**Parameters**
|
||||||
@@ -1034,6 +1073,9 @@ The API is:
|
|||||||
GET /_synapse/admin/v1/users/<user_id>/override_ratelimit
|
GET /_synapse/admin/v1/users/<user_id>/override_ratelimit
|
||||||
```
|
```
|
||||||
|
|
||||||
|
To use it, you will need to authenticate by providing an `access_token` for a
|
||||||
|
server admin: [Admin API](../usage/administration/admin_api)
|
||||||
|
|
||||||
A response body like the following is returned:
|
A response body like the following is returned:
|
||||||
|
|
||||||
```json
|
```json
|
||||||
@@ -1073,6 +1115,9 @@ The API is:
|
|||||||
POST /_synapse/admin/v1/users/<user_id>/override_ratelimit
|
POST /_synapse/admin/v1/users/<user_id>/override_ratelimit
|
||||||
```
|
```
|
||||||
|
|
||||||
|
To use it, you will need to authenticate by providing an `access_token` for a
|
||||||
|
server admin: [Admin API](../usage/administration/admin_api)
|
||||||
|
|
||||||
A response body like the following is returned:
|
A response body like the following is returned:
|
||||||
|
|
||||||
```json
|
```json
|
||||||
@@ -1115,6 +1160,9 @@ The API is:
|
|||||||
DELETE /_synapse/admin/v1/users/<user_id>/override_ratelimit
|
DELETE /_synapse/admin/v1/users/<user_id>/override_ratelimit
|
||||||
```
|
```
|
||||||
|
|
||||||
|
To use it, you will need to authenticate by providing an `access_token` for a
|
||||||
|
server admin: [Admin API](../usage/administration/admin_api)
|
||||||
|
|
||||||
An empty JSON dict is returned.
|
An empty JSON dict is returned.
|
||||||
|
|
||||||
```json
|
```json
|
||||||
@@ -1143,5 +1191,7 @@ The API is:
|
|||||||
GET /_synapse/admin/v1/username_available?username=$localpart
|
GET /_synapse/admin/v1/username_available?username=$localpart
|
||||||
```
|
```
|
||||||
|
|
||||||
The request and response format is the same as the
|
The request and response format is the same as the [/_matrix/client/r0/register/available](https://matrix.org/docs/spec/client_server/r0.6.0#get-matrix-client-r0-register-available) API.
|
||||||
[/_matrix/client/r0/register/available](https://matrix.org/docs/spec/client_server/r0.6.0#get-matrix-client-r0-register-available) API.
|
|
||||||
|
To use it, you will need to authenticate by providing an `access_token` for a
|
||||||
|
server admin: [Admin API](../usage/administration/admin_api)
|
||||||
|
|||||||
@@ -16,6 +16,6 @@ It returns a JSON body like the following:
|
|||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"server_version": "0.99.2rc1 (b=develop, abcdef123)",
|
"server_version": "0.99.2rc1 (b=develop, abcdef123)",
|
||||||
"python_version": "3.7.8"
|
"python_version": "3.6.8"
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|||||||
+1
-1
@@ -172,6 +172,6 @@ frobber:
|
|||||||
```
|
```
|
||||||
|
|
||||||
Note that the sample configuration is generated from the synapse code
|
Note that the sample configuration is generated from the synapse code
|
||||||
and is maintained by a script, `scripts-dev/generate_sample_config.sh`.
|
and is maintained by a script, `scripts-dev/generate_sample_config`.
|
||||||
Making sure that the output from this script matches the desired format
|
Making sure that the output from this script matches the desired format
|
||||||
is left as an exercise for the reader!
|
is left as an exercise for the reader!
|
||||||
|
|||||||
@@ -20,9 +20,7 @@ recommended for development. More information about WSL can be found at
|
|||||||
<https://docs.microsoft.com/en-us/windows/wsl/install>. Running Synapse natively
|
<https://docs.microsoft.com/en-us/windows/wsl/install>. Running Synapse natively
|
||||||
on Windows is not officially supported.
|
on Windows is not officially supported.
|
||||||
|
|
||||||
The code of Synapse is written in Python 3. To do pretty much anything, you'll need [a recent version of Python 3](https://www.python.org/downloads/). Your Python also needs support for [virtual environments](https://docs.python.org/3/library/venv.html). This is usually built-in, but some Linux distributions like Debian and Ubuntu split it out into its own package. Running `sudo apt install python3-venv` should be enough.
|
The code of Synapse is written in Python 3. To do pretty much anything, you'll need [a recent version of Python 3](https://wiki.python.org/moin/BeginnersGuide/Download).
|
||||||
|
|
||||||
Synapse can connect to PostgreSQL via the [psycopg2](https://pypi.org/project/psycopg2/) Python library. Building this library from source requires access to PostgreSQL's C header files. On Debian or Ubuntu Linux, these can be installed with `sudo apt install libpq-dev`.
|
|
||||||
|
|
||||||
The source code of Synapse is hosted on GitHub. You will also need [a recent version of git](https://github.com/git-guides/install-git).
|
The source code of Synapse is hosted on GitHub. You will also need [a recent version of git](https://github.com/git-guides/install-git).
|
||||||
|
|
||||||
@@ -55,7 +53,6 @@ setup a *virtualenv*, as follows:
|
|||||||
cd path/where/you/have/cloned/the/repository
|
cd path/where/you/have/cloned/the/repository
|
||||||
python3 -m venv ./env
|
python3 -m venv ./env
|
||||||
source ./env/bin/activate
|
source ./env/bin/activate
|
||||||
pip install wheel
|
|
||||||
pip install -e ".[all,dev]"
|
pip install -e ".[all,dev]"
|
||||||
pip install tox
|
pip install tox
|
||||||
```
|
```
|
||||||
@@ -117,7 +114,7 @@ The linters look at your code and do two things:
|
|||||||
- ensure that your code follows the coding style adopted by the project;
|
- ensure that your code follows the coding style adopted by the project;
|
||||||
- catch a number of errors in your code.
|
- catch a number of errors in your code.
|
||||||
|
|
||||||
The linter takes no time at all to run as soon as you've [downloaded the dependencies into your python virtual environment](#4-install-the-dependencies).
|
They're pretty fast, don't hesitate!
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
source ./env/bin/activate
|
source ./env/bin/activate
|
||||||
@@ -172,27 +169,6 @@ To increase the log level for the tests, set `SYNAPSE_TEST_LOG_LEVEL`:
|
|||||||
SYNAPSE_TEST_LOG_LEVEL=DEBUG trial tests
|
SYNAPSE_TEST_LOG_LEVEL=DEBUG trial tests
|
||||||
```
|
```
|
||||||
|
|
||||||
By default, tests will use an in-memory SQLite database for test data. For additional
|
|
||||||
help with debugging, one can use an on-disk SQLite database file instead, in order to
|
|
||||||
review database state during and after running tests. This can be done by setting
|
|
||||||
the `SYNAPSE_TEST_PERSIST_SQLITE_DB` environment variable. Doing so will cause the
|
|
||||||
database state to be stored in a file named `test.db` under the trial process'
|
|
||||||
working directory. Typically, this ends up being `_trial_temp/test.db`. For example:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
SYNAPSE_TEST_PERSIST_SQLITE_DB=1 trial tests
|
|
||||||
```
|
|
||||||
|
|
||||||
The database file can then be inspected with:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
sqlite3 _trial_temp/test.db
|
|
||||||
```
|
|
||||||
|
|
||||||
Note that the database file is cleared at the beginning of each test run. Thus it
|
|
||||||
will always only contain the data generated by the *last run test*. Though generally
|
|
||||||
when debugging, one is only running a single test anyway.
|
|
||||||
|
|
||||||
### Running tests under PostgreSQL
|
### Running tests under PostgreSQL
|
||||||
|
|
||||||
Invoking `trial` as above will use an in-memory SQLite database. This is great for
|
Invoking `trial` as above will use an in-memory SQLite database. This is great for
|
||||||
|
|||||||
@@ -96,60 +96,6 @@ Ensure postgres is installed, then run:
|
|||||||
NB at the time of writing, this script predates the split into separate `state`/`main`
|
NB at the time of writing, this script predates the split into separate `state`/`main`
|
||||||
databases so will require updates to handle that correctly.
|
databases so will require updates to handle that correctly.
|
||||||
|
|
||||||
## Delta files
|
|
||||||
|
|
||||||
Delta files define the steps required to upgrade the database from an earlier version.
|
|
||||||
They can be written as either a file containing a series of SQL statements, or a Python
|
|
||||||
module.
|
|
||||||
|
|
||||||
Synapse remembers which delta files it has applied to a database (they are stored in the
|
|
||||||
`applied_schema_deltas` table) and will not re-apply them (even if a given file is
|
|
||||||
subsequently updated).
|
|
||||||
|
|
||||||
Delta files should be placed in a directory named `synapse/storage/schema/<database>/delta/<version>/`.
|
|
||||||
They are applied in alphanumeric order, so by convention the first two characters
|
|
||||||
of the filename should be an integer such as `01`, to put the file in the right order.
|
|
||||||
|
|
||||||
### SQL delta files
|
|
||||||
|
|
||||||
These should be named `*.sql`, or — for changes which should only be applied for a
|
|
||||||
given database engine — `*.sql.posgres` or `*.sql.sqlite`. For example, a delta which
|
|
||||||
adds a new column to the `foo` table might be called `01add_bar_to_foo.sql`.
|
|
||||||
|
|
||||||
Note that our SQL parser is a bit simple - it understands comments (`--` and `/*...*/`),
|
|
||||||
but complex statements which require a `;` in the middle of them (such as `CREATE
|
|
||||||
TRIGGER`) are beyond it and you'll have to use a Python delta file.
|
|
||||||
|
|
||||||
### Python delta files
|
|
||||||
|
|
||||||
For more flexibility, a delta file can take the form of a python module. These should
|
|
||||||
be named `*.py`. Note that database-engine-specific modules are not supported here –
|
|
||||||
instead you can write `if isinstance(database_engine, PostgresEngine)` or similar.
|
|
||||||
|
|
||||||
A Python delta module should define either or both of the following functions:
|
|
||||||
|
|
||||||
```python
|
|
||||||
import synapse.config.homeserver
|
|
||||||
import synapse.storage.engines
|
|
||||||
import synapse.storage.types
|
|
||||||
|
|
||||||
|
|
||||||
def run_create(
|
|
||||||
cur: synapse.storage.types.Cursor,
|
|
||||||
database_engine: synapse.storage.engines.BaseDatabaseEngine,
|
|
||||||
) -> None:
|
|
||||||
"""Called whenever an existing or new database is to be upgraded"""
|
|
||||||
...
|
|
||||||
|
|
||||||
def run_upgrade(
|
|
||||||
cur: synapse.storage.types.Cursor,
|
|
||||||
database_engine: synapse.storage.engines.BaseDatabaseEngine,
|
|
||||||
config: synapse.config.homeserver.HomeServerConfig,
|
|
||||||
) -> None:
|
|
||||||
"""Called whenever an existing database is to be upgraded."""
|
|
||||||
...
|
|
||||||
```
|
|
||||||
|
|
||||||
## Boolean columns
|
## Boolean columns
|
||||||
|
|
||||||
Boolean columns require special treatment, since SQLite treats booleans the
|
Boolean columns require special treatment, since SQLite treats booleans the
|
||||||
@@ -158,9 +104,9 @@ same as integers.
|
|||||||
There are three separate aspects to this:
|
There are three separate aspects to this:
|
||||||
|
|
||||||
* Any new boolean column must be added to the `BOOLEAN_COLUMNS` list in
|
* Any new boolean column must be added to the `BOOLEAN_COLUMNS` list in
|
||||||
`synapse/_scripts/synapse_port_db.py`. This tells the port script to cast
|
`scripts/synapse_port_db`. This tells the port script to cast the integer
|
||||||
the integer value from SQLite to a boolean before writing the value to the
|
value from SQLite to a boolean before writing the value to the postgres
|
||||||
postgres database.
|
database.
|
||||||
|
|
||||||
* Before SQLite 3.23, `TRUE` and `FALSE` were not recognised as constants by
|
* Before SQLite 3.23, `TRUE` and `FALSE` were not recognised as constants by
|
||||||
SQLite, and the `IS [NOT] TRUE`/`IS [NOT] FALSE` operators were not
|
SQLite, and the `IS [NOT] TRUE`/`IS [NOT] FALSE` operators were not
|
||||||
|
|||||||
@@ -1,41 +0,0 @@
|
|||||||
# Synapse demo setup
|
|
||||||
|
|
||||||
**DO NOT USE THESE DEMO SERVERS IN PRODUCTION**
|
|
||||||
|
|
||||||
Requires you to have a [Synapse development environment setup](https://matrix-org.github.io/synapse/develop/development/contributing_guide.html#4-install-the-dependencies).
|
|
||||||
|
|
||||||
The demo setup allows running three federation Synapse servers, with server
|
|
||||||
names `localhost:8080`, `localhost:8081`, and `localhost:8082`.
|
|
||||||
|
|
||||||
You can access them via any Matrix client over HTTP at `localhost:8080`,
|
|
||||||
`localhost:8081`, and `localhost:8082` or over HTTPS at `localhost:8480`,
|
|
||||||
`localhost:8481`, and `localhost:8482`.
|
|
||||||
|
|
||||||
To enable the servers to communicate, self-signed SSL certificates are generated
|
|
||||||
and the servers are configured in a highly insecure way, including:
|
|
||||||
|
|
||||||
* Not checking certificates over federation.
|
|
||||||
* Not verifying keys.
|
|
||||||
|
|
||||||
The servers are configured to store their data under `demo/8080`, `demo/8081`, and
|
|
||||||
`demo/8082`. This includes configuration, logs, SQLite databases, and media.
|
|
||||||
|
|
||||||
Note that when joining a public room on a different HS via "#foo:bar.net", then
|
|
||||||
you are (in the current impl) joining a room with room_id "foo". This means that
|
|
||||||
it won't work if your HS already has a room with that name.
|
|
||||||
|
|
||||||
## Using the demo scripts
|
|
||||||
|
|
||||||
There's three main scripts with straightforward purposes:
|
|
||||||
|
|
||||||
* `start.sh` will start the Synapse servers, generating any missing configuration.
|
|
||||||
* This accepts a single parameter `--no-rate-limit` to "disable" rate limits
|
|
||||||
(they actually still exist, but are very high).
|
|
||||||
* `stop.sh` will stop the Synapse servers.
|
|
||||||
* `clean.sh` will delete the configuration, databases, log files, etc.
|
|
||||||
|
|
||||||
To start a completely new set of servers, run:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
./demo/stop.sh; ./demo/clean.sh && ./demo/start.sh
|
|
||||||
```
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
# Synapse Release Cycle
|
|
||||||
|
|
||||||
Releases of Synapse follow a two week release cycle with new releases usually
|
|
||||||
occurring on Tuesdays:
|
|
||||||
|
|
||||||
* Day 0: Synapse `N - 1` is released.
|
|
||||||
* Day 7: Synapse `N` release candidate 1 is released.
|
|
||||||
* Days 7 - 13: Synapse `N` release candidates 2+ are released, if bugs are found.
|
|
||||||
* Day 14: Synapse `N` is released.
|
|
||||||
|
|
||||||
Note that this schedule might be modified depending on the availability of the
|
|
||||||
Synapse team, e.g. releases may be skipped to avoid holidays.
|
|
||||||
|
|
||||||
Release announcements can be found in the
|
|
||||||
[release category of the Matrix blog](https://matrix.org/blog/category/releases).
|
|
||||||
|
|
||||||
## Bugfix releases
|
|
||||||
|
|
||||||
If a bug is found after release that is deemed severe enough (by a combination
|
|
||||||
of the impacted users and the impact on those users) then a bugfix release may
|
|
||||||
be issued. This may be at any point in the release cycle.
|
|
||||||
|
|
||||||
## Security releases
|
|
||||||
|
|
||||||
Security will sometimes be backported to the previous version and released
|
|
||||||
immediately before the next release candidate. An example of this might be:
|
|
||||||
|
|
||||||
* Day 0: Synapse N - 1 is released.
|
|
||||||
* Day 7: Synapse (N - 1).1 is released as Synapse N - 1 + the security fix.
|
|
||||||
* Day 7: Synapse N release candidate 1 is released (including the security fix).
|
|
||||||
|
|
||||||
Depending on the impact and complexity of security fixes, multiple fixes might
|
|
||||||
be held to be released together.
|
|
||||||
|
|
||||||
In some cases, a pre-disclosure of a security release will be issued as a notice
|
|
||||||
to Synapse operators that there is an upcoming security release. These can be
|
|
||||||
found in the [security category of the Matrix blog](https://matrix.org/blog/category/security).
|
|
||||||
@@ -30,57 +30,13 @@ rather than skipping any that arrived late; whereas if you're looking at a
|
|||||||
historical section of timeline (i.e. `/messages`), you want to see the best
|
historical section of timeline (i.e. `/messages`), you want to see the best
|
||||||
representation of the state of the room as others were seeing it at the time.
|
representation of the state of the room as others were seeing it at the time.
|
||||||
|
|
||||||
## Outliers
|
|
||||||
|
|
||||||
We mark an event as an `outlier` when we haven't figured out the state for the
|
|
||||||
room at that point in the DAG yet. They are "floating" events that we haven't
|
|
||||||
yet correlated to the DAG.
|
|
||||||
|
|
||||||
Outliers typically arise when we fetch the auth chain or state for a given
|
|
||||||
event. When that happens, we just grab the events in the state/auth chain,
|
|
||||||
without calculating the state at those events, or backfilling their
|
|
||||||
`prev_events`.
|
|
||||||
|
|
||||||
So, typically, we won't have the `prev_events` of an `outlier` in the database,
|
|
||||||
(though it's entirely possible that we *might* have them for some other
|
|
||||||
reason). Other things that make outliers different from regular events:
|
|
||||||
|
|
||||||
* We don't have state for them, so there should be no entry in
|
|
||||||
`event_to_state_groups` for an outlier. (In practice this isn't always
|
|
||||||
the case, though I'm not sure why: see https://github.com/matrix-org/synapse/issues/12201).
|
|
||||||
|
|
||||||
* We don't record entries for them in the `event_edges`,
|
|
||||||
`event_forward_extremeties` or `event_backward_extremities` tables.
|
|
||||||
|
|
||||||
Since outliers are not tied into the DAG, they do not normally form part of the
|
|
||||||
timeline sent down to clients via `/sync` or `/messages`; however there is an
|
|
||||||
exception:
|
|
||||||
|
|
||||||
### Out-of-band membership events
|
|
||||||
|
|
||||||
A special case of outlier events are some membership events for federated rooms
|
|
||||||
that we aren't full members of. For example:
|
|
||||||
|
|
||||||
* invites received over federation, before we join the room
|
|
||||||
* *rejections* for said invites
|
|
||||||
* knock events for rooms that we would like to join but have not yet joined.
|
|
||||||
|
|
||||||
In all the above cases, we don't have the state for the room, which is why they
|
|
||||||
are treated as outliers. They are a bit special though, in that they are
|
|
||||||
proactively sent to clients via `/sync`.
|
|
||||||
|
|
||||||
## Forward extremity
|
## Forward extremity
|
||||||
|
|
||||||
Most-recent-in-time events in the DAG which are not referenced by any other
|
Most-recent-in-time events in the DAG which are not referenced by any other events' `prev_events` yet.
|
||||||
events' `prev_events` yet. (In this definition, outliers, rejected events, and
|
|
||||||
soft-failed events don't count.)
|
|
||||||
|
|
||||||
The forward extremities of a room (or at least, a subset of them, if there are
|
The forward extremities of a room are used as the `prev_events` when the next event is sent.
|
||||||
more than ten) are used as the `prev_events` when the next event is sent.
|
|
||||||
|
|
||||||
The "current state" of a room (ie: the state which would be used if we
|
|
||||||
generated a new event) is, therefore, the resolution of the room states
|
|
||||||
at each of the forward extremities.
|
|
||||||
|
|
||||||
## Backward extremity
|
## Backward extremity
|
||||||
|
|
||||||
@@ -88,14 +44,23 @@ The current marker of where we have backfilled up to and will generally be the
|
|||||||
`prev_events` of the oldest-in-time events we have in the DAG. This gives a starting point when
|
`prev_events` of the oldest-in-time events we have in the DAG. This gives a starting point when
|
||||||
backfilling history.
|
backfilling history.
|
||||||
|
|
||||||
Note that, unlike forward extremities, we typically don't have any backward
|
When we persist a non-outlier event, we clear it as a backward extremity and set
|
||||||
extremity events themselves in the database - or, if we do, they will be "outliers" (see
|
all of its `prev_events` as the new backward extremities if they aren't already
|
||||||
above). Either way, we don't expect to have the room state at a backward extremity.
|
persisted in the `events` table.
|
||||||
|
|
||||||
|
|
||||||
|
## Outliers
|
||||||
|
|
||||||
|
We mark an event as an `outlier` when we haven't figured out the state for the
|
||||||
|
room at that point in the DAG yet.
|
||||||
|
|
||||||
|
We won't *necessarily* have the `prev_events` of an `outlier` in the database,
|
||||||
|
but it's entirely possible that we *might*.
|
||||||
|
|
||||||
|
For example, when we fetch the event auth chain or state for a given event, we
|
||||||
|
mark all of those claimed auth events as outliers because we haven't done the
|
||||||
|
state calculation ourself.
|
||||||
|
|
||||||
When we persist a non-outlier event, if it was previously a backward extremity,
|
|
||||||
we clear it as a backward extremity and set all of its `prev_events` as the new
|
|
||||||
backward extremities if they aren't already persisted as non-outliers. This
|
|
||||||
therefore keeps the backward extremities up-to-date.
|
|
||||||
|
|
||||||
## State groups
|
## State groups
|
||||||
|
|
||||||
|
|||||||
@@ -35,12 +35,7 @@ When Synapse is asked to preview a URL it does the following:
|
|||||||
5. If the media is HTML:
|
5. If the media is HTML:
|
||||||
1. Decodes the HTML via the stored file.
|
1. Decodes the HTML via the stored file.
|
||||||
2. Generates an Open Graph response from the HTML.
|
2. Generates an Open Graph response from the HTML.
|
||||||
3. If a JSON oEmbed URL was found in the HTML via autodiscovery:
|
3. If an image exists in the Open Graph response:
|
||||||
1. Downloads the URL and stores it into a file via the media storage provider
|
|
||||||
and saves the local media metadata.
|
|
||||||
2. Convert the oEmbed response to an Open Graph response.
|
|
||||||
3. Override any Open Graph data from the HTML with data from oEmbed.
|
|
||||||
4. If an image exists in the Open Graph response:
|
|
||||||
1. Downloads the URL and stores it into a file via the media storage
|
1. Downloads the URL and stores it into a file via the media storage
|
||||||
provider and saves the local media metadata.
|
provider and saves the local media metadata.
|
||||||
2. Generates thumbnails.
|
2. Generates thumbnails.
|
||||||
|
|||||||
+1
-2
@@ -63,5 +63,4 @@ release of Synapse.
|
|||||||
|
|
||||||
If you want to get up and running quickly with a trio of homeservers in a
|
If you want to get up and running quickly with a trio of homeservers in a
|
||||||
private federation, there is a script in the `demo` directory. This is mainly
|
private federation, there is a script in the `demo` directory. This is mainly
|
||||||
useful just for development purposes. See
|
useful just for development purposes. See [demo/README](https://github.com/matrix-org/synapse/tree/develop/demo/).
|
||||||
[demo scripts](https://matrix-org.github.io/synapse/develop/development/demo.html).
|
|
||||||
|
|||||||
+1
-1
@@ -94,6 +94,6 @@ As a simple example, retrieving an event from the database:
|
|||||||
|
|
||||||
```pycon
|
```pycon
|
||||||
>>> from twisted.internet import defer
|
>>> from twisted.internet import defer
|
||||||
>>> defer.ensureDeferred(hs.get_datastores().main.get_event('$1416420717069yeQaw:matrix.org'))
|
>>> defer.ensureDeferred(hs.get_datastore().get_event('$1416420717069yeQaw:matrix.org'))
|
||||||
<Deferred at 0x7ff253fc6998 current result: <FrozenEvent event_id='$1416420717069yeQaw:matrix.org', type='m.room.create', state_key=''>>
|
<Deferred at 0x7ff253fc6998 current result: <FrozenEvent event_id='$1416420717069yeQaw:matrix.org', type='m.room.create', state_key=''>>
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ If the authentication is unsuccessful, the module must return `None`.
|
|||||||
If multiple modules implement this callback, they will be considered in order. If a
|
If multiple modules implement this callback, they will be considered in order. If a
|
||||||
callback returns `None`, Synapse falls through to the next one. The value of the first
|
callback returns `None`, Synapse falls through to the next one. The value of the first
|
||||||
callback that does not return `None` will be used. If this happens, Synapse will not call
|
callback that does not return `None` will be used. If this happens, Synapse will not call
|
||||||
any of the subsequent implementations of this callback. If every callback returns `None`,
|
any of the subsequent implementations of this callback. If every callback return `None`,
|
||||||
the authentication is denied.
|
the authentication is denied.
|
||||||
|
|
||||||
### `on_logged_out`
|
### `on_logged_out`
|
||||||
@@ -105,115 +105,6 @@ device ID), and the (now deactivated) access token.
|
|||||||
|
|
||||||
If multiple modules implement this callback, Synapse runs them all in order.
|
If multiple modules implement this callback, Synapse runs them all in order.
|
||||||
|
|
||||||
### `get_username_for_registration`
|
|
||||||
|
|
||||||
_First introduced in Synapse v1.52.0_
|
|
||||||
|
|
||||||
```python
|
|
||||||
async def get_username_for_registration(
|
|
||||||
uia_results: Dict[str, Any],
|
|
||||||
params: Dict[str, Any],
|
|
||||||
) -> Optional[str]
|
|
||||||
```
|
|
||||||
|
|
||||||
Called when registering a new user. The module can return a username to set for the user
|
|
||||||
being registered by returning it as a string, or `None` if it doesn't wish to force a
|
|
||||||
username for this user. If a username is returned, it will be used as the local part of a
|
|
||||||
user's full Matrix ID (e.g. it's `alice` in `@alice:example.com`).
|
|
||||||
|
|
||||||
This callback is called once [User-Interactive Authentication](https://spec.matrix.org/latest/client-server-api/#user-interactive-authentication-api)
|
|
||||||
has been completed by the user. It is not called when registering a user via SSO. It is
|
|
||||||
passed two dictionaries, which include the information that the user has provided during
|
|
||||||
the registration process.
|
|
||||||
|
|
||||||
The first dictionary contains the results of the [User-Interactive Authentication](https://spec.matrix.org/latest/client-server-api/#user-interactive-authentication-api)
|
|
||||||
flow followed by the user. Its keys are the identifiers of every step involved in the flow,
|
|
||||||
associated with either a boolean value indicating whether the step was correctly completed,
|
|
||||||
or additional information (e.g. email address, phone number...). A list of most existing
|
|
||||||
identifiers can be found in the [Matrix specification](https://spec.matrix.org/v1.1/client-server-api/#authentication-types).
|
|
||||||
Here's an example featuring all currently supported keys:
|
|
||||||
|
|
||||||
```python
|
|
||||||
{
|
|
||||||
"m.login.dummy": True, # Dummy authentication
|
|
||||||
"m.login.terms": True, # User has accepted the terms of service for the homeserver
|
|
||||||
"m.login.recaptcha": True, # User has completed the recaptcha challenge
|
|
||||||
"m.login.email.identity": { # User has provided and verified an email address
|
|
||||||
"medium": "email",
|
|
||||||
"address": "alice@example.com",
|
|
||||||
"validated_at": 1642701357084,
|
|
||||||
},
|
|
||||||
"m.login.msisdn": { # User has provided and verified a phone number
|
|
||||||
"medium": "msisdn",
|
|
||||||
"address": "33123456789",
|
|
||||||
"validated_at": 1642701357084,
|
|
||||||
},
|
|
||||||
"m.login.registration_token": "sometoken", # User has registered through a registration token
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
The second dictionary contains the parameters provided by the user's client in the request
|
|
||||||
to `/_matrix/client/v3/register`. See the [Matrix specification](https://spec.matrix.org/latest/client-server-api/#post_matrixclientv3register)
|
|
||||||
for a complete list of these parameters.
|
|
||||||
|
|
||||||
If the module cannot, or does not wish to, generate a username for this user, it must
|
|
||||||
return `None`.
|
|
||||||
|
|
||||||
If multiple modules implement this callback, they will be considered in order. If a
|
|
||||||
callback returns `None`, Synapse falls through to the next one. The value of the first
|
|
||||||
callback that does not return `None` will be used. If this happens, Synapse will not call
|
|
||||||
any of the subsequent implementations of this callback. If every callback returns `None`,
|
|
||||||
the username provided by the user is used, if any (otherwise one is automatically
|
|
||||||
generated).
|
|
||||||
|
|
||||||
### `get_displayname_for_registration`
|
|
||||||
|
|
||||||
_First introduced in Synapse v1.54.0_
|
|
||||||
|
|
||||||
```python
|
|
||||||
async def get_displayname_for_registration(
|
|
||||||
uia_results: Dict[str, Any],
|
|
||||||
params: Dict[str, Any],
|
|
||||||
) -> Optional[str]
|
|
||||||
```
|
|
||||||
|
|
||||||
Called when registering a new user. The module can return a display name to set for the
|
|
||||||
user being registered by returning it as a string, or `None` if it doesn't wish to force a
|
|
||||||
display name for this user.
|
|
||||||
|
|
||||||
This callback is called once [User-Interactive Authentication](https://spec.matrix.org/latest/client-server-api/#user-interactive-authentication-api)
|
|
||||||
has been completed by the user. It is not called when registering a user via SSO. It is
|
|
||||||
passed two dictionaries, which include the information that the user has provided during
|
|
||||||
the registration process. These dictionaries are identical to the ones passed to
|
|
||||||
[`get_username_for_registration`](#get_username_for_registration), so refer to the
|
|
||||||
documentation of this callback for more information about them.
|
|
||||||
|
|
||||||
If multiple modules implement this callback, they will be considered in order. If a
|
|
||||||
callback returns `None`, Synapse falls through to the next one. The value of the first
|
|
||||||
callback that does not return `None` will be used. If this happens, Synapse will not call
|
|
||||||
any of the subsequent implementations of this callback. If every callback returns `None`,
|
|
||||||
the username will be used (e.g. `alice` if the user being registered is `@alice:example.com`).
|
|
||||||
|
|
||||||
## `is_3pid_allowed`
|
|
||||||
|
|
||||||
_First introduced in Synapse v1.53.0_
|
|
||||||
|
|
||||||
```python
|
|
||||||
async def is_3pid_allowed(self, medium: str, address: str, registration: bool) -> bool
|
|
||||||
```
|
|
||||||
|
|
||||||
Called when attempting to bind a third-party identifier (i.e. an email address or a phone
|
|
||||||
number). The module is given the medium of the third-party identifier (which is `email` if
|
|
||||||
the identifier is an email address, or `msisdn` if the identifier is a phone number) and
|
|
||||||
its address, as well as a boolean indicating whether the attempt to bind is happening as
|
|
||||||
part of registering a new user. The module must return a boolean indicating whether the
|
|
||||||
identifier can be allowed to be bound to an account on the local homeserver.
|
|
||||||
|
|
||||||
If multiple modules implement this callback, they will be considered in order. If a
|
|
||||||
callback returns `True`, Synapse falls through to the next one. The value of the first
|
|
||||||
callback that does not return `True` will be used. If this happens, Synapse will not call
|
|
||||||
any of the subsequent implementations of this callback.
|
|
||||||
|
|
||||||
## Example
|
## Example
|
||||||
|
|
||||||
The example module below implements authentication checkers for two different login types:
|
The example module below implements authentication checkers for two different login types:
|
||||||
@@ -222,7 +113,8 @@ The example module below implements authentication checkers for two different lo
|
|||||||
- Is checked by the method: `self.check_my_login`
|
- Is checked by the method: `self.check_my_login`
|
||||||
- `m.login.password` (defined in [the spec](https://matrix.org/docs/spec/client_server/latest#password-based))
|
- `m.login.password` (defined in [the spec](https://matrix.org/docs/spec/client_server/latest#password-based))
|
||||||
- Expects a `password` field to be sent to `/login`
|
- Expects a `password` field to be sent to `/login`
|
||||||
- Is checked by the method: `self.check_pass`
|
- Is checked by the method: `self.check_pass`
|
||||||
|
|
||||||
|
|
||||||
```python
|
```python
|
||||||
from typing import Awaitable, Callable, Optional, Tuple
|
from typing import Awaitable, Callable, Optional, Tuple
|
||||||
|
|||||||
@@ -16,12 +16,10 @@ _First introduced in Synapse v1.37.0_
|
|||||||
async def check_event_for_spam(event: "synapse.events.EventBase") -> Union[bool, str]
|
async def check_event_for_spam(event: "synapse.events.EventBase") -> Union[bool, str]
|
||||||
```
|
```
|
||||||
|
|
||||||
Called when receiving an event from a client or via federation. The callback must return
|
Called when receiving an event from a client or via federation. The module can return
|
||||||
either:
|
either a `bool` to indicate whether the event must be rejected because of spam, or a `str`
|
||||||
- an error message string, to indicate the event must be rejected because of spam and
|
to indicate the event must be rejected because of spam and to give a rejection reason to
|
||||||
give a rejection reason to forward to clients;
|
forward to clients.
|
||||||
- the boolean `True`, to indicate that the event is spammy, but not provide further details; or
|
|
||||||
- the booelan `False`, to indicate that the event is not considered spammy.
|
|
||||||
|
|
||||||
If multiple modules implement this callback, they will be considered in order. If a
|
If multiple modules implement this callback, they will be considered in order. If a
|
||||||
callback returns `False`, Synapse falls through to the next one. The value of the first
|
callback returns `False`, Synapse falls through to the next one. The value of the first
|
||||||
@@ -37,10 +35,7 @@ async def user_may_join_room(user: str, room: str, is_invited: bool) -> bool
|
|||||||
```
|
```
|
||||||
|
|
||||||
Called when a user is trying to join a room. The module must return a `bool` to indicate
|
Called when a user is trying to join a room. The module must return a `bool` to indicate
|
||||||
whether the user can join the room. Return `False` to prevent the user from joining the
|
whether the user can join the room. The user is represented by their Matrix user ID (e.g.
|
||||||
room; otherwise return `True` to permit the joining.
|
|
||||||
|
|
||||||
The user is represented by their Matrix user ID (e.g.
|
|
||||||
`@alice:example.com`) and the room is represented by its Matrix ID (e.g.
|
`@alice:example.com`) and the room is represented by its Matrix ID (e.g.
|
||||||
`!room:example.com`). The module is also given a boolean to indicate whether the user
|
`!room:example.com`). The module is also given a boolean to indicate whether the user
|
||||||
currently has a pending invite in the room.
|
currently has a pending invite in the room.
|
||||||
@@ -63,8 +58,7 @@ async def user_may_invite(inviter: str, invitee: str, room_id: str) -> bool
|
|||||||
|
|
||||||
Called when processing an invitation. The module must return a `bool` indicating whether
|
Called when processing an invitation. The module must return a `bool` indicating whether
|
||||||
the inviter can invite the invitee to the given room. Both inviter and invitee are
|
the inviter can invite the invitee to the given room. Both inviter and invitee are
|
||||||
represented by their Matrix user ID (e.g. `@alice:example.com`). Return `False` to prevent
|
represented by their Matrix user ID (e.g. `@alice:example.com`).
|
||||||
the invitation; otherwise return `True` to permit it.
|
|
||||||
|
|
||||||
If multiple modules implement this callback, they will be considered in order. If a
|
If multiple modules implement this callback, they will be considered in order. If a
|
||||||
callback returns `True`, Synapse falls through to the next one. The value of the first
|
callback returns `True`, Synapse falls through to the next one. The value of the first
|
||||||
@@ -86,8 +80,7 @@ async def user_may_send_3pid_invite(
|
|||||||
|
|
||||||
Called when processing an invitation using a third-party identifier (also called a 3PID,
|
Called when processing an invitation using a third-party identifier (also called a 3PID,
|
||||||
e.g. an email address or a phone number). The module must return a `bool` indicating
|
e.g. an email address or a phone number). The module must return a `bool` indicating
|
||||||
whether the inviter can invite the invitee to the given room. Return `False` to prevent
|
whether the inviter can invite the invitee to the given room.
|
||||||
the invitation; otherwise return `True` to permit it.
|
|
||||||
|
|
||||||
The inviter is represented by their Matrix user ID (e.g. `@alice:example.com`), and the
|
The inviter is represented by their Matrix user ID (e.g. `@alice:example.com`), and the
|
||||||
invitee is represented by its medium (e.g. "email") and its address
|
invitee is represented by its medium (e.g. "email") and its address
|
||||||
@@ -124,7 +117,6 @@ async def user_may_create_room(user: str) -> bool
|
|||||||
|
|
||||||
Called when processing a room creation request. The module must return a `bool` indicating
|
Called when processing a room creation request. The module must return a `bool` indicating
|
||||||
whether the given user (represented by their Matrix user ID) is allowed to create a room.
|
whether the given user (represented by their Matrix user ID) is allowed to create a room.
|
||||||
Return `False` to prevent room creation; otherwise return `True` to permit it.
|
|
||||||
|
|
||||||
If multiple modules implement this callback, they will be considered in order. If a
|
If multiple modules implement this callback, they will be considered in order. If a
|
||||||
callback returns `True`, Synapse falls through to the next one. The value of the first
|
callback returns `True`, Synapse falls through to the next one. The value of the first
|
||||||
@@ -141,8 +133,7 @@ async def user_may_create_room_alias(user: str, room_alias: "synapse.types.RoomA
|
|||||||
|
|
||||||
Called when trying to associate an alias with an existing room. The module must return a
|
Called when trying to associate an alias with an existing room. The module must return a
|
||||||
`bool` indicating whether the given user (represented by their Matrix user ID) is allowed
|
`bool` indicating whether the given user (represented by their Matrix user ID) is allowed
|
||||||
to set the given alias. Return `False` to prevent the alias creation; otherwise return
|
to set the given alias.
|
||||||
`True` to permit it.
|
|
||||||
|
|
||||||
If multiple modules implement this callback, they will be considered in order. If a
|
If multiple modules implement this callback, they will be considered in order. If a
|
||||||
callback returns `True`, Synapse falls through to the next one. The value of the first
|
callback returns `True`, Synapse falls through to the next one. The value of the first
|
||||||
@@ -159,8 +150,7 @@ async def user_may_publish_room(user: str, room_id: str) -> bool
|
|||||||
|
|
||||||
Called when trying to publish a room to the homeserver's public rooms directory. The
|
Called when trying to publish a room to the homeserver's public rooms directory. The
|
||||||
module must return a `bool` indicating whether the given user (represented by their
|
module must return a `bool` indicating whether the given user (represented by their
|
||||||
Matrix user ID) is allowed to publish the given room. Return `False` to prevent the
|
Matrix user ID) is allowed to publish the given room.
|
||||||
room from being published; otherwise return `True` to permit its publication.
|
|
||||||
|
|
||||||
If multiple modules implement this callback, they will be considered in order. If a
|
If multiple modules implement this callback, they will be considered in order. If a
|
||||||
callback returns `True`, Synapse falls through to the next one. The value of the first
|
callback returns `True`, Synapse falls through to the next one. The value of the first
|
||||||
@@ -176,11 +166,8 @@ async def check_username_for_spam(user_profile: Dict[str, str]) -> bool
|
|||||||
```
|
```
|
||||||
|
|
||||||
Called when computing search results in the user directory. The module must return a
|
Called when computing search results in the user directory. The module must return a
|
||||||
`bool` indicating whether the given user should be excluded from user directory
|
`bool` indicating whether the given user profile can appear in search results. The profile
|
||||||
searches. Return `True` to indicate that the user is spammy and exclude them from
|
is represented as a dictionary with the following keys:
|
||||||
search results; otherwise return `False`.
|
|
||||||
|
|
||||||
The profile is represented as a dictionary with the following keys:
|
|
||||||
|
|
||||||
* `user_id`: The Matrix ID for this user.
|
* `user_id`: The Matrix ID for this user.
|
||||||
* `display_name`: The user's display name.
|
* `display_name`: The user's display name.
|
||||||
@@ -238,9 +225,8 @@ async def check_media_file_for_spam(
|
|||||||
) -> bool
|
) -> bool
|
||||||
```
|
```
|
||||||
|
|
||||||
Called when storing a local or remote file. The module must return a `bool` indicating
|
Called when storing a local or remote file. The module must return a boolean indicating
|
||||||
whether the given file should be excluded from the homeserver's media store. Return
|
whether the given file can be stored in the homeserver's media store.
|
||||||
`True` to prevent this file from being stored; otherwise return `False`.
|
|
||||||
|
|
||||||
If multiple modules implement this callback, they will be considered in order. If a
|
If multiple modules implement this callback, they will be considered in order. If a
|
||||||
callback returns `False`, Synapse falls through to the next one. The value of the first
|
callback returns `False`, Synapse falls through to the next one. The value of the first
|
||||||
|
|||||||
@@ -148,105 +148,6 @@ deny an incoming event, see [`check_event_for_spam`](spam_checker_callbacks.md#c
|
|||||||
|
|
||||||
If multiple modules implement this callback, Synapse runs them all in order.
|
If multiple modules implement this callback, Synapse runs them all in order.
|
||||||
|
|
||||||
### `check_can_shutdown_room`
|
|
||||||
|
|
||||||
_First introduced in Synapse v1.55.0_
|
|
||||||
|
|
||||||
```python
|
|
||||||
async def check_can_shutdown_room(
|
|
||||||
user_id: str, room_id: str,
|
|
||||||
) -> bool:
|
|
||||||
```
|
|
||||||
|
|
||||||
Called when an admin user requests the shutdown of a room. The module must return a
|
|
||||||
boolean indicating whether the shutdown can go through. If the callback returns `False`,
|
|
||||||
the shutdown will not proceed and the caller will see a `M_FORBIDDEN` error.
|
|
||||||
|
|
||||||
If multiple modules implement this callback, they will be considered in order. If a
|
|
||||||
callback returns `True`, Synapse falls through to the next one. The value of the first
|
|
||||||
callback that does not return `True` will be used. If this happens, Synapse will not call
|
|
||||||
any of the subsequent implementations of this callback.
|
|
||||||
|
|
||||||
### `check_can_deactivate_user`
|
|
||||||
|
|
||||||
_First introduced in Synapse v1.55.0_
|
|
||||||
|
|
||||||
```python
|
|
||||||
async def check_can_deactivate_user(
|
|
||||||
user_id: str, by_admin: bool,
|
|
||||||
) -> bool:
|
|
||||||
```
|
|
||||||
|
|
||||||
Called when the deactivation of a user is requested. User deactivation can be
|
|
||||||
performed by an admin or the user themselves, so developers are encouraged to check the
|
|
||||||
requester when implementing this callback. The module must return a
|
|
||||||
boolean indicating whether the deactivation can go through. If the callback returns `False`,
|
|
||||||
the deactivation will not proceed and the caller will see a `M_FORBIDDEN` error.
|
|
||||||
|
|
||||||
The module is passed two parameters, `user_id` which is the ID of the user being deactivated, and `by_admin` which is `True` if the request is made by a serve admin, and `False` otherwise.
|
|
||||||
|
|
||||||
If multiple modules implement this callback, they will be considered in order. If a
|
|
||||||
callback returns `True`, Synapse falls through to the next one. The value of the first
|
|
||||||
callback that does not return `True` will be used. If this happens, Synapse will not call
|
|
||||||
any of the subsequent implementations of this callback.
|
|
||||||
|
|
||||||
|
|
||||||
### `on_profile_update`
|
|
||||||
|
|
||||||
_First introduced in Synapse v1.54.0_
|
|
||||||
|
|
||||||
```python
|
|
||||||
async def on_profile_update(
|
|
||||||
user_id: str,
|
|
||||||
new_profile: "synapse.module_api.ProfileInfo",
|
|
||||||
by_admin: bool,
|
|
||||||
deactivation: bool,
|
|
||||||
) -> None:
|
|
||||||
```
|
|
||||||
|
|
||||||
Called after updating a local user's profile. The update can be triggered either by the
|
|
||||||
user themselves or a server admin. The update can also be triggered by a user being
|
|
||||||
deactivated (in which case their display name is set to an empty string (`""`) and the
|
|
||||||
avatar URL is set to `None`). The module is passed the Matrix ID of the user whose profile
|
|
||||||
has been updated, their new profile, as well as a `by_admin` boolean that is `True` if the
|
|
||||||
update was triggered by a server admin (and `False` otherwise), and a `deactivated`
|
|
||||||
boolean that is `True` if the update is a result of the user being deactivated.
|
|
||||||
|
|
||||||
Note that the `by_admin` boolean is also `True` if the profile change happens as a result
|
|
||||||
of the user logging in through Single Sign-On, or if a server admin updates their own
|
|
||||||
profile.
|
|
||||||
|
|
||||||
Per-room profile changes do not trigger this callback to be called. Synapse administrators
|
|
||||||
wishing this callback to be called on every profile change are encouraged to disable
|
|
||||||
per-room profiles globally using the `allow_per_room_profiles` configuration setting in
|
|
||||||
Synapse's configuration file.
|
|
||||||
This callback is not called when registering a user, even when setting it through the
|
|
||||||
[`get_displayname_for_registration`](https://matrix-org.github.io/synapse/latest/modules/password_auth_provider_callbacks.html#get_displayname_for_registration)
|
|
||||||
module callback.
|
|
||||||
|
|
||||||
If multiple modules implement this callback, Synapse runs them all in order.
|
|
||||||
|
|
||||||
### `on_user_deactivation_status_changed`
|
|
||||||
|
|
||||||
_First introduced in Synapse v1.54.0_
|
|
||||||
|
|
||||||
```python
|
|
||||||
async def on_user_deactivation_status_changed(
|
|
||||||
user_id: str, deactivated: bool, by_admin: bool
|
|
||||||
) -> None:
|
|
||||||
```
|
|
||||||
|
|
||||||
Called after deactivating a local user, or reactivating them through the admin API. The
|
|
||||||
deactivation can be triggered either by the user themselves or a server admin. The module
|
|
||||||
is passed the Matrix ID of the user whose status is changed, as well as a `deactivated`
|
|
||||||
boolean that is `True` if the user is being deactivated and `False` if they're being
|
|
||||||
reactivated, and a `by_admin` boolean that is `True` if the deactivation was triggered by
|
|
||||||
a server admin (and `False` otherwise). This latter `by_admin` boolean is always `True`
|
|
||||||
if the user is being reactivated, as this operation can only be performed through the
|
|
||||||
admin API.
|
|
||||||
|
|
||||||
If multiple modules implement this callback, Synapse runs them all in order.
|
|
||||||
|
|
||||||
## Example
|
## Example
|
||||||
|
|
||||||
The example below is a module that implements the third-party rules callback
|
The example below is a module that implements the third-party rules callback
|
||||||
|
|||||||
+12
-13
@@ -390,6 +390,9 @@ oidc_providers:
|
|||||||
|
|
||||||
### Facebook
|
### Facebook
|
||||||
|
|
||||||
|
Like Github, Facebook provide a custom OAuth2 API rather than an OIDC-compliant
|
||||||
|
one so requires a little more configuration.
|
||||||
|
|
||||||
0. You will need a Facebook developer account. You can register for one
|
0. You will need a Facebook developer account. You can register for one
|
||||||
[here](https://developers.facebook.com/async/registration/).
|
[here](https://developers.facebook.com/async/registration/).
|
||||||
1. On the [apps](https://developers.facebook.com/apps/) page of the developer
|
1. On the [apps](https://developers.facebook.com/apps/) page of the developer
|
||||||
@@ -409,28 +412,24 @@ Synapse config:
|
|||||||
idp_name: Facebook
|
idp_name: Facebook
|
||||||
idp_brand: "facebook" # optional: styling hint for clients
|
idp_brand: "facebook" # optional: styling hint for clients
|
||||||
discover: false
|
discover: false
|
||||||
issuer: "https://www.facebook.com"
|
issuer: "https://facebook.com"
|
||||||
client_id: "your-client-id" # TO BE FILLED
|
client_id: "your-client-id" # TO BE FILLED
|
||||||
client_secret: "your-client-secret" # TO BE FILLED
|
client_secret: "your-client-secret" # TO BE FILLED
|
||||||
scopes: ["openid", "email"]
|
scopes: ["openid", "email"]
|
||||||
authorization_endpoint: "https://facebook.com/dialog/oauth"
|
authorization_endpoint: https://facebook.com/dialog/oauth
|
||||||
token_endpoint: "https://graph.facebook.com/v9.0/oauth/access_token"
|
token_endpoint: https://graph.facebook.com/v9.0/oauth/access_token
|
||||||
jwks_uri: "https://www.facebook.com/.well-known/oauth/openid/jwks/"
|
user_profile_method: "userinfo_endpoint"
|
||||||
|
userinfo_endpoint: "https://graph.facebook.com/v9.0/me?fields=id,name,email,picture"
|
||||||
user_mapping_provider:
|
user_mapping_provider:
|
||||||
config:
|
config:
|
||||||
|
subject_claim: "id"
|
||||||
display_name_template: "{{ user.name }}"
|
display_name_template: "{{ user.name }}"
|
||||||
email_template: "{{ '{{ user.email }}' }}"
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Relevant documents:
|
Relevant documents:
|
||||||
* [Manually Build a Login Flow](https://developers.facebook.com/docs/facebook-login/manually-build-a-login-flow)
|
* https://developers.facebook.com/docs/facebook-login/manually-build-a-login-flow
|
||||||
* [Using Facebook's Graph API](https://developers.facebook.com/docs/graph-api/using-graph-api/)
|
* Using Facebook's Graph API: https://developers.facebook.com/docs/graph-api/using-graph-api/
|
||||||
* [Reference to the User endpoint](https://developers.facebook.com/docs/graph-api/reference/user)
|
* Reference to the User endpoint: https://developers.facebook.com/docs/graph-api/reference/user
|
||||||
|
|
||||||
Facebook do have an [OIDC discovery endpoint](https://www.facebook.com/.well-known/openid-configuration),
|
|
||||||
but it has a `response_types_supported` which excludes "code" (which we rely on, and
|
|
||||||
is even mentioned in their [documentation](https://developers.facebook.com/docs/facebook-login/manually-build-a-login-flow#login)),
|
|
||||||
so we have to disable discovery and configure the URIs manually.
|
|
||||||
|
|
||||||
### Gitea
|
### Gitea
|
||||||
|
|
||||||
|
|||||||
@@ -31,29 +31,28 @@ Anything that requires modifying the device list [#7721](https://github.com/matr
|
|||||||
Put the below in a new file at /etc/matrix-synapse/conf.d/sbc.yaml to override the defaults in homeserver.yaml.
|
Put the below in a new file at /etc/matrix-synapse/conf.d/sbc.yaml to override the defaults in homeserver.yaml.
|
||||||
|
|
||||||
```
|
```
|
||||||
# Disable presence tracking, which is currently fairly resource intensive
|
# Set to false to disable presence tracking on this homeserver.
|
||||||
# More info: https://github.com/matrix-org/synapse/issues/9478
|
|
||||||
use_presence: false
|
use_presence: false
|
||||||
|
|
||||||
# Set a small complexity limit, preventing users from joining large rooms
|
# When this is enabled, the room "complexity" will be checked before a user
|
||||||
# which may be resource-intensive to remain a part of.
|
# joins a new remote room. If it is above the complexity limit, the server will
|
||||||
#
|
# disallow joining, or will instantly leave.
|
||||||
# Note that this will not prevent users from joining smaller rooms that
|
|
||||||
# eventually become complex.
|
|
||||||
limit_remote_rooms:
|
limit_remote_rooms:
|
||||||
enabled: true
|
# Uncomment to enable room complexity checking.
|
||||||
|
#enabled: true
|
||||||
complexity: 3.0
|
complexity: 3.0
|
||||||
|
|
||||||
# Database configuration
|
# Database configuration
|
||||||
database:
|
database:
|
||||||
# Use postgres for the best performance
|
|
||||||
name: psycopg2
|
name: psycopg2
|
||||||
args:
|
args:
|
||||||
user: matrix-synapse
|
user: matrix-synapse
|
||||||
# Generate a long, secure password using a password manager
|
# Generate a long, secure one with a password manager
|
||||||
password: hunter2
|
password: hunter2
|
||||||
database: matrix-synapse
|
database: matrix-synapse
|
||||||
host: localhost
|
host: localhost
|
||||||
|
cp_min: 5
|
||||||
|
cp_max: 10
|
||||||
```
|
```
|
||||||
|
|
||||||
Currently the complexity is measured by [current_state_events / 500](https://github.com/matrix-org/synapse/blob/v1.20.1/synapse/storage/databases/main/events_worker.py#L986). You can find join times and your most complex rooms like this:
|
Currently the complexity is measured by [current_state_events / 500](https://github.com/matrix-org/synapse/blob/v1.20.1/synapse/storage/databases/main/events_worker.py#L986). You can find join times and your most complex rooms like this:
|
||||||
|
|||||||
+4
-4
@@ -153,9 +153,9 @@ database file (typically `homeserver.db`) to another location. Once the
|
|||||||
copy is complete, restart synapse. For instance:
|
copy is complete, restart synapse. For instance:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
synctl stop
|
./synctl stop
|
||||||
cp homeserver.db homeserver.db.snapshot
|
cp homeserver.db homeserver.db.snapshot
|
||||||
synctl start
|
./synctl start
|
||||||
```
|
```
|
||||||
|
|
||||||
Copy the old config file into a new config file:
|
Copy the old config file into a new config file:
|
||||||
@@ -192,10 +192,10 @@ Once that has completed, change the synapse config to point at the
|
|||||||
PostgreSQL database configuration file `homeserver-postgres.yaml`:
|
PostgreSQL database configuration file `homeserver-postgres.yaml`:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
synctl stop
|
./synctl stop
|
||||||
mv homeserver.yaml homeserver-old-sqlite.yaml
|
mv homeserver.yaml homeserver-old-sqlite.yaml
|
||||||
mv homeserver-postgres.yaml homeserver.yaml
|
mv homeserver-postgres.yaml homeserver.yaml
|
||||||
synctl start
|
./synctl start
|
||||||
```
|
```
|
||||||
|
|
||||||
Synapse should now be running against PostgreSQL.
|
Synapse should now be running against PostgreSQL.
|
||||||
|
|||||||
+23
-69
@@ -41,11 +41,11 @@
|
|||||||
# documentation on how to configure or create custom modules for Synapse.
|
# documentation on how to configure or create custom modules for Synapse.
|
||||||
#
|
#
|
||||||
modules:
|
modules:
|
||||||
#- module: my_super_module.MySuperClass
|
# - module: my_super_module.MySuperClass
|
||||||
# config:
|
# config:
|
||||||
# do_thing: true
|
# do_thing: true
|
||||||
#- module: my_other_super_module.SomeClass
|
# - module: my_other_super_module.SomeClass
|
||||||
# config: {}
|
# config: {}
|
||||||
|
|
||||||
|
|
||||||
## Server ##
|
## Server ##
|
||||||
@@ -74,7 +74,13 @@ server_name: "SERVERNAME"
|
|||||||
#
|
#
|
||||||
pid_file: DATADIR/homeserver.pid
|
pid_file: DATADIR/homeserver.pid
|
||||||
|
|
||||||
# The absolute URL to the web client which / will redirect to.
|
# The absolute URL to the web client which /_matrix/client will redirect
|
||||||
|
# to if 'webclient' is configured under the 'listeners' configuration.
|
||||||
|
#
|
||||||
|
# This option can be also set to the filesystem path to the web client
|
||||||
|
# which will be served at /_matrix/client/ if 'webclient' is configured
|
||||||
|
# under the 'listeners' configuration, however this is a security risk:
|
||||||
|
# https://github.com/matrix-org/synapse#security-note
|
||||||
#
|
#
|
||||||
#web_client_location: https://riot.example.com/
|
#web_client_location: https://riot.example.com/
|
||||||
|
|
||||||
@@ -158,12 +164,12 @@ presence:
|
|||||||
# The default room version for newly created rooms.
|
# The default room version for newly created rooms.
|
||||||
#
|
#
|
||||||
# Known room versions are listed here:
|
# Known room versions are listed here:
|
||||||
# https://spec.matrix.org/latest/rooms/#complete-list-of-room-versions
|
# https://matrix.org/docs/spec/#complete-list-of-room-versions
|
||||||
#
|
#
|
||||||
# For example, for room version 1, default_room_version should be set
|
# For example, for room version 1, default_room_version should be set
|
||||||
# to "1".
|
# to "1".
|
||||||
#
|
#
|
||||||
#default_room_version: "9"
|
#default_room_version: "6"
|
||||||
|
|
||||||
# The GC threshold parameters to pass to `gc.set_threshold`, if defined
|
# The GC threshold parameters to pass to `gc.set_threshold`, if defined
|
||||||
#
|
#
|
||||||
@@ -304,6 +310,8 @@ presence:
|
|||||||
# static: static resources under synapse/static (/_matrix/static). (Mostly
|
# static: static resources under synapse/static (/_matrix/static). (Mostly
|
||||||
# useful for 'fallback authentication'.)
|
# useful for 'fallback authentication'.)
|
||||||
#
|
#
|
||||||
|
# webclient: A web client. Requires web_client_location to be set.
|
||||||
|
#
|
||||||
listeners:
|
listeners:
|
||||||
# TLS-enabled listener: for when matrix traffic is sent directly to synapse.
|
# TLS-enabled listener: for when matrix traffic is sent directly to synapse.
|
||||||
#
|
#
|
||||||
@@ -471,20 +479,6 @@ limit_remote_rooms:
|
|||||||
#
|
#
|
||||||
#allow_per_room_profiles: false
|
#allow_per_room_profiles: false
|
||||||
|
|
||||||
# The largest allowed file size for a user avatar. Defaults to no restriction.
|
|
||||||
#
|
|
||||||
# Note that user avatar changes will not work if this is set without
|
|
||||||
# using Synapse's media repository.
|
|
||||||
#
|
|
||||||
#max_avatar_size: 10M
|
|
||||||
|
|
||||||
# The MIME types allowed for user avatars. Defaults to no restriction.
|
|
||||||
#
|
|
||||||
# Note that user avatar changes will not work if this is set without
|
|
||||||
# using Synapse's media repository.
|
|
||||||
#
|
|
||||||
#allowed_avatar_mimetypes: ["image/png", "image/jpeg", "image/gif"]
|
|
||||||
|
|
||||||
# How long to keep redacted events in unredacted form in the database. After
|
# How long to keep redacted events in unredacted form in the database. After
|
||||||
# this period redacted events get replaced with their redacted form in the DB.
|
# this period redacted events get replaced with their redacted form in the DB.
|
||||||
#
|
#
|
||||||
@@ -751,16 +745,11 @@ caches:
|
|||||||
per_cache_factors:
|
per_cache_factors:
|
||||||
#get_users_who_share_room_with_user: 2.0
|
#get_users_who_share_room_with_user: 2.0
|
||||||
|
|
||||||
# Controls whether cache entries are evicted after a specified time
|
# Controls how long an entry can be in a cache without having been
|
||||||
# period. Defaults to true. Uncomment to disable this feature.
|
# accessed before being evicted. Defaults to None, which means
|
||||||
|
# entries are never evicted based on time.
|
||||||
#
|
#
|
||||||
#expire_caches: false
|
#expiry_time: 30m
|
||||||
|
|
||||||
# If expire_caches is enabled, this flag controls how long an entry can
|
|
||||||
# be in a cache without having been accessed before being evicted.
|
|
||||||
# Defaults to 30m. Uncomment to set a different time to live for cache entries.
|
|
||||||
#
|
|
||||||
#cache_entry_ttl: 30m
|
|
||||||
|
|
||||||
# Controls how long the results of a /sync request are cached for after
|
# Controls how long the results of a /sync request are cached for after
|
||||||
# a successful response is returned. A higher duration can help clients with
|
# a successful response is returned. A higher duration can help clients with
|
||||||
@@ -862,9 +851,6 @@ log_config: "CONFDIR/SERVERNAME.log.config"
|
|||||||
# - one for ratelimiting how often a user or IP can attempt to validate a 3PID.
|
# - one for ratelimiting how often a user or IP can attempt to validate a 3PID.
|
||||||
# - two for ratelimiting how often invites can be sent in a room or to a
|
# - two for ratelimiting how often invites can be sent in a room or to a
|
||||||
# specific user.
|
# specific user.
|
||||||
# - one for ratelimiting 3PID invites (i.e. invites sent to a third-party ID
|
|
||||||
# such as an email address or a phone number) based on the account that's
|
|
||||||
# sending the invite.
|
|
||||||
#
|
#
|
||||||
# The defaults are as shown below.
|
# The defaults are as shown below.
|
||||||
#
|
#
|
||||||
@@ -914,10 +900,6 @@ log_config: "CONFDIR/SERVERNAME.log.config"
|
|||||||
# per_user:
|
# per_user:
|
||||||
# per_second: 0.003
|
# per_second: 0.003
|
||||||
# burst_count: 5
|
# burst_count: 5
|
||||||
#
|
|
||||||
#rc_third_party_invite:
|
|
||||||
# per_second: 0.2
|
|
||||||
# burst_count: 10
|
|
||||||
|
|
||||||
# Ratelimiting settings for incoming federation
|
# Ratelimiting settings for incoming federation
|
||||||
#
|
#
|
||||||
@@ -1454,16 +1436,6 @@ account_threepid_delegates:
|
|||||||
#
|
#
|
||||||
#auto_join_rooms_for_guests: false
|
#auto_join_rooms_for_guests: false
|
||||||
|
|
||||||
# Whether to inhibit errors raised when registering a new account if the user ID
|
|
||||||
# already exists. If turned on, that requests to /register/available will always
|
|
||||||
# show a user ID as available, and Synapse won't raise an error when starting
|
|
||||||
# a registration with a user ID that already exists. However, Synapse will still
|
|
||||||
# raise an error if the registration completes and the username conflicts.
|
|
||||||
#
|
|
||||||
# Defaults to false.
|
|
||||||
#
|
|
||||||
#inhibit_user_in_use_error: true
|
|
||||||
|
|
||||||
|
|
||||||
## Metrics ###
|
## Metrics ###
|
||||||
|
|
||||||
@@ -1531,21 +1503,6 @@ room_prejoin_state:
|
|||||||
#additional_event_types:
|
#additional_event_types:
|
||||||
# - org.example.custom.event.type
|
# - org.example.custom.event.type
|
||||||
|
|
||||||
# We record the IP address of clients used to access the API for various
|
|
||||||
# reasons, including displaying it to the user in the "Where you're signed in"
|
|
||||||
# dialog.
|
|
||||||
#
|
|
||||||
# By default, when puppeting another user via the admin API, the client IP
|
|
||||||
# address is recorded against the user who created the access token (ie, the
|
|
||||||
# admin user), and *not* the puppeted user.
|
|
||||||
#
|
|
||||||
# Uncomment the following to also record the IP address against the puppeted
|
|
||||||
# user. (This also means that the puppeted user will count as an "active" user
|
|
||||||
# for the purpose of monthly active user tracking - see 'limit_usage_by_mau' etc
|
|
||||||
# above.)
|
|
||||||
#
|
|
||||||
#track_puppeted_user_ips: true
|
|
||||||
|
|
||||||
|
|
||||||
# A list of application service config files to use
|
# A list of application service config files to use
|
||||||
#
|
#
|
||||||
@@ -1913,13 +1870,10 @@ saml2_config:
|
|||||||
# Defaults to false. Avoid this in production.
|
# Defaults to false. Avoid this in production.
|
||||||
#
|
#
|
||||||
# user_profile_method: Whether to fetch the user profile from the userinfo
|
# user_profile_method: Whether to fetch the user profile from the userinfo
|
||||||
# endpoint, or to rely on the data returned in the id_token from the
|
# endpoint. Valid values are: 'auto' or 'userinfo_endpoint'.
|
||||||
# token_endpoint.
|
|
||||||
#
|
#
|
||||||
# Valid values are: 'auto' or 'userinfo_endpoint'.
|
# Defaults to 'auto', which fetches the userinfo endpoint if 'openid' is
|
||||||
#
|
# included in 'scopes'. Set to 'userinfo_endpoint' to always fetch the
|
||||||
# Defaults to 'auto', which uses the userinfo endpoint if 'openid' is
|
|
||||||
# not included in 'scopes'. Set to 'userinfo_endpoint' to always use the
|
|
||||||
# userinfo endpoint.
|
# userinfo endpoint.
|
||||||
#
|
#
|
||||||
# allow_existing_users: set to 'true' to allow a user logging in via OIDC to
|
# allow_existing_users: set to 'true' to allow a user logging in via OIDC to
|
||||||
|
|||||||
@@ -194,7 +194,7 @@ When following this route please make sure that the [Platform-specific prerequis
|
|||||||
System requirements:
|
System requirements:
|
||||||
|
|
||||||
- POSIX-compliant system (tested on Linux & OS X)
|
- POSIX-compliant system (tested on Linux & OS X)
|
||||||
- Python 3.7 or later, up to Python 3.10.
|
- Python 3.6 or later, up to Python 3.9.
|
||||||
- At least 1GB of free RAM if you want to join large public rooms like #matrix:matrix.org
|
- At least 1GB of free RAM if you want to join large public rooms like #matrix:matrix.org
|
||||||
|
|
||||||
To install the Synapse homeserver run:
|
To install the Synapse homeserver run:
|
||||||
|
|||||||
@@ -81,12 +81,14 @@ remote endpoint at 10.1.2.3:9999.
|
|||||||
|
|
||||||
## Upgrading from legacy structured logging configuration
|
## Upgrading from legacy structured logging configuration
|
||||||
|
|
||||||
Versions of Synapse prior to v1.54.0 automatically converted the legacy
|
Versions of Synapse prior to v1.23.0 included a custom structured logging
|
||||||
structured logging configuration, which was deprecated in v1.23.0, to the standard
|
configuration which is deprecated. It used a `structured: true` flag and
|
||||||
library logging configuration.
|
configured `drains` instead of ``handlers`` and `formatters`.
|
||||||
|
|
||||||
The following reference can be used to update your configuration. Based on the
|
Synapse currently automatically converts the old configuration to the new
|
||||||
drain `type`, we can pick a new handler:
|
configuration, but this will be removed in a future version of Synapse. The
|
||||||
|
following reference can be used to update your configuration. Based on the drain
|
||||||
|
`type`, we can pick a new handler:
|
||||||
|
|
||||||
1. For a type of `console`, `console_json`, or `console_json_terse`: a handler
|
1. For a type of `console`, `console_json`, or `console_json_terse`: a handler
|
||||||
with a class of `logging.StreamHandler` and a `stream` of `ext://sys.stdout`
|
with a class of `logging.StreamHandler` and a `stream` of `ext://sys.stdout`
|
||||||
@@ -139,7 +141,7 @@ formatters:
|
|||||||
handlers:
|
handlers:
|
||||||
console:
|
console:
|
||||||
class: logging.StreamHandler
|
class: logging.StreamHandler
|
||||||
stream: ext://sys.stdout
|
location: ext://sys.stdout
|
||||||
file:
|
file:
|
||||||
class: logging.FileHandler
|
class: logging.FileHandler
|
||||||
formatter: json
|
formatter: json
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user