Code Monkey home page Code Monkey logo

prekey-server-docker-compose's Introduction

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.

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

Content

Running the xmpp server on Docker

  1. Create an .env file that looks exactly like this:
  PREKEY_SERVER_IDENTITY=prekeys.localhost
  PREKEY_SERVER_FINGERPRINT=
  XMPP_COMPONENTS_SECRET=this is secret
  1. Run:
  $ docker-compose up
  1. 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...
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
  1. Run:
$ docker-compose up

Everything should run. This line should show up:

xmpp-server_1   | prekeys.localhost:component  info	External component successfully authenticated

In order to make this server be recognizable by the pidgin plugin, you need to run the following command:

  ./configure CFLAGS="-ggdb3 -O0 -DDEFAULT_PREKEYS_SERVER='\"prekeys.localhost\"'"

Restarting the prosody server

Run:

$ docker-compose down
$ docker-compose stop
$ docker system prune -a

Available accounts

+-------------------------------------+
|   ACCOUNT            |   PASSWORD   |
+-------------------------------------+
|   alice@localhost    |   alice      |
+-------------------------------------+
|   bob@localhost      |   bob        |
+-------------------------------------+

Troubleshoots

If you need to fix ownership issues using prosody, you can do the following:

  1. In another terminal window run:
$ docker-compose exec xmpp-server bash
$ ls -al ~/localhost/
  1. 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.

$ sudo chown -R uid:gid prekey-server-docker-compose/prosody/data/localhost/
  1. In some distributions could be necessary to execute the following steps:
  • Modify prekey-server-docker-compose/prosody/Dockerfile adding:
$ chown root:prosody /etc/prosody/certs/localhost.key
$ chmod 660 /etc/prosody/certs/localhost.key
  • Rebuild the image with:
$ sudo docker-compose build

prekey-server-docker-compose's People

Contributors

claucece avatar giovaneliberato avatar juniorz avatar maurovelasco avatar pedropalau avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

librechain

prekey-server-docker-compose's Issues

An error occurs when you try to run the image

When I run the image with:

$ docker-compose up

an error occurs that says the following:

ERROR: for prekey-server-docker-compose_xmpp-server_1  
Cannot start service xmpp-server: driver failed programming external connectivity on endpoint prekey-server-docker-compose_xmpp-server_1
Error starting userland proxy: listen tcp 0.0.0.0:5222: bind: address already in use

Is possible to run this image using another port instead of 5222?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.