Git Product home page Git Product logo

django-ejabberd-bridge's Introduction

django_ejabberd_bridge Build Status Coverage Status

It's a django app to integrate ejabberd XMPP server with Django

Right now it just allows the ejabberd service to perform authentication against Django's authentication middleware. This part is based on the guidelines provided by Alexey Shchepin [email protected] on the eJabberd developer's guide.

Quick Start

Install django_ejabberd_bridge with the following

$ python setup.py install

TODO: add quick starts here...

Install and startup eJabberd

On a debian/ubuntu linux you can use

$ apt-get -y install ejabberd
$ service ejabberd restart

whereas on OSX using homebrew

$ brew install ejabberd
$ ejabberdctl restart

Setup Admin User

  • Change "password" to your own value:
$ ejabberdctl register admin localhost password
  • Give Admin Privileges. By default, hostname used by eJabberd is 'localhost', which can be modified from config file. For our example we will call our admin user "admin@localhost" and modify the following lines in /etc/ejabberd/ejabberd.cfg (/usr/local/etc/ejabberd/ejabberd.cfg if you're using homebrew):
%% Admin user
{acl, admin, {user, "admin", "localhost"}}.

%% Hostname
{hosts, ["localhost"]}.

Configure external authentication

On eJabberd you can configure several authentication methods. For our integration purpose we must select "external" and provide the path to our script.

%%
%% Authentication using external script
%% Make sure the script is executable by ejabberd.
%%
{auth_method, external}.
{extauth_program, "/path/to/authentication/script"}.

Since a virtualenv is commonly used while dealing with python projects, we could write a script that enables the virtualenv and calls the django command to perform authentication, e.g. we could use an authentication script like these:

#!/bin/bash
source <virtualenv_path>/bin/activate
python <django_project_path>/manage.py ejabberd_auth $@

Restart eJabberd

If a service is provided you can use

$ service ejabberd restart

Or if available

$ ejabberdctl restart

Now, you can access ejabberd admin page at the url

http://localhost:5280/admin

TODO

  1. Simplify configuration by providing the script
  2. Write down a page specifically for eJabberd

License

LGPLv3

Copyright (c) 2013 Fabio Falcinelli [email protected]

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this program. If not, see http://www.gnu.org/licenses/.

django-ejabberd-bridge's People

Contributors

ffalcinelli avatar

Watchers

GeorgeHOHO 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.