summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorAndrej Shadura <andrewsh@debian.org>2019-10-27 10:14:09 +0100
committerAndrej Shadura <andrewsh@debian.org>2019-10-27 10:14:09 +0100
commitc31e324e81acb92090b208cfb402253e29297e4f (patch)
treed5e8bef11da0a50cb7aec3396f4100ff3ea052bb /contrib
parenta75cba04245cf6393199570a1a51de951c6aa237 (diff)
New upstream version 1.5.0~rc1
Diffstat (limited to 'contrib')
-rw-r--r--contrib/docker/README.md35
-rw-r--r--contrib/docker/docker-compose.yml21
-rw-r--r--contrib/experiments/test_messaging.py2
-rw-r--r--contrib/graph/graph2.py4
4 files changed, 30 insertions, 32 deletions
diff --git a/contrib/docker/README.md b/contrib/docker/README.md
index af102f75..89c1518b 100644
--- a/contrib/docker/README.md
+++ b/contrib/docker/README.md
@@ -1,39 +1,26 @@
-# Synapse Docker
-
-FIXME: this is out-of-date as of
-https://github.com/matrix-org/synapse/issues/5518. Contributions to bring it up
-to date would be welcome.
-
-### Automated configuration
-
-It is recommended that you use Docker Compose to run your containers, including
-this image and a Postgres server. A sample ``docker-compose.yml`` is provided,
-including example labels for reverse proxying and other artifacts.
-
-Read the section about environment variables and set at least mandatory variables,
-then run the server:
-
-```
-docker-compose up -d
-```
-If secrets are not specified in the environment variables, they will be generated
-as part of the startup. Please ensure these secrets are kept between launches of the
-Docker container, as their loss may require users to log in again.
+# Synapse Docker
-### Manual configuration
+### Configuration
A sample ``docker-compose.yml`` is provided, including example labels for
reverse proxying and other artifacts. The docker-compose file is an example,
please comment/uncomment sections that are not suitable for your usecase.
Specify a ``SYNAPSE_CONFIG_PATH``, preferably to a persistent path,
-to use manual configuration. To generate a fresh ``homeserver.yaml``, simply run:
+to use manual configuration.
+
+To generate a fresh `homeserver.yaml`, you can use the `generate` command.
+(See the [documentation](../../docker/README.md#generating-a-configuration-file)
+for more information.) You will need to specify appropriate values for at least the
+`SYNAPSE_SERVER_NAME` and `SYNAPSE_REPORT_STATS` environment variables. For example:
```
-docker-compose run --rm -e SYNAPSE_SERVER_NAME=my.matrix.host synapse generate
+docker-compose run --rm -e SYNAPSE_SERVER_NAME=my.matrix.host -e SYNAPSE_REPORT_STATS=yes synapse generate
```
+(This will also generate necessary signing keys.)
+
Then, customize your configuration and run the server:
```
diff --git a/contrib/docker/docker-compose.yml b/contrib/docker/docker-compose.yml
index 1e4ee437..72c87054 100644
--- a/contrib/docker/docker-compose.yml
+++ b/contrib/docker/docker-compose.yml
@@ -15,13 +15,10 @@ services:
restart: unless-stopped
# See the readme for a full documentation of the environment settings
environment:
- - SYNAPSE_SERVER_NAME=my.matrix.host
- - SYNAPSE_REPORT_STATS=no
- - SYNAPSE_ENABLE_REGISTRATION=yes
- - SYNAPSE_LOG_LEVEL=INFO
- - POSTGRES_PASSWORD=changeme
+ - SYNAPSE_CONFIG_PATH=/etc/homeserver.yaml
volumes:
# You may either store all the files in a local folder
+ - ./matrix-config:/etc
- ./files:/data
# .. or you may split this between different storage points
# - ./files:/data
@@ -35,9 +32,23 @@ services:
- 8448:8448/tcp
# ... or use a reverse proxy, here is an example for traefik:
labels:
+ # The following lines are valid for Traefik version 1.x:
- traefik.enable=true
- traefik.frontend.rule=Host:my.matrix.Host
- traefik.port=8008
+ # Alternatively, for Traefik version 2.0:
+ - traefik.enable=true
+ - traefik.http.routers.http-synapse.entryPoints=http
+ - traefik.http.routers.http-synapse.rule=Host(`my.matrix.host`)
+ - traefik.http.middlewares.https_redirect.redirectscheme.scheme=https
+ - traefik.http.middlewares.https_redirect.redirectscheme.permanent=true
+ - traefik.http.routers.http-synapse.middlewares=https_redirect
+ - traefik.http.routers.https-synapse.entryPoints=https
+ - traefik.http.routers.https-synapse.rule=Host(`my.matrix.host`)
+ - traefik.http.routers.https-synapse.service=synapse
+ - traefik.http.routers.https-synapse.tls=true
+ - traefik.http.services.synapse.loadbalancer.server.port=8008
+ - traefik.http.routers.https-synapse.tls.certResolver=le-ssl
db:
image: docker.io/postgres:10-alpine
diff --git a/contrib/experiments/test_messaging.py b/contrib/experiments/test_messaging.py
index 5ef140ae..6b22400a 100644
--- a/contrib/experiments/test_messaging.py
+++ b/contrib/experiments/test_messaging.py
@@ -339,7 +339,7 @@ def main(stdscr):
root_logger = logging.getLogger()
formatter = logging.Formatter(
- "%(asctime)s - %(name)s - %(lineno)d - " "%(levelname)s - %(message)s"
+ "%(asctime)s - %(name)s - %(lineno)d - %(levelname)s - %(message)s"
)
if not os.path.exists("logs"):
os.makedirs("logs")
diff --git a/contrib/graph/graph2.py b/contrib/graph/graph2.py
index 9db8725e..4619f0e3 100644
--- a/contrib/graph/graph2.py
+++ b/contrib/graph/graph2.py
@@ -36,7 +36,7 @@ def make_graph(db_name, room_id, file_prefix, limit):
args = [room_id]
if limit:
- sql += " ORDER BY topological_ordering DESC, stream_ordering DESC " "LIMIT ?"
+ sql += " ORDER BY topological_ordering DESC, stream_ordering DESC LIMIT ?"
args.append(limit)
@@ -53,7 +53,7 @@ def make_graph(db_name, room_id, file_prefix, limit):
for event in events:
c = conn.execute(
- "SELECT state_group FROM event_to_state_groups " "WHERE event_id = ?",
+ "SELECT state_group FROM event_to_state_groups WHERE event_id = ?",
(event.event_id,),
)