### Install coturn using apt Source: https://matrix-org.github.io/synapse/latest/setup/turn/coturn.html Installs the coturn package and starts the systemd service. Use this method for Debian-based systems. ```bash sudo apt install coturn ``` -------------------------------- ### Starting Synapse Main Process with Poetry Source: https://matrix-org.github.io/synapse/latest/workers.html Use this command to start the main Synapse homeserver process when installed from source using Poetry. ```bash poetry run synapse_homeserver --config-file [your homeserver.yaml] ``` -------------------------------- ### Configure and install coturn from source Source: https://matrix-org.github.io/synapse/latest/setup/turn/coturn.html Steps to download, configure, build, and install coturn from its source code. Ensure libevent2 is installed if prompted. ```bash ./configure ``` ```bash make sudo make install ``` -------------------------------- ### Install openSUSE Prerequisites Source: https://matrix-org.github.io/synapse/latest/setup/installation.html Installs development patterns and packages for Synapse on openSUSE. ```bash 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 \ libicu-devel ``` -------------------------------- ### Start Synapse Homeserver Source: https://matrix-org.github.io/synapse/latest/setup/installation.html Start the Synapse homeserver from its working directory after activating the virtual environment. ```bash cd ~/synapse source env/bin/activate synctl start ``` -------------------------------- ### Install Synapse on Void Linux Source: https://matrix-org.github.io/synapse/latest/setup/installation.html Update repositories and install Synapse using xbps-install. ```bash xbps-install -Su xbps-install -S synapse ``` -------------------------------- ### Activate virtualenv and start Synapse Source: https://matrix-org.github.io/synapse/latest/setup/installation.html If Synapse was installed via pip, activate its virtual environment and start the Synapse service before running user registration commands. ```bash cd ~/synapse source env/bin/activate synctl start # if not already running ``` -------------------------------- ### Install Synapse on OpenBSD Source: https://matrix-org.github.io/synapse/latest/setup/installation.html Install Synapse using the pre-compiled binary package. Ensure the filesystem for /var/synapse is mounted with 'wxallowed'. ```bash doas pkg_add synapse ``` -------------------------------- ### Install Dependencies in User Space Source: https://matrix-org.github.io/synapse/latest/upgrade.html Install new dependencies by running setup.py in develop mode for the current user. ```bash python setup.py develop --user ``` -------------------------------- ### Example JSON body to start a background update job Source: https://matrix-org.github.io/synapse/latest/usage/administration/admin_api/background_updates.html Provides the JSON payload for scheduling a specific background update job. ```json { "job_name": "populate_stats_process_rooms" } ``` -------------------------------- ### Install Synapse on Alpine Linux Source: https://matrix-org.github.io/synapse/latest/setup/installation.html Install Synapse from the community repository using apk. ```bash sudo apk add synapse ``` -------------------------------- ### Starting Synapse Worker Process with Poetry Source: https://matrix-org.github.io/synapse/latest/workers.html Use this command to start a Synapse worker process when installed from source using Poetry, specifying both the main homeserver and worker configuration files. ```bash poetry run synapse_worker --config-file [your homeserver.yaml] --config-file [your worker.yaml] ``` -------------------------------- ### Install Synapse on FreeBSD Source: https://matrix-org.github.io/synapse/latest/setup/installation.html Install Synapse using either the Ports collection or pre-compiled packages. ```bash cd /usr/ports/net-im/py-matrix-synapse && make install clean pkg install py38-matrix-synapse ``` -------------------------------- ### Install Synapse on OpenSUSE Source: https://matrix-org.github.io/synapse/latest/setup/installation.html Use zypper to install the Synapse package from the OpenSUSE repositories. ```bash sudo zypper install matrix-synapse ``` -------------------------------- ### Start Synapse Demo Servers Source: https://matrix-org.github.io/synapse/latest/development/demo.html Starts the Synapse demo servers, generating configuration if needed. An optional --no-rate-limit flag can be used to disable rate limiting. ```bash ./demo/stop.sh; ./demo/clean.sh && ./demo/start.sh ``` -------------------------------- ### Install Synapse Dependencies with Poetry Source: https://matrix-org.github.io/synapse/latest/development/contributing_guide.html Navigate to your cloned repository and install all runtime and developer dependencies for Synapse using Poetry. Ensure the 'poetry install' command completes successfully. ```bash cd path/where/you/have/cloned/the/repository poetry install --extras all ``` -------------------------------- ### Build and Install Synapse on OpenBSD Source: https://matrix-org.github.io/synapse/latest/setup/installation.html Navigates to the Synapse port directory and initiates the build and installation process on OpenBSD. ```bash cd /usr/ports/net/synapse make install ``` -------------------------------- ### Install Ubuntu/Debian Prerequisites Source: https://matrix-org.github.io/synapse/latest/setup/installation.html Installs essential build tools and Python development headers for Synapse on Ubuntu or Debian systems. ```bash sudo apt install build-essential python3-dev libffi-dev \ python3-pip python3-setuptools sqlite3 \ libssl-dev virtualenv libjpeg-dev libxslt1-dev libicu-dev ``` -------------------------------- ### Install CentOS/Fedora Prerequisites Source: https://matrix-org.github.io/synapse/latest/setup/installation.html Installs development libraries and tools required for Synapse on CentOS or Fedora Linux. ```bash 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 \ libicu-devel sudo dnf groupinstall "Development Tools" ``` -------------------------------- ### Example .well-known/matrix/server for specific routing Source: https://matrix-org.github.io/synapse/latest/delegate.html This example shows how to configure the .well-known file to route federation traffic to synapse.example.com on port 443. ```json { "m.server": "synapse.example.com:443" } ``` -------------------------------- ### Example User Registration Prompt Source: https://matrix-org.github.io/synapse/latest/setup/installation.html This is an example of the interactive prompts you will encounter when running `register_new_matrix_user` to create a new user account. ```text New user localpart: erikj Password: Confirm password: Make admin [no]: Success! ``` -------------------------------- ### Install Synapse on Fedora Source: https://matrix-org.github.io/synapse/latest/setup/installation.html Use dnf to install the Synapse package from the Fedora repositories. ```bash sudo dnf install matrix-synapse ``` -------------------------------- ### Install Synapse on Debian/Ubuntu (Prerelease Channel) Source: https://matrix-org.github.io/synapse/latest/setup/installation.html Installs a release candidate version of Synapse by enabling the prerelease channel in APT sources. Requires `lsb-release`, `wget`, and `apt-transport-https`. ```bash sudo wget -O /usr/share/keyrings/matrix-org-archive-keyring.gpg https://packages.matrix.org/debian/matrix-org-archive-keyring.gpg ``` ```bash echo "deb [signed-by=/usr/share/keyrings/matrix-org-archive-keyring.gpg] https://packages.matrix.org/debian/ $(lsb_release -cs) main prerelease" | sudo tee /etc/apt/sources.list.d/matrix-org.list ``` ```bash sudo apt update ``` ```bash sudo apt install matrix-synapse-py3 ``` -------------------------------- ### Install Synapse on Debian/Ubuntu (Latest Release) Source: https://matrix-org.github.io/synapse/latest/setup/installation.html Installs the latest stable release of Synapse using official Matrix.org Debian packages. Ensure you have `lsb-release`, `wget`, and `apt-transport-https` installed. ```bash sudo apt install -y lsb-release wget apt-transport-https ``` ```bash sudo wget -O /usr/share/keyrings/matrix-org-archive-keyring.gpg https://packages.matrix.org/debian/matrix-org-archive-keyring.gpg ``` ```bash 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 ``` ```bash sudo apt update ``` ```bash sudo apt install matrix-synapse-py3 ``` -------------------------------- ### Example of calling user_may_send_3pid_invite Source: https://matrix-org.github.io/synapse/latest/modules/spam_checker_callbacks.html This example demonstrates how to call the `user_may_send_3pid_invite` callback with specific parameters for inviting a user via email. ```python await user_may_send_3pid_invite( "@bob:example.com", # The inviter's user ID "email", # The medium of the 3PID to invite "alice@example.com", # The address of the 3PID to invite "!some_room:example.com", # The ID of the room to send the invite into ) ``` -------------------------------- ### Start Synapse with Python 3 Virtual Environment Source: https://matrix-org.github.io/synapse/latest/upgrade.html After activating the Python 3 virtual environment, use these commands to navigate to your Synapse directory and start the server. Ensure the virtual environment is active before running synctl. ```bash cd ~/synapse source env3/bin/activate synctl start ``` -------------------------------- ### Install Synapse from Debian Repositories (bookworm/sid) Source: https://matrix-org.github.io/synapse/latest/setup/installation.html Installs the `matrix-synapse` package directly from the Debian repositories for `bookworm` and `sid` distributions. ```bash sudo apt install matrix-synapse ``` -------------------------------- ### Install Dependencies with Poetry Source: https://matrix-org.github.io/synapse/latest/development/dependencies.html Installs all project dependencies, including optional extras, and synchronizes the lock file with the current environment. ```bash poetry install --all-extras --sync ``` -------------------------------- ### Install PostgreSQL Python Client Source: https://matrix-org.github.io/synapse/latest/postgres.html Install the necessary Python client library for PostgreSQL. This command assumes you are using a virtual environment. ```bash ~/synapse/env/bin/pip install "matrix-synapse[postgres]" ``` -------------------------------- ### Install ArchLinux Prerequisites Source: https://matrix-org.github.io/synapse/latest/setup/installation.html Installs necessary packages for building Synapse on ArchLinux, including development tools and Python components. ```bash sudo pacman -S base-devel python python-pip \ python-setuptools python-virtualenv sqlite3 icu ``` -------------------------------- ### Example Module Configuration in YAML Source: https://matrix-org.github.io/synapse/latest/code_style.html This example shows how to configure modules in Synapse's YAML configuration. It demonstrates adding a module with specific configuration options, including nested dictionaries and boolean flags. ```yaml modules: - module: my_super_module.MySuperClass config: do_thing: true - module: my_other_super_module.SomeClass config: {} ``` -------------------------------- ### Example Password Authentication Provider Source: https://matrix-org.github.io/synapse/latest/modules/password_auth_provider_callbacks.html An example implementation of a custom password authentication provider, demonstrating how to register and implement `check_my_login` and `check_pass` callbacks. ```APIDOC ## Password Authentication Provider Example The example module below implements authentication checkers for two different login types: * `my.login.type` * Expects a `my_field` field to be sent to `/login` * Is checked by the method: `self.check_my_login` * `m.login.password` (defined in the spec) * Expects a `password` field to be sent to `/login` * Is checked by the method: `self.check_pass` ``` __ from typing import Awaitable, Callable, Optional, Tuple import synapse from synapse import module_api class MyAuthProvider: def __init__(self, config: dict, api: module_api): self.api = api self.credentials = { "bob": "building", "@scoop:matrix.org": "digging", } api.register_password_auth_provider_callbacks( auth_checkers= { ("my.login_type", ("my_field",)): self.check_my_login, ("m.login.password", ("password",)): self.check_pass, }, ) async def check_my_login( self, username: str, login_type: str, login_dict: "synapse.module_api.JsonDict", ) -> Optional[ Tuple[ str, Optional[Callable[["synapse.module_api.LoginResponse"], Awaitable[None]]], ] ]: if login_type != "my.login_type": return None if self.credentials.get(username) == login_dict.get("my_field"): return (self.api.get_qualified_user_id(username), None) async def check_pass( self, username: str, login_type: str, login_dict: "synapse.module_api.JsonDict", ) -> Optional[ Tuple[ str, Optional[Callable[["synapse.module_api.LoginResponse"], Awaitable[None]]], ] ]: if login_type != "m.login.password": return None if self.credentials.get(username) == login_dict.get("password"): return (self.api.get_qualified_user_id(username), None) ``` ``` -------------------------------- ### Example OIDC Provider Configuration Source: https://matrix-org.github.io/synapse/latest/usage/configuration/config_documentation.html A generic example of how to configure an OIDC provider in Synapse, including essential details like issuer, client ID, and discovery settings. ```yaml oidc_providers: # Generic example # - idp_id: my_idp idp_name: "My OpenID provider" idp_icon: "mxc://example.com/mediaid" discover: false issuer: "https://accounts.example.com/" client_id: "provided-by-your-issuer" ``` -------------------------------- ### User Media Response Example Source: https://matrix-org.github.io/synapse/latest/admin_api/user_admin_api.html An example of the JSON response body when retrieving a user's media list. Includes media details, pagination tokens, and total counts. ```json { "media": [ { "created_ts": 100400, "last_access_ts": null, "media_id": "qXhyRzulkwLsNHTbpHreuEgo", "media_length": 67, "media_type": "image/png", "quarantined_by": null, "safe_from_quarantine": false, "upload_name": "test1.png" }, { "created_ts": 200400, "last_access_ts": null, "media_id": "FHfiSnzoINDatrXHQIXBtahw", "media_length": 67, "media_type": "image/png", "quarantined_by": null, "safe_from_quarantine": false, "upload_name": "test2.png" }, { "created_ts": 300400, "last_access_ts": 300700, "media_id": "BzYNLRUgGHphBkdKGbzXwbjX", "media_length": 1337, "media_type": "application/octet-stream", "quarantined_by": null, "safe_from_quarantine": false, "upload_name": null } ], "next_token": 3, "total": 2 } ``` -------------------------------- ### Install Synapse with Redis Dependencies Source: https://matrix-org.github.io/synapse/latest/workers.html Install Synapse with the necessary dependencies for Redis support, which is required for worker communication. This command is typically run within a virtual environment. ```bash pip install "matrix-synapse[redis]" ``` -------------------------------- ### Worker YAML Configuration Example (Updated) Source: https://matrix-org.github.io/synapse/latest/upgrade.html Example of an updated worker YAML configuration, removing deprecated `worker_replication_*` settings and relying on the shared `instance_map`. ```yaml worker_app: synapse.app.generic_worker worker_name: generic_worker1 worker_listeners: - type: http port: 1234 resources: - names: [client, federation] - type: http port: 5678 resources: - names: [replication] worker_log_config: /etc/matrix-synapse/generic-worker-log.yaml ``` -------------------------------- ### Set up Synapse Virtual Environment Source: https://matrix-org.github.io/synapse/latest/setup/installation.html Create a directory, set up a Python virtual environment, and install Synapse along with its dependencies from PyPI. ```bash 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 ``` -------------------------------- ### GET Request for Event Reports Source: https://matrix-org.github.io/synapse/latest/admin_api/event_reports.html This is an example of a GET request to the event reports endpoint. It demonstrates how to fetch a list of reported events with optional pagination parameters. ```http GET /_synapse/admin/v1/event_reports?from=0&limit=10 ``` -------------------------------- ### Run Homeserver with Configuration Source: https://matrix-org.github.io/synapse/latest/upgrade.html Start the homeserver using the specified configuration file after it has been generated or edited. ```bash $ python synapse/app/homeserver.py --config-path homeserver.config ``` -------------------------------- ### Recreate Poetry Virtual Environment Source: https://matrix-org.github.io/synapse/latest/development/dependencies.html Removes all existing virtual environments for the project and then recreates them with all extras installed. Ensure you deactivate any active virtual environment before starting. ```bash # Stop the current virtualenv if active $ deactivate # Remove all of the files from the current environment. # Don't worry, even though it says "all", this will only # remove the Poetry virtualenvs for the current project. $ poetry env remove --all # Reactivate Poetry shell to create the virtualenv again $ poetry shell # Install everything again $ poetry install --extras all ``` -------------------------------- ### Example Server Version Response (JSON) Source: https://matrix-org.github.io/synapse/latest/admin_api/version_api.html The API returns a JSON object containing the server version. Note that the `python_version` key was removed starting from Synapse 1.94.0. ```json { "server_version": "0.99.2rc1 (b=develop, abcdef123)" } ``` -------------------------------- ### Shibboleth OIDC Relying Party Configuration Source: https://matrix-org.github.io/synapse/latest/openid.html Example configuration for Shibboleth as an OpenID Connect provider. Ensure `client_id` and `client_secret` are securely generated and that the `redirect_uris` match your Synapse installation. ```json { "client_id": "SOME-CLIENT-ID", "client_secret": "SOME-SUPER-SECRET-SECRET", "response_types": ["code"], "grant_types": ["authorization_code"], "scope": "openid profile email", "redirect_uris": ["https://[synapse public baseurl]/_synapse/client/oidc/callback"] } ``` -------------------------------- ### Copy Sample Configuration Files Source: https://matrix-org.github.io/synapse/latest/development/contributing_guide.html Before starting a local Synapse instance, copy the sample configuration files to your working directory. You will need to edit `homeserver.yaml` to configure your instance. ```bash cp docs/sample_config.yaml homeserver.yaml cp docs/sample_log_config.yaml log_config.yaml ``` -------------------------------- ### Federation Destination Retry Info Response Source: https://matrix-org.github.io/synapse/latest/usage/administration/admin_api/federation.html This is an example of the JSON response body returned by the GET /_synapse/admin/v1/federation/destinations endpoint. It details the federation status, retry timings, and failure timestamps for remote servers. ```json { "destinations":[ { "destination": "matrix.org", "retry_last_ts": 1557332397936, "retry_interval": 3000000, "failure_ts": 1557329397936, "last_successful_stream_ordering": null } ], "total": 1 } ``` -------------------------------- ### View Synapse Configuration Help Source: https://matrix-org.github.io/synapse/latest/usage/configuration/config_documentation.html Run this command to access the help reference for Synapse configuration options. ```bash python -m synapse.config --help ``` -------------------------------- ### Address Docker Port Binding Error Source: https://matrix-org.github.io/synapse/latest/development/contributing_guide.html An example error message indicating that port 5432 is already in use, likely by a locally running PostgreSQL instance. This suggests stopping the existing instance before starting a new one via Docker. ```bash docker: Error response from daemon: driver failed programming external connectivity on endpoint nice_ride (b57bbe2e251b70015518d00c9981e8cb8346b5c785250341a6c53e3c899875f1): Error starting userland proxy: listen tcp4 0.0.0.0:5432: bind: address already in use. ``` -------------------------------- ### Install Twisted Dependency Source: https://matrix-org.github.io/synapse/latest/setup/installation.html Use this command to individually install the Twisted dependency if pip runs into memory issues during Synapse installation. ```bash pip install twisted ``` -------------------------------- ### Enable a Synapse Configuration Setting Source: https://matrix-org.github.io/synapse/latest/usage/configuration/config_documentation.html Example showing how to enable a configuration setting by uncommenting it in the YAML file. ```yaml pid_file: DATADIR/homeserver.pid ``` -------------------------------- ### Install New Python Dependencies Source: https://matrix-org.github.io/synapse/latest/upgrade.html Install new Python dependencies required for the Synapse upgrade. This command uses xargs to pipe the list of dependencies to pip install. ```bash python synapse/python_dependencies.py | xargs -n 1 pip install ``` -------------------------------- ### Install PyICU for Improved User Search Source: https://matrix-org.github.io/synapse/latest/upgrade.html To enable improved user search with Unicode characters, install PyICU and its development headers. Then, install matrix-synapse with the user-search extra. ```bash pip install matrix-synapse[user-search] ``` -------------------------------- ### Install OIDC Dependencies for Synapse Source: https://matrix-org.github.io/synapse/latest/openid.html Install the necessary dependencies for OpenID Connect integration if Synapse was installed in a virtual environment. This ensures the 'authlib' library and related packages are available. ```bash /path/to/env/bin/pip install matrix-synapse[oidc] ``` -------------------------------- ### Sample homeserver.yaml Configuration Source: https://matrix-org.github.io/synapse/latest/usage/configuration/homeserver_sample_config.html This is a sample homeserver configuration file for Synapse. It outlines various settings for server name, database, logging, media storage, and trusted key servers. Note that this file is for reference and should not be directly copied; generate a fresh configuration using Synapse. ```yaml # This file is maintained as an up-to-date snapshot of the default # homeserver.yaml configuration generated by Synapse. You can find a # complete accounting of possible configuration options at # https://matrix-org.github.io/synapse/latest/usage/configuration/config_documentation.html # # It is *not* intended to be copied and used as the basis for a real # homeserver.yaml. Instead, if you are starting from scratch, please generate # a fresh config using Synapse by following the instructions in # https://matrix-org.github.io/synapse/latest/setup/installation.html. # ################################################################################ # Configuration file for Synapse. # # This is a YAML file: see [1] for a quick introduction. Note in particular # that *indentation is important*: all the elements of a list or dictionary # should have the same indentation. # # [1] https://docs.ansible.com/ansible/latest/reference_appendices/YAMLSyntax.html # # For more information on how to configure Synapse, including a complete accounting of # each option, go to docs/usage/configuration/config_documentation.md or # https://matrix-org.github.io/synapse/latest/usage/configuration/config_documentation.html server_name: "SERVERNAME" pid_file: DATADIR/homeserver.pid listeners: - port: 8008 tls: false type: http x_forwarded: true bind_addresses: ['::1', '127.0.0.1'] resources: - names: [client, federation] compress: false database: name: sqlite3 args: database: DATADIR/homeserver.db log_config: "CONFDIR/SERVERNAME.log.config" media_store_path: DATADIR/media_store signing_key_path: "CONFDIR/SERVERNAME.signing.key" trusted_key_servers: - server_name: "matrix.org" ``` -------------------------------- ### Configure Nested Synapse Settings Source: https://matrix-org.github.io/synapse/latest/usage/configuration/config_documentation.html Example demonstrating correct indentation for nested configuration options, such as enabling presence. ```yaml presence: enabled: false ``` -------------------------------- ### Get Rooms Joined by a User Source: https://matrix-org.github.io/synapse/latest/admin_api/user_admin_api.html Gets a list of all `room_id` that a specific `user_id` is a member of. ```APIDOC ## GET /_synapse/admin/v1/users//joined_rooms ### Description Gets a list of all `room_id` that a specific `user_id` is a member of. The server returns the list of rooms of which the user and the server are members. If the user is local, all rooms of which the user is a member are returned. ### Method GET ### Endpoint /_synapse/admin/v1/users//joined_rooms ### Parameters #### Path Parameters - **user_id** (string) - Required - The fully qualified user ID (e.g., `@user:server.com`). ### Response #### Success Response (200) - **joined_rooms** (array) - An array of `room_id` strings. - **total** (integer) - The total number of rooms the user is a member of. ### Response Example ```json { "joined_rooms": [ "!DuGcnbhHGaSZQoNQR:matrix.org", "!ZtSaPCawyWtxfWiIy:matrix.org" ], "total": 2 } ``` ``` -------------------------------- ### Start Specific Background Job Source: https://matrix-org.github.io/synapse/latest/usage/administration/admin_api/background_updates.html Schedules and immediately starts a specific background update job. ```APIDOC ## POST /_synapse/admin/v1/background_updates/start_job ### Description Schedules a specific background update to run. The job starts immediately after calling the API. ### Method POST ### Endpoint /_synapse/admin/v1/background_updates/start_job ### Request Body - **job_name** (string) - Required - The name of the job to run. Valid values are: `populate_stats_process_rooms` (Recalculate the stats for all rooms) or `regenerate_directory` (Recalculate the user directory if it is stale or out of sync). ### Request Example ```json { "job_name": "populate_stats_process_rooms" } ``` ``` -------------------------------- ### Initial Port to PostgreSQL Source: https://matrix-org.github.io/synapse/latest/postgres.html Run the `synapse_port_db` script with the SQLite snapshot and PostgreSQL configuration to perform the initial data migration. ```bash synapse_port_db --sqlite-database homeserver.db.snapshot \ --postgres-config homeserver-postgres.yaml ``` -------------------------------- ### Upgrade Synapse Installation Source: https://matrix-org.github.io/synapse/latest/setup/installation.html Upgrade an existing Synapse installation within its virtual environment using pip. ```bash source ~/synapse/env/bin/activate pip install -U matrix-synapse ``` -------------------------------- ### Install Django and django-mama-cas Source: https://matrix-org.github.io/synapse/latest/development/cas.html Installs specific versions of Django and django-mama-cas. Ensure your virtual environment is activated. ```bash python -m pip install "django<3" "django-mama-cas==2.4.0" ``` -------------------------------- ### GET: Get background updates enabled state Source: https://matrix-org.github.io/synapse/latest/usage/administration/admin_api/background_updates.html Retrieves the current enabled state of background updates. ```http GET /_synapse/admin/v1/background_updates/enabled ``` -------------------------------- ### Setup SQLite Database Source: https://matrix-org.github.io/synapse/latest/development/cas.html Applies database migrations to set up the SQLite database for the Django project. This is a required step after creating the project. ```bash python manage.py migrate ``` -------------------------------- ### Run Trial with PostgreSQL Source: https://matrix-org.github.io/synapse/latest/development/contributing_guide.html Executes the 'trial' test runner after setting PostgreSQL environment variables. This assumes PostgreSQL is configured locally and accessible via the specified environment variables. ```bash trial ``` -------------------------------- ### Worker YAML Configuration Example (Old) Source: https://matrix-org.github.io/synapse/latest/upgrade.html Example of a worker YAML configuration using deprecated `worker_replication_*` settings. ```yaml worker_app: synapse.app.generic_worker worker_name: generic_worker1 worker_replication_host: localhost worker_replication_http_port: 3456 worker_replication_http_tls: false worker_listeners: - type: http port: 1234 resources: - names: [client, federation] - type: http port: 5678 resources: - names: [replication] worker_log_config: /etc/matrix-synapse/generic-worker-log.yaml ``` -------------------------------- ### Shared YAML Configuration Example Source: https://matrix-org.github.io/synapse/latest/upgrade.html Example of a shared YAML configuration for Synapse workers, defining instance maps. ```yaml instance_map: generic_worker1: host: localhost port: 5678 tls: false ``` -------------------------------- ### Run Synapse Local Instance Source: https://matrix-org.github.io/synapse/latest/development/contributing_guide.html After configuring `homeserver.yaml`, run Synapse using the `poetry run` command. Ensure your `server_name` is set and paths are correct. ```bash poetry run python -m synapse.app.homeserver -c homeserver.yaml ``` -------------------------------- ### Install macOS Homebrew Dependencies Source: https://matrix-org.github.io/synapse/latest/setup/installation.html Installs additional dependencies like libjpeg and libpq on ARM-based Macs using Homebrew. ```bash brew install jpeg libpq ``` -------------------------------- ### Prepare Database for v0.5.0 Upgrade Source: https://matrix-org.github.io/synapse/latest/upgrade.html Execute the database preparation script before restarting the homeserver for the v0.5.0 upgrade. This script saves user information but purges messages, room memberships, and alias mappings. Manual intervention may be required for conflict resolution. Ensure the homeserver is shut down before running. ```bash ./scripts/database-prepare-for-0.5.0.sh "homeserver.db" ``` -------------------------------- ### Generate Synapse Configuration Source: https://matrix-org.github.io/synapse/latest/setup/installation.html Generate the initial Synapse configuration file and keys within your virtual environment. Replace 'my.domain.name' with your server's domain and choose whether to report statistics. ```bash cd ~/synapse python -m synapse.app.homeserver \ --server-name my.domain.name \ --config-path homeserver.yaml \ --generate-config \ --report-stats=[yes|no] ``` -------------------------------- ### Example Generic Worker Configuration Source: https://matrix-org.github.io/synapse/latest/systemd-with-workers/index.html This is a sample configuration file for a generic worker. Ensure that daemonization is not enabled in Synapse configuration files when using systemd. ```yaml worker_app: synapse.app.generic_worker worker_name: generic_worker1 worker_listeners: - type: http port: 8083 x_forwarded: true resources: - names: [client, federation] worker_log_config: /etc/matrix-synapse/generic-worker-log.yaml ``` -------------------------------- ### Batched RDATA Command Example Source: https://matrix-org.github.io/synapse/latest/tcp_replication.html Illustrates how multiple RDATA commands can be batched together. Clients should only advance their token after processing the last RDATA in a batch. ```text __ > RDATA caches master batch ["get_user_by_id",["@test:localhost:8823"],1490197670513] > RDATA caches master batch ["get_user_by_id",["@test2:localhost:8823"],1490197670513] > RDATA caches master batch ["get_user_by_id",["@test3:localhost:8823"],1490197670513] > RDATA caches master 54 ["get_user_by_id",["@test4:localhost:8823"],1490197670513] ``` -------------------------------- ### Install macOS Xcode Command Line Tools Source: https://matrix-org.github.io/synapse/latest/setup/installation.html Installs the Xcode command line tools on macOS, which are often required for compiling software. ```bash xcode-select --install ``` -------------------------------- ### Create a new registration token with specified fields Source: https://matrix-org.github.io/synapse/latest/usage/administration/admin_api/registration_tokens.html This example shows how to create a registration token while specifying custom values for 'token' and 'uses_allowed'. The 'expiry_time' and other fields will use their default values if not provided. ```http POST /_synapse/admin/v1/registration_tokens/new { "token": "defg", "uses_allowed": 1 } ``` ```json { "token": "defg", "uses_allowed": 1, "pending": 0, "completed": 0, "expiry_time": null } ``` -------------------------------- ### Upgrade Synapse using Poetry Source: https://matrix-org.github.io/synapse/latest/upgrade.html If you manage your Synapse installation with Poetry, use this command to upgrade. You can include specific extras or install all available extras. ```bash poetry install # Include any relevant extras with --extras, e.g. "poetry install --extras postgres --extras oidc". It's probably easiest to run "poetry install --extras all". ```