diff --git a/CHANGELOG.md b/CHANGELOG.md index f962832c97cf4d20e39c1c81b5fe2328684d3f81..fe3b1657104ee0539f847cfdb408969dd264f9ed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/README.md b/README.md index b6c69b5e937b522da399cde53f0ded3d7e897ec4..71d4f4e9b51c1509a4677ee665d0a692b16b7718 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/dev/conduit.toml b/dev/conduit.toml deleted file mode 100644 index 5f88941a5899de278364a1aa8895d560ecb801ea..0000000000000000000000000000000000000000 --- a/dev/conduit.toml +++ /dev/null @@ -1,54 +0,0 @@ -[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 diff --git a/dev/docker-compose.yaml b/dev/docker-compose.yaml index bb1e381091b6aab00206e9217e7b8f90d4e3ad2a..3ef29f5bdc18c3576014a62c37d05c5825177301 100644 --- a/dev/docker-compose.yaml +++ b/dev/docker-compose.yaml @@ -1,15 +1,13 @@ 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: diff --git a/dev/conduit.nginx.conf b/dev/homeserver.nginx.conf similarity index 86% rename from dev/conduit.nginx.conf rename to dev/homeserver.nginx.conf index 80e7d7ef9979ca22b212277448bf76be4ea5160b..2857ff76c0590b9a500fbc2bf3bd16bf1326e1ab 100644 --- a/dev/conduit.nginx.conf +++ b/dev/homeserver.nginx.conf @@ -9,7 +9,7 @@ server { } location /_matrix { - proxy_pass http://media_repo_conduit:6167; + proxy_pass http://media_repo_synapse:8008; } location / { diff --git a/dev/synapse-db/.gitignore b/dev/synapse-db/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..d6b7ef32c8478a48c3994dcadc86837f4371184d --- /dev/null +++ b/dev/synapse-db/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore