2018-01-06 15:21:04 +00:00
|
|
|
## docker.jcg.re/synapse
|
|
|
|
[![Build Status](https://drone.jcg.re/api/badges/jcgruenhage/docker-synapse/status.svg)](https://drone.jcg.re/jcgruenhage/docker-synapse)
|
|
|
|
|
|
|
|
### Introduction:
|
|
|
|
A basic docker image running [synapse](https://github.com/matrix-org/synapse), a [matrix](https://matrix.org) homeserver.
|
|
|
|
|
|
|
|
For a complete self hosted chat and VOIP app, you also need a TURN server (for example coturn),
|
|
|
|
and a matrix client (for example [Riot.im](https://riot.im/)).
|
|
|
|
|
|
|
|
### Getting started:
|
|
|
|
|
|
|
|
First, start by generating a config file:
|
|
|
|
```bash
|
|
|
|
docker run \
|
|
|
|
-e SERVER_NAME=example.com \
|
|
|
|
-v `pwd`/data:/data \
|
|
|
|
--rm \
|
|
|
|
--entrypoint generate \
|
|
|
|
docker.jcg.re/synapse
|
|
|
|
```
|
|
|
|
|
|
|
|
There are 2 things you need to take care of here:
|
|
|
|
- put your domain where `example.com` is
|
|
|
|
- modify \`pwd\`/data to match the folder where you want your homeservers data to be.
|
|
|
|
This contains things like log, database, media and config.
|
|
|
|
|
|
|
|
After you're done with that, you might want to change some things in the default configuration.
|
|
|
|
You will find the configuration file in `data/config/homeserver.yaml`.
|
|
|
|
|
|
|
|
Now that you have synapse configured, it's time to start it up:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
docker run \
|
|
|
|
-v `pwd`/data:/data \
|
|
|
|
-p 8008:8008 \
|
|
|
|
-p 8448:8448 \
|
|
|
|
-n synapse \
|
|
|
|
docker.jcg.re/synapse
|
|
|
|
```
|
|
|
|
|
|
|
|
You now should have synapse running and should be able to connect to it from a client.
|
|
|
|
|
|
|
|
If you haven't enabled registration manually in the config file, you can create users from the CLI:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
docker exec \
|
|
|
|
--interactive \
|
|
|
|
--tty \
|
|
|
|
synapse \
|
|
|
|
register_new_matrix_user \
|
|
|
|
-c /data/config/homeserver.yaml \
|
|
|
|
http://localhost:8008
|
|
|
|
```
|
|
|
|
|
|
|
|
The next step would be to put a reverse proxy in front of it for secure client connections,
|
|
|
|
and to install and configure a TURN server.
|
|
|
|
|
|
|
|
#### Tags:
|
|
|
|
- **latest**: latest stable version
|
|
|
|
|
|
|
|
#### Environment variables:
|
|
|
|
##### Runtime:
|
|
|
|
- **UID**: user id (default: 1337)
|
|
|
|
- **GID**: group id (default: 1337)
|
2018-01-06 16:23:28 +00:00
|
|
|
|
2018-01-06 15:21:04 +00:00
|
|
|
##### Config generation:
|
|
|
|
- **SERVER_NAME**: domain name of the homeserver. (**mandatory**)
|
|
|
|
- **REPORT_STATS**: either `yes` or `no`, default: `yes`
|
|
|
|
|
|
|
|
#### Ports:
|
|
|
|
- 8008: client-to-server matrix traffic
|
2018-01-06 16:23:28 +00:00
|
|
|
- 8448: server-to-server matrix traffic
|