summary refs log tree commit diff
path: root/scripts-dev/workers_setup.md
blob: a6108e32d931c5a36f017b78027b0cc032205651 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# workers_setup

This gives you a **development-grade** installation of workerised Synapse.

DO NOT USE ME IN PRODUCTION.

## Known defects

* Non-generic workers aren't set up properly with their worker type.
* I haven't checked the routes that well; they are probably wrong.


## Requirements from you:

* Redis on default port (unauthenticated)
  ```
  # You need Redis. On Ubuntu, this gets you what you need running on the right port:
  apt install redis-server redis-tools
  ```
* Postgres on default port, using UNIX sockets for authentication.
  This means you want your normal user account to have a corresponding Postgres account,
  and let Postgres authenticate you automatically.
  On Ubuntu, this just means you need to `createuser <your Linux account name>`.
  You need a database with the same name as your server_name (I used `syn7`).
  It should be owned by your user; see `createdb` to do that properly (and don't
  forget to follow the Synapse instructions to use a C locale!)
  Typing `psql syn7` should just work once your database is ready.
  (If your UNIX socket is not numbered 5432, you might have to add `port: 5433`
  to the config. Somehow I messed up my Postgres installation ages ago that it
  chose port 5433 rather than the default 5432...)
* Virtualenv with Synapse (don't forget: `[postgres,redis]`)
* You'll need a bog standard Caddy binary (as the reverse proxy / router).
  The website offers pre-built static binaries.
* (Optional): If you want to federate, you can set up TLS yourself afterwards.
  I haven't bothered so far.


## Run the script

```
# python scripts-dev/workers_setup.py (path to server dir) (server name)
python scripts-dev/workers_setup.py ../servers/syn7_auto syn7
```


## Launching the homeserver

```
cd syn7_auto
/path/to/synapse/.venv/bin/synctl start homeserver.yaml -a workers
/path/to/caddy run
```


## Stopping the homeserver

```
# ^C to stop Caddy
/path/to/synapse/.venv/bin/synctl stop homeserver.yaml -a workers
```