Skip to content
Snippets Groups Projects
Commit 80de92e6 authored by Travis Ralston's avatar Travis Ralston
Browse files

Swap conduit for synapse as a more reliable container

parent 27182162
No related branches found
No related tags found
No related merge requests found
......@@ -10,6 +10,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
### Changed
* Swap out the HEIF library for better support towards [ARM64 Docker Images](https://github.com/turt2live/matrix-media-repo/issues/365).
* The development environment now uses Synapse as a homeserver. Test accounts will need recreating.
## [1.2.12] - March 31, 2022
......
......@@ -28,10 +28,18 @@ once to ensure the assets are set up correctly: follow the
[compilation steps](https://docs.t2bot.io/matrix-media-repo/installing/method/compilation.html)
posted on docs.t2bot.io.
If you'd like to use a regular Matrix client to test the media repo, `docker-compose -f dev/docker-compose.yaml up`
will give you a [Conduit](https://conduit.rs/) homeserver behind an nginx reverse proxy which routes media requests to
`http://host.docker.internal:8001`. To test accurately, it is recommended to add the following homeserver configuration
to your media repo config:
This project offers a development environment you can use to test against a client and homeserver.
As a first-time setup, run:
```bash
docker run --rm -it -v ./dev/synapse-db:/data -e SYNAPSE_SERVER_NAME=localhost -e SYNAPSE_REPORT_STATS=no matrixdotorg/synapse:latest generate
```
Then you can run `docker-compose -f dev/docker-compose.yaml up` to always bring the service online. The homeserver will
be behind an nginx reverse proxy which routes media requests to `http://host.docker.internal:8001`. To test accurately,
it is recommended to add the following homeserver configuration to your media repo config:
```yaml
name: "localhost"
csApi: "http://localhost:8008" # This is exposed by the nginx container
......
[global]
# The server_name is the pretty name of this server. It is used as a suffix for user
# and room ids. Examples: matrix.org, conduit.rs
# The Conduit server needs all /_matrix/ requests to be reachable at
# https://your.server.name/ on port 443 (client-server) and 8448 (federation).
# If that's not possible for you, you can create /.well-known files to redirect
# requests. See
# https://matrix.org/docs/spec/client_server/latest#get-well-known-matrix-client
# and
# https://matrix.org/docs/spec/server_server/r0.1.4#get-well-known-matrix-server
# for more information
# YOU NEED TO EDIT THIS
server_name = "localhost"
# This is the only directory where Conduit will save its data
database_path = "/srv/conduit/.local/share/conduit"
database_backend = "rocksdb"
# The port Conduit will be running on. You need to set up a reverse proxy in
# your web server (e.g. apache or nginx), so all requests to /_matrix on port
# 443 and 8448 will be forwarded to the Conduit instance running on this port
# Docker users: Don't change this, you'll need to map an external port to this.
#port = 8004
# Max size for uploads
max_request_size = 20_000_000 # in bytes
# Enables registration. If set to false, no users can register on this server.
allow_registration = true
# Disable encryption, so no new encrypted rooms can be created
# Note: existing rooms will continue to work
#allow_encryption = false
allow_federation = false
# Enable jaeger to support monitoring and troubleshooting through jaeger
#allow_jaeger = false
trusted_servers = []
#max_concurrent_requests = 100 # How many requests Conduit sends to other servers at the same time
log = "debug,state_res=warn,rocket=off,_=off,sled=off"
#workers = 4 # default: cpu core count * 2
#address = "127.0.0.1" # This makes sure Conduit can only be reached using the reverse proxy
address = "0.0.0.0" # If Conduit is running in a container, make sure the reverse proxy (ie. Traefik) can reach it.
proxy = "none" # more examples can be found at src/database/proxy.rs:6
# The total amount of memory that the database will use.
#db_cache_capacity_mb = 200
version: '2.0'
services:
media_conduit:
container_name: "media_repo_conduit"
#image: "matrixconduit/matrix-conduit:latest"
image: "conduit-local"
container_name: "media_repo_synapse"
image: "matrixdotorg/synapse:latest"
restart: unless-stopped
volumes:
- ./conduit-db:/srv/conduit/.local/share/conduit
- ./conduit.toml:/srv/conduit/conduit.toml
- ./synapse-db:/data
ports:
- "6167:6167"
- "6167:8008"
networks:
- media_proxy
media_nginx:
......@@ -17,7 +15,7 @@ services:
image: "nginx:latest"
restart: unless-stopped
volumes:
- ./conduit.nginx.conf:/etc/nginx/conf.d/default.conf
- ./homeserver.nginx.conf:/etc/nginx/conf.d/default.conf
ports:
- "8008:80"
networks:
......
......@@ -9,7 +9,7 @@ server {
}
location /_matrix {
proxy_pass http://media_repo_conduit:6167;
proxy_pass http://media_repo_synapse:8008;
}
location / {
......
*
!.gitignore
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment