There are many ways to contribute to Commune Rust, including writing code, openning issues, helping people, reproduce, or fix bugs that people have filed and improving documentation.
Commune Rust is written in The Rust Programming Language, you will have to setup Rust in your machine to run the project locally.
Tools like Justfile are recommended to improve DX and reduce learning curve by running commands easily.
- Create a copy of
.env.example
on.env
cp .env.example .env
- Generate
Synapse
server configuration
just gen_synapse_conf
- Run Synapse Server (and other containerized services) using Docker Compose via:
just backend
When you are ready
Teardown services using just stop
.
If you want to perform a complete cleanup use just clear
.
Warning
just clear
will remove all containers and images.
This application has 2 layers for tests:
Unit
: Are usually inlined inside crates, and dont depend on any integrationE2E
: Lives intest
crate and counts with the services that run the application
Unit tests can be executed via cargo test -p <crate name>
, this will run
every unit test.
You must run Docker services as for development. In order to avoid messing up
the development environment, its recommended to use the synapse setup from
crates/test/fixtures/synapse
replacing it with docker/synapse
.
Make sure the
.env
file is created from the contents on.env.example
The client, any HTTP Client, comunicates with the Commune Server which may or may not communicate with Matrix's server Synapse which runs along with its database in a Docker container.
Use MJML Editor and then render into HTML. Make sure variables use
Handlebars syntax (e.g. {{name}}
).
For local testing you can use something like:
curl -s http://localhost:1080/email | grep -o -E "This is your verification code.{0,7}" | tail -1 | sed 's/^.*://' | awk '{$1=$1;print}
To get the very last email's verification code.
Warning Note that changes on email content will break this script
A Redis instance is used to keep in-memory short-lived data used certain server operations such as storing verification codes.
For this purpose Redis is served as part of the development stack on Docker.
The redis/redis-stack
image contains both Redis Stack server and RedisInsight,
you can use RedisInsight by pointing your browser to localhost:8001
.
There is an official Synapse image available at https://hub.docker.com/r/matrixdotorg/synapse
or at ghcr.io/matrix-org/synapse
which can be used with the docker-compose
file available at contrib/docker. Further information on this including
configuration options is available in the README on hub.docker.com.