README.md 2.28 KB
Newer Older
Giovane Liberato's avatar
Giovane Liberato committed
1
# Prosody server with a OTRv4 prekey server included
2

Giovane Liberato's avatar
Giovane Liberato committed
3 4 5 6 7
A docker composed infrastructure containing a prosody xmpp server and a OTRv4 prekey server added to it. It also has some dummy accounts.

NOTE: This server is intended to be used only for local testing.

## Running the xmpp server on Docker
8

Sofia Celi's avatar
Sofia Celi committed
9
1. Create an `.env` file that looks exactly like this:
Sofia Celi's avatar
Sofia Celi committed
10 11 12 13 14 15 16 17 18 19 20 21 22

```
  PREKEY_SERVER_IDENTITY=prekeys.localhost
  PREKEY_SERVER_FINGERPRINT=
  XMPP_COMPONENTS_SECRET=this is secret
```

2. Run:

```
  docker-compose up
```

23
3. Copy the shown fingerprint (without spaces/brackets) into the `.env` file.
Sofia Celi's avatar
Sofia Celi committed
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
   Something like this will be shown:

```
prekeys-raw_1   | Starting server on 0.0.0.0:30123...
prekeys-raw_1   | [F91453A3D80BB48F FD683C98FBB2ED30 33F52861F6549F64 A45216627D43BA80 CCD9B08156CBAB97 E9B00314B313AF87 6FD6FBAFE97C00CC]
prekeys-xmpp_1  | fingerprint provided is not valid
```

This is line shows you the appropriate fingerprint `prekeys-raw_1   | [F91453A3D80BB48F FD683C98FBB2ED30 33F52861F6549F64 A45216627D43BA80 CCD9B08156CBAB97 E9B00314B313AF87 6FD6FBAFE97C00CC]`.

Copy it on the `.env` file, so it looks like this:

```
PREKEY_SERVER_IDENTITY=prekeys.localhost
PREKEY_SERVER_FINGERPRINT=F91453A3D80BB48FFD683C98FBB2ED3033F52861F6549F64A45216627D43BA80CCD9B08156CBAB97E9B00314B313AF876FD6FBAFE97C00CC
XMPP_COMPONENTS_SECRET=this is secret
```
Sofia Celi's avatar
Sofia Celi committed
41 42 43

4. Run:

44 45 46 47
```
docker-compose up
```

Sofia Celi's avatar
Sofia Celi committed
48
Everything should run. This line should show up:
49 50

```
Sofia Celi's avatar
Sofia Celi committed
51
xmpp-server_1   | prekeys.localhost:component  info	External component successfully authenticated
52 53
```

Sofia Celi's avatar
Sofia Celi committed
54 55 56
-------------------------------------------------------------------------------

If you need to fix ownership issues, do:
57

Sofia Celi's avatar
Sofia Celi committed
58
1. In another window do:
59 60

```
Sofia Celi's avatar
Sofia Celi committed
61 62
docker-compose exec xmpp-server bash
ls -al ~/localhost/
63 64
```

Sofia Celi's avatar
Sofia Celi committed
65
2. Take the id/gid of the offline folder chown it outside of the docker container so the offline storage is writable.
66

Sofia Celi's avatar
Sofia Celi committed
67
```
Sofia Celi's avatar
Sofia Celi committed
68
sudo chown -R uid:gid prekey-server-docker-compose/prosody/data/localhost/
Sofia Celi's avatar
Sofia Celi committed
69 70
```

Sofia Celi's avatar
Sofia Celi committed
71 72
-------------------------------------------------------------------------------

Sofia Celi's avatar
Sofia Celi committed
73 74
In order to make this server be recognizable by the pidgin plugin, you need to:

75
```
Sofia Celi's avatar
Sofia Celi committed
76
  ./configure CFLAGS="-ggdb3 -O0 -DDEFAULT_PREKEYS_SERVER='\"prekeys.localhost\"'"
77 78
```

Sofia Celi's avatar
Sofia Celi committed
79 80
## Accounts available

Giovane Liberato's avatar
Giovane Liberato committed
81 82 83 84 85
```
user                password
alice@localhost     alice
bob@localhost       bob
```