Compare commits
1 Commits
anoa/log_e
...
hs/use-mal
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7ea2cd1ce9 |
13
.buildkite/.env
Normal file
13
.buildkite/.env
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
CI
|
||||||
|
BUILDKITE
|
||||||
|
BUILDKITE_BUILD_NUMBER
|
||||||
|
BUILDKITE_BRANCH
|
||||||
|
BUILDKITE_BUILD_NUMBER
|
||||||
|
BUILDKITE_JOB_ID
|
||||||
|
BUILDKITE_BUILD_URL
|
||||||
|
BUILDKITE_PROJECT_SLUG
|
||||||
|
BUILDKITE_COMMIT
|
||||||
|
BUILDKITE_PULL_REQUEST
|
||||||
|
BUILDKITE_TAG
|
||||||
|
CODECOV_TOKEN
|
||||||
|
TRIAL_FLAGS
|
||||||
35
.buildkite/merge_base_branch.sh
Executable file
35
.buildkite/merge_base_branch.sh
Executable file
@@ -0,0 +1,35 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
if [[ "$BUILDKITE_BRANCH" =~ ^(develop|master|dinsic|shhs|release-.*)$ ]]; then
|
||||||
|
echo "Not merging forward, as this is a release branch"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -z $BUILDKITE_PULL_REQUEST_BASE_BRANCH ]]; then
|
||||||
|
echo "Not a pull request, or hasn't had a PR opened yet..."
|
||||||
|
|
||||||
|
# It probably hasn't had a PR opened yet. Since all PRs land on develop, we
|
||||||
|
# can probably assume it's based on it and will be merged into it.
|
||||||
|
GITBASE="develop"
|
||||||
|
else
|
||||||
|
# Get the reference, using the GitHub API
|
||||||
|
GITBASE=$BUILDKITE_PULL_REQUEST_BASE_BRANCH
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "--- merge_base_branch $GITBASE"
|
||||||
|
|
||||||
|
# Show what we are before
|
||||||
|
git --no-pager show -s
|
||||||
|
|
||||||
|
# Set up username so it can do a merge
|
||||||
|
git config --global user.email bot@matrix.org
|
||||||
|
git config --global user.name "A robot"
|
||||||
|
|
||||||
|
# Fetch and merge. If it doesn't work, it will raise due to set -e.
|
||||||
|
git fetch -u origin $GITBASE
|
||||||
|
git merge --no-edit --no-commit origin/$GITBASE
|
||||||
|
|
||||||
|
# Show what we are after.
|
||||||
|
git --no-pager show -s
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
# CI's Docker setup at the point where this file is considered.
|
# CI's Docker setup at the point where this file is considered.
|
||||||
server_name: "localhost:8800"
|
server_name: "localhost:8800"
|
||||||
|
|
||||||
signing_key_path: ".ci/test.signing.key"
|
signing_key_path: "/src/.buildkite/test.signing.key"
|
||||||
|
|
||||||
report_stats: false
|
report_stats: false
|
||||||
|
|
||||||
@@ -11,9 +11,11 @@ database:
|
|||||||
name: "psycopg2"
|
name: "psycopg2"
|
||||||
args:
|
args:
|
||||||
user: postgres
|
user: postgres
|
||||||
host: localhost
|
host: postgres
|
||||||
password: postgres
|
password: postgres
|
||||||
database: synapse
|
database: synapse
|
||||||
|
|
||||||
# Suppress the key server warning.
|
# Suppress the key server warning.
|
||||||
trusted_key_servers: []
|
trusted_key_servers:
|
||||||
|
- server_name: "matrix.org"
|
||||||
|
suppress_key_server_warning: true
|
||||||
@@ -23,7 +23,7 @@ import psycopg2
|
|||||||
# We use "postgres" as a database because it's bound to exist and the "synapse" one
|
# We use "postgres" as a database because it's bound to exist and the "synapse" one
|
||||||
# doesn't exist yet.
|
# doesn't exist yet.
|
||||||
db_conn = psycopg2.connect(
|
db_conn = psycopg2.connect(
|
||||||
user="postgres", host="localhost", password="postgres", dbname="postgres"
|
user="postgres", host="postgres", password="postgres", dbname="postgres"
|
||||||
)
|
)
|
||||||
db_conn.autocommit = True
|
db_conn.autocommit = True
|
||||||
cur = db_conn.cursor()
|
cur = db_conn.cursor()
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
# this script is run by GitHub Actions in a plain `bionic` container; it installs the
|
# this script is run by buildkite in a plain `bionic` container; it installs the
|
||||||
# minimal requirements for tox and hands over to the py3-old tox environment.
|
# minimal requirements for tox and hands over to the py3-old tox environment.
|
||||||
|
|
||||||
set -ex
|
set -ex
|
||||||
@@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
|
|
||||||
set -xe
|
set -xe
|
||||||
cd "$(dirname "$0")/../.."
|
cd `dirname $0`/../..
|
||||||
|
|
||||||
echo "--- Install dependencies"
|
echo "--- Install dependencies"
|
||||||
|
|
||||||
@@ -20,22 +20,18 @@ pip install -e .
|
|||||||
echo "--- Generate the signing key"
|
echo "--- Generate the signing key"
|
||||||
|
|
||||||
# Generate the server's signing key.
|
# Generate the server's signing key.
|
||||||
python -m synapse.app.homeserver --generate-keys -c .ci/sqlite-config.yaml
|
python -m synapse.app.homeserver --generate-keys -c .buildkite/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.
|
||||||
scripts/update_synapse_database --database-config .ci/sqlite-config.yaml --run-background-updates
|
scripts-dev/update_database --database-config .buildkite/sqlite-config.yaml
|
||||||
|
|
||||||
# Create the PostgreSQL database.
|
# Create the PostgreSQL database.
|
||||||
.ci/scripts/postgres_exec.py "CREATE DATABASE synapse"
|
./.buildkite/scripts/postgres_exec.py "CREATE DATABASE synapse"
|
||||||
|
|
||||||
echo "+++ Run synapse_port_db against test database"
|
echo "+++ Run synapse_port_db against test database"
|
||||||
coverage run scripts/synapse_port_db --sqlite-database .ci/test_db.db --postgres-config .ci/postgres-config.yaml
|
coverage run scripts/synapse_port_db --sqlite-database .buildkite/test_db.db --postgres-config .buildkite/postgres-config.yaml
|
||||||
|
|
||||||
# We should be able to run twice against the same database.
|
|
||||||
echo "+++ Run synapse_port_db a second time"
|
|
||||||
coverage run scripts/synapse_port_db --sqlite-database .ci/test_db.db --postgres-config .ci/postgres-config.yaml
|
|
||||||
|
|
||||||
#####
|
#####
|
||||||
|
|
||||||
@@ -44,14 +40,14 @@ coverage run scripts/synapse_port_db --sqlite-database .ci/test_db.db --postgres
|
|||||||
echo "--- Prepare empty SQLite database"
|
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 .buildkite/test_db.db
|
||||||
|
|
||||||
scripts/update_synapse_database --database-config .ci/sqlite-config.yaml --run-background-updates
|
scripts-dev/update_database --database-config .buildkite/sqlite-config.yaml
|
||||||
|
|
||||||
# re-create the PostgreSQL database.
|
# re-create the PostgreSQL database.
|
||||||
.ci/scripts/postgres_exec.py \
|
./.buildkite/scripts/postgres_exec.py \
|
||||||
"DROP DATABASE synapse" \
|
"DROP DATABASE synapse" \
|
||||||
"CREATE DATABASE synapse"
|
"CREATE DATABASE synapse"
|
||||||
|
|
||||||
echo "+++ Run synapse_port_db against empty database"
|
echo "+++ Run synapse_port_db against empty database"
|
||||||
coverage run scripts/synapse_port_db --sqlite-database .ci/test_db.db --postgres-config .ci/postgres-config.yaml
|
coverage run scripts/synapse_port_db --sqlite-database .buildkite/test_db.db --postgres-config .buildkite/postgres-config.yaml
|
||||||
@@ -3,14 +3,16 @@
|
|||||||
# schema and run background updates on it.
|
# schema and run background updates on it.
|
||||||
server_name: "localhost:8800"
|
server_name: "localhost:8800"
|
||||||
|
|
||||||
signing_key_path: ".ci/test.signing.key"
|
signing_key_path: "/src/.buildkite/test.signing.key"
|
||||||
|
|
||||||
report_stats: false
|
report_stats: false
|
||||||
|
|
||||||
database:
|
database:
|
||||||
name: "sqlite3"
|
name: "sqlite3"
|
||||||
args:
|
args:
|
||||||
database: ".ci/test_db.db"
|
database: ".buildkite/test_db.db"
|
||||||
|
|
||||||
# Suppress the key server warning.
|
# Suppress the key server warning.
|
||||||
trusted_key_servers: []
|
trusted_key_servers:
|
||||||
|
- server_name: "matrix.org"
|
||||||
|
suppress_key_server_warning: true
|
||||||
10
.buildkite/worker-blacklist
Normal file
10
.buildkite/worker-blacklist
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
# This file serves as a blacklist for SyTest tests that we expect will fail in
|
||||||
|
# Synapse when run under worker mode. For more details, see sytest-blacklist.
|
||||||
|
|
||||||
|
Can re-join room if re-invited
|
||||||
|
|
||||||
|
# new failures as of https://github.com/matrix-org/sytest/pull/732
|
||||||
|
Device list doesn't change if remote server is down
|
||||||
|
|
||||||
|
# https://buildkite.com/matrix-dot-org/synapse/builds/6134#6f67bf47-e234-474d-80e8-c6e1868b15c5
|
||||||
|
Server correctly handles incoming m.device_list_update
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# replaces the dependency on Twisted in `python_dependencies` with trunk.
|
|
||||||
|
|
||||||
set -e
|
|
||||||
cd "$(dirname "$0")"/..
|
|
||||||
|
|
||||||
sed -i -e 's#"Twisted.*"#"Twisted @ git+https://github.com/twisted/twisted"#' synapse/python_dependencies.py
|
|
||||||
@@ -1,57 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
# Test for the export-data admin command against sqlite and postgres
|
|
||||||
|
|
||||||
set -xe
|
|
||||||
cd "$(dirname "$0")/../.."
|
|
||||||
|
|
||||||
echo "--- Install dependencies"
|
|
||||||
|
|
||||||
# Install dependencies for this test.
|
|
||||||
pip install psycopg2
|
|
||||||
|
|
||||||
# Install Synapse itself. This won't update any libraries.
|
|
||||||
pip install -e .
|
|
||||||
|
|
||||||
echo "--- Generate the signing key"
|
|
||||||
|
|
||||||
# Generate the server's signing key.
|
|
||||||
python -m synapse.app.homeserver --generate-keys -c .ci/sqlite-config.yaml
|
|
||||||
|
|
||||||
echo "--- Prepare test database"
|
|
||||||
|
|
||||||
# Make sure the SQLite3 database is using the latest schema and has no pending background update.
|
|
||||||
scripts/update_synapse_database --database-config .ci/sqlite-config.yaml --run-background-updates
|
|
||||||
|
|
||||||
# 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 \
|
|
||||||
--output-directory /tmp/export_data
|
|
||||||
|
|
||||||
# Test that the output directory exists and contains the rooms directory
|
|
||||||
dir="/tmp/export_data/rooms"
|
|
||||||
if [ -d "$dir" ]; then
|
|
||||||
echo "Command successful, this test passes"
|
|
||||||
else
|
|
||||||
echo "No output directories found, the command fails against a sqlite database."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Create the PostgreSQL database.
|
|
||||||
.ci/scripts/postgres_exec.py "CREATE DATABASE synapse"
|
|
||||||
|
|
||||||
# Port the SQLite databse to postgres so we can check command works against postgres
|
|
||||||
echo "+++ Port SQLite3 databse to postgres"
|
|
||||||
scripts/synapse_port_db --sqlite-database .ci/test_db.db --postgres-config .ci/postgres-config.yaml
|
|
||||||
|
|
||||||
# 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 \
|
|
||||||
--output-directory /tmp/export_data2
|
|
||||||
|
|
||||||
# Test that the output directory exists and contains the rooms directory
|
|
||||||
dir2="/tmp/export_data2/rooms"
|
|
||||||
if [ -d "$dir2" ]; then
|
|
||||||
echo "Command successful, this test passes"
|
|
||||||
else
|
|
||||||
echo "No output directories found, the command fails against a postgres database."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
---
|
|
||||||
title: CI run against Twisted trunk is failing
|
|
||||||
---
|
|
||||||
See https://github.com/{{env.GITHUB_REPOSITORY}}/actions/runs/{{env.GITHUB_RUN_ID}}
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
# This file serves as a blacklist for SyTest tests that we expect will fail in
|
|
||||||
# Synapse when run under worker mode. For more details, see sytest-blacklist.
|
|
||||||
78
.circleci/config.yml
Normal file
78
.circleci/config.yml
Normal file
@@ -0,0 +1,78 @@
|
|||||||
|
version: 2.1
|
||||||
|
jobs:
|
||||||
|
dockerhubuploadrelease:
|
||||||
|
docker:
|
||||||
|
- image: docker:git
|
||||||
|
steps:
|
||||||
|
- checkout
|
||||||
|
- docker_prepare
|
||||||
|
- run: docker login --username $DOCKER_HUB_USERNAME --password $DOCKER_HUB_PASSWORD
|
||||||
|
# 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.
|
||||||
|
- docker_build:
|
||||||
|
tag: -t matrixdotorg/synapse:${CIRCLE_TAG}
|
||||||
|
platforms: linux/amd64
|
||||||
|
- docker_build:
|
||||||
|
tag: -t matrixdotorg/synapse:${CIRCLE_TAG}
|
||||||
|
platforms: linux/amd64,linux/arm64
|
||||||
|
|
||||||
|
dockerhubuploadlatest:
|
||||||
|
docker:
|
||||||
|
- image: docker:git
|
||||||
|
steps:
|
||||||
|
- checkout
|
||||||
|
- docker_prepare
|
||||||
|
- run: docker login --username $DOCKER_HUB_USERNAME --password $DOCKER_HUB_PASSWORD
|
||||||
|
# for `latest`, we don't want the arm images to disappear, so don't update the tag
|
||||||
|
# until all of the platforms are built.
|
||||||
|
- docker_build:
|
||||||
|
tag: -t matrixdotorg/synapse:latest
|
||||||
|
platforms: linux/amd64,linux/arm64
|
||||||
|
|
||||||
|
workflows:
|
||||||
|
build:
|
||||||
|
jobs:
|
||||||
|
- dockerhubuploadrelease:
|
||||||
|
filters:
|
||||||
|
tags:
|
||||||
|
only: /v[0-9].[0-9]+.[0-9]+.*/
|
||||||
|
branches:
|
||||||
|
ignore: /.*/
|
||||||
|
- dockerhubuploadlatest:
|
||||||
|
filters:
|
||||||
|
branches:
|
||||||
|
only: master
|
||||||
|
|
||||||
|
commands:
|
||||||
|
docker_prepare:
|
||||||
|
description: Sets up a remote docker server, downloads the buildx cli plugin, and enables multiarch images
|
||||||
|
parameters:
|
||||||
|
buildx_version:
|
||||||
|
type: string
|
||||||
|
default: "v0.4.1"
|
||||||
|
steps:
|
||||||
|
- setup_remote_docker:
|
||||||
|
# 19.03.13 was the most recent available on circleci at the time of
|
||||||
|
# writing.
|
||||||
|
version: 19.03.13
|
||||||
|
- run: apk add --no-cache curl
|
||||||
|
- run: mkdir -vp ~/.docker/cli-plugins/ ~/dockercache
|
||||||
|
- run: curl --silent -L "https://github.com/docker/buildx/releases/download/<< parameters.buildx_version >>/buildx-<< parameters.buildx_version >>.linux-amd64" > ~/.docker/cli-plugins/docker-buildx
|
||||||
|
- run: chmod a+x ~/.docker/cli-plugins/docker-buildx
|
||||||
|
# install qemu links in /proc/sys/fs/binfmt_misc on the docker instance running the circleci job
|
||||||
|
- run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
|
||||||
|
# create a context named `builder` for the builds
|
||||||
|
- run: docker context create builder
|
||||||
|
# create a buildx builder using the new context, and set it as the default
|
||||||
|
- run: docker buildx create builder --use
|
||||||
|
|
||||||
|
docker_build:
|
||||||
|
description: Builds and pushed images to dockerhub using buildx
|
||||||
|
parameters:
|
||||||
|
platforms:
|
||||||
|
type: string
|
||||||
|
default: linux/amd64
|
||||||
|
tag:
|
||||||
|
type: string
|
||||||
|
steps:
|
||||||
|
- run: docker buildx build -f docker/Dockerfile --push --platform << parameters.platforms >> --label gitsha1=${CIRCLE_SHA1} << parameters.tag >> --progress=plain .
|
||||||
2
.github/CODEOWNERS
vendored
2
.github/CODEOWNERS
vendored
@@ -1,2 +0,0 @@
|
|||||||
# Automatically request reviews from the synapse-core team when a pull request comes in.
|
|
||||||
* @matrix-org/synapse-core
|
|
||||||
10
.github/PULL_REQUEST_TEMPLATE.md
vendored
10
.github/PULL_REQUEST_TEMPLATE.md
vendored
@@ -1,14 +1,12 @@
|
|||||||
### Pull Request Checklist
|
### Pull Request Checklist
|
||||||
|
|
||||||
<!-- Please read https://matrix-org.github.io/synapse/latest/development/contributing_guide.html before submitting your pull request -->
|
<!-- Please read CONTRIBUTING.md before submitting your pull request -->
|
||||||
|
|
||||||
* [ ] Pull request is based on the develop branch
|
* [ ] Pull request is based on the develop branch
|
||||||
* [ ] Pull request includes a [changelog file](https://matrix-org.github.io/synapse/latest/development/contributing_guide.html#changelog). The entry should:
|
* [ ] Pull request includes a [changelog file](https://github.com/matrix-org/synapse/blob/master/CONTRIBUTING.md#changelog). The entry should:
|
||||||
- Be a short description of your change which makes sense to users. "Fixed a bug that prevented receiving messages from other servers." instead of "Moved X method from `EventStore` to `EventWorkerStore`.".
|
- Be a short description of your change which makes sense to users. "Fixed a bug that prevented receiving messages from other servers." instead of "Moved X method from `EventStore` to `EventWorkerStore`.".
|
||||||
- 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://github.com/matrix-org/synapse/blob/master/CONTRIBUTING.md#sign-off)
|
||||||
* [ ] Pull request includes a [sign off](https://matrix-org.github.io/synapse/latest/development/contributing_guide.html#sign-off)
|
* [ ] Code style is correct (run the [linters](https://github.com/matrix-org/synapse/blob/master/CONTRIBUTING.md#code-style))
|
||||||
* [ ] [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))
|
|
||||||
|
|||||||
75
.github/workflows/docker.yml
vendored
75
.github/workflows/docker.yml
vendored
@@ -1,75 +0,0 @@
|
|||||||
# GitHub actions workflow which builds and publishes the docker images.
|
|
||||||
|
|
||||||
name: Build docker images
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
tags: ["v*"]
|
|
||||||
branches: [ master, main, develop ]
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Set up QEMU
|
|
||||||
id: qemu
|
|
||||||
uses: docker/setup-qemu-action@v1
|
|
||||||
with:
|
|
||||||
platforms: arm64
|
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
|
||||||
id: buildx
|
|
||||||
uses: docker/setup-buildx-action@v1
|
|
||||||
|
|
||||||
- name: Inspect builder
|
|
||||||
run: docker buildx inspect
|
|
||||||
|
|
||||||
- name: Log in to DockerHub
|
|
||||||
uses: docker/login-action@v1
|
|
||||||
with:
|
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
||||||
|
|
||||||
- name: Calculate docker image tag
|
|
||||||
id: set-tag
|
|
||||||
run: |
|
|
||||||
case "${GITHUB_REF}" in
|
|
||||||
refs/heads/develop)
|
|
||||||
tag=develop
|
|
||||||
;;
|
|
||||||
refs/heads/master|refs/heads/main)
|
|
||||||
tag=latest
|
|
||||||
;;
|
|
||||||
refs/tags/*)
|
|
||||||
tag=${GITHUB_REF#refs/tags/}
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
tag=${GITHUB_SHA}
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
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
|
|
||||||
uses: docker/build-push-action@v2
|
|
||||||
with:
|
|
||||||
push: true
|
|
||||||
labels: "gitsha1=${{ github.sha }}"
|
|
||||||
tags: "matrixdotorg/synapse:${{ steps.set-tag.outputs.tag }}"
|
|
||||||
file: "docker/Dockerfile"
|
|
||||||
platforms: linux/amd64,linux/arm64
|
|
||||||
65
.github/workflows/docs.yaml
vendored
65
.github/workflows/docs.yaml
vendored
@@ -1,65 +0,0 @@
|
|||||||
name: Deploy the documentation
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
# For bleeding-edge documentation
|
|
||||||
- develop
|
|
||||||
# For documentation specific to a release
|
|
||||||
- 'release-v*'
|
|
||||||
# stable docs
|
|
||||||
- master
|
|
||||||
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
pages:
|
|
||||||
name: GitHub Pages
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
|
|
||||||
- name: Setup mdbook
|
|
||||||
uses: peaceiris/actions-mdbook@4b5ef36b314c2599664ca107bb8c02412548d79d # v1.1.14
|
|
||||||
with:
|
|
||||||
mdbook-version: '0.4.9'
|
|
||||||
|
|
||||||
- name: Build the documentation
|
|
||||||
# mdbook will only create an index.html if we're including docs/README.md in SUMMARY.md.
|
|
||||||
# However, we're using docs/README.md for other purposes and need to pick a new page
|
|
||||||
# as the default. Let's opt for the welcome page instead.
|
|
||||||
run: |
|
|
||||||
mdbook build
|
|
||||||
cp book/welcome_and_overview.html book/index.html
|
|
||||||
|
|
||||||
# Figure out the target directory.
|
|
||||||
#
|
|
||||||
# The target directory depends on the name of the branch
|
|
||||||
#
|
|
||||||
- name: Get the target directory name
|
|
||||||
id: vars
|
|
||||||
run: |
|
|
||||||
# first strip the 'refs/heads/' prefix with some shell foo
|
|
||||||
branch="${GITHUB_REF#refs/heads/}"
|
|
||||||
|
|
||||||
case $branch in
|
|
||||||
release-*)
|
|
||||||
# strip 'release-' from the name for release branches.
|
|
||||||
branch="${branch#release-}"
|
|
||||||
;;
|
|
||||||
master)
|
|
||||||
# deploy to "latest" for the master branch.
|
|
||||||
branch="latest"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# finally, set the 'branch-version' var.
|
|
||||||
echo "::set-output name=branch-version::$branch"
|
|
||||||
|
|
||||||
# Deploy to the target directory.
|
|
||||||
- name: Deploy to gh pages
|
|
||||||
uses: peaceiris/actions-gh-pages@068dc23d9710f1ba62e86896f84735d869951305 # v3.8.0
|
|
||||||
with:
|
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
publish_dir: ./book
|
|
||||||
destination_dir: ./${{ steps.vars.outputs.branch-version }}
|
|
||||||
130
.github/workflows/release-artifacts.yml
vendored
130
.github/workflows/release-artifacts.yml
vendored
@@ -1,130 +0,0 @@
|
|||||||
# GitHub actions workflow which builds the release artifacts.
|
|
||||||
|
|
||||||
name: Build release artifacts
|
|
||||||
|
|
||||||
on:
|
|
||||||
# we build on PRs and develop to (hopefully) get early warning
|
|
||||||
# of things breaking (but only build one set of debs)
|
|
||||||
pull_request:
|
|
||||||
push:
|
|
||||||
branches: ["develop"]
|
|
||||||
|
|
||||||
# we do the full build on tags.
|
|
||||||
tags: ["v*"]
|
|
||||||
|
|
||||||
concurrency:
|
|
||||||
group: ${{ github.workflow }}-${{ github.ref }}
|
|
||||||
cancel-in-progress: true
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
get-distros:
|
|
||||||
name: "Calculate list of debian distros"
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
- uses: actions/setup-python@v2
|
|
||||||
- id: set-distros
|
|
||||||
run: |
|
|
||||||
# if we're running from a tag, get the full list of distros; otherwise just use debian:sid
|
|
||||||
dists='["debian:sid"]'
|
|
||||||
if [[ $GITHUB_REF == refs/tags/* ]]; then
|
|
||||||
dists=$(scripts-dev/build_debian_packages --show-dists-json)
|
|
||||||
fi
|
|
||||||
echo "::set-output name=distros::$dists"
|
|
||||||
# map the step outputs to job outputs
|
|
||||||
outputs:
|
|
||||||
distros: ${{ steps.set-distros.outputs.distros }}
|
|
||||||
|
|
||||||
# now build the packages with a matrix build.
|
|
||||||
build-debs:
|
|
||||||
needs: get-distros
|
|
||||||
name: "Build .deb packages"
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
distro: ${{ fromJson(needs.get-distros.outputs.distros) }}
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v2
|
|
||||||
with:
|
|
||||||
path: src
|
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
|
||||||
id: buildx
|
|
||||||
uses: docker/setup-buildx-action@v1
|
|
||||||
with:
|
|
||||||
install: true
|
|
||||||
|
|
||||||
- name: Set up docker layer caching
|
|
||||||
uses: actions/cache@v2
|
|
||||||
with:
|
|
||||||
path: /tmp/.buildx-cache
|
|
||||||
key: ${{ runner.os }}-buildx-${{ github.sha }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-buildx-
|
|
||||||
|
|
||||||
- name: Set up python
|
|
||||||
uses: actions/setup-python@v2
|
|
||||||
|
|
||||||
- name: Build the packages
|
|
||||||
# see https://github.com/docker/build-push-action/issues/252
|
|
||||||
# for the cache magic here
|
|
||||||
run: |
|
|
||||||
./src/scripts-dev/build_debian_packages \
|
|
||||||
--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=--progress=plain \
|
|
||||||
--docker-build-arg=--load \
|
|
||||||
"${{ matrix.distro }}"
|
|
||||||
rm -rf /tmp/.buildx-cache
|
|
||||||
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
|
|
||||||
|
|
||||||
- name: Upload debs as artifacts
|
|
||||||
uses: actions/upload-artifact@v2
|
|
||||||
with:
|
|
||||||
name: debs
|
|
||||||
path: debs/*
|
|
||||||
|
|
||||||
build-sdist:
|
|
||||||
name: "Build pypi distribution files"
|
|
||||||
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
|
|
||||||
attach-assets:
|
|
||||||
name: "Attach assets to release"
|
|
||||||
if: ${{ !failure() && !cancelled() && startsWith(github.ref, 'refs/tags/') }}
|
|
||||||
needs:
|
|
||||||
- build-debs
|
|
||||||
- build-sdist
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Download all workflow run artifacts
|
|
||||||
uses: actions/download-artifact@v2
|
|
||||||
- name: Build a tarball for the debs
|
|
||||||
run: tar -cvJf debs.tar.xz debs
|
|
||||||
- name: Attach to release
|
|
||||||
uses: softprops/action-gh-release@a929a66f232c1b11af63782948aa2210f981808a # PR#109
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
with:
|
|
||||||
files: |
|
|
||||||
python-dist/*
|
|
||||||
debs.tar.xz
|
|
||||||
# if it's not already published, keep the release as a draft.
|
|
||||||
draft: true
|
|
||||||
# mark it as a prerelease if the tag contains 'rc'.
|
|
||||||
prerelease: ${{ contains(github.ref, 'rc') }}
|
|
||||||
186
.github/workflows/tests.yml
vendored
186
.github/workflows/tests.yml
vendored
@@ -5,10 +5,6 @@ on:
|
|||||||
branches: ["develop", "release-*"]
|
branches: ["develop", "release-*"]
|
||||||
pull_request:
|
pull_request:
|
||||||
|
|
||||||
concurrency:
|
|
||||||
group: ${{ github.workflow }}-${{ github.ref }}
|
|
||||||
cancel-in-progress: true
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
lint:
|
lint:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -39,14 +35,13 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
with:
|
|
||||||
ref: ${{ github.event.pull_request.head.sha }}
|
|
||||||
fetch-depth: 0
|
|
||||||
- uses: actions/setup-python@v2
|
- uses: actions/setup-python@v2
|
||||||
- run: pip install tox
|
- run: pip install tox
|
||||||
|
- name: Patch Buildkite-specific test script
|
||||||
|
run: |
|
||||||
|
sed -i -e 's/\$BUILDKITE_PULL_REQUEST/${{ github.event.number }}/' \
|
||||||
|
scripts-dev/check-newsfragment
|
||||||
- run: scripts-dev/check-newsfragment
|
- run: scripts-dev/check-newsfragment
|
||||||
env:
|
|
||||||
PULL_REQUEST_NUMBER: ${{ github.event.number }}
|
|
||||||
|
|
||||||
lint-sdist:
|
lint-sdist:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -64,37 +59,34 @@ jobs:
|
|||||||
|
|
||||||
# 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: ${{ always() }} # Run this even if prior jobs were skipped
|
||||||
needs: [lint, lint-crlf, lint-newsfile, lint-sdist]
|
needs: [lint, lint-crlf, lint-newsfile, lint-sdist]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- run: "true"
|
- run: "true"
|
||||||
|
|
||||||
trial:
|
trial:
|
||||||
if: ${{ !cancelled() && !failure() }} # Allow previous steps to be skipped, but not fail
|
if: ${{ !failure() }} # Allow previous steps to be skipped, but not fail
|
||||||
needs: linting-done
|
needs: linting-done
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
python-version: ["3.7", "3.8", "3.9", "3.10"]
|
python-version: ["3.6", "3.7", "3.8", "3.9"]
|
||||||
database: ["sqlite"]
|
database: ["sqlite"]
|
||||||
toxenv: ["py"]
|
|
||||||
include:
|
include:
|
||||||
# Newest Python without optional deps
|
# Newest Python without optional deps
|
||||||
- python-version: "3.10"
|
- python-version: "3.9"
|
||||||
toxenv: "py-noextras"
|
toxenv: "py-noextras,combine"
|
||||||
|
|
||||||
# Oldest Python with PostgreSQL
|
# Oldest Python with PostgreSQL
|
||||||
- python-version: "3.7"
|
- python-version: "3.6"
|
||||||
database: "postgres"
|
database: "postgres"
|
||||||
postgres-version: "10"
|
postgres-version: "9.6"
|
||||||
toxenv: "py"
|
|
||||||
|
|
||||||
# Newest Python with newest PostgreSQL
|
# Newest Python with PostgreSQL
|
||||||
- python-version: "3.10"
|
- python-version: "3.9"
|
||||||
database: "postgres"
|
database: "postgres"
|
||||||
postgres-version: "14"
|
postgres-version: "13"
|
||||||
toxenv: "py"
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
@@ -114,7 +106,7 @@ jobs:
|
|||||||
if: ${{ matrix.postgres-version }}
|
if: ${{ matrix.postgres-version }}
|
||||||
timeout-minutes: 2
|
timeout-minutes: 2
|
||||||
run: until pg_isready -h localhost; do sleep 1; done
|
run: until pg_isready -h localhost; do sleep 1; done
|
||||||
- run: tox -e ${{ matrix.toxenv }}
|
- run: tox -e py,combine
|
||||||
env:
|
env:
|
||||||
TRIAL_FLAGS: "--jobs=2"
|
TRIAL_FLAGS: "--jobs=2"
|
||||||
SYNAPSE_POSTGRES: ${{ matrix.database == 'postgres' || '' }}
|
SYNAPSE_POSTGRES: ${{ matrix.database == 'postgres' || '' }}
|
||||||
@@ -122,8 +114,6 @@ jobs:
|
|||||||
SYNAPSE_POSTGRES_USER: postgres
|
SYNAPSE_POSTGRES_USER: postgres
|
||||||
SYNAPSE_POSTGRES_PASSWORD: postgres
|
SYNAPSE_POSTGRES_PASSWORD: postgres
|
||||||
- name: Dump logs
|
- name: Dump logs
|
||||||
# Logs are most useful when the command fails, always include them.
|
|
||||||
if: ${{ always() }}
|
|
||||||
# Note: Dumps to workflow logs instead of using actions/upload-artifact
|
# Note: Dumps to workflow logs instead of using actions/upload-artifact
|
||||||
# This keeps logs colocated with failing jobs
|
# This keeps logs colocated with failing jobs
|
||||||
# It also ignores find's exit code; this is a best effort affair
|
# It also ignores find's exit code; this is a best effort affair
|
||||||
@@ -135,7 +125,7 @@ jobs:
|
|||||||
|| true
|
|| true
|
||||||
|
|
||||||
trial-olddeps:
|
trial-olddeps:
|
||||||
if: ${{ !cancelled() && !failure() }} # Allow previous steps to be skipped, but not fail
|
if: ${{ !failure() }} # Allow previous steps to be skipped, but not fail
|
||||||
needs: linting-done
|
needs: linting-done
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
@@ -144,12 +134,10 @@ jobs:
|
|||||||
uses: docker://ubuntu:bionic # 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: .buildkite/scripts/test_old_deps.sh
|
||||||
env:
|
env:
|
||||||
TRIAL_FLAGS: "--jobs=2"
|
TRIAL_FLAGS: "--jobs=2"
|
||||||
- name: Dump logs
|
- name: Dump logs
|
||||||
# Logs are most useful when the command fails, always include them.
|
|
||||||
if: ${{ always() }}
|
|
||||||
# Note: Dumps to workflow logs instead of using actions/upload-artifact
|
# Note: Dumps to workflow logs instead of using actions/upload-artifact
|
||||||
# This keeps logs colocated with failing jobs
|
# This keeps logs colocated with failing jobs
|
||||||
# It also ignores find's exit code; this is a best effort affair
|
# It also ignores find's exit code; this is a best effort affair
|
||||||
@@ -162,12 +150,12 @@ jobs:
|
|||||||
|
|
||||||
trial-pypy:
|
trial-pypy:
|
||||||
# Very slow; only run if the branch name includes 'pypy'
|
# Very slow; only run if the branch name includes 'pypy'
|
||||||
if: ${{ contains(github.ref, 'pypy') && !failure() && !cancelled() }}
|
if: ${{ contains(github.ref, 'pypy') && !failure() }}
|
||||||
needs: linting-done
|
needs: linting-done
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
python-version: ["pypy-3.7"]
|
python-version: ["pypy-3.6"]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
@@ -176,12 +164,10 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
python-version: ${{ matrix.python-version }}
|
python-version: ${{ matrix.python-version }}
|
||||||
- run: pip install tox
|
- run: pip install tox
|
||||||
- run: tox -e py
|
- run: tox -e py,combine
|
||||||
env:
|
env:
|
||||||
TRIAL_FLAGS: "--jobs=2"
|
TRIAL_FLAGS: "--jobs=2"
|
||||||
- name: Dump logs
|
- name: Dump logs
|
||||||
# Logs are most useful when the command fails, always include them.
|
|
||||||
if: ${{ always() }}
|
|
||||||
# Note: Dumps to workflow logs instead of using actions/upload-artifact
|
# Note: Dumps to workflow logs instead of using actions/upload-artifact
|
||||||
# This keeps logs colocated with failing jobs
|
# This keeps logs colocated with failing jobs
|
||||||
# It also ignores find's exit code; this is a best effort affair
|
# It also ignores find's exit code; this is a best effort affair
|
||||||
@@ -193,7 +179,7 @@ jobs:
|
|||||||
|| true
|
|| true
|
||||||
|
|
||||||
sytest:
|
sytest:
|
||||||
if: ${{ !failure() && !cancelled() }}
|
if: ${{ !failure() }}
|
||||||
needs: linting-done
|
needs: linting-done
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container:
|
container:
|
||||||
@@ -201,13 +187,12 @@ jobs:
|
|||||||
volumes:
|
volumes:
|
||||||
- ${{ github.workspace }}:/src
|
- ${{ github.workspace }}:/src
|
||||||
env:
|
env:
|
||||||
SYTEST_BRANCH: ${{ github.head_ref }}
|
BUILDKITE_BRANCH: ${{ github.head_ref }}
|
||||||
POSTGRES: ${{ matrix.postgres && 1}}
|
POSTGRES: ${{ matrix.postgres && 1}}
|
||||||
MULTI_POSTGRES: ${{ (matrix.postgres == 'multi-postgres') && 1}}
|
MULTI_POSTGRES: ${{ (matrix.postgres == 'multi-postgres') && 1}}
|
||||||
WORKERS: ${{ matrix.workers && 1 }}
|
WORKERS: ${{ matrix.workers && 1 }}
|
||||||
REDIS: ${{ matrix.redis && 1 }}
|
REDIS: ${{ matrix.redis && 1 }}
|
||||||
BLACKLIST: ${{ matrix.workers && 'synapse-blacklist-with-workers' }}
|
BLACKLIST: ${{ matrix.workers && 'synapse-blacklist-with-workers' }}
|
||||||
TOP: ${{ github.workspace }}
|
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
@@ -237,13 +222,13 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: Prepare test blacklist
|
- name: Prepare test blacklist
|
||||||
run: cat sytest-blacklist .ci/worker-blacklist > synapse-blacklist-with-workers
|
run: cat sytest-blacklist .buildkite/worker-blacklist > synapse-blacklist-with-workers
|
||||||
- name: Run SyTest
|
- name: Run SyTest
|
||||||
run: /bootstrap.sh synapse
|
run: /bootstrap.sh synapse
|
||||||
working-directory: /src
|
working-directory: /src
|
||||||
- name: Summarise results.tap
|
- name: Dump results.tap
|
||||||
if: ${{ always() }}
|
if: ${{ always() }}
|
||||||
run: /sytest/scripts/tap_to_gha.pl /logs/results.tap
|
run: cat /logs/results.tap
|
||||||
- name: Upload SyTest logs
|
- name: Upload SyTest logs
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v2
|
||||||
if: ${{ always() }}
|
if: ${{ always() }}
|
||||||
@@ -253,49 +238,18 @@ jobs:
|
|||||||
/logs/results.tap
|
/logs/results.tap
|
||||||
/logs/**/*.log*
|
/logs/**/*.log*
|
||||||
|
|
||||||
export-data:
|
|
||||||
if: ${{ !failure() && !cancelled() }} # Allow previous steps to be skipped, but not fail
|
|
||||||
needs: [linting-done, portdb]
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
env:
|
|
||||||
TOP: ${{ github.workspace }}
|
|
||||||
|
|
||||||
services:
|
|
||||||
postgres:
|
|
||||||
image: postgres
|
|
||||||
ports:
|
|
||||||
- 5432:5432
|
|
||||||
env:
|
|
||||||
POSTGRES_PASSWORD: "postgres"
|
|
||||||
POSTGRES_INITDB_ARGS: "--lc-collate C --lc-ctype C --encoding UTF8"
|
|
||||||
options: >-
|
|
||||||
--health-cmd pg_isready
|
|
||||||
--health-interval 10s
|
|
||||||
--health-timeout 5s
|
|
||||||
--health-retries 5
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
- run: sudo apt-get -qq install xmlsec1
|
|
||||||
- uses: actions/setup-python@v2
|
|
||||||
with:
|
|
||||||
python-version: "3.9"
|
|
||||||
- run: .ci/scripts/test_export_data_command.sh
|
|
||||||
|
|
||||||
portdb:
|
portdb:
|
||||||
if: ${{ !failure() && !cancelled() }} # Allow previous steps to be skipped, but not fail
|
if: ${{ !failure() }} # Allow previous steps to be skipped, but not fail
|
||||||
needs: linting-done
|
needs: linting-done
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
env:
|
|
||||||
TOP: ${{ github.workspace }}
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- python-version: "3.7"
|
- python-version: "3.6"
|
||||||
postgres-version: "10"
|
postgres-version: "9.6"
|
||||||
|
|
||||||
- python-version: "3.10"
|
- python-version: "3.9"
|
||||||
postgres-version: "14"
|
postgres-version: "13"
|
||||||
|
|
||||||
services:
|
services:
|
||||||
postgres:
|
postgres:
|
||||||
@@ -317,10 +271,16 @@ jobs:
|
|||||||
- uses: actions/setup-python@v2
|
- uses: actions/setup-python@v2
|
||||||
with:
|
with:
|
||||||
python-version: ${{ matrix.python-version }}
|
python-version: ${{ matrix.python-version }}
|
||||||
- run: .ci/scripts/test_synapse_port_db.sh
|
- name: Patch Buildkite-specific test scripts
|
||||||
|
run: |
|
||||||
|
sed -i -e 's/host="postgres"/host="localhost"/' .buildkite/scripts/postgres_exec.py
|
||||||
|
sed -i -e 's/host: postgres/host: localhost/' .buildkite/postgres-config.yaml
|
||||||
|
sed -i -e 's|/src/||' .buildkite/{sqlite,postgres}-config.yaml
|
||||||
|
sed -i -e 's/\$TOP/\$GITHUB_WORKSPACE/' .coveragerc
|
||||||
|
- run: .buildkite/scripts/test_synapse_port_db.sh
|
||||||
|
|
||||||
complement:
|
complement:
|
||||||
if: ${{ !failure() && !cancelled() }}
|
if: ${{ !failure() }}
|
||||||
needs: linting-done
|
needs: linting-done
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container:
|
container:
|
||||||
@@ -339,35 +299,15 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
path: synapse
|
path: synapse
|
||||||
|
|
||||||
# Attempt to check out the same branch of Complement as the PR. If it
|
- name: Run actions/checkout@v2 for complement
|
||||||
# doesn't exist, fallback to master.
|
uses: actions/checkout@v2
|
||||||
- name: Checkout complement
|
with:
|
||||||
shell: bash
|
repository: "matrix-org/complement"
|
||||||
run: |
|
path: complement
|
||||||
mkdir -p complement
|
|
||||||
# Attempt to use the version of complement which best matches the current
|
|
||||||
# build. Depending on whether this is a PR or release, etc. we need to
|
|
||||||
# use different fallbacks.
|
|
||||||
#
|
|
||||||
# 1. First check if there's a similarly named branch (GITHUB_HEAD_REF
|
|
||||||
# for pull requests, otherwise GITHUB_REF).
|
|
||||||
# 2. Attempt to use the base branch, e.g. when merging into release-vX.Y
|
|
||||||
# (GITHUB_BASE_REF for pull requests).
|
|
||||||
# 3. Use the default complement branch ("master").
|
|
||||||
for BRANCH_NAME in "$GITHUB_HEAD_REF" "$GITHUB_BASE_REF" "${GITHUB_REF#refs/heads/}" "master"; do
|
|
||||||
# Skip empty branch names and merge commits.
|
|
||||||
if [[ -z "$BRANCH_NAME" || $BRANCH_NAME =~ ^refs/pull/.* ]]; then
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
|
|
||||||
(wget -O - "https://github.com/matrix-org/complement/archive/$BRANCH_NAME.tar.gz" | tar -xz --strip-components=1 -C complement) && break
|
|
||||||
done
|
|
||||||
|
|
||||||
# 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
|
||||||
@@ -376,45 +316,7 @@ jobs:
|
|||||||
working-directory: complement/dockerfiles
|
working-directory: complement/dockerfiles
|
||||||
|
|
||||||
# Run Complement
|
# Run Complement
|
||||||
- run: set -o pipefail && go test -v -json -tags synapse_blacklist,msc2403 ./tests/... 2>&1 | gotestfmt
|
- run: go test -v -tags synapse_blacklist ./tests
|
||||||
shell: bash
|
|
||||||
env:
|
env:
|
||||||
COMPLEMENT_BASE_IMAGE: complement-synapse:latest
|
COMPLEMENT_BASE_IMAGE: complement-synapse:latest
|
||||||
working-directory: complement
|
working-directory: complement
|
||||||
|
|
||||||
# a job which marks all the other jobs as complete, thus allowing PRs to be merged.
|
|
||||||
tests-done:
|
|
||||||
if: ${{ always() }}
|
|
||||||
needs:
|
|
||||||
- lint
|
|
||||||
- lint-crlf
|
|
||||||
- lint-newsfile
|
|
||||||
- lint-sdist
|
|
||||||
- trial
|
|
||||||
- trial-olddeps
|
|
||||||
- sytest
|
|
||||||
- portdb
|
|
||||||
- complement
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Set build result
|
|
||||||
env:
|
|
||||||
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
|
|
||||||
|
|
||||||
if [ "$result" != "success" ]; then
|
|
||||||
echo "::set-failed ::Job $job returned $result"
|
|
||||||
rc=1
|
|
||||||
fi
|
|
||||||
done <<< $results
|
|
||||||
exit $rc
|
|
||||||
|
|||||||
92
.github/workflows/twisted_trunk.yml
vendored
92
.github/workflows/twisted_trunk.yml
vendored
@@ -1,92 +0,0 @@
|
|||||||
name: Twisted Trunk
|
|
||||||
|
|
||||||
on:
|
|
||||||
schedule:
|
|
||||||
- cron: 0 8 * * *
|
|
||||||
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
mypy:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
- uses: actions/setup-python@v2
|
|
||||||
- run: .ci/patch_for_twisted_trunk.sh
|
|
||||||
- run: pip install tox
|
|
||||||
- run: tox -e mypy
|
|
||||||
|
|
||||||
trial:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
- run: sudo apt-get -qq install xmlsec1
|
|
||||||
- uses: actions/setup-python@v2
|
|
||||||
with:
|
|
||||||
python-version: 3.6
|
|
||||||
- run: .ci/patch_for_twisted_trunk.sh
|
|
||||||
- run: pip install tox
|
|
||||||
- run: tox -e py
|
|
||||||
env:
|
|
||||||
TRIAL_FLAGS: "--jobs=2"
|
|
||||||
|
|
||||||
- name: Dump logs
|
|
||||||
# Logs are most useful when the command fails, always include them.
|
|
||||||
if: ${{ always() }}
|
|
||||||
# Note: Dumps to workflow logs instead of using actions/upload-artifact
|
|
||||||
# This keeps logs colocated with failing jobs
|
|
||||||
# It also ignores find's exit code; this is a best effort affair
|
|
||||||
run: >-
|
|
||||||
find _trial_temp -name '*.log'
|
|
||||||
-exec echo "::group::{}" \;
|
|
||||||
-exec cat {} \;
|
|
||||||
-exec echo "::endgroup::" \;
|
|
||||||
|| true
|
|
||||||
|
|
||||||
sytest:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
container:
|
|
||||||
image: matrixdotorg/sytest-synapse:buster
|
|
||||||
volumes:
|
|
||||||
- ${{ github.workspace }}:/src
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
- name: Patch dependencies
|
|
||||||
run: .ci/patch_for_twisted_trunk.sh
|
|
||||||
working-directory: /src
|
|
||||||
- name: Run SyTest
|
|
||||||
run: /bootstrap.sh synapse
|
|
||||||
working-directory: /src
|
|
||||||
- name: Summarise results.tap
|
|
||||||
if: ${{ always() }}
|
|
||||||
run: /sytest/scripts/tap_to_gha.pl /logs/results.tap
|
|
||||||
- name: Upload SyTest logs
|
|
||||||
uses: actions/upload-artifact@v2
|
|
||||||
if: ${{ always() }}
|
|
||||||
with:
|
|
||||||
name: Sytest Logs - ${{ job.status }} - (${{ join(matrix.*, ', ') }})
|
|
||||||
path: |
|
|
||||||
/logs/results.tap
|
|
||||||
/logs/**/*.log*
|
|
||||||
|
|
||||||
# open an issue if the build fails, so we know about it.
|
|
||||||
open-issue:
|
|
||||||
if: failure()
|
|
||||||
needs:
|
|
||||||
- mypy
|
|
||||||
- trial
|
|
||||||
- sytest
|
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
- uses: JasonEtco/create-an-issue@5d9504915f79f9cc6d791934b8ef34f2353dd74d # v2.5.0, 2020-12-06
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
with:
|
|
||||||
update_existing: true
|
|
||||||
filename: .ci/twisted_trunk_build_failed_issue_template.md
|
|
||||||
8
.gitignore
vendored
8
.gitignore
vendored
@@ -40,17 +40,9 @@ __pycache__/
|
|||||||
/.coverage*
|
/.coverage*
|
||||||
/.mypy_cache/
|
/.mypy_cache/
|
||||||
/.tox
|
/.tox
|
||||||
/.tox-pg-container
|
|
||||||
/build/
|
/build/
|
||||||
/coverage.*
|
/coverage.*
|
||||||
/dist/
|
/dist/
|
||||||
/docs/build/
|
/docs/build/
|
||||||
/htmlcov
|
/htmlcov
|
||||||
/pip-wheel-metadata/
|
/pip-wheel-metadata/
|
||||||
|
|
||||||
# docs
|
|
||||||
book/
|
|
||||||
|
|
||||||
# complement
|
|
||||||
/complement-master
|
|
||||||
/master.tar.gz
|
|
||||||
|
|||||||
1771
CHANGES.md
1771
CHANGES.md
File diff suppressed because it is too large
Load Diff
398
CONTRIBUTING.md
398
CONTRIBUTING.md
@@ -1,3 +1,397 @@
|
|||||||
# Welcome to Synapse
|
Welcome to Synapse
|
||||||
|
|
||||||
Please see the [contributors' guide](https://matrix-org.github.io/synapse/latest/development/contributing_guide.html) in our rendered documentation.
|
This document aims to get you started with contributing to this repo!
|
||||||
|
|
||||||
|
- [1. Who can contribute to Synapse?](#1-who-can-contribute-to-synapse)
|
||||||
|
- [2. What do I need?](#2-what-do-i-need)
|
||||||
|
- [3. Get the source.](#3-get-the-source)
|
||||||
|
- [4. Install the dependencies](#4-install-the-dependencies)
|
||||||
|
* [Under Unix (macOS, Linux, BSD, ...)](#under-unix-macos-linux-bsd-)
|
||||||
|
* [Under Windows](#under-windows)
|
||||||
|
- [5. Get in touch.](#5-get-in-touch)
|
||||||
|
- [6. Pick an issue.](#6-pick-an-issue)
|
||||||
|
- [7. Turn coffee and documentation into code and documentation!](#7-turn-coffee-and-documentation-into-code-and-documentation)
|
||||||
|
- [8. Test, test, test!](#8-test-test-test)
|
||||||
|
* [Run the linters.](#run-the-linters)
|
||||||
|
* [Run the unit tests.](#run-the-unit-tests)
|
||||||
|
* [Run the integration tests.](#run-the-integration-tests)
|
||||||
|
- [9. Submit your patch.](#9-submit-your-patch)
|
||||||
|
* [Changelog](#changelog)
|
||||||
|
+ [How do I know what to call the changelog file before I create the PR?](#how-do-i-know-what-to-call-the-changelog-file-before-i-create-the-pr)
|
||||||
|
+ [Debian changelog](#debian-changelog)
|
||||||
|
* [Sign off](#sign-off)
|
||||||
|
- [10. Turn feedback into better code.](#10-turn-feedback-into-better-code)
|
||||||
|
- [11. Find a new issue.](#11-find-a-new-issue)
|
||||||
|
- [Notes for maintainers on merging PRs etc](#notes-for-maintainers-on-merging-prs-etc)
|
||||||
|
- [Conclusion](#conclusion)
|
||||||
|
|
||||||
|
# 1. Who can contribute to Synapse?
|
||||||
|
|
||||||
|
Everyone is welcome to contribute code to [matrix.org
|
||||||
|
projects](https://github.com/matrix-org), provided that they are willing to
|
||||||
|
license their contributions under the same license as the project itself. We
|
||||||
|
follow a simple 'inbound=outbound' model for contributions: the act of
|
||||||
|
submitting an 'inbound' contribution means that the contributor agrees to
|
||||||
|
license the code under the same terms as the project's overall 'outbound'
|
||||||
|
license - in our case, this is almost always Apache Software License v2 (see
|
||||||
|
[LICENSE](LICENSE)).
|
||||||
|
|
||||||
|
# 2. What do I need?
|
||||||
|
|
||||||
|
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).
|
||||||
|
|
||||||
|
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).
|
||||||
|
|
||||||
|
For some tests, you will need [a recent version of Docker](https://docs.docker.com/get-docker/).
|
||||||
|
|
||||||
|
|
||||||
|
# 3. Get the source.
|
||||||
|
|
||||||
|
The preferred and easiest way to contribute changes is to fork the relevant
|
||||||
|
project on GitHub, and then [create a pull request](
|
||||||
|
https://help.github.com/articles/using-pull-requests/) to ask us to pull your
|
||||||
|
changes into our repo.
|
||||||
|
|
||||||
|
Please base your changes on the `develop` branch.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
git clone git@github.com:YOUR_GITHUB_USER_NAME/synapse.git
|
||||||
|
git checkout develop
|
||||||
|
```
|
||||||
|
|
||||||
|
If you need help getting started with git, this is beyond the scope of the document, but you
|
||||||
|
can find many good git tutorials on the web.
|
||||||
|
|
||||||
|
# 4. Install the dependencies
|
||||||
|
|
||||||
|
## Under Unix (macOS, Linux, BSD, ...)
|
||||||
|
|
||||||
|
Once you have installed Python 3 and added the source, please open a terminal and
|
||||||
|
setup a *virtualenv*, as follows:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
cd path/where/you/have/cloned/the/repository
|
||||||
|
python3 -m venv ./env
|
||||||
|
source ./env/bin/activate
|
||||||
|
pip install -e ".[all,lint,mypy,test]"
|
||||||
|
pip install tox
|
||||||
|
```
|
||||||
|
|
||||||
|
This will install the developer dependencies for the project.
|
||||||
|
|
||||||
|
## Under Windows
|
||||||
|
|
||||||
|
TBD
|
||||||
|
|
||||||
|
|
||||||
|
# 5. Get in touch.
|
||||||
|
|
||||||
|
Join our developer community on Matrix: #synapse-dev:matrix.org !
|
||||||
|
|
||||||
|
|
||||||
|
# 6. Pick an issue.
|
||||||
|
|
||||||
|
Fix your favorite problem or perhaps find a [Good First Issue](https://github.com/matrix-org/synapse/issues?q=is%3Aopen+is%3Aissue+label%3A%22Good+First+Issue%22)
|
||||||
|
to work on.
|
||||||
|
|
||||||
|
|
||||||
|
# 7. Turn coffee and documentation into code and documentation!
|
||||||
|
|
||||||
|
Synapse's code style is documented [here](docs/code_style.md). Please follow
|
||||||
|
it, including the conventions for the [sample configuration
|
||||||
|
file](docs/code_style.md#configuration-file-format).
|
||||||
|
|
||||||
|
There is a growing amount of documentation located in the [docs](docs)
|
||||||
|
directory. This documentation is intended primarily for sysadmins running their
|
||||||
|
own Synapse instance, as well as developers interacting externally with
|
||||||
|
Synapse. [docs/dev](docs/dev) exists primarily to house documentation for
|
||||||
|
Synapse developers. [docs/admin_api](docs/admin_api) houses documentation
|
||||||
|
regarding Synapse's Admin API, which is used mostly by sysadmins and external
|
||||||
|
service developers.
|
||||||
|
|
||||||
|
If you add new files added to either of these folders, please use [GitHub-Flavoured
|
||||||
|
Markdown](https://guides.github.com/features/mastering-markdown/).
|
||||||
|
|
||||||
|
Some documentation also exists in [Synapse's GitHub
|
||||||
|
Wiki](https://github.com/matrix-org/synapse/wiki), although this is primarily
|
||||||
|
contributed to by community authors.
|
||||||
|
|
||||||
|
|
||||||
|
# 8. Test, test, test!
|
||||||
|
<a name="test-test-test"></a>
|
||||||
|
|
||||||
|
While you're developing and before submitting a patch, you'll
|
||||||
|
want to test your code.
|
||||||
|
|
||||||
|
## Run the linters.
|
||||||
|
|
||||||
|
The linters look at your code and do two things:
|
||||||
|
|
||||||
|
- ensure that your code follows the coding style adopted by the project;
|
||||||
|
- catch a number of errors in your code.
|
||||||
|
|
||||||
|
They're pretty fast, don't hesitate!
|
||||||
|
|
||||||
|
```sh
|
||||||
|
source ./env/bin/activate
|
||||||
|
./scripts-dev/lint.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
Note that this script *will modify your files* to fix styling errors.
|
||||||
|
Make sure that you have saved all your files.
|
||||||
|
|
||||||
|
If you wish to restrict the linters to only the files changed since the last commit
|
||||||
|
(much faster!), you can instead run:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
source ./env/bin/activate
|
||||||
|
./scripts-dev/lint.sh -d
|
||||||
|
```
|
||||||
|
|
||||||
|
Or if you know exactly which files you wish to lint, you can instead run:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
source ./env/bin/activate
|
||||||
|
./scripts-dev/lint.sh path/to/file1.py path/to/file2.py path/to/folder
|
||||||
|
```
|
||||||
|
|
||||||
|
## Run the unit tests.
|
||||||
|
|
||||||
|
The unit tests run parts of Synapse, including your changes, to see if anything
|
||||||
|
was broken. They are slower than the linters but will typically catch more errors.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
source ./env/bin/activate
|
||||||
|
trial tests
|
||||||
|
```
|
||||||
|
|
||||||
|
If you wish to only run *some* unit tests, you may specify
|
||||||
|
another module instead of `tests` - or a test class or a method:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
source ./env/bin/activate
|
||||||
|
trial tests.rest.admin.test_room tests.handlers.test_admin.ExfiltrateData.test_invite
|
||||||
|
```
|
||||||
|
|
||||||
|
If your tests fail, you may wish to look at the logs:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
less _trial_temp/test.log
|
||||||
|
```
|
||||||
|
|
||||||
|
## Run the integration tests.
|
||||||
|
|
||||||
|
The integration tests are a more comprehensive suite of tests. They
|
||||||
|
run a full version of Synapse, including your changes, to check if
|
||||||
|
anything was broken. They are slower than the unit tests but will
|
||||||
|
typically catch more errors.
|
||||||
|
|
||||||
|
The following command will let you run the integration test with the most common
|
||||||
|
configuration:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
$ docker run --rm -it -v /path/where/you/have/cloned/the/repository\:/src:ro -v /path/to/where/you/want/logs\:/logs matrixdotorg/sytest-synapse:py37
|
||||||
|
```
|
||||||
|
|
||||||
|
This configuration should generally cover your needs. For more details about other configurations, see [documentation in the SyTest repo](https://github.com/matrix-org/sytest/blob/develop/docker/README.md).
|
||||||
|
|
||||||
|
|
||||||
|
# 9. Submit your patch.
|
||||||
|
|
||||||
|
Once you're happy with your patch, it's time to prepare a Pull Request.
|
||||||
|
|
||||||
|
To prepare a Pull Request, please:
|
||||||
|
|
||||||
|
1. verify that [all the tests pass](#test-test-test), including the coding style;
|
||||||
|
2. [sign off](#sign-off) your contribution;
|
||||||
|
3. `git push` your commit to your fork of Synapse;
|
||||||
|
4. on GitHub, [create the Pull Request](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request);
|
||||||
|
5. add a [changelog entry](#changelog) and push it to your Pull Request;
|
||||||
|
6. for most contributors, that's all - however, if you are a member of the organization `matrix-org`, on GitHub, please request a review from `matrix.org / Synapse Core`.
|
||||||
|
|
||||||
|
|
||||||
|
## Changelog
|
||||||
|
|
||||||
|
All changes, even minor ones, need a corresponding changelog / newsfragment
|
||||||
|
entry. These are managed by [Towncrier](https://github.com/hawkowl/towncrier).
|
||||||
|
|
||||||
|
To create a changelog entry, make a new file in the `changelog.d` directory named
|
||||||
|
in the format of `PRnumber.type`. The type can be one of the following:
|
||||||
|
|
||||||
|
* `feature`
|
||||||
|
* `bugfix`
|
||||||
|
* `docker` (for updates to the Docker image)
|
||||||
|
* `doc` (for updates to the documentation)
|
||||||
|
* `removal` (also used for deprecations)
|
||||||
|
* `misc` (for internal-only changes)
|
||||||
|
|
||||||
|
This file will become part of our [changelog](
|
||||||
|
https://github.com/matrix-org/synapse/blob/master/CHANGES.md) at the next
|
||||||
|
release, so the content of the file should be a short description of your
|
||||||
|
change in the same style as the rest of the changelog. The file can contain Markdown
|
||||||
|
formatting, and should end with a full stop (.) or an exclamation mark (!) for
|
||||||
|
consistency.
|
||||||
|
|
||||||
|
Adding credits to the changelog is encouraged, we value your
|
||||||
|
contributions and would like to have you shouted out in the release notes!
|
||||||
|
|
||||||
|
For example, a fix in PR #1234 would have its changelog entry in
|
||||||
|
`changelog.d/1234.bugfix`, and contain content like:
|
||||||
|
|
||||||
|
> The security levels of Florbs are now validated when received
|
||||||
|
> via the `/federation/florb` endpoint. Contributed by Jane Matrix.
|
||||||
|
|
||||||
|
If there are multiple pull requests involved in a single bugfix/feature/etc,
|
||||||
|
then the content for each `changelog.d` file should be the same. Towncrier will
|
||||||
|
merge the matching files together into a single changelog entry when we come to
|
||||||
|
release.
|
||||||
|
|
||||||
|
### How do I know what to call the changelog file before I create the PR?
|
||||||
|
|
||||||
|
Obviously, you don't know if you should call your newsfile
|
||||||
|
`1234.bugfix` or `5678.bugfix` until you create the PR, which leads to a
|
||||||
|
chicken-and-egg problem.
|
||||||
|
|
||||||
|
There are two options for solving this:
|
||||||
|
|
||||||
|
1. Open the PR without a changelog file, see what number you got, and *then*
|
||||||
|
add the changelog file to your branch (see [Updating your pull
|
||||||
|
request](#updating-your-pull-request)), or:
|
||||||
|
|
||||||
|
1. Look at the [list of all
|
||||||
|
issues/PRs](https://github.com/matrix-org/synapse/issues?q=), add one to the
|
||||||
|
highest number you see, and quickly open the PR before somebody else claims
|
||||||
|
your number.
|
||||||
|
|
||||||
|
[This
|
||||||
|
script](https://github.com/richvdh/scripts/blob/master/next_github_number.sh)
|
||||||
|
might be helpful if you find yourself doing this a lot.
|
||||||
|
|
||||||
|
Sorry, we know it's a bit fiddly, but it's *really* helpful for us when we come
|
||||||
|
to put together a release!
|
||||||
|
|
||||||
|
### Debian changelog
|
||||||
|
|
||||||
|
Changes which affect the debian packaging files (in `debian`) are an
|
||||||
|
exception to the rule that all changes require a `changelog.d` file.
|
||||||
|
|
||||||
|
In this case, you will need to add an entry to the debian changelog for the
|
||||||
|
next release. For this, run the following command:
|
||||||
|
|
||||||
|
```
|
||||||
|
dch
|
||||||
|
```
|
||||||
|
|
||||||
|
This will make up a new version number (if there isn't already an unreleased
|
||||||
|
version in flight), and open an editor where you can add a new changelog entry.
|
||||||
|
(Our release process will ensure that the version number and maintainer name is
|
||||||
|
corrected for the release.)
|
||||||
|
|
||||||
|
If your change affects both the debian packaging *and* files outside the debian
|
||||||
|
directory, you will need both a regular newsfragment *and* an entry in the
|
||||||
|
debian changelog. (Though typically such changes should be submitted as two
|
||||||
|
separate pull requests.)
|
||||||
|
|
||||||
|
## Sign off
|
||||||
|
|
||||||
|
In order to have a concrete record that your contribution is intentional
|
||||||
|
and you agree to license it under the same terms as the project's license, we've adopted the
|
||||||
|
same lightweight approach that the Linux Kernel
|
||||||
|
[submitting patches process](
|
||||||
|
https://www.kernel.org/doc/html/latest/process/submitting-patches.html#sign-your-work-the-developer-s-certificate-of-origin>),
|
||||||
|
[Docker](https://github.com/docker/docker/blob/master/CONTRIBUTING.md), and many other
|
||||||
|
projects use: the DCO (Developer Certificate of Origin:
|
||||||
|
http://developercertificate.org/). This is a simple declaration that you wrote
|
||||||
|
the contribution or otherwise have the right to contribute it to Matrix:
|
||||||
|
|
||||||
|
```
|
||||||
|
Developer Certificate of Origin
|
||||||
|
Version 1.1
|
||||||
|
|
||||||
|
Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
|
||||||
|
660 York Street, Suite 102,
|
||||||
|
San Francisco, CA 94110 USA
|
||||||
|
|
||||||
|
Everyone is permitted to copy and distribute verbatim copies of this
|
||||||
|
license document, but changing it is not allowed.
|
||||||
|
|
||||||
|
Developer's Certificate of Origin 1.1
|
||||||
|
|
||||||
|
By making a contribution to this project, I certify that:
|
||||||
|
|
||||||
|
(a) The contribution was created in whole or in part by me and I
|
||||||
|
have the right to submit it under the open source license
|
||||||
|
indicated in the file; or
|
||||||
|
|
||||||
|
(b) The contribution is based upon previous work that, to the best
|
||||||
|
of my knowledge, is covered under an appropriate open source
|
||||||
|
license and I have the right under that license to submit that
|
||||||
|
work with modifications, whether created in whole or in part
|
||||||
|
by me, under the same open source license (unless I am
|
||||||
|
permitted to submit under a different license), as indicated
|
||||||
|
in the file; or
|
||||||
|
|
||||||
|
(c) The contribution was provided directly to me by some other
|
||||||
|
person who certified (a), (b) or (c) and I have not modified
|
||||||
|
it.
|
||||||
|
|
||||||
|
(d) I understand and agree that this project and the contribution
|
||||||
|
are public and that a record of the contribution (including all
|
||||||
|
personal information I submit with it, including my sign-off) is
|
||||||
|
maintained indefinitely and may be redistributed consistent with
|
||||||
|
this project or the open source license(s) involved.
|
||||||
|
```
|
||||||
|
|
||||||
|
If you agree to this for your contribution, then all that's needed is to
|
||||||
|
include the line in your commit or pull request comment:
|
||||||
|
|
||||||
|
```
|
||||||
|
Signed-off-by: Your Name <your@email.example.org>
|
||||||
|
```
|
||||||
|
|
||||||
|
We accept contributions under a legally identifiable name, such as
|
||||||
|
your name on government documentation or common-law names (names
|
||||||
|
claimed by legitimate usage or repute). Unfortunately, we cannot
|
||||||
|
accept anonymous contributions at this time.
|
||||||
|
|
||||||
|
Git allows you to add this signoff automatically when using the `-s`
|
||||||
|
flag to `git commit`, which uses the name and email set in your
|
||||||
|
`user.name` and `user.email` git configs.
|
||||||
|
|
||||||
|
|
||||||
|
# 10. Turn feedback into better code.
|
||||||
|
|
||||||
|
Once the Pull Request is opened, you will see a few things:
|
||||||
|
|
||||||
|
1. our automated CI (Continuous Integration) pipeline will run (again) the linters, the unit tests, the integration tests and more;
|
||||||
|
2. one or more of the developers will take a look at your Pull Request and offer feedback.
|
||||||
|
|
||||||
|
From this point, you should:
|
||||||
|
|
||||||
|
1. Look at the results of the CI pipeline.
|
||||||
|
- If there is any error, fix the error.
|
||||||
|
2. If a developer has requested changes, make these changes and let us know if it is ready for a developer to review again.
|
||||||
|
3. Create a new commit with the changes.
|
||||||
|
- Please do NOT overwrite the history. New commits make the reviewer's life easier.
|
||||||
|
- Push this commits to your Pull Request.
|
||||||
|
4. Back to 1.
|
||||||
|
|
||||||
|
Once both the CI and the developers are happy, the patch will be merged into Synapse and released shortly!
|
||||||
|
|
||||||
|
# 11. Find a new issue.
|
||||||
|
|
||||||
|
By now, you know the drill!
|
||||||
|
|
||||||
|
# Notes for maintainers on merging PRs etc
|
||||||
|
|
||||||
|
There are some notes for those with commit access to the project on how we
|
||||||
|
manage git [here](docs/dev/git.md).
|
||||||
|
|
||||||
|
# Conclusion
|
||||||
|
|
||||||
|
That's it! Matrix is a very open and collaborative project as you might expect
|
||||||
|
given our obsession with open communication. If we're going to successfully
|
||||||
|
matrix together all the fragmented communication technologies out there we are
|
||||||
|
reliant on contributions and collaboration from the community to do so. So
|
||||||
|
please get involved - and we hope you have as much fun hacking on Matrix as we
|
||||||
|
do!
|
||||||
|
|||||||
595
INSTALL.md
595
INSTALL.md
@@ -1,7 +1,594 @@
|
|||||||
# Installation Instructions
|
# Installation Instructions
|
||||||
|
|
||||||
This document has moved to the
|
There are 3 steps to follow under **Installation Instructions**.
|
||||||
[Synapse documentation website](https://matrix-org.github.io/synapse/latest/setup/installation.html).
|
|
||||||
Please update your links.
|
|
||||||
|
|
||||||
The markdown source is available in [docs/setup/installation.md](docs/setup/installation.md).
|
- [Installation Instructions](#installation-instructions)
|
||||||
|
- [Choosing your server name](#choosing-your-server-name)
|
||||||
|
- [Installing Synapse](#installing-synapse)
|
||||||
|
- [Installing from source](#installing-from-source)
|
||||||
|
- [Platform-specific prerequisites](#platform-specific-prerequisites)
|
||||||
|
- [Debian/Ubuntu/Raspbian](#debianubunturaspbian)
|
||||||
|
- [ArchLinux](#archlinux)
|
||||||
|
- [CentOS/Fedora](#centosfedora)
|
||||||
|
- [macOS](#macos)
|
||||||
|
- [OpenSUSE](#opensuse)
|
||||||
|
- [OpenBSD](#openbsd)
|
||||||
|
- [Windows](#windows)
|
||||||
|
- [Prebuilt packages](#prebuilt-packages)
|
||||||
|
- [Docker images and Ansible playbooks](#docker-images-and-ansible-playbooks)
|
||||||
|
- [Debian/Ubuntu](#debianubuntu)
|
||||||
|
- [Matrix.org packages](#matrixorg-packages)
|
||||||
|
- [Downstream Debian packages](#downstream-debian-packages)
|
||||||
|
- [Downstream Ubuntu packages](#downstream-ubuntu-packages)
|
||||||
|
- [Fedora](#fedora)
|
||||||
|
- [OpenSUSE](#opensuse-1)
|
||||||
|
- [SUSE Linux Enterprise Server](#suse-linux-enterprise-server)
|
||||||
|
- [ArchLinux](#archlinux-1)
|
||||||
|
- [Void Linux](#void-linux)
|
||||||
|
- [FreeBSD](#freebsd)
|
||||||
|
- [OpenBSD](#openbsd-1)
|
||||||
|
- [NixOS](#nixos)
|
||||||
|
- [Setting up Synapse](#setting-up-synapse)
|
||||||
|
- [Using PostgreSQL](#using-postgresql)
|
||||||
|
- [TLS certificates](#tls-certificates)
|
||||||
|
- [Client Well-Known URI](#client-well-known-uri)
|
||||||
|
- [Email](#email)
|
||||||
|
- [Registering a user](#registering-a-user)
|
||||||
|
- [Setting up a TURN server](#setting-up-a-turn-server)
|
||||||
|
- [URL previews](#url-previews)
|
||||||
|
- [Troubleshooting Installation](#troubleshooting-installation)
|
||||||
|
|
||||||
|
|
||||||
|
## Choosing your server name
|
||||||
|
|
||||||
|
It is important to choose the name for your server before you install Synapse,
|
||||||
|
because it cannot be changed later.
|
||||||
|
|
||||||
|
The server name determines the "domain" part of user-ids for users on your
|
||||||
|
server: these will all be of the format `@user:my.domain.name`. It also
|
||||||
|
determines how other matrix servers will reach yours for federation.
|
||||||
|
|
||||||
|
For a test configuration, set this to the hostname of your server. For a more
|
||||||
|
production-ready setup, you will probably want to specify your domain
|
||||||
|
(`example.com`) rather than a matrix-specific hostname here (in the same way
|
||||||
|
that your email address is probably `user@example.com` rather than
|
||||||
|
`user@email.example.com`) - but doing so may require more advanced setup: see
|
||||||
|
[Setting up Federation](docs/federate.md).
|
||||||
|
|
||||||
|
## Installing Synapse
|
||||||
|
|
||||||
|
### Installing from source
|
||||||
|
|
||||||
|
(Prebuilt packages are available for some platforms - see [Prebuilt packages](#prebuilt-packages).)
|
||||||
|
|
||||||
|
When installing from source please make sure that the [Platform-specific prerequisites](#platform-specific-prerequisites) are already installed.
|
||||||
|
|
||||||
|
System requirements:
|
||||||
|
|
||||||
|
- POSIX-compliant system (tested on Linux & OS X)
|
||||||
|
- Python 3.5.2 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
|
||||||
|
|
||||||
|
|
||||||
|
To install the Synapse homeserver run:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
mkdir -p ~/synapse
|
||||||
|
virtualenv -p python3 ~/synapse/env
|
||||||
|
source ~/synapse/env/bin/activate
|
||||||
|
pip install --upgrade pip
|
||||||
|
pip install --upgrade setuptools
|
||||||
|
pip install matrix-synapse
|
||||||
|
```
|
||||||
|
|
||||||
|
This will download Synapse from [PyPI](https://pypi.org/project/matrix-synapse)
|
||||||
|
and install it, along with the python libraries it uses, into a virtual environment
|
||||||
|
under `~/synapse/env`. Feel free to pick a different directory if you
|
||||||
|
prefer.
|
||||||
|
|
||||||
|
This Synapse installation can then be later upgraded by using pip again with the
|
||||||
|
update flag:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
source ~/synapse/env/bin/activate
|
||||||
|
pip install -U matrix-synapse
|
||||||
|
```
|
||||||
|
|
||||||
|
Before you can start Synapse, you will need to generate a configuration
|
||||||
|
file. To do this, run (in your virtualenv, as before):
|
||||||
|
|
||||||
|
```sh
|
||||||
|
cd ~/synapse
|
||||||
|
python -m synapse.app.homeserver \
|
||||||
|
--server-name my.domain.name \
|
||||||
|
--config-path homeserver.yaml \
|
||||||
|
--generate-config \
|
||||||
|
--report-stats=[yes|no]
|
||||||
|
```
|
||||||
|
|
||||||
|
... substituting an appropriate value for `--server-name`.
|
||||||
|
|
||||||
|
This command will generate you a config file that you can then customise, but it will
|
||||||
|
also generate a set of keys for you. These keys will allow your homeserver to
|
||||||
|
identify itself to other homeserver, so don't lose or delete them. It would be
|
||||||
|
wise to back them up somewhere safe. (If, for whatever reason, you do need to
|
||||||
|
change your homeserver's keys, you may find that other homeserver have the
|
||||||
|
old key cached. If you update the signing key, you should change the name of the
|
||||||
|
key in the `<server name>.signing.key` file (the second word) to something
|
||||||
|
different. See the [spec](https://matrix.org/docs/spec/server_server/latest.html#retrieving-server-keys) for more information on key management).
|
||||||
|
|
||||||
|
To actually run your new homeserver, pick a working directory for Synapse to
|
||||||
|
run (e.g. `~/synapse`), and:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
cd ~/synapse
|
||||||
|
source env/bin/activate
|
||||||
|
synctl start
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Platform-specific prerequisites
|
||||||
|
|
||||||
|
Synapse is written in Python but some of the libraries it uses are written in
|
||||||
|
C. So before we can install Synapse itself we need a working C compiler and the
|
||||||
|
header files for Python C extensions.
|
||||||
|
|
||||||
|
##### Debian/Ubuntu/Raspbian
|
||||||
|
|
||||||
|
Installing prerequisites on Ubuntu or Debian:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
sudo apt install build-essential python3-dev libffi-dev \
|
||||||
|
python3-pip python3-setuptools sqlite3 \
|
||||||
|
libssl-dev virtualenv libjpeg-dev libxslt1-dev
|
||||||
|
```
|
||||||
|
|
||||||
|
##### ArchLinux
|
||||||
|
|
||||||
|
Installing prerequisites on ArchLinux:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
sudo pacman -S base-devel python python-pip \
|
||||||
|
python-setuptools python-virtualenv sqlite3
|
||||||
|
```
|
||||||
|
|
||||||
|
##### CentOS/Fedora
|
||||||
|
|
||||||
|
Installing prerequisites on CentOS or Fedora Linux:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
sudo dnf install libtiff-devel libjpeg-devel libzip-devel freetype-devel \
|
||||||
|
libwebp-devel libxml2-devel libxslt-devel libpq-devel \
|
||||||
|
python3-virtualenv libffi-devel openssl-devel python3-devel
|
||||||
|
sudo dnf groupinstall "Development Tools"
|
||||||
|
```
|
||||||
|
|
||||||
|
##### macOS
|
||||||
|
|
||||||
|
Installing prerequisites on macOS:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
xcode-select --install
|
||||||
|
sudo easy_install pip
|
||||||
|
sudo pip install virtualenv
|
||||||
|
brew install pkg-config libffi
|
||||||
|
```
|
||||||
|
|
||||||
|
On macOS Catalina (10.15) you may need to explicitly install OpenSSL
|
||||||
|
via brew and inform `pip` about it so that `psycopg2` builds:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
brew install openssl@1.1
|
||||||
|
export LDFLAGS="-L/usr/local/opt/openssl/lib"
|
||||||
|
export CPPFLAGS="-I/usr/local/opt/openssl/include"
|
||||||
|
```
|
||||||
|
|
||||||
|
##### OpenSUSE
|
||||||
|
|
||||||
|
Installing prerequisites on openSUSE:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
sudo zypper in -t pattern devel_basis
|
||||||
|
sudo zypper in python-pip python-setuptools sqlite3 python-virtualenv \
|
||||||
|
python-devel libffi-devel libopenssl-devel libjpeg62-devel
|
||||||
|
```
|
||||||
|
|
||||||
|
##### OpenBSD
|
||||||
|
|
||||||
|
A port of Synapse is available under `net/synapse`. The filesystem
|
||||||
|
underlying the homeserver directory (defaults to `/var/synapse`) has to be
|
||||||
|
mounted with `wxallowed` (cf. `mount(8)`), so creating a separate filesystem
|
||||||
|
and mounting it to `/var/synapse` should be taken into consideration.
|
||||||
|
|
||||||
|
To be able to build Synapse's dependency on python the `WRKOBJDIR`
|
||||||
|
(cf. `bsd.port.mk(5)`) for building python, too, needs to be on a filesystem
|
||||||
|
mounted with `wxallowed` (cf. `mount(8)`).
|
||||||
|
|
||||||
|
Creating a `WRKOBJDIR` for building python under `/usr/local` (which on a
|
||||||
|
default OpenBSD installation is mounted with `wxallowed`):
|
||||||
|
|
||||||
|
```sh
|
||||||
|
doas mkdir /usr/local/pobj_wxallowed
|
||||||
|
```
|
||||||
|
|
||||||
|
Assuming `PORTS_PRIVSEP=Yes` (cf. `bsd.port.mk(5)`) and `SUDO=doas` are
|
||||||
|
configured in `/etc/mk.conf`:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
doas chown _pbuild:_pbuild /usr/local/pobj_wxallowed
|
||||||
|
```
|
||||||
|
|
||||||
|
Setting the `WRKOBJDIR` for building python:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
echo WRKOBJDIR_lang/python/3.7=/usr/local/pobj_wxallowed \\nWRKOBJDIR_lang/python/2.7=/usr/local/pobj_wxallowed >> /etc/mk.conf
|
||||||
|
```
|
||||||
|
|
||||||
|
Building Synapse:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
cd /usr/ports/net/synapse
|
||||||
|
make install
|
||||||
|
```
|
||||||
|
|
||||||
|
##### Windows
|
||||||
|
|
||||||
|
If you wish to run or develop Synapse on Windows, the Windows Subsystem For
|
||||||
|
Linux provides a Linux environment on Windows 10 which is capable of using the
|
||||||
|
Debian, Fedora, or source installation methods. More information about WSL can
|
||||||
|
be found at <https://docs.microsoft.com/en-us/windows/wsl/install-win10> for
|
||||||
|
Windows 10 and <https://docs.microsoft.com/en-us/windows/wsl/install-on-server>
|
||||||
|
for Windows Server.
|
||||||
|
|
||||||
|
### Prebuilt packages
|
||||||
|
|
||||||
|
As an alternative to installing from source, prebuilt packages are available
|
||||||
|
for a number of platforms.
|
||||||
|
|
||||||
|
#### Docker images and Ansible playbooks
|
||||||
|
|
||||||
|
There is an official synapse image available at
|
||||||
|
<https://hub.docker.com/r/matrixdotorg/synapse> which can be used with
|
||||||
|
the docker-compose file available at [contrib/docker](contrib/docker). Further
|
||||||
|
information on this including configuration options is available in the README
|
||||||
|
on hub.docker.com.
|
||||||
|
|
||||||
|
Alternatively, Andreas Peters (previously Silvio Fricke) has contributed a
|
||||||
|
Dockerfile to automate a synapse server in a single Docker image, at
|
||||||
|
<https://hub.docker.com/r/avhost/docker-matrix/tags/>
|
||||||
|
|
||||||
|
Slavi Pantaleev has created an Ansible playbook,
|
||||||
|
which installs the offical Docker image of Matrix Synapse
|
||||||
|
along with many other Matrix-related services (Postgres database, Element, coturn,
|
||||||
|
ma1sd, SSL support, etc.).
|
||||||
|
For more details, see
|
||||||
|
<https://github.com/spantaleev/matrix-docker-ansible-deploy>
|
||||||
|
|
||||||
|
#### Debian/Ubuntu
|
||||||
|
|
||||||
|
##### Matrix.org packages
|
||||||
|
|
||||||
|
Matrix.org provides Debian/Ubuntu packages of the latest stable version of
|
||||||
|
Synapse via <https://packages.matrix.org/debian/>. They are available for Debian
|
||||||
|
9 (Stretch), Ubuntu 16.04 (Xenial), and later. To use them:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
sudo apt install -y lsb-release wget apt-transport-https
|
||||||
|
sudo wget -O /usr/share/keyrings/matrix-org-archive-keyring.gpg https://packages.matrix.org/debian/matrix-org-archive-keyring.gpg
|
||||||
|
echo "deb [signed-by=/usr/share/keyrings/matrix-org-archive-keyring.gpg] https://packages.matrix.org/debian/ $(lsb_release -cs) main" |
|
||||||
|
sudo tee /etc/apt/sources.list.d/matrix-org.list
|
||||||
|
sudo apt update
|
||||||
|
sudo apt install matrix-synapse-py3
|
||||||
|
```
|
||||||
|
|
||||||
|
**Note**: if you followed a previous version of these instructions which
|
||||||
|
recommended using `apt-key add` to add an old key from
|
||||||
|
`https://matrix.org/packages/debian/`, you should note that this key has been
|
||||||
|
revoked. You should remove the old key with `sudo apt-key remove
|
||||||
|
C35EB17E1EAE708E6603A9B3AD0592FE47F0DF61`, and follow the above instructions to
|
||||||
|
update your configuration.
|
||||||
|
|
||||||
|
The fingerprint of the repository signing key (as shown by `gpg
|
||||||
|
/usr/share/keyrings/matrix-org-archive-keyring.gpg`) is
|
||||||
|
`AAF9AE843A7584B5A3E4CD2BCF45A512DE2DA058`.
|
||||||
|
|
||||||
|
##### Downstream Debian packages
|
||||||
|
|
||||||
|
We do not recommend using the packages from the default Debian `buster`
|
||||||
|
repository at this time, as they are old and suffer from known security
|
||||||
|
vulnerabilities. You can install the latest version of Synapse from
|
||||||
|
[our repository](#matrixorg-packages) or from `buster-backports`. Please
|
||||||
|
see the [Debian documentation](https://backports.debian.org/Instructions/)
|
||||||
|
for information on how to use backports.
|
||||||
|
|
||||||
|
If you are using Debian `sid` or testing, Synapse is available in the default
|
||||||
|
repositories and it should be possible to install it simply with:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
sudo apt install matrix-synapse
|
||||||
|
```
|
||||||
|
|
||||||
|
##### Downstream Ubuntu packages
|
||||||
|
|
||||||
|
We do not recommend using the packages in the default Ubuntu repository
|
||||||
|
at this time, as they are old and suffer from known security vulnerabilities.
|
||||||
|
The latest version of Synapse can be installed from [our repository](#matrixorg-packages).
|
||||||
|
|
||||||
|
#### Fedora
|
||||||
|
|
||||||
|
Synapse is in the Fedora repositories as `matrix-synapse`:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
sudo dnf install matrix-synapse
|
||||||
|
```
|
||||||
|
|
||||||
|
Oleg Girko provides Fedora RPMs at
|
||||||
|
<https://obs.infoserver.lv/project/monitor/matrix-synapse>
|
||||||
|
|
||||||
|
#### OpenSUSE
|
||||||
|
|
||||||
|
Synapse is in the OpenSUSE repositories as `matrix-synapse`:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
sudo zypper install matrix-synapse
|
||||||
|
```
|
||||||
|
|
||||||
|
#### SUSE Linux Enterprise Server
|
||||||
|
|
||||||
|
Unofficial package are built for SLES 15 in the openSUSE:Backports:SLE-15 repository at
|
||||||
|
<https://download.opensuse.org/repositories/openSUSE:/Backports:/SLE-15/standard/>
|
||||||
|
|
||||||
|
#### ArchLinux
|
||||||
|
|
||||||
|
The quickest way to get up and running with ArchLinux is probably with the community package
|
||||||
|
<https://www.archlinux.org/packages/community/any/matrix-synapse/>, which should pull in most of
|
||||||
|
the necessary dependencies.
|
||||||
|
|
||||||
|
pip may be outdated (6.0.7-1 and needs to be upgraded to 6.0.8-1 ):
|
||||||
|
|
||||||
|
```sh
|
||||||
|
sudo pip install --upgrade pip
|
||||||
|
```
|
||||||
|
|
||||||
|
If you encounter an error with lib bcrypt causing an Wrong ELF Class:
|
||||||
|
ELFCLASS32 (x64 Systems), you may need to reinstall py-bcrypt to correctly
|
||||||
|
compile it under the right architecture. (This should not be needed if
|
||||||
|
installing under virtualenv):
|
||||||
|
|
||||||
|
```sh
|
||||||
|
sudo pip uninstall py-bcrypt
|
||||||
|
sudo pip install py-bcrypt
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Void Linux
|
||||||
|
|
||||||
|
Synapse can be found in the void repositories as 'synapse':
|
||||||
|
|
||||||
|
```sh
|
||||||
|
xbps-install -Su
|
||||||
|
xbps-install -S synapse
|
||||||
|
```
|
||||||
|
|
||||||
|
#### FreeBSD
|
||||||
|
|
||||||
|
Synapse can be installed via FreeBSD Ports or Packages contributed by Brendan Molloy from:
|
||||||
|
|
||||||
|
- Ports: `cd /usr/ports/net-im/py-matrix-synapse && make install clean`
|
||||||
|
- Packages: `pkg install py37-matrix-synapse`
|
||||||
|
|
||||||
|
#### OpenBSD
|
||||||
|
|
||||||
|
As of OpenBSD 6.7 Synapse is available as a pre-compiled binary. The filesystem
|
||||||
|
underlying the homeserver directory (defaults to `/var/synapse`) has to be
|
||||||
|
mounted with `wxallowed` (cf. `mount(8)`), so creating a separate filesystem
|
||||||
|
and mounting it to `/var/synapse` should be taken into consideration.
|
||||||
|
|
||||||
|
Installing Synapse:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
doas pkg_add synapse
|
||||||
|
```
|
||||||
|
|
||||||
|
#### NixOS
|
||||||
|
|
||||||
|
Robin Lambertz has packaged Synapse for NixOS at:
|
||||||
|
<https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/services/misc/matrix-synapse.nix>
|
||||||
|
|
||||||
|
## Setting up Synapse
|
||||||
|
|
||||||
|
Once you have installed synapse as above, you will need to configure it.
|
||||||
|
|
||||||
|
### Using PostgreSQL
|
||||||
|
|
||||||
|
By default Synapse uses [SQLite](https://sqlite.org/) and in doing so trades performance for convenience.
|
||||||
|
SQLite is only recommended in Synapse for testing purposes or for servers with
|
||||||
|
very light workloads.
|
||||||
|
|
||||||
|
Almost all installations should opt to use [PostgreSQL](https://www.postgresql.org). Advantages include:
|
||||||
|
|
||||||
|
- significant performance improvements due to the superior threading and
|
||||||
|
caching model, smarter query optimiser
|
||||||
|
- allowing the DB to be run on separate hardware
|
||||||
|
|
||||||
|
For information on how to install and use PostgreSQL in Synapse, please see
|
||||||
|
[docs/postgres.md](docs/postgres.md)
|
||||||
|
|
||||||
|
### TLS certificates
|
||||||
|
|
||||||
|
The default configuration exposes a single HTTP port on the local
|
||||||
|
interface: `http://localhost:8008`. It is suitable for local testing,
|
||||||
|
but for any practical use, you will need Synapse's APIs to be served
|
||||||
|
over HTTPS.
|
||||||
|
|
||||||
|
The recommended way to do so is to set up a reverse proxy on port
|
||||||
|
`8448`. You can find documentation on doing so in
|
||||||
|
[docs/reverse_proxy.md](docs/reverse_proxy.md).
|
||||||
|
|
||||||
|
Alternatively, you can configure Synapse to expose an HTTPS port. To do
|
||||||
|
so, you will need to edit `homeserver.yaml`, as follows:
|
||||||
|
|
||||||
|
- First, under the `listeners` section, uncomment the configuration for the
|
||||||
|
TLS-enabled listener. (Remove the hash sign (`#`) at the start of
|
||||||
|
each line). The relevant lines are like this:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
- port: 8448
|
||||||
|
type: http
|
||||||
|
tls: true
|
||||||
|
resources:
|
||||||
|
- names: [client, federation]
|
||||||
|
```
|
||||||
|
|
||||||
|
- You will also need to uncomment the `tls_certificate_path` and
|
||||||
|
`tls_private_key_path` lines under the `TLS` section. You will need to manage
|
||||||
|
provisioning of these certificates yourself — Synapse had built-in ACME
|
||||||
|
support, but the ACMEv1 protocol Synapse implements is deprecated, not
|
||||||
|
allowed by LetsEncrypt for new sites, and will break for existing sites in
|
||||||
|
late 2020. See [ACME.md](docs/ACME.md).
|
||||||
|
|
||||||
|
If you are using your own certificate, be sure to use a `.pem` file that
|
||||||
|
includes the full certificate chain including any intermediate certificates
|
||||||
|
(for instance, if using certbot, use `fullchain.pem` as your certificate, not
|
||||||
|
`cert.pem`).
|
||||||
|
|
||||||
|
For a more detailed guide to configuring your server for federation, see
|
||||||
|
[federate.md](docs/federate.md).
|
||||||
|
|
||||||
|
### Client Well-Known URI
|
||||||
|
|
||||||
|
Setting up the client Well-Known URI is optional but if you set it up, it will
|
||||||
|
allow users to enter their full username (e.g. `@user:<server_name>`) into clients
|
||||||
|
which support well-known lookup to automatically configure the homeserver and
|
||||||
|
identity server URLs. This is useful so that users don't have to memorize or think
|
||||||
|
about the actual homeserver URL you are using.
|
||||||
|
|
||||||
|
The URL `https://<server_name>/.well-known/matrix/client` should return JSON in
|
||||||
|
the following format.
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"m.homeserver": {
|
||||||
|
"base_url": "https://<matrix.example.com>"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
It can optionally contain identity server information as well.
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"m.homeserver": {
|
||||||
|
"base_url": "https://<matrix.example.com>"
|
||||||
|
},
|
||||||
|
"m.identity_server": {
|
||||||
|
"base_url": "https://<identity.example.com>"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
To work in browser based clients, the file must be served with the appropriate
|
||||||
|
Cross-Origin Resource Sharing (CORS) headers. A recommended value would be
|
||||||
|
`Access-Control-Allow-Origin: *` which would allow all browser based clients to
|
||||||
|
view it.
|
||||||
|
|
||||||
|
In nginx this would be something like:
|
||||||
|
|
||||||
|
```nginx
|
||||||
|
location /.well-known/matrix/client {
|
||||||
|
return 200 '{"m.homeserver": {"base_url": "https://<matrix.example.com>"}}';
|
||||||
|
default_type application/json;
|
||||||
|
add_header Access-Control-Allow-Origin *;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
You should also ensure the `public_baseurl` option in `homeserver.yaml` is set
|
||||||
|
correctly. `public_baseurl` should be set to the URL that clients will use to
|
||||||
|
connect to your server. This is the same URL you put for the `m.homeserver`
|
||||||
|
`base_url` above.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
public_baseurl: "https://<matrix.example.com>"
|
||||||
|
```
|
||||||
|
|
||||||
|
### Email
|
||||||
|
|
||||||
|
It is desirable for Synapse to have the capability to send email. This allows
|
||||||
|
Synapse to send password reset emails, send verifications when an email address
|
||||||
|
is added to a user's account, and send email notifications to users when they
|
||||||
|
receive new messages.
|
||||||
|
|
||||||
|
To configure an SMTP server for Synapse, modify the configuration section
|
||||||
|
headed `email`, and be sure to have at least the `smtp_host`, `smtp_port`
|
||||||
|
and `notif_from` fields filled out. You may also need to set `smtp_user`,
|
||||||
|
`smtp_pass`, and `require_transport_security`.
|
||||||
|
|
||||||
|
If email is not configured, password reset, registration and notifications via
|
||||||
|
email will be disabled.
|
||||||
|
|
||||||
|
### Registering a user
|
||||||
|
|
||||||
|
The easiest way to create a new user is to do so from a client like [Element](https://element.io/).
|
||||||
|
|
||||||
|
Alternatively, you can do so from the command line. This can be done as follows:
|
||||||
|
|
||||||
|
1. If synapse was installed via pip, activate the virtualenv as follows (if Synapse was
|
||||||
|
installed via a prebuilt package, `register_new_matrix_user` should already be
|
||||||
|
on the search path):
|
||||||
|
```sh
|
||||||
|
cd ~/synapse
|
||||||
|
source env/bin/activate
|
||||||
|
synctl start # if not already running
|
||||||
|
```
|
||||||
|
2. Run the following command:
|
||||||
|
```sh
|
||||||
|
register_new_matrix_user -c homeserver.yaml http://localhost:8008
|
||||||
|
```
|
||||||
|
|
||||||
|
This will prompt you to add details for the new user, and will then connect to
|
||||||
|
the running Synapse to create the new user. For example:
|
||||||
|
```
|
||||||
|
New user localpart: erikj
|
||||||
|
Password:
|
||||||
|
Confirm password:
|
||||||
|
Make admin [no]:
|
||||||
|
Success!
|
||||||
|
```
|
||||||
|
|
||||||
|
This process uses a setting `registration_shared_secret` in
|
||||||
|
`homeserver.yaml`, which is shared between Synapse itself and the
|
||||||
|
`register_new_matrix_user` script. It doesn't matter what it is (a random
|
||||||
|
value is generated by `--generate-config`), but it should be kept secret, as
|
||||||
|
anyone with knowledge of it can register users, including admin accounts,
|
||||||
|
on your server even if `enable_registration` is `false`.
|
||||||
|
|
||||||
|
### Setting up a TURN server
|
||||||
|
|
||||||
|
For reliable VoIP calls to be routed via this homeserver, you MUST configure
|
||||||
|
a TURN server. See [docs/turn-howto.md](docs/turn-howto.md) for details.
|
||||||
|
|
||||||
|
### URL previews
|
||||||
|
|
||||||
|
Synapse includes support for previewing URLs, which is disabled by default. To
|
||||||
|
turn it on you must enable the `url_preview_enabled: True` config parameter
|
||||||
|
and explicitly specify the IP ranges that Synapse is not allowed to spider for
|
||||||
|
previewing in the `url_preview_ip_range_blacklist` configuration parameter.
|
||||||
|
This is critical from a security perspective to stop arbitrary Matrix users
|
||||||
|
spidering 'internal' URLs on your network. At the very least we recommend that
|
||||||
|
your loopback and RFC1918 IP addresses are blacklisted.
|
||||||
|
|
||||||
|
This also requires the optional `lxml` python dependency to be installed. This
|
||||||
|
in turn requires the `libxml2` library to be available - on Debian/Ubuntu this
|
||||||
|
means `apt-get install libxml2-dev`, or equivalent for your OS.
|
||||||
|
|
||||||
|
### Troubleshooting Installation
|
||||||
|
|
||||||
|
`pip` seems to leak *lots* of memory during installation. For instance, a Linux
|
||||||
|
host with 512MB of RAM may run out of memory whilst installing Twisted. If this
|
||||||
|
happens, you will have to individually install the dependencies which are
|
||||||
|
failing, e.g.:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
pip install twisted
|
||||||
|
```
|
||||||
|
|
||||||
|
If you have any other problems, feel free to ask in
|
||||||
|
[#synapse:matrix.org](https://matrix.to/#/#synapse:matrix.org).
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ include demo/demo.tls.dh
|
|||||||
include demo/*.py
|
include demo/*.py
|
||||||
include demo/*.sh
|
include demo/*.sh
|
||||||
|
|
||||||
include synapse/py.typed
|
|
||||||
recursive-include synapse/storage *.sql
|
recursive-include synapse/storage *.sql
|
||||||
recursive-include synapse/storage *.sql.postgres
|
recursive-include synapse/storage *.sql.postgres
|
||||||
recursive-include synapse/storage *.sql.sqlite
|
recursive-include synapse/storage *.sql.sqlite
|
||||||
@@ -41,13 +40,12 @@ exclude mypy.ini
|
|||||||
exclude sytest-blacklist
|
exclude sytest-blacklist
|
||||||
exclude test_postgresql.sh
|
exclude test_postgresql.sh
|
||||||
|
|
||||||
include book.toml
|
|
||||||
include pyproject.toml
|
include pyproject.toml
|
||||||
recursive-include changelog.d *
|
recursive-include changelog.d *
|
||||||
|
|
||||||
|
prune .buildkite
|
||||||
prune .circleci
|
prune .circleci
|
||||||
prune .github
|
prune .github
|
||||||
prune .ci
|
|
||||||
prune contrib
|
prune contrib
|
||||||
prune debian
|
prune debian
|
||||||
prune demo/etc
|
prune demo/etc
|
||||||
|
|||||||
144
README.rst
144
README.rst
@@ -1,6 +1,6 @@
|
|||||||
=========================================================================
|
=========================================================
|
||||||
Synapse |support| |development| |documentation| |license| |pypi| |python|
|
Synapse |support| |development| |license| |pypi| |python|
|
||||||
=========================================================================
|
=========================================================
|
||||||
|
|
||||||
.. contents::
|
.. contents::
|
||||||
|
|
||||||
@@ -25,7 +25,7 @@ The overall architecture is::
|
|||||||
|
|
||||||
``#matrix:matrix.org`` is the official support room for Matrix, and can be
|
``#matrix:matrix.org`` is the official support room for Matrix, and can be
|
||||||
accessed by any client from https://matrix.org/docs/projects/try-matrix-now.html or
|
accessed by any client from https://matrix.org/docs/projects/try-matrix-now.html or
|
||||||
via IRC bridge at irc://irc.libera.chat/matrix.
|
via IRC bridge at irc://irc.freenode.net/matrix.
|
||||||
|
|
||||||
Synapse is currently in rapid development, but as of version 0.5 we believe it
|
Synapse is currently in rapid development, but as of version 0.5 we believe it
|
||||||
is sufficiently stable to be run as an internet-facing service for real usage!
|
is sufficiently stable to be run as an internet-facing service for real usage!
|
||||||
@@ -55,8 +55,11 @@ solutions. The hope is for Matrix to act as the building blocks for a new
|
|||||||
generation of fully open and interoperable messaging and VoIP apps for the
|
generation of fully open and interoperable messaging and VoIP apps for the
|
||||||
internet.
|
internet.
|
||||||
|
|
||||||
Synapse is a Matrix "homeserver" implementation developed by the matrix.org core
|
Synapse is a reference "homeserver" implementation of Matrix from the core
|
||||||
team, written in Python 3/Twisted.
|
development team at matrix.org, written in Python/Twisted. It is intended to
|
||||||
|
showcase the concept of Matrix and let folks see the spec in the context of a
|
||||||
|
codebase and let you run your own homeserver and generally help bootstrap the
|
||||||
|
ecosystem.
|
||||||
|
|
||||||
In Matrix, every user runs one or more Matrix clients, which connect through to
|
In Matrix, every user runs one or more Matrix clients, which connect through to
|
||||||
a Matrix homeserver. The homeserver stores all their personal chat history and
|
a Matrix homeserver. The homeserver stores all their personal chat history and
|
||||||
@@ -82,22 +85,16 @@ For support installing or managing Synapse, please join |room|_ (from a matrix.o
|
|||||||
account if necessary) and ask questions there. We do not use GitHub issues for
|
account if necessary) and ask questions there. We do not use GitHub issues for
|
||||||
support requests, only for bug reports and feature requests.
|
support requests, only for bug reports and feature requests.
|
||||||
|
|
||||||
Synapse's documentation is `nicely rendered on GitHub Pages <https://matrix-org.github.io/synapse>`_,
|
|
||||||
with its source available in |docs|_.
|
|
||||||
|
|
||||||
.. |room| replace:: ``#synapse:matrix.org``
|
.. |room| replace:: ``#synapse:matrix.org``
|
||||||
.. _room: https://matrix.to/#/#synapse:matrix.org
|
.. _room: https://matrix.to/#/#synapse:matrix.org
|
||||||
|
|
||||||
.. |docs| replace:: ``docs``
|
|
||||||
.. _docs: docs
|
|
||||||
|
|
||||||
Synapse Installation
|
Synapse Installation
|
||||||
====================
|
====================
|
||||||
|
|
||||||
.. _federation:
|
.. _federation:
|
||||||
|
|
||||||
* For details on how to install synapse, see
|
* For details on how to install synapse, see `<INSTALL.md>`_.
|
||||||
`Installation Instructions <https://matrix-org.github.io/synapse/latest/setup/installation.html>`_.
|
|
||||||
* For specific details on how to configure Synapse for federation see `docs/federate.md <docs/federate.md>`_
|
* For specific details on how to configure Synapse for federation see `docs/federate.md <docs/federate.md>`_
|
||||||
|
|
||||||
|
|
||||||
@@ -109,8 +106,7 @@ from a web client.
|
|||||||
|
|
||||||
Unless you are running a test instance of Synapse on your local machine, in
|
Unless you are running a test instance of Synapse on your local machine, in
|
||||||
general, you will need to enable TLS support before you can successfully
|
general, you will need to enable TLS support before you can successfully
|
||||||
connect from a client: see
|
connect from a client: see `<INSTALL.md#tls-certificates>`_.
|
||||||
`TLS certificates <https://matrix-org.github.io/synapse/latest/setup/installation.html#tls-certificates>`_.
|
|
||||||
|
|
||||||
An easy way to get started is to login or register via Element at
|
An easy way to get started is to login or register via Element at
|
||||||
https://app.element.io/#/login or https://app.element.io/#/register respectively.
|
https://app.element.io/#/login or https://app.element.io/#/register respectively.
|
||||||
@@ -146,55 +142,38 @@ the form of::
|
|||||||
As when logging in, you will need to specify a "Custom server". Specify your
|
As when logging in, you will need to specify a "Custom server". Specify your
|
||||||
desired ``localpart`` in the 'User name' box.
|
desired ``localpart`` in the 'User name' box.
|
||||||
|
|
||||||
Security note
|
ACME setup
|
||||||
|
==========
|
||||||
|
|
||||||
|
For details on having Synapse manage your federation TLS certificates
|
||||||
|
automatically, please see `<docs/ACME.md>`_.
|
||||||
|
|
||||||
|
|
||||||
|
Security Note
|
||||||
=============
|
=============
|
||||||
|
|
||||||
Matrix serves raw, user-supplied data in some APIs -- specifically the `content
|
Matrix serves raw user generated data in some APIs - specifically the `content
|
||||||
repository endpoints`_.
|
repository endpoints <https://matrix.org/docs/spec/client_server/latest.html#get-matrix-media-r0-download-servername-mediaid>`_.
|
||||||
|
|
||||||
.. _content repository endpoints: https://matrix.org/docs/spec/client_server/latest.html#get-matrix-media-r0-download-servername-mediaid
|
Whilst we have tried to mitigate against possible XSS attacks (e.g.
|
||||||
|
https://github.com/matrix-org/synapse/pull/1021) we recommend running
|
||||||
|
matrix homeservers on a dedicated domain name, to limit any malicious user generated
|
||||||
|
content served to web browsers a matrix API from being able to attack webapps hosted
|
||||||
|
on the same domain. This is particularly true of sharing a matrix webclient and
|
||||||
|
server on the same domain.
|
||||||
|
|
||||||
Whilst we make a reasonable effort to mitigate against XSS attacks (for
|
See https://github.com/vector-im/riot-web/issues/1977 and
|
||||||
instance, by using `CSP`_), a Matrix homeserver should not be hosted on a
|
https://developer.github.com/changes/2014-04-25-user-content-security for more details.
|
||||||
domain hosting other web applications. This especially applies to sharing
|
|
||||||
the domain with Matrix web clients and other sensitive applications like
|
|
||||||
webmail. See
|
|
||||||
https://developer.github.com/changes/2014-04-25-user-content-security for more
|
|
||||||
information.
|
|
||||||
|
|
||||||
.. _CSP: https://github.com/matrix-org/synapse/pull/1021
|
|
||||||
|
|
||||||
Ideally, the homeserver should not simply be on a different subdomain, but on
|
|
||||||
a completely different `registered domain`_ (also known as top-level site or
|
|
||||||
eTLD+1). This is because `some attacks`_ are still possible as long as the two
|
|
||||||
applications share the same registered domain.
|
|
||||||
|
|
||||||
.. _registered domain: https://tools.ietf.org/html/draft-ietf-httpbis-rfc6265bis-03#section-2.3
|
|
||||||
|
|
||||||
.. _some attacks: https://en.wikipedia.org/wiki/Session_fixation#Attacks_using_cross-subdomain_cookie
|
|
||||||
|
|
||||||
To illustrate this with an example, if your Element Web or other sensitive web
|
|
||||||
application is hosted on ``A.example1.com``, you should ideally host Synapse on
|
|
||||||
``example2.com``. Some amount of protection is offered by hosting on
|
|
||||||
``B.example1.com`` instead, so this is also acceptable in some scenarios.
|
|
||||||
However, you should *not* host your Synapse on ``A.example1.com``.
|
|
||||||
|
|
||||||
Note that all of the above refers exclusively to the domain used in Synapse's
|
|
||||||
``public_baseurl`` setting. In particular, it has no bearing on the domain
|
|
||||||
mentioned in MXIDs hosted on that server.
|
|
||||||
|
|
||||||
Following this advice ensures that even if an XSS is found in Synapse, the
|
|
||||||
impact to other applications will be minimal.
|
|
||||||
|
|
||||||
|
|
||||||
Upgrading an existing Synapse
|
Upgrading an existing Synapse
|
||||||
=============================
|
=============================
|
||||||
|
|
||||||
The instructions for upgrading synapse are in `the upgrade notes`_.
|
The instructions for upgrading synapse are in `UPGRADE.rst`_.
|
||||||
Please check these instructions as upgrading may require extra steps for some
|
Please check these instructions as upgrading may require extra steps for some
|
||||||
versions of synapse.
|
versions of synapse.
|
||||||
|
|
||||||
.. _the upgrade notes: https://matrix-org.github.io/synapse/develop/upgrade.html
|
.. _UPGRADE.rst: UPGRADE.rst
|
||||||
|
|
||||||
.. _reverse-proxy:
|
.. _reverse-proxy:
|
||||||
|
|
||||||
@@ -265,27 +244,11 @@ Then update the ``users`` table in the database::
|
|||||||
Synapse Development
|
Synapse Development
|
||||||
===================
|
===================
|
||||||
|
|
||||||
The best place to get started is our
|
Join our developer community on Matrix: `#synapse-dev:matrix.org <https://matrix.to/#/#synapse-dev:matrix.org>`_
|
||||||
`guide for contributors <https://matrix-org.github.io/synapse/latest/development/contributing_guide.html>`_.
|
|
||||||
This is part of our larger `documentation <https://matrix-org.github.io/synapse/latest>`_, which includes
|
|
||||||
information for synapse developers as well as synapse administrators.
|
|
||||||
|
|
||||||
Developers might be particularly interested in:
|
|
||||||
|
|
||||||
* `Synapse's database schema <https://matrix-org.github.io/synapse/latest/development/database_schema.html>`_,
|
|
||||||
* `notes on Synapse's implementation details <https://matrix-org.github.io/synapse/latest/development/internal_documentation/index.html>`_, and
|
|
||||||
* `how we use git <https://matrix-org.github.io/synapse/latest/development/git.html>`_.
|
|
||||||
|
|
||||||
Alongside all that, join our developer community on Matrix:
|
|
||||||
`#synapse-dev:matrix.org <https://matrix.to/#/#synapse-dev:matrix.org>`_, featuring real humans!
|
|
||||||
|
|
||||||
|
|
||||||
Quick start
|
|
||||||
-----------
|
|
||||||
|
|
||||||
Before setting up a development environment for synapse, make sure you have the
|
Before setting up a development environment for synapse, make sure you have the
|
||||||
system dependencies (such as the python header files) installed - see
|
system dependencies (such as the python header files) installed - see
|
||||||
`Platform-specific prerequisites <https://matrix-org.github.io/synapse/latest/setup/installation.html#platform-specific-prerequisites>`_.
|
`Installing from source <INSTALL.md#installing-from-source>`_.
|
||||||
|
|
||||||
To check out a synapse for development, clone the git repo into a working
|
To check out a synapse for development, clone the git repo into a working
|
||||||
directory of your choice::
|
directory of your choice::
|
||||||
@@ -298,7 +261,7 @@ to install using pip and a virtualenv::
|
|||||||
|
|
||||||
python3 -m venv ./env
|
python3 -m venv ./env
|
||||||
source ./env/bin/activate
|
source ./env/bin/activate
|
||||||
pip install -e ".[all,dev]"
|
pip install -e ".[all,test]"
|
||||||
|
|
||||||
This will run a process of downloading and installing all the needed
|
This will run a process of downloading and installing all the needed
|
||||||
dependencies into a virtual env. If any dependencies fail to install,
|
dependencies into a virtual env. If any dependencies fail to install,
|
||||||
@@ -306,6 +269,18 @@ try installing the failing modules individually::
|
|||||||
|
|
||||||
pip install -e "module-name"
|
pip install -e "module-name"
|
||||||
|
|
||||||
|
Once this is done, you may wish to run Synapse's unit tests to
|
||||||
|
check that everything is installed correctly::
|
||||||
|
|
||||||
|
python -m twisted.trial tests
|
||||||
|
|
||||||
|
This should end with a 'PASSED' result (note that exact numbers will
|
||||||
|
differ)::
|
||||||
|
|
||||||
|
Ran 1337 tests in 716.064s
|
||||||
|
|
||||||
|
PASSED (skips=15, successes=1322)
|
||||||
|
|
||||||
We recommend using the demo which starts 3 federated instances running on ports `8080` - `8082`
|
We recommend using the demo which starts 3 federated instances running on ports `8080` - `8082`
|
||||||
|
|
||||||
./demo/start.sh
|
./demo/start.sh
|
||||||
@@ -325,27 +300,10 @@ If you just want to start a single instance of the app and run it directly::
|
|||||||
python -m synapse.app.homeserver --config-path homeserver.yaml
|
python -m synapse.app.homeserver --config-path homeserver.yaml
|
||||||
|
|
||||||
|
|
||||||
Running the unit tests
|
|
||||||
----------------------
|
|
||||||
|
|
||||||
After getting up and running, you may wish to run Synapse's unit tests to
|
|
||||||
check that everything is installed correctly::
|
|
||||||
|
|
||||||
trial tests
|
|
||||||
|
|
||||||
This should end with a 'PASSED' result (note that exact numbers will
|
|
||||||
differ)::
|
|
||||||
|
|
||||||
Ran 1337 tests in 716.064s
|
|
||||||
|
|
||||||
PASSED (skips=15, successes=1322)
|
|
||||||
|
|
||||||
For more tips on running the unit tests, like running a specific test or
|
|
||||||
to see the logging output, see the `CONTRIBUTING doc <CONTRIBUTING.md#run-the-unit-tests>`_.
|
|
||||||
|
|
||||||
|
|
||||||
Running the Integration Tests
|
Running the Integration Tests
|
||||||
-----------------------------
|
=============================
|
||||||
|
|
||||||
Synapse is accompanied by `SyTest <https://github.com/matrix-org/sytest>`_,
|
Synapse is accompanied by `SyTest <https://github.com/matrix-org/sytest>`_,
|
||||||
a Matrix homeserver integration testing suite, which uses HTTP requests to
|
a Matrix homeserver integration testing suite, which uses HTTP requests to
|
||||||
@@ -353,8 +311,8 @@ access the API as a Matrix client would. It is able to run Synapse directly from
|
|||||||
the source tree, so installation of the server is not required.
|
the source tree, so installation of the server is not required.
|
||||||
|
|
||||||
Testing with SyTest is recommended for verifying that changes related to the
|
Testing with SyTest is recommended for verifying that changes related to the
|
||||||
Client-Server API are functioning correctly. See the `SyTest installation
|
Client-Server API are functioning correctly. See the `installation instructions
|
||||||
instructions <https://github.com/matrix-org/sytest#installing>`_ for details.
|
<https://github.com/matrix-org/sytest#installing>`_ for details.
|
||||||
|
|
||||||
|
|
||||||
Platform dependencies
|
Platform dependencies
|
||||||
@@ -463,10 +421,6 @@ This is normally caused by a misconfiguration in your reverse-proxy. See
|
|||||||
:alt: (discuss development on #synapse-dev:matrix.org)
|
:alt: (discuss development on #synapse-dev:matrix.org)
|
||||||
:target: https://matrix.to/#/#synapse-dev:matrix.org
|
:target: https://matrix.to/#/#synapse-dev:matrix.org
|
||||||
|
|
||||||
.. |documentation| image:: https://img.shields.io/badge/documentation-%E2%9C%93-success
|
|
||||||
:alt: (Rendered documentation on GitHub Pages)
|
|
||||||
:target: https://matrix-org.github.io/synapse/latest/
|
|
||||||
|
|
||||||
.. |license| image:: https://img.shields.io/github/license/matrix-org/synapse
|
.. |license| image:: https://img.shields.io/github/license/matrix-org/synapse
|
||||||
:alt: (check license in LICENSE file)
|
:alt: (check license in LICENSE file)
|
||||||
:target: LICENSE
|
:target: LICENSE
|
||||||
|
|||||||
1326
UPGRADE.rst
1326
UPGRADE.rst
File diff suppressed because it is too large
Load Diff
39
book.toml
39
book.toml
@@ -1,39 +0,0 @@
|
|||||||
# Documentation for possible options in this file is at
|
|
||||||
# https://rust-lang.github.io/mdBook/format/config.html
|
|
||||||
[book]
|
|
||||||
title = "Synapse"
|
|
||||||
authors = ["The Matrix.org Foundation C.I.C."]
|
|
||||||
language = "en"
|
|
||||||
multilingual = false
|
|
||||||
|
|
||||||
# The directory that documentation files are stored in
|
|
||||||
src = "docs"
|
|
||||||
|
|
||||||
[build]
|
|
||||||
# Prevent markdown pages from being automatically generated when they're
|
|
||||||
# linked to in SUMMARY.md
|
|
||||||
create-missing = false
|
|
||||||
|
|
||||||
[output.html]
|
|
||||||
# The URL visitors will be directed to when they try to edit a page
|
|
||||||
edit-url-template = "https://github.com/matrix-org/synapse/edit/develop/{path}"
|
|
||||||
|
|
||||||
# Remove the numbers that appear before each item in the sidebar, as they can
|
|
||||||
# get quite messy as we nest deeper
|
|
||||||
no-section-label = true
|
|
||||||
|
|
||||||
# The source code URL of the repository
|
|
||||||
git-repository-url = "https://github.com/matrix-org/synapse"
|
|
||||||
|
|
||||||
# The path that the docs are hosted on
|
|
||||||
site-url = "/synapse/"
|
|
||||||
|
|
||||||
# Additional HTML, JS, CSS that's injected into each page of the book.
|
|
||||||
# More information available in docs/website_files/README.md
|
|
||||||
additional-css = [
|
|
||||||
"docs/website_files/table-of-contents.css",
|
|
||||||
"docs/website_files/remove-nav-buttons.css",
|
|
||||||
"docs/website_files/indent-section-headers.css",
|
|
||||||
]
|
|
||||||
additional-js = ["docs/website_files/table-of-contents.js"]
|
|
||||||
theme = "docs/website_files/theme"
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
Fix a long-standing issue which could cause Synapse to incorrectly accept data in the unsigned field of events
|
|
||||||
received over federation.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
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.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
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).
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
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).
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Fix a performance regression in `/sync` handling, introduced in 1.49.0.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Fix a long-standing bug where Synapse wouldn't cache a response indicating that a remote user has no devices.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Fix an error in to get federation status of a destination server even if no error has occurred. This admin API was new introduced in Synapse 1.49.0.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Avoid database access in the JSON serialization process.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Include the bundled aggregations in the `/sync` response, per [MSC2675](https://github.com/matrix-org/matrix-doc/pull/2675).
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Fix `/_matrix/client/v1/room/{roomId}/hierarchy` endpoint returning incorrect fields which have been present since Synapse 1.49.0.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Fix preview of some gif URLs (like tenor.com). Contributed by Philippe Daouadi.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Return an `M_FORBIDDEN` error code instead of `M_UNKNOWN` when a spam checker module prevents a user from creating a room.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Add a flag to the `synapse_review_recent_signups` script to ignore and filter appservice users.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Remove the unstable `/send_relation` endpoint.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Run `pyupgrade --py37-plus --keep-percent-format` on Synapse.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Warn against using a Let's Encrypt certificate for TLS/DTLS TURN server client connections, and suggest using ZeroSSL certificate instead. This bypasses client-side connectivity errors caused by WebRTC libraries that reject Let's Encrypt certificates. Contibuted by @AndrewFerr.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Use buildkit's cache feature to speed up docker builds.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Use `auto_attribs` and native type hints for attrs classes.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Remove debug logging for #4422, which has been closed since Synapse 0.99.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Fix a bug where the 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.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Remove fallback code for Python 2.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Add a test for [an edge case](https://github.com/matrix-org/synapse/pull/11532#discussion_r769104461) in the `/sync` logic.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Add the option to write sqlite test dbs to disk when running tests.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Improve Complement test output for Gitub Actions.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
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.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Fix a typechecker problem related to our (ab)use of `nacl.signing.SigningKey`s.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Document the new `SYNAPSE_TEST_PERSIST_SQLITE_DB` environment variable in the contributing guide.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Fix docstring on `add_account_data_for_user`.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Complement environment variable name change and update `.gitignore`.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Simplify calculation of prometheus metrics for garbage collection.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Improve accuracy of `python_twisted_reactor_tick_time` prometheus metric.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Remove `python_twisted_reactor_pending_calls` prometheus metric.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Document that now the minimum supported PostgreSQL version is 10.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Fix typo in demo docs: differnt.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Make the list rooms admin api sort stable. Contributed by Daniël Sonck.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Update room spec url in config files.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Mention python3-venv and libpq-dev dependencies in contribution guide.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Minor efficiency improvements when inserting many values into the database.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Invite PR authors to give themselves credit in the changelog.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
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.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
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.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Update documentation for configuring login with facebook.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
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.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Remove `log_function` utility function and its uses.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Use `auto_attribs` and native type hints for attrs classes.
|
|
||||||
1
changelog.d/xxxx.misc
Normal file
1
changelog.d/xxxx.misc
Normal file
@@ -0,0 +1 @@
|
|||||||
|
Ensure python uses `malloc` when running Synapse in Docker.
|
||||||
@@ -14,7 +14,6 @@ services:
|
|||||||
# failure
|
# failure
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
# See the readme for a full documentation of the environment settings
|
# See the readme for a full documentation of the environment settings
|
||||||
# NOTE: You must edit homeserver.yaml to use postgres, it defaults to sqlite
|
|
||||||
environment:
|
environment:
|
||||||
- SYNAPSE_CONFIG_PATH=/data/homeserver.yaml
|
- SYNAPSE_CONFIG_PATH=/data/homeserver.yaml
|
||||||
volumes:
|
volumes:
|
||||||
@@ -57,7 +56,7 @@ services:
|
|||||||
- POSTGRES_USER=synapse
|
- POSTGRES_USER=synapse
|
||||||
- POSTGRES_PASSWORD=changeme
|
- POSTGRES_PASSWORD=changeme
|
||||||
# ensure the database gets created correctly
|
# ensure the database gets created correctly
|
||||||
# https://matrix-org.github.io/synapse/latest/postgres.html#set-up-database
|
# https://github.com/matrix-org/synapse/blob/master/docs/postgres.md#set-up-database
|
||||||
- POSTGRES_INITDB_ARGS=--encoding=UTF-8 --lc-collate=C --lc-ctype=C
|
- POSTGRES_INITDB_ARGS=--encoding=UTF-8 --lc-collate=C --lc-ctype=C
|
||||||
volumes:
|
volumes:
|
||||||
# You may store the database tables in a local folder..
|
# You may store the database tables in a local folder..
|
||||||
|
|||||||
@@ -46,14 +46,14 @@ class CursesStdIO:
|
|||||||
self.callback = callback
|
self.callback = callback
|
||||||
|
|
||||||
def fileno(self):
|
def fileno(self):
|
||||||
"""We want to select on FD 0"""
|
""" We want to select on FD 0 """
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
def connectionLost(self, reason):
|
def connectionLost(self, reason):
|
||||||
self.close()
|
self.close()
|
||||||
|
|
||||||
def print_line(self, text):
|
def print_line(self, text):
|
||||||
"""add a line to the internal list of lines"""
|
""" add a line to the internal list of lines"""
|
||||||
|
|
||||||
self.lines.append(text)
|
self.lines.append(text)
|
||||||
self.redraw()
|
self.redraw()
|
||||||
@@ -92,7 +92,7 @@ class CursesStdIO:
|
|||||||
)
|
)
|
||||||
|
|
||||||
def doRead(self):
|
def doRead(self):
|
||||||
"""Input is ready!"""
|
""" Input is ready! """
|
||||||
curses.noecho()
|
curses.noecho()
|
||||||
c = self.stdscr.getch() # read a character
|
c = self.stdscr.getch() # read a character
|
||||||
|
|
||||||
@@ -132,7 +132,7 @@ class CursesStdIO:
|
|||||||
return "CursesStdIO"
|
return "CursesStdIO"
|
||||||
|
|
||||||
def close(self):
|
def close(self):
|
||||||
"""clean up"""
|
""" clean up """
|
||||||
|
|
||||||
curses.nocbreak()
|
curses.nocbreak()
|
||||||
self.stdscr.keypad(0)
|
self.stdscr.keypad(0)
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# Using the Synapse Grafana dashboard
|
# Using the Synapse Grafana dashboard
|
||||||
|
|
||||||
0. Set up Prometheus and Grafana. Out of scope for this readme. Useful documentation about using Grafana with Prometheus: http://docs.grafana.org/features/datasources/prometheus/
|
0. Set up Prometheus and Grafana. Out of scope for this readme. Useful documentation about using Grafana with Prometheus: http://docs.grafana.org/features/datasources/prometheus/
|
||||||
1. Have your Prometheus scrape your Synapse. https://matrix-org.github.io/synapse/latest/metrics-howto.html
|
1. Have your Prometheus scrape your Synapse. https://github.com/matrix-org/synapse/blob/master/docs/metrics-howto.md
|
||||||
2. Import dashboard into Grafana. Download `synapse.json`. Import it to Grafana and select the correct Prometheus datasource. http://docs.grafana.org/reference/export_import/
|
2. Import dashboard into Grafana. Download `synapse.json`. Import it to Grafana and select the correct Prometheus datasource. http://docs.grafana.org/reference/export_import/
|
||||||
3. Set up required recording rules. [contrib/prometheus](../prometheus)
|
3. Set up required recording rules. https://github.com/matrix-org/synapse/tree/master/contrib/prometheus
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -34,7 +34,7 @@ Add a new job to the main prometheus.yml file:
|
|||||||
```
|
```
|
||||||
|
|
||||||
An example of a Prometheus configuration with workers can be found in
|
An example of a Prometheus configuration with workers can be found in
|
||||||
[metrics-howto.md](https://matrix-org.github.io/synapse/latest/metrics-howto.html).
|
[metrics-howto.md](https://github.com/matrix-org/synapse/blob/master/docs/metrics-howto.md).
|
||||||
|
|
||||||
To use `synapse.rules` add
|
To use `synapse.rules` add
|
||||||
|
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
@@ -3,9 +3,8 @@ Purge history API examples
|
|||||||
|
|
||||||
# `purge_history.sh`
|
# `purge_history.sh`
|
||||||
|
|
||||||
A bash file, that uses the
|
A bash file, that uses the [purge history API](/docs/admin_api/purge_history_api.rst) to
|
||||||
[purge history API](https://matrix-org.github.io/synapse/latest/admin_api/purge_history_api.html)
|
purge all messages in a list of rooms up to a certain event. You can select a
|
||||||
to purge all messages in a list of rooms up to a certain event. You can select a
|
|
||||||
timeframe or a number of messages that you want to keep in the room.
|
timeframe or a number of messages that you want to keep in the room.
|
||||||
|
|
||||||
Just configure the variables DOMAIN, ADMIN, ROOMS_ARRAY and TIME at the top of
|
Just configure the variables DOMAIN, ADMIN, ROOMS_ARRAY and TIME at the top of
|
||||||
@@ -13,6 +12,5 @@ the script.
|
|||||||
|
|
||||||
# `purge_remote_media.sh`
|
# `purge_remote_media.sh`
|
||||||
|
|
||||||
A bash file, that uses the
|
A bash file, that uses the [purge history API](/docs/admin_api/purge_history_api.rst) to
|
||||||
[purge history API](https://matrix-org.github.io/synapse/latest/admin_api/purge_history_api.html)
|
purge all old cached remote media.
|
||||||
to purge all old cached remote media.
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
# this script will use the api:
|
# this script will use the api:
|
||||||
# https://matrix-org.github.io/synapse/latest/admin_api/purge_history_api.html
|
# https://github.com/matrix-org/synapse/blob/master/docs/admin_api/purge_history_api.rst
|
||||||
#
|
#
|
||||||
# It will purge all messages in a list of rooms up to a cetrain event
|
# It will purge all messages in a list of rooms up to a cetrain event
|
||||||
|
|
||||||
@@ -84,9 +84,7 @@ AUTH="Authorization: Bearer $TOKEN"
|
|||||||
###################################################################################################
|
###################################################################################################
|
||||||
# finally start pruning the room:
|
# finally start pruning the room:
|
||||||
###################################################################################################
|
###################################################################################################
|
||||||
# this will really delete local events, so the messages in the room really
|
POSTDATA='{"delete_local_events":"true"}' # this will really delete local events, so the messages in the room really disappear unless they are restored by remote federation
|
||||||
# disappear unless they are restored by remote federation. This is because
|
|
||||||
# we pass {"delete_local_events":true} to the curl invocation below.
|
|
||||||
|
|
||||||
for ROOM in "${ROOMS_ARRAY[@]}"; do
|
for ROOM in "${ROOMS_ARRAY[@]}"; do
|
||||||
echo "########################################### $(date) ################# "
|
echo "########################################### $(date) ################# "
|
||||||
@@ -106,7 +104,7 @@ for ROOM in "${ROOMS_ARRAY[@]}"; do
|
|||||||
SLEEP=2
|
SLEEP=2
|
||||||
set -x
|
set -x
|
||||||
# call purge
|
# call purge
|
||||||
OUT=$(curl --header "$AUTH" -s -d '{"delete_local_events":true}' POST "$API_URL/admin/purge_history/$ROOM/$EVENT_ID")
|
OUT=$(curl --header "$AUTH" -s -d $POSTDATA POST "$API_URL/admin/purge_history/$ROOM/$EVENT_ID")
|
||||||
PURGE_ID=$(echo "$OUT" |grep purge_id|cut -d'"' -f4 )
|
PURGE_ID=$(echo "$OUT" |grep purge_id|cut -d'"' -f4 )
|
||||||
if [ "$PURGE_ID" == "" ]; then
|
if [ "$PURGE_ID" == "" ]; then
|
||||||
# probably the history purge is already in progress for $ROOM
|
# probably the history purge is already in progress for $ROOM
|
||||||
|
|||||||
@@ -1,3 +1,2 @@
|
|||||||
The documentation for using systemd to manage synapse workers is now part of
|
The documentation for using systemd to manage synapse workers is now part of
|
||||||
the main synapse distribution. See
|
the main synapse distribution. See [docs/systemd-with-workers](../../docs/systemd-with-workers).
|
||||||
[docs/systemd-with-workers](https://matrix-org.github.io/synapse/latest/systemd-with-workers/index.html).
|
|
||||||
|
|||||||
@@ -2,8 +2,7 @@
|
|||||||
This is a setup for managing synapse with a user contributed systemd unit
|
This is a setup for managing synapse with a user contributed systemd unit
|
||||||
file. It provides a `matrix-synapse` systemd unit file that should be tailored
|
file. It provides a `matrix-synapse` systemd unit file that should be tailored
|
||||||
to accommodate your installation in accordance with the installation
|
to accommodate your installation in accordance with the installation
|
||||||
instructions provided in
|
instructions provided in [installation instructions](../../INSTALL.md).
|
||||||
[installation instructions](https://matrix-org.github.io/synapse/latest/setup/installation.html).
|
|
||||||
|
|
||||||
## Setup
|
## Setup
|
||||||
1. Under the service section, ensure the `User` variable matches which user
|
1. Under the service section, ensure the `User` variable matches which user
|
||||||
|
|||||||
@@ -1,71 +0,0 @@
|
|||||||
[Service]
|
|
||||||
# The following directives give the synapse service R/W access to:
|
|
||||||
# - /run/matrix-synapse
|
|
||||||
# - /var/lib/matrix-synapse
|
|
||||||
# - /var/log/matrix-synapse
|
|
||||||
|
|
||||||
RuntimeDirectory=matrix-synapse
|
|
||||||
StateDirectory=matrix-synapse
|
|
||||||
LogsDirectory=matrix-synapse
|
|
||||||
|
|
||||||
######################
|
|
||||||
## Security Sandbox ##
|
|
||||||
######################
|
|
||||||
|
|
||||||
# Make sure that the service has its own unshared tmpfs at /tmp and that it
|
|
||||||
# cannot see or change any real devices
|
|
||||||
PrivateTmp=true
|
|
||||||
PrivateDevices=true
|
|
||||||
|
|
||||||
# We give no capabilities to a service by default
|
|
||||||
CapabilityBoundingSet=
|
|
||||||
AmbientCapabilities=
|
|
||||||
|
|
||||||
# Protect the following from modification:
|
|
||||||
# - The entire filesystem
|
|
||||||
# - sysctl settings and loaded kernel modules
|
|
||||||
# - No modifications allowed to Control Groups
|
|
||||||
# - Hostname
|
|
||||||
# - System Clock
|
|
||||||
ProtectSystem=strict
|
|
||||||
ProtectKernelTunables=true
|
|
||||||
ProtectKernelModules=true
|
|
||||||
ProtectControlGroups=true
|
|
||||||
ProtectClock=true
|
|
||||||
ProtectHostname=true
|
|
||||||
|
|
||||||
# Prevent access to the following:
|
|
||||||
# - /home directory
|
|
||||||
# - Kernel logs
|
|
||||||
ProtectHome=tmpfs
|
|
||||||
ProtectKernelLogs=true
|
|
||||||
|
|
||||||
# Make sure that the process can only see PIDs and process details of itself,
|
|
||||||
# and the second option disables seeing details of things like system load and
|
|
||||||
# I/O etc
|
|
||||||
ProtectProc=invisible
|
|
||||||
ProcSubset=pid
|
|
||||||
|
|
||||||
# While not needed, we set these options explicitly
|
|
||||||
# - This process has been given access to the host network
|
|
||||||
# - It can also communicate with any IP Address
|
|
||||||
PrivateNetwork=false
|
|
||||||
RestrictAddressFamilies=AF_INET AF_INET6 AF_UNIX
|
|
||||||
IPAddressAllow=any
|
|
||||||
|
|
||||||
# Restrict system calls to a sane bunch
|
|
||||||
SystemCallArchitectures=native
|
|
||||||
SystemCallFilter=@system-service
|
|
||||||
SystemCallFilter=~@privileged @resources @obsolete
|
|
||||||
|
|
||||||
# Misc restrictions
|
|
||||||
# - Since the process is a python process it needs to be able to write and
|
|
||||||
# execute memory regions, so we set MemoryDenyWriteExecute to false
|
|
||||||
RestrictSUIDSGID=true
|
|
||||||
RemoveIPC=true
|
|
||||||
NoNewPrivileges=true
|
|
||||||
RestrictRealtime=true
|
|
||||||
RestrictNamespaces=true
|
|
||||||
LockPersonality=true
|
|
||||||
PrivateUsers=true
|
|
||||||
MemoryDenyWriteExecute=false
|
|
||||||
30
debian/build_virtualenv
vendored
30
debian/build_virtualenv
vendored
@@ -15,7 +15,7 @@ export DH_VIRTUALENV_INSTALL_ROOT=/opt/venvs
|
|||||||
# python won't look in the right directory. At least this way, the error will
|
# python won't look in the right directory. At least this way, the error will
|
||||||
# be a *bit* more obvious.
|
# be a *bit* more obvious.
|
||||||
#
|
#
|
||||||
SNAKE=$(readlink -e /usr/bin/python3)
|
SNAKE=`readlink -e /usr/bin/python3`
|
||||||
|
|
||||||
# try to set the CFLAGS so any compiled C extensions are compiled with the most
|
# try to set the CFLAGS so any compiled C extensions are compiled with the most
|
||||||
# generic as possible x64 instructions, so that compiling it on a new Intel chip
|
# generic as possible x64 instructions, so that compiling it on a new Intel chip
|
||||||
@@ -24,7 +24,7 @@ SNAKE=$(readlink -e /usr/bin/python3)
|
|||||||
# TODO: add similar things for non-amd64, or figure out a more generic way to
|
# TODO: add similar things for non-amd64, or figure out a more generic way to
|
||||||
# do this.
|
# do this.
|
||||||
|
|
||||||
case $(dpkg-architecture -q DEB_HOST_ARCH) in
|
case `dpkg-architecture -q DEB_HOST_ARCH` in
|
||||||
amd64)
|
amd64)
|
||||||
export CFLAGS=-march=x86-64
|
export CFLAGS=-march=x86-64
|
||||||
;;
|
;;
|
||||||
@@ -33,14 +33,15 @@ esac
|
|||||||
# Use --builtin-venv to use the better `venv` module from CPython 3.4+ rather
|
# Use --builtin-venv to use the better `venv` module from CPython 3.4+ rather
|
||||||
# than the 2/3 compatible `virtualenv`.
|
# than the 2/3 compatible `virtualenv`.
|
||||||
|
|
||||||
|
# Pin pip to 20.3.4 to fix breakage in 21.0 on py3.5 (xenial)
|
||||||
|
|
||||||
dh_virtualenv \
|
dh_virtualenv \
|
||||||
--install-suffix "matrix-synapse" \
|
--install-suffix "matrix-synapse" \
|
||||||
--builtin-venv \
|
--builtin-venv \
|
||||||
--python "$SNAKE" \
|
--python "$SNAKE" \
|
||||||
--upgrade-pip \
|
--upgrade-pip-to="20.3.4" \
|
||||||
--preinstall="lxml" \
|
--preinstall="lxml" \
|
||||||
--preinstall="mock" \
|
--preinstall="mock" \
|
||||||
--preinstall="wheel" \
|
|
||||||
--extra-pip-arg="--no-cache-dir" \
|
--extra-pip-arg="--no-cache-dir" \
|
||||||
--extra-pip-arg="--compile" \
|
--extra-pip-arg="--compile" \
|
||||||
--extras="all,systemd,test"
|
--extras="all,systemd,test"
|
||||||
@@ -57,8 +58,8 @@ case "$DEB_BUILD_OPTIONS" in
|
|||||||
*)
|
*)
|
||||||
# Copy tests to a temporary directory so that we can put them on the
|
# Copy tests to a temporary directory so that we can put them on the
|
||||||
# PYTHONPATH without putting the uninstalled synapse on the pythonpath.
|
# PYTHONPATH without putting the uninstalled synapse on the pythonpath.
|
||||||
tmpdir=$(mktemp -d)
|
tmpdir=`mktemp -d`
|
||||||
trap 'rm -r $tmpdir' EXIT
|
trap "rm -r $tmpdir" EXIT
|
||||||
|
|
||||||
cp -r tests "$tmpdir"
|
cp -r tests "$tmpdir"
|
||||||
|
|
||||||
@@ -99,20 +100,5 @@ esac
|
|||||||
--output-file="${PACKAGE_BUILD_DIR}/etc/matrix-synapse/log.yaml"
|
--output-file="${PACKAGE_BUILD_DIR}/etc/matrix-synapse/log.yaml"
|
||||||
|
|
||||||
# add a dependency on the right version of python to substvars.
|
# add a dependency on the right version of python to substvars.
|
||||||
PYPKG=$(basename "$SNAKE")
|
PYPKG=`basename $SNAKE`
|
||||||
echo "synapse:pydepends=$PYPKG" >> debian/matrix-synapse-py3.substvars
|
echo "synapse:pydepends=$PYPKG" >> debian/matrix-synapse-py3.substvars
|
||||||
|
|
||||||
|
|
||||||
# add a couple of triggers. This is needed so that dh-virtualenv can rebuild
|
|
||||||
# the venv when the system python changes (see
|
|
||||||
# https://dh-virtualenv.readthedocs.io/en/latest/tutorial.html#step-2-set-up-packaging-for-your-project)
|
|
||||||
#
|
|
||||||
# we do it here rather than the more conventional way of just adding it to
|
|
||||||
# debian/matrix-synapse-py3.triggers, because we need to add a trigger on the
|
|
||||||
# right version of python.
|
|
||||||
cat >>"debian/.debhelper/generated/matrix-synapse-py3/triggers" <<EOF
|
|
||||||
# triggers for dh-virtualenv
|
|
||||||
interest-noawait $SNAKE
|
|
||||||
interest dh-virtualenv-interpreter-update
|
|
||||||
|
|
||||||
EOF
|
|
||||||
|
|||||||
320
debian/changelog
vendored
320
debian/changelog
vendored
@@ -1,323 +1,3 @@
|
|||||||
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
|
|
||||||
|
|
||||||
* New synapse release 1.50.0.
|
|
||||||
|
|
||||||
-- Synapse Packaging team <packages@matrix.org> Tue, 18 Jan 2022 10:40:38 +0000
|
|
||||||
|
|
||||||
matrix-synapse-py3 (1.50.0~rc2) stable; urgency=medium
|
|
||||||
|
|
||||||
* New synapse release 1.50.0~rc2.
|
|
||||||
|
|
||||||
-- Synapse Packaging team <packages@matrix.org> Fri, 14 Jan 2022 11:18:06 +0000
|
|
||||||
|
|
||||||
matrix-synapse-py3 (1.50.0~rc1) stable; urgency=medium
|
|
||||||
|
|
||||||
* New synapse release 1.50.0~rc1.
|
|
||||||
|
|
||||||
-- Synapse Packaging team <packages@matrix.org> Wed, 05 Jan 2022 12:36:17 +0000
|
|
||||||
|
|
||||||
matrix-synapse-py3 (1.49.2) stable; urgency=medium
|
|
||||||
|
|
||||||
* New synapse release 1.49.2.
|
|
||||||
|
|
||||||
-- Synapse Packaging team <packages@matrix.org> Tue, 21 Dec 2021 17:31:03 +0000
|
|
||||||
|
|
||||||
matrix-synapse-py3 (1.49.1) stable; urgency=medium
|
|
||||||
|
|
||||||
* New synapse release 1.49.1.
|
|
||||||
|
|
||||||
-- Synapse Packaging team <packages@matrix.org> Tue, 21 Dec 2021 11:07:30 +0000
|
|
||||||
|
|
||||||
matrix-synapse-py3 (1.49.0) stable; urgency=medium
|
|
||||||
|
|
||||||
* New synapse release 1.49.0.
|
|
||||||
|
|
||||||
-- Synapse Packaging team <packages@matrix.org> Tue, 14 Dec 2021 12:39:46 +0000
|
|
||||||
|
|
||||||
matrix-synapse-py3 (1.49.0~rc1) stable; urgency=medium
|
|
||||||
|
|
||||||
* New synapse release 1.49.0~rc1.
|
|
||||||
|
|
||||||
-- Synapse Packaging team <packages@matrix.org> Tue, 07 Dec 2021 13:52:21 +0000
|
|
||||||
|
|
||||||
matrix-synapse-py3 (1.48.0) stable; urgency=medium
|
|
||||||
|
|
||||||
* New synapse release 1.48.0.
|
|
||||||
|
|
||||||
-- Synapse Packaging team <packages@matrix.org> Tue, 30 Nov 2021 11:24:15 +0000
|
|
||||||
|
|
||||||
matrix-synapse-py3 (1.48.0~rc1) stable; urgency=medium
|
|
||||||
|
|
||||||
* New synapse release 1.48.0~rc1.
|
|
||||||
|
|
||||||
-- Synapse Packaging team <packages@matrix.org> Thu, 25 Nov 2021 15:56:03 +0000
|
|
||||||
|
|
||||||
matrix-synapse-py3 (1.47.1) stable; urgency=medium
|
|
||||||
|
|
||||||
* New synapse release 1.47.1.
|
|
||||||
|
|
||||||
-- Synapse Packaging team <packages@matrix.org> Fri, 19 Nov 2021 13:44:32 +0000
|
|
||||||
|
|
||||||
matrix-synapse-py3 (1.47.0) stable; urgency=medium
|
|
||||||
|
|
||||||
* New synapse release 1.47.0.
|
|
||||||
|
|
||||||
-- Synapse Packaging team <packages@matrix.org> Wed, 17 Nov 2021 13:09:43 +0000
|
|
||||||
|
|
||||||
matrix-synapse-py3 (1.47.0~rc3) stable; urgency=medium
|
|
||||||
|
|
||||||
* New synapse release 1.47.0~rc3.
|
|
||||||
|
|
||||||
-- Synapse Packaging team <packages@matrix.org> Tue, 16 Nov 2021 14:32:47 +0000
|
|
||||||
|
|
||||||
matrix-synapse-py3 (1.47.0~rc2) stable; urgency=medium
|
|
||||||
|
|
||||||
[ Dan Callahan ]
|
|
||||||
* Update scripts to pass Shellcheck lints.
|
|
||||||
* Remove unused Vagrant scripts from debian/ directory.
|
|
||||||
* Allow building Debian packages for any architecture, not just amd64.
|
|
||||||
* Preinstall the "wheel" package when building virtualenvs.
|
|
||||||
* Do not error if /etc/default/matrix-synapse is missing.
|
|
||||||
|
|
||||||
[ Synapse Packaging team ]
|
|
||||||
* New synapse release 1.47.0~rc2.
|
|
||||||
|
|
||||||
-- Synapse Packaging team <packages@matrix.org> Wed, 10 Nov 2021 09:41:01 +0000
|
|
||||||
|
|
||||||
matrix-synapse-py3 (1.46.0) stable; urgency=medium
|
|
||||||
|
|
||||||
[ Richard van der Hoff ]
|
|
||||||
* Compress debs with xz, to fix incompatibility of impish debs with reprepro.
|
|
||||||
|
|
||||||
[ Synapse Packaging team ]
|
|
||||||
* New synapse release 1.46.0.
|
|
||||||
|
|
||||||
-- Synapse Packaging team <packages@matrix.org> Tue, 02 Nov 2021 13:22:53 +0000
|
|
||||||
|
|
||||||
matrix-synapse-py3 (1.46.0~rc1) stable; urgency=medium
|
|
||||||
|
|
||||||
* New synapse release 1.46.0~rc1.
|
|
||||||
|
|
||||||
-- Synapse Packaging team <packages@matrix.org> Tue, 26 Oct 2021 14:04:04 +0100
|
|
||||||
|
|
||||||
matrix-synapse-py3 (1.45.1) stable; urgency=medium
|
|
||||||
|
|
||||||
* New synapse release 1.45.1.
|
|
||||||
|
|
||||||
-- Synapse Packaging team <packages@matrix.org> Wed, 20 Oct 2021 11:58:27 +0100
|
|
||||||
|
|
||||||
matrix-synapse-py3 (1.45.0) stable; urgency=medium
|
|
||||||
|
|
||||||
* New synapse release 1.45.0.
|
|
||||||
|
|
||||||
-- Synapse Packaging team <packages@matrix.org> Tue, 19 Oct 2021 11:18:53 +0100
|
|
||||||
|
|
||||||
matrix-synapse-py3 (1.45.0~rc2) stable; urgency=medium
|
|
||||||
|
|
||||||
* New synapse release 1.45.0~rc2.
|
|
||||||
|
|
||||||
-- Synapse Packaging team <packages@matrix.org> Thu, 14 Oct 2021 10:58:24 +0100
|
|
||||||
|
|
||||||
matrix-synapse-py3 (1.45.0~rc1) stable; urgency=medium
|
|
||||||
|
|
||||||
[ Nick @ Beeper ]
|
|
||||||
* Include an `update_synapse_database` script in the distribution.
|
|
||||||
|
|
||||||
[ Synapse Packaging team ]
|
|
||||||
* New synapse release 1.45.0~rc1.
|
|
||||||
|
|
||||||
-- Synapse Packaging team <packages@matrix.org> Tue, 12 Oct 2021 10:46:27 +0100
|
|
||||||
|
|
||||||
matrix-synapse-py3 (1.44.0) stable; urgency=medium
|
|
||||||
|
|
||||||
* New synapse release 1.44.0.
|
|
||||||
|
|
||||||
-- Synapse Packaging team <packages@matrix.org> Tue, 05 Oct 2021 13:43:57 +0100
|
|
||||||
|
|
||||||
matrix-synapse-py3 (1.44.0~rc3) stable; urgency=medium
|
|
||||||
|
|
||||||
* New synapse release 1.44.0~rc3.
|
|
||||||
|
|
||||||
-- Synapse Packaging team <packages@matrix.org> Mon, 04 Oct 2021 14:57:22 +0100
|
|
||||||
|
|
||||||
matrix-synapse-py3 (1.44.0~rc2) stable; urgency=medium
|
|
||||||
|
|
||||||
* New synapse release 1.44.0~rc2.
|
|
||||||
|
|
||||||
-- Synapse Packaging team <packages@matrix.org> Thu, 30 Sep 2021 12:39:10 +0100
|
|
||||||
|
|
||||||
matrix-synapse-py3 (1.44.0~rc1) stable; urgency=medium
|
|
||||||
|
|
||||||
* New synapse release 1.44.0~rc1.
|
|
||||||
|
|
||||||
-- Synapse Packaging team <packages@matrix.org> Tue, 28 Sep 2021 13:41:28 +0100
|
|
||||||
|
|
||||||
matrix-synapse-py3 (1.43.0) stable; urgency=medium
|
|
||||||
|
|
||||||
* New synapse release 1.43.0.
|
|
||||||
|
|
||||||
-- Synapse Packaging team <packages@matrix.org> Tue, 21 Sep 2021 11:49:05 +0100
|
|
||||||
|
|
||||||
matrix-synapse-py3 (1.43.0~rc2) stable; urgency=medium
|
|
||||||
|
|
||||||
* New synapse release 1.43.0~rc2.
|
|
||||||
|
|
||||||
-- Synapse Packaging team <packages@matrix.org> Fri, 17 Sep 2021 10:43:21 +0100
|
|
||||||
|
|
||||||
matrix-synapse-py3 (1.43.0~rc1) stable; urgency=medium
|
|
||||||
|
|
||||||
* New synapse release 1.43.0~rc1.
|
|
||||||
|
|
||||||
-- Synapse Packaging team <packages@matrix.org> Tue, 14 Sep 2021 11:39:46 +0100
|
|
||||||
|
|
||||||
matrix-synapse-py3 (1.42.0) stable; urgency=medium
|
|
||||||
|
|
||||||
* New synapse release 1.42.0.
|
|
||||||
|
|
||||||
-- Synapse Packaging team <packages@matrix.org> Tue, 07 Sep 2021 16:19:09 +0100
|
|
||||||
|
|
||||||
matrix-synapse-py3 (1.42.0~rc2) stable; urgency=medium
|
|
||||||
|
|
||||||
* New synapse release 1.42.0~rc2.
|
|
||||||
|
|
||||||
-- Synapse Packaging team <packages@matrix.org> Mon, 06 Sep 2021 15:25:13 +0100
|
|
||||||
|
|
||||||
matrix-synapse-py3 (1.42.0~rc1) stable; urgency=medium
|
|
||||||
|
|
||||||
* New synapse release 1.42.0rc1.
|
|
||||||
|
|
||||||
-- Synapse Packaging team <packages@matrix.org> Wed, 01 Sep 2021 11:37:48 +0100
|
|
||||||
|
|
||||||
matrix-synapse-py3 (1.41.1) stable; urgency=high
|
|
||||||
|
|
||||||
* New synapse release 1.41.1.
|
|
||||||
|
|
||||||
-- Synapse Packaging team <packages@matrix.org> Tue, 31 Aug 2021 12:59:10 +0100
|
|
||||||
|
|
||||||
matrix-synapse-py3 (1.41.0) stable; urgency=medium
|
|
||||||
|
|
||||||
* New synapse release 1.41.0.
|
|
||||||
|
|
||||||
-- Synapse Packaging team <packages@matrix.org> Tue, 24 Aug 2021 15:31:45 +0100
|
|
||||||
|
|
||||||
matrix-synapse-py3 (1.41.0~rc1) stable; urgency=medium
|
|
||||||
|
|
||||||
* New synapse release 1.41.0~rc1.
|
|
||||||
|
|
||||||
-- Synapse Packaging team <packages@matrix.org> Wed, 18 Aug 2021 15:52:00 +0100
|
|
||||||
|
|
||||||
matrix-synapse-py3 (1.40.0) stable; urgency=medium
|
|
||||||
|
|
||||||
* New synapse release 1.40.0.
|
|
||||||
|
|
||||||
-- Synapse Packaging team <packages@matrix.org> Tue, 10 Aug 2021 13:50:48 +0100
|
|
||||||
|
|
||||||
matrix-synapse-py3 (1.40.0~rc3) stable; urgency=medium
|
|
||||||
|
|
||||||
* New synapse release 1.40.0~rc3.
|
|
||||||
|
|
||||||
-- Synapse Packaging team <packages@matrix.org> Mon, 09 Aug 2021 13:41:08 +0100
|
|
||||||
|
|
||||||
matrix-synapse-py3 (1.40.0~rc2) stable; urgency=medium
|
|
||||||
|
|
||||||
* New synapse release 1.40.0~rc2.
|
|
||||||
|
|
||||||
-- Synapse Packaging team <packages@matrix.org> Wed, 04 Aug 2021 17:08:55 +0100
|
|
||||||
|
|
||||||
matrix-synapse-py3 (1.40.0~rc1) stable; urgency=medium
|
|
||||||
|
|
||||||
[ Richard van der Hoff ]
|
|
||||||
* Drop backwards-compatibility code that was required to support Ubuntu Xenial.
|
|
||||||
* Update package triggers so that the virtualenv is correctly rebuilt
|
|
||||||
when the system python is rebuilt, on recent Python versions.
|
|
||||||
|
|
||||||
[ Synapse Packaging team ]
|
|
||||||
* New synapse release 1.40.0~rc1.
|
|
||||||
|
|
||||||
-- Synapse Packaging team <packages@matrix.org> Tue, 03 Aug 2021 11:31:49 +0100
|
|
||||||
|
|
||||||
matrix-synapse-py3 (1.39.0) stable; urgency=medium
|
|
||||||
|
|
||||||
* New synapse release 1.39.0.
|
|
||||||
|
|
||||||
-- Synapse Packaging team <packages@matrix.org> Thu, 29 Jul 2021 09:59:00 +0100
|
|
||||||
|
|
||||||
matrix-synapse-py3 (1.39.0~rc3) stable; urgency=medium
|
|
||||||
|
|
||||||
* New synapse release 1.39.0~rc3.
|
|
||||||
|
|
||||||
-- Synapse Packaging team <packages@matrix.org> Wed, 28 Jul 2021 13:30:58 +0100
|
|
||||||
|
|
||||||
matrix-synapse-py3 (1.38.1) stable; urgency=medium
|
|
||||||
|
|
||||||
* New synapse release 1.38.1.
|
|
||||||
|
|
||||||
-- Synapse Packaging team <packages@matrix.org> Thu, 22 Jul 2021 15:37:06 +0100
|
|
||||||
|
|
||||||
matrix-synapse-py3 (1.39.0~rc1) stable; urgency=medium
|
|
||||||
|
|
||||||
* New synapse release 1.39.0rc1.
|
|
||||||
|
|
||||||
-- Synapse Packaging team <packages@matrix.org> Tue, 20 Jul 2021 14:28:34 +0100
|
|
||||||
|
|
||||||
matrix-synapse-py3 (1.38.0) stable; urgency=medium
|
|
||||||
|
|
||||||
* New synapse release 1.38.0.
|
|
||||||
|
|
||||||
-- Synapse Packaging team <packages@matrix.org> Tue, 13 Jul 2021 13:20:56 +0100
|
|
||||||
|
|
||||||
matrix-synapse-py3 (1.38.0rc3) prerelease; urgency=medium
|
|
||||||
|
|
||||||
[ Erik Johnston ]
|
|
||||||
* Add synapse_review_recent_signups script
|
|
||||||
|
|
||||||
[ Synapse Packaging team ]
|
|
||||||
* New synapse release 1.38.0rc3.
|
|
||||||
|
|
||||||
-- Synapse Packaging team <packages@matrix.org> Tue, 13 Jul 2021 11:53:56 +0100
|
|
||||||
|
|
||||||
matrix-synapse-py3 (1.37.1) stable; urgency=medium
|
|
||||||
|
|
||||||
* New synapse release 1.37.1.
|
|
||||||
|
|
||||||
-- Synapse Packaging team <packages@matrix.org> Wed, 30 Jun 2021 12:24:06 +0100
|
|
||||||
|
|
||||||
matrix-synapse-py3 (1.37.0) stable; urgency=medium
|
|
||||||
|
|
||||||
* New synapse release 1.37.0.
|
|
||||||
|
|
||||||
-- Synapse Packaging team <packages@matrix.org> Tue, 29 Jun 2021 10:15:25 +0100
|
|
||||||
|
|
||||||
matrix-synapse-py3 (1.36.0) stable; urgency=medium
|
|
||||||
|
|
||||||
* New synapse release 1.36.0.
|
|
||||||
|
|
||||||
-- Synapse Packaging team <packages@matrix.org> Tue, 15 Jun 2021 15:41:53 +0100
|
|
||||||
|
|
||||||
matrix-synapse-py3 (1.35.1) stable; urgency=medium
|
|
||||||
|
|
||||||
* New synapse release 1.35.1.
|
|
||||||
|
|
||||||
-- Synapse Packaging team <packages@matrix.org> Thu, 03 Jun 2021 08:11:29 -0400
|
|
||||||
|
|
||||||
matrix-synapse-py3 (1.35.0) stable; urgency=medium
|
|
||||||
|
|
||||||
* New synapse release 1.35.0.
|
|
||||||
|
|
||||||
-- Synapse Packaging team <packages@matrix.org> Tue, 01 Jun 2021 13:23:35 +0100
|
|
||||||
|
|
||||||
matrix-synapse-py3 (1.34.0) stable; urgency=medium
|
|
||||||
|
|
||||||
* New synapse release 1.34.0.
|
|
||||||
|
|
||||||
-- Synapse Packaging team <packages@matrix.org> Mon, 17 May 2021 11:34:18 +0100
|
|
||||||
|
|
||||||
matrix-synapse-py3 (1.33.2) stable; urgency=medium
|
matrix-synapse-py3 (1.33.2) stable; urgency=medium
|
||||||
|
|
||||||
* New synapse release 1.33.2.
|
* New synapse release 1.33.2.
|
||||||
|
|||||||
2
debian/compat
vendored
2
debian/compat
vendored
@@ -1 +1 @@
|
|||||||
10
|
9
|
||||||
|
|||||||
7
debian/control
vendored
7
debian/control
vendored
@@ -3,8 +3,11 @@ Section: contrib/python
|
|||||||
Priority: extra
|
Priority: extra
|
||||||
Maintainer: Synapse Packaging team <packages@matrix.org>
|
Maintainer: Synapse Packaging team <packages@matrix.org>
|
||||||
# keep this list in sync with the build dependencies in docker/Dockerfile-dhvirtualenv.
|
# keep this list in sync with the build dependencies in docker/Dockerfile-dhvirtualenv.
|
||||||
|
# TODO: Remove the dependency on dh-systemd after dropping support for Ubuntu xenial
|
||||||
|
# On all other supported releases, it's merely a transitional package which
|
||||||
|
# does nothing but depends on debhelper (> 9.20160709)
|
||||||
Build-Depends:
|
Build-Depends:
|
||||||
debhelper (>= 10),
|
debhelper (>= 9.20160709) | dh-systemd,
|
||||||
dh-virtualenv (>= 1.1),
|
dh-virtualenv (>= 1.1),
|
||||||
libsystemd-dev,
|
libsystemd-dev,
|
||||||
libpq-dev,
|
libpq-dev,
|
||||||
@@ -19,7 +22,7 @@ Standards-Version: 3.9.8
|
|||||||
Homepage: https://github.com/matrix-org/synapse
|
Homepage: https://github.com/matrix-org/synapse
|
||||||
|
|
||||||
Package: matrix-synapse-py3
|
Package: matrix-synapse-py3
|
||||||
Architecture: any
|
Architecture: amd64
|
||||||
Provides: matrix-synapse
|
Provides: matrix-synapse
|
||||||
Conflicts:
|
Conflicts:
|
||||||
matrix-synapse (<< 0.34.0.1-0matrix2),
|
matrix-synapse (<< 0.34.0.1-0matrix2),
|
||||||
|
|||||||
42
debian/hash_password.1
vendored
42
debian/hash_password.1
vendored
@@ -1,58 +1,90 @@
|
|||||||
.\" generated with Ronn-NG/v0.8.0
|
.\" generated with Ronn/v0.7.3
|
||||||
.\" http://github.com/apjanke/ronn-ng/tree/0.8.0
|
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
||||||
.TH "HASH_PASSWORD" "1" "July 2021" "" ""
|
.
|
||||||
|
.TH "HASH_PASSWORD" "1" "February 2017" "" ""
|
||||||
|
.
|
||||||
.SH "NAME"
|
.SH "NAME"
|
||||||
\fBhash_password\fR \- Calculate the hash of a new password, so that passwords can be reset
|
\fBhash_password\fR \- Calculate the hash of a new password, so that passwords can be reset
|
||||||
|
.
|
||||||
.SH "SYNOPSIS"
|
.SH "SYNOPSIS"
|
||||||
\fBhash_password\fR [\fB\-p\fR|\fB\-\-password\fR [password]] [\fB\-c\fR|\fB\-\-config\fR \fIfile\fR]
|
\fBhash_password\fR [\fB\-p\fR|\fB\-\-password\fR [password]] [\fB\-c\fR|\fB\-\-config\fR \fIfile\fR]
|
||||||
|
.
|
||||||
.SH "DESCRIPTION"
|
.SH "DESCRIPTION"
|
||||||
\fBhash_password\fR calculates the hash of a supplied password using bcrypt\.
|
\fBhash_password\fR calculates the hash of a supplied password using bcrypt\.
|
||||||
|
.
|
||||||
.P
|
.P
|
||||||
\fBhash_password\fR takes a password as an parameter either on the command line or the \fBSTDIN\fR if not supplied\.
|
\fBhash_password\fR takes a password as an parameter either on the command line or the \fBSTDIN\fR if not supplied\.
|
||||||
|
.
|
||||||
.P
|
.P
|
||||||
It accepts an YAML file which can be used to specify parameters like the number of rounds for bcrypt and password_config section having the pepper value used for the hashing\. By default \fBbcrypt_rounds\fR is set to \fB10\fR\.
|
It accepts an YAML file which can be used to specify parameters like the number of rounds for bcrypt and password_config section having the pepper value used for the hashing\. By default \fBbcrypt_rounds\fR is set to \fB10\fR\.
|
||||||
|
.
|
||||||
.P
|
.P
|
||||||
The hashed password is written on the \fBSTDOUT\fR\.
|
The hashed password is written on the \fBSTDOUT\fR\.
|
||||||
|
.
|
||||||
.SH "FILES"
|
.SH "FILES"
|
||||||
A sample YAML file accepted by \fBhash_password\fR is described below:
|
A sample YAML file accepted by \fBhash_password\fR is described below:
|
||||||
|
.
|
||||||
.P
|
.P
|
||||||
bcrypt_rounds: 17 password_config: pepper: "random hashing pepper"
|
bcrypt_rounds: 17 password_config: pepper: "random hashing pepper"
|
||||||
|
.
|
||||||
.SH "OPTIONS"
|
.SH "OPTIONS"
|
||||||
|
.
|
||||||
.TP
|
.TP
|
||||||
\fB\-p\fR, \fB\-\-password\fR
|
\fB\-p\fR, \fB\-\-password\fR
|
||||||
Read the password form the command line if [password] is supplied\. If not, prompt the user and read the password form the \fBSTDIN\fR\. It is not recommended to type the password on the command line directly\. Use the STDIN instead\.
|
Read the password form the command line if [password] is supplied\. If not, prompt the user and read the password form the \fBSTDIN\fR\. It is not recommended to type the password on the command line directly\. Use the STDIN instead\.
|
||||||
|
.
|
||||||
.TP
|
.TP
|
||||||
\fB\-c\fR, \fB\-\-config\fR
|
\fB\-c\fR, \fB\-\-config\fR
|
||||||
Read the supplied YAML \fIfile\fR containing the options \fBbcrypt_rounds\fR and the \fBpassword_config\fR section containing the \fBpepper\fR value\.
|
Read the supplied YAML \fIfile\fR containing the options \fBbcrypt_rounds\fR and the \fBpassword_config\fR section containing the \fBpepper\fR value\.
|
||||||
|
.
|
||||||
.SH "EXAMPLES"
|
.SH "EXAMPLES"
|
||||||
Hash from the command line:
|
Hash from the command line:
|
||||||
|
.
|
||||||
.IP "" 4
|
.IP "" 4
|
||||||
|
.
|
||||||
.nf
|
.nf
|
||||||
|
|
||||||
$ hash_password \-p "p@ssw0rd"
|
$ hash_password \-p "p@ssw0rd"
|
||||||
$2b$12$VJNqWQYfsWTEwcELfoSi4Oa8eA17movHqqi8\.X8fWFpum7SxZ9MFe
|
$2b$12$VJNqWQYfsWTEwcELfoSi4Oa8eA17movHqqi8\.X8fWFpum7SxZ9MFe
|
||||||
|
.
|
||||||
.fi
|
.fi
|
||||||
|
.
|
||||||
.IP "" 0
|
.IP "" 0
|
||||||
|
.
|
||||||
.P
|
.P
|
||||||
Hash from the STDIN:
|
Hash from the STDIN:
|
||||||
|
.
|
||||||
.IP "" 4
|
.IP "" 4
|
||||||
|
.
|
||||||
.nf
|
.nf
|
||||||
|
|
||||||
$ hash_password
|
$ hash_password
|
||||||
Password:
|
Password:
|
||||||
Confirm password:
|
Confirm password:
|
||||||
$2b$12$AszlvfmJl2esnyhmn8m/kuR2tdXgROWtWxnX\.rcuAbM8ErLoUhybG
|
$2b$12$AszlvfmJl2esnyhmn8m/kuR2tdXgROWtWxnX\.rcuAbM8ErLoUhybG
|
||||||
|
.
|
||||||
.fi
|
.fi
|
||||||
|
.
|
||||||
.IP "" 0
|
.IP "" 0
|
||||||
|
.
|
||||||
.P
|
.P
|
||||||
Using a config file:
|
Using a config file:
|
||||||
|
.
|
||||||
.IP "" 4
|
.IP "" 4
|
||||||
|
.
|
||||||
.nf
|
.nf
|
||||||
|
|
||||||
$ hash_password \-c config\.yml
|
$ hash_password \-c config\.yml
|
||||||
Password:
|
Password:
|
||||||
Confirm password:
|
Confirm password:
|
||||||
$2b$12$CwI\.wBNr\.w3kmiUlV3T5s\.GT2wH7uebDCovDrCOh18dFedlANK99O
|
$2b$12$CwI\.wBNr\.w3kmiUlV3T5s\.GT2wH7uebDCovDrCOh18dFedlANK99O
|
||||||
|
.
|
||||||
.fi
|
.fi
|
||||||
|
.
|
||||||
.IP "" 0
|
.IP "" 0
|
||||||
|
.
|
||||||
.SH "COPYRIGHT"
|
.SH "COPYRIGHT"
|
||||||
This man page was written by Rahul De <\fI\%mailto:rahulde@swecha\.net\fR> for Debian GNU/Linux distribution\.
|
This man page was written by Rahul De <\fIrahulde@swecha\.net\fR> for Debian GNU/Linux distribution\.
|
||||||
|
.
|
||||||
.SH "SEE ALSO"
|
.SH "SEE ALSO"
|
||||||
synctl(1), synapse_port_db(1), register_new_matrix_user(1), synapse_review_recent_signups(1)
|
synctl(1), synapse_port_db(1), register_new_matrix_user(1)
|
||||||
|
|||||||
2
debian/hash_password.ronn
vendored
2
debian/hash_password.ronn
vendored
@@ -66,4 +66,4 @@ for Debian GNU/Linux distribution.
|
|||||||
|
|
||||||
## SEE ALSO
|
## SEE ALSO
|
||||||
|
|
||||||
synctl(1), synapse_port_db(1), register_new_matrix_user(1), synapse_review_recent_signups(1)
|
synctl(1), synapse_port_db(1), register_new_matrix_user(1)
|
||||||
|
|||||||
1
debian/manpages
vendored
1
debian/manpages
vendored
@@ -1,5 +1,4 @@
|
|||||||
debian/hash_password.1
|
debian/hash_password.1
|
||||||
debian/register_new_matrix_user.1
|
debian/register_new_matrix_user.1
|
||||||
debian/synapse_port_db.1
|
debian/synapse_port_db.1
|
||||||
debian/synapse_review_recent_signups.1
|
|
||||||
debian/synctl.1
|
debian/synctl.1
|
||||||
|
|||||||
1
debian/matrix-synapse-py3.config
vendored
1
debian/matrix-synapse-py3.config
vendored
@@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
# shellcheck disable=SC1091
|
|
||||||
. /usr/share/debconf/confmodule
|
. /usr/share/debconf/confmodule
|
||||||
|
|
||||||
# try to update the debconf db according to whatever is in the config files
|
# try to update the debconf db according to whatever is in the config files
|
||||||
|
|||||||
2
debian/matrix-synapse-py3.links
vendored
2
debian/matrix-synapse-py3.links
vendored
@@ -1,6 +1,4 @@
|
|||||||
opt/venvs/matrix-synapse/bin/hash_password usr/bin/hash_password
|
opt/venvs/matrix-synapse/bin/hash_password usr/bin/hash_password
|
||||||
opt/venvs/matrix-synapse/bin/register_new_matrix_user usr/bin/register_new_matrix_user
|
opt/venvs/matrix-synapse/bin/register_new_matrix_user usr/bin/register_new_matrix_user
|
||||||
opt/venvs/matrix-synapse/bin/synapse_port_db usr/bin/synapse_port_db
|
opt/venvs/matrix-synapse/bin/synapse_port_db usr/bin/synapse_port_db
|
||||||
opt/venvs/matrix-synapse/bin/synapse_review_recent_signups usr/bin/synapse_review_recent_signups
|
|
||||||
opt/venvs/matrix-synapse/bin/synctl usr/bin/synctl
|
opt/venvs/matrix-synapse/bin/synctl usr/bin/synctl
|
||||||
opt/venvs/matrix-synapse/bin/update_synapse_database usr/bin/update_synapse_database
|
|
||||||
|
|||||||
1
debian/matrix-synapse-py3.postinst
vendored
1
debian/matrix-synapse-py3.postinst
vendored
@@ -1,6 +1,5 @@
|
|||||||
#!/bin/sh -e
|
#!/bin/sh -e
|
||||||
|
|
||||||
# shellcheck disable=SC1091
|
|
||||||
. /usr/share/debconf/confmodule
|
. /usr/share/debconf/confmodule
|
||||||
|
|
||||||
CONFIGFILE_SERVERNAME="/etc/matrix-synapse/conf.d/server_name.yaml"
|
CONFIGFILE_SERVERNAME="/etc/matrix-synapse/conf.d/server_name.yaml"
|
||||||
|
|||||||
9
debian/matrix-synapse-py3.triggers
vendored
Normal file
9
debian/matrix-synapse-py3.triggers
vendored
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
# Register interest in Python interpreter changes and
|
||||||
|
# don't make the Python package dependent on the virtualenv package
|
||||||
|
# processing (noawait)
|
||||||
|
interest-noawait /usr/bin/python3.5
|
||||||
|
interest-noawait /usr/bin/python3.6
|
||||||
|
interest-noawait /usr/bin/python3.7
|
||||||
|
|
||||||
|
# Also provide a symbolic trigger for all dh-virtualenv packages
|
||||||
|
interest dh-virtualenv-interpreter-update
|
||||||
2
debian/matrix-synapse.service
vendored
2
debian/matrix-synapse.service
vendored
@@ -5,7 +5,7 @@ Description=Synapse Matrix homeserver
|
|||||||
Type=notify
|
Type=notify
|
||||||
User=matrix-synapse
|
User=matrix-synapse
|
||||||
WorkingDirectory=/var/lib/matrix-synapse
|
WorkingDirectory=/var/lib/matrix-synapse
|
||||||
EnvironmentFile=-/etc/default/matrix-synapse
|
EnvironmentFile=/etc/default/matrix-synapse
|
||||||
ExecStartPre=/opt/venvs/matrix-synapse/bin/python -m synapse.app.homeserver --config-path=/etc/matrix-synapse/homeserver.yaml --config-path=/etc/matrix-synapse/conf.d/ --generate-keys
|
ExecStartPre=/opt/venvs/matrix-synapse/bin/python -m synapse.app.homeserver --config-path=/etc/matrix-synapse/homeserver.yaml --config-path=/etc/matrix-synapse/conf.d/ --generate-keys
|
||||||
ExecStart=/opt/venvs/matrix-synapse/bin/python -m synapse.app.homeserver --config-path=/etc/matrix-synapse/homeserver.yaml --config-path=/etc/matrix-synapse/conf.d/
|
ExecStart=/opt/venvs/matrix-synapse/bin/python -m synapse.app.homeserver --config-path=/etc/matrix-synapse/homeserver.yaml --config-path=/etc/matrix-synapse/conf.d/
|
||||||
ExecReload=/bin/kill -HUP $MAINPID
|
ExecReload=/bin/kill -HUP $MAINPID
|
||||||
|
|||||||
37
debian/register_new_matrix_user.1
vendored
37
debian/register_new_matrix_user.1
vendored
@@ -1,47 +1,72 @@
|
|||||||
.\" generated with Ronn-NG/v0.8.0
|
.\" generated with Ronn/v0.7.3
|
||||||
.\" http://github.com/apjanke/ronn-ng/tree/0.8.0
|
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
||||||
.TH "REGISTER_NEW_MATRIX_USER" "1" "July 2021" "" ""
|
.
|
||||||
|
.TH "REGISTER_NEW_MATRIX_USER" "1" "February 2017" "" ""
|
||||||
|
.
|
||||||
.SH "NAME"
|
.SH "NAME"
|
||||||
\fBregister_new_matrix_user\fR \- Used to register new users with a given home server when registration has been disabled
|
\fBregister_new_matrix_user\fR \- Used to register new users with a given home server when registration has been disabled
|
||||||
|
.
|
||||||
.SH "SYNOPSIS"
|
.SH "SYNOPSIS"
|
||||||
\fBregister_new_matrix_user\fR options\|\.\|\.\|\.
|
\fBregister_new_matrix_user\fR options\.\.\.
|
||||||
|
.
|
||||||
.SH "DESCRIPTION"
|
.SH "DESCRIPTION"
|
||||||
\fBregister_new_matrix_user\fR registers new users with a given home server when registration has been disabled\. For this to work, the home server must be configured with the \'registration_shared_secret\' option set\.
|
\fBregister_new_matrix_user\fR registers new users with a given home server when registration has been disabled\. For this to work, the home server must be configured with the \'registration_shared_secret\' option set\.
|
||||||
|
.
|
||||||
.P
|
.P
|
||||||
This accepts the user credentials like the username, password, is user an admin or not and registers the user onto the homeserver database\. Also, a YAML file containing the shared secret can be provided\. If not, the shared secret can be provided via the command line\.
|
This accepts the user credentials like the username, password, is user an admin or not and registers the user onto the homeserver database\. Also, a YAML file containing the shared secret can be provided\. If not, the shared secret can be provided via the command line\.
|
||||||
|
.
|
||||||
.P
|
.P
|
||||||
By default it assumes the home server URL to be \fBhttps://localhost:8448\fR\. This can be changed via the \fBserver_url\fR command line option\.
|
By default it assumes the home server URL to be \fBhttps://localhost:8448\fR\. This can be changed via the \fBserver_url\fR command line option\.
|
||||||
|
.
|
||||||
.SH "FILES"
|
.SH "FILES"
|
||||||
A sample YAML file accepted by \fBregister_new_matrix_user\fR is described below:
|
A sample YAML file accepted by \fBregister_new_matrix_user\fR is described below:
|
||||||
|
.
|
||||||
.IP "" 4
|
.IP "" 4
|
||||||
|
.
|
||||||
.nf
|
.nf
|
||||||
|
|
||||||
registration_shared_secret: "s3cr3t"
|
registration_shared_secret: "s3cr3t"
|
||||||
|
.
|
||||||
.fi
|
.fi
|
||||||
|
.
|
||||||
.IP "" 0
|
.IP "" 0
|
||||||
|
.
|
||||||
.SH "OPTIONS"
|
.SH "OPTIONS"
|
||||||
|
.
|
||||||
.TP
|
.TP
|
||||||
\fB\-u\fR, \fB\-\-user\fR
|
\fB\-u\fR, \fB\-\-user\fR
|
||||||
Local part of the new user\. Will prompt if omitted\.
|
Local part of the new user\. Will prompt if omitted\.
|
||||||
|
.
|
||||||
.TP
|
.TP
|
||||||
\fB\-p\fR, \fB\-\-password\fR
|
\fB\-p\fR, \fB\-\-password\fR
|
||||||
New password for user\. Will prompt if omitted\. Supplying the password on the command line is not recommended\. Use the STDIN instead\.
|
New password for user\. Will prompt if omitted\. Supplying the password on the command line is not recommended\. Use the STDIN instead\.
|
||||||
|
.
|
||||||
.TP
|
.TP
|
||||||
\fB\-a\fR, \fB\-\-admin\fR
|
\fB\-a\fR, \fB\-\-admin\fR
|
||||||
Register new user as an admin\. Will prompt if omitted\.
|
Register new user as an admin\. Will prompt if omitted\.
|
||||||
|
.
|
||||||
.TP
|
.TP
|
||||||
\fB\-c\fR, \fB\-\-config\fR
|
\fB\-c\fR, \fB\-\-config\fR
|
||||||
Path to server config file containing the shared secret\.
|
Path to server config file containing the shared secret\.
|
||||||
|
.
|
||||||
.TP
|
.TP
|
||||||
\fB\-k\fR, \fB\-\-shared\-secret\fR
|
\fB\-k\fR, \fB\-\-shared\-secret\fR
|
||||||
Shared secret as defined in server config file\. This is an optional parameter as it can be also supplied via the YAML file\.
|
Shared secret as defined in server config file\. This is an optional parameter as it can be also supplied via the YAML file\.
|
||||||
|
.
|
||||||
.TP
|
.TP
|
||||||
\fBserver_url\fR
|
\fBserver_url\fR
|
||||||
URL of the home server\. Defaults to \'https://localhost:8448\'\.
|
URL of the home server\. Defaults to \'https://localhost:8448\'\.
|
||||||
|
.
|
||||||
.SH "EXAMPLES"
|
.SH "EXAMPLES"
|
||||||
|
.
|
||||||
.nf
|
.nf
|
||||||
|
|
||||||
$ register_new_matrix_user \-u user1 \-p p@ssword \-a \-c config\.yaml
|
$ register_new_matrix_user \-u user1 \-p p@ssword \-a \-c config\.yaml
|
||||||
|
.
|
||||||
.fi
|
.fi
|
||||||
|
.
|
||||||
.SH "COPYRIGHT"
|
.SH "COPYRIGHT"
|
||||||
This man page was written by Rahul De <\fI\%mailto:rahulde@swecha\.net\fR> for Debian GNU/Linux distribution\.
|
This man page was written by Rahul De <\fIrahulde@swecha\.net\fR> for Debian GNU/Linux distribution\.
|
||||||
|
.
|
||||||
.SH "SEE ALSO"
|
.SH "SEE ALSO"
|
||||||
synctl(1), synapse_port_db(1), hash_password(1), synapse_review_recent_signups(1)
|
synctl(1), synapse_port_db(1), hash_password(1)
|
||||||
|
|||||||
2
debian/register_new_matrix_user.ronn
vendored
2
debian/register_new_matrix_user.ronn
vendored
@@ -58,4 +58,4 @@ for Debian GNU/Linux distribution.
|
|||||||
|
|
||||||
## SEE ALSO
|
## SEE ALSO
|
||||||
|
|
||||||
synctl(1), synapse_port_db(1), hash_password(1), synapse_review_recent_signups(1)
|
synctl(1), synapse_port_db(1), hash_password(1)
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user