Improve README

parent ad275eac
# Prosody server with a OTRv4 prekey server included
A docker composed infrastructure containing a prosody xmpp server and a OTRv4 prekey server added to it. It also has some dummy accounts.
A docker composed infrastructure containing a [prosody](https://prosody.im/) xmpp server and a [OTRv4](https://github.com/otrv4/libotr-ng) prekey server added to it.
NOTE: This server is intended to be used only for local testing.
It also has some [dummy accounts](#available-accounts).
__IMPORTANT__: This server is intended to be used only for **local testing**.
## Content
- [Running the xmpp server on Docker](#running-the-xmpp-server-on-docker)
- [Restarting the prosody server](#restarting-the-prosody-server)
- [Available accounts](#available-accounts)
- [Troubleshoots](#troubleshoots)
## Running the xmpp server on Docker
......@@ -17,11 +26,10 @@ NOTE: This server is intended to be used only for local testing.
2. Run:
```
docker-compose up
$ docker-compose up
```
3. Copy the shown fingerprint (without spaces/brackets) into the `.env` file.
Something like this will be shown:
3. Copy the shown fingerprint (without spaces/brackets) into the `.env` file. Something like this will be shown:
```
prekeys-raw_1 | Starting server on 0.0.0.0:30123...
......@@ -29,7 +37,9 @@ prekeys-raw_1 | [F91453A3D80BB48F FD683C98FBB2ED30 33F52861F6549F64 A45216627D
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]`.
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:
......@@ -42,7 +52,7 @@ XMPP_COMPONENTS_SECRET=this is secret
4. Run:
```
docker-compose up
$ docker-compose up
```
Everything should run. This line should show up:
......@@ -51,62 +61,64 @@ Everything should run. This line should show up:
xmpp-server_1 | prekeys.localhost:component info External component successfully authenticated
```
-------------------------------------------------------------------------------
If you need to fix ownership issues, do:
1. In another window do:
In order to make this server be recognizable by the [pidgin plugin](https://github.com/otrv4/pidgin-otrng), you need to run the following command:
```
docker-compose exec xmpp-server bash
ls -al ~/localhost/
./configure CFLAGS="-ggdb3 -O0 -DDEFAULT_PREKEYS_SERVER='\"prekeys.localhost\"'"
```
2. Take the `id/gid` (the 4th column) of the offline folder. Chown it outside of
the docker container so the offline storage is writable. Note that the user
must belong to the docker group.
## Restarting the prosody server
Run:
```
sudo chown -R uid:gid prekey-server-docker-compose/prosody/data/localhost/
$ docker-compose down
$ docker-compose stop
$ docker system prune -a
```
3. In some distributions could be necessary to execute the following steps:
- Modify prekey-server-docker-compose/prosody/Dockerfile adding:
## Available accounts
```
RUN chown root:prosody /etc/prosody/certs/localhost.key
RUN chmod 660 /etc/prosody/certs/localhost.key
+-------------------------------------+
| ACCOUNT | PASSWORD |
+-------------------------------------+
| alice@localhost | alice |
+-------------------------------------+
| bob@localhost | bob |
+-------------------------------------+
```
- Rebuild the image
## Troubleshoots
If you need to fix [ownership]([https://prosody.im/doc/certificates](https://prosody.im/doc/certificates)) issues using `prosody`, you can do the following:
1. In another terminal window run:
```
sudo docker-compose build
$ docker-compose exec xmpp-server bash
$ ls -al ~/localhost/
```
-------------------------------------------------------------------------------
2. Take the `id/gid` (the 4th column) of the offline folder. `chown` it outside of the docker container so the offline storage is writable.
In order to make this server be recognizable by the pidgin plugin, you need to:
Note that the user must belong to the docker group.
```
./configure CFLAGS="-ggdb3 -O0 -DDEFAULT_PREKEYS_SERVER='\"prekeys.localhost\"'"
$ sudo chown -R uid:gid prekey-server-docker-compose/prosody/data/localhost/
```
## Restart the prosody server
3. In some distributions could be necessary to execute the following steps:
Run:
- Modify `prekey-server-docker-compose/prosody/Dockerfile` adding:
```
docker-compose down
docker-compose stop
docker system prune -a
$ chown root:prosody /etc/prosody/certs/localhost.key
$ chmod 660 /etc/prosody/certs/localhost.key
```
## Accounts available
- Rebuild the image with:
```
user password
alice@localhost alice
bob@localhost bob
$ sudo docker-compose build
```
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment