Integration/XMPP/Prosody: Difference between revisions
(→MySQL) |
|||
Line 66: | Line 66: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
'''MySQL Setup''' | |||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
Line 72: | Line 72: | ||
sql_dsp = { driver = "MySQL", database = "diaspora_production", username = "diaspora", password = "pass", host = "localhost" } | sql_dsp = { driver = "MySQL", database = "diaspora_production", username = "diaspora", password = "pass", host = "localhost" } | ||
</syntaxhighlight> | </syntaxhighlight> | ||
'''PostgreSQL Setup''' | |||
<syntaxhighlight lang="bash"> | |||
sql = { driver = "PostgreSQL", database = "prosody_xmpp", username = "prosody_xmpp", password = "pass", host = "localhost" } | |||
sql_dsp = { driver = "PostgreSQL", database = "diaspora_production", username = "diaspora", password = "pass", host = "localhost" } | |||
</syntaxhighlight> | |||
* sql | * sql |
Revision as of 19:32, 26 June 2014
Integrating Prosody with Diaspora
Here you will find all you need to install and setup a Prosody XMPP server integrated with Diaspora users database. This tutorial was developed using Debain 7 but it probably will work well for all GNU Distributions. There is several steps and configurations you will need to do, so watch it carefully.
Understanding
The main goal is setup Prosody to be capable to compare the password received by the XMPP Client with the hashed password stored on Diaspora database. Diaspora password hash is done with bcrypt library, so we need to patch Prosody to do the same with the received password. To do so, we need to install a modified - mod_auth_sql module available below.
On this setup Prosody will use it's own SQL database to store users data like friends, etc. and it will connect on Diaspora database just to compare passwords. Then two database configurations will be required.
Follow the tutorial and this should work well.
SQL
Before install Prosody create a database and user for it. You can do it on the same Diaspora SQL Server. Just as Diaspora you can choose between MySQL or PostgreSQL.
Prosody
Prosody is a modern XMPP communication server. It aims to be easy to set up and configure, and efficient with system resources. Additionally, for developers it aims to be easy to extend and give a flexible system on which to rapidly develop added functionality, or prototype new protocols.
- Prosody - XMPP Server
Installing Prosody
To install Prosody follow the official instructions described on their official site - - Download
Once Prosody is installed ten you can proceed.
Setup prosody.cfg.lua
Separated by topics here you have what you need to do on this file:
modules_enabled
- Disable
"saslauth"
- Enable
"bosh"
"legacyauth"
Setup and configure SQL
The default auth method is internal and it must be replaced by sql. But sql require some configurations like SQL Server, database, user and password to access Diaspora and Prosody databases.
- Modify
authentication = "sql"
- Add
storage = "sql"
MySQL Setup
sql = { driver = "MySQL", database = "prosody_xmpp", username = "prosody_xmpp", password = "pass", host = "localhost" }
sql_dsp = { driver = "MySQL", database = "diaspora_production", username = "diaspora", password = "pass", host = "localhost" }
PostgreSQL Setup
sql = { driver = "PostgreSQL", database = "prosody_xmpp", username = "prosody_xmpp", password = "pass", host = "localhost" }
sql_dsp = { driver = "PostgreSQL", database = "diaspora_production", username = "diaspora", password = "pass", host = "localhost" }
- sql
This are the Prosody database setup where Prosody will store users friends lists and it's personal setup. The database user must have wright permission on this;
- sql_dsp
This are the Diaspora database setup
Add to the file
VirtualHost "your POD domain.foo"