Giter VIP home page Giter VIP logo

otalk-server's Introduction

Otalk XMPP Server

Any XMPP server that supports websockets would work, but Prosody also supports some extra features that makes Otalk nicer to use, like message archiving.

We do plan to create a packaged Docker image soon.

Installation

  1. Install Prosody.

     sudo apt-get install prosody-0.10
    

    You may need to follow the instructions to install the Prosody PPA first.

  2. Install additional dependencies needed by MAM and WebSocket

     sudo apt-get install lua-zlib
     sudo apt-get install lua-sec-prosody
     sudo apt-get install lua-dbi-sqlite3
     sudo apt-get install liblua5.1-bitop-dev
     sudo apt-get install liblua5.1-bitop0
    
  3. Install the included modules

     sudo mkdir /opt/otalk-server
     sudo cp -r mod_carbons /opt/otalk-server
     sudo cp -r mod_mam /opt/otalk-server
     sudo cp -r mod_smacks2 /opt/otalk-server
     sudo cp -r mod_smacks3 /opt/otalk-server
     sudo cp -r mod_websocket /opt/otalk-server
     sudo cp -r mod_http_altconnect /opt/otalk-server
     sudo cp -r mod_turncredentials /opt/otalk-server
     sudo cp -r mod_idlecompat /opt/otalk-server
    

Alternatively, you can just clone the otalk-server repo to /opt/otalk-server.

  1. Configure Prosody

    First edit the included template config to replace the HOST value, and set any other desired options.

     sudo cp prosody.cfg.lua /etc/prosody/
    
  2. Allow access to port 5281. Proxying to hide the port would be best (eg, use wss://HOST/xmpp-websocket).

    If you don't proxy the WS connections, be sure to visit https://HOST:5281/xmpp-websocket first so that any client certificate requests are fulfilled. Otherwise, connecting to otalk might fail because the browser closes the websocket connection if prompted for client certs.

  3. Configure restund according to restund/README.md. Optional, but highly recommended.

By default, You will need to ensure that these ports are open on your server:

  • 5222 (XMPP client to server connections)
  • 5269 (XMPP server to server connections)
  • 5280/5281 HTTP and WebSocket connection (5281 for SSL versions)
  • 3478 UDP (STUN/TURN)

You should also setup DNS SRV records:

  • _xmpp-client._tcp.HOST 3600 IN SRV 0 10 5222 HOST
  • _xmpp-server._tcp.HOST 3600 IN SRV 0 10 5269 HOST

If you use the mod_http_altconnect module, Otalk will be able to auto-discover the WebSocket connection endpoint for your server, if you make https://HOST/.well-known/host-meta served by Prosody.

One way to do this is to make Prosody act as your HTTP server. An example nginx config for doing that is included.

To use &yet authentication (optional)

NOTE: This is intended for use by otalk.im as a default authentication method for people who already have Andyet accounts to bootstrap the process and experience of using Otalk. If you're running your own private XMPP server, this is not needed, and you can use any of the various authentication backends provided by Prosody.

  1. Install external auth module

     sudo cp -r mod_auth_external /usr/lib/prosody/modules
    
  2. Modify Prosody config

     VirtualHost "HOST"
         authentication = "external"
         external_auth_command = "andyet-prosody-auth"
    
  3. Install andyet-prosody-auth

     npm install -g andyet-prosody-auth
    
  4. Create /etc/prosody/andyet.json.

     {
         "bucker": {
             "file": {
                 "filename": "/var/log/prosody/auth.log"
             }
             "console": false
         },
         "andyetAuth": {
             "id": "CLIENT ID",
             "secret": "CLIENT SECRET"
         },
         "andyetAPIs": {
             "apps": "https://apps.andyet.com",
             "shippy": "https://api.andbang.com"
         }
     }
    

    NOTE: the "console": false configuration MUST be included for bucker so that log output does not get sent to Prosody instead of the success/failure tokens.

otalk-server's People

Contributors

legastero avatar fippo avatar

Watchers

James Cloos avatar  avatar

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.