mirror of
https://github.com/processone/ejabberd.git
synced 2024-12-24 17:29:28 +01:00
Merge from trunk (r1563 to r1613).
PR: EJABP-1 SVN Revision: 1614
This commit is contained in:
parent
aaecdc4b8a
commit
67a87af459
66
ChangeLog
66
ChangeLog
@ -1,3 +1,7 @@
|
||||
2008-10-08 Jean-Sébastien Pédron <js.pedron@meetic-corp.com>
|
||||
|
||||
Merge from trunk (r1563 to r1613).
|
||||
|
||||
2008-10-07 Jean-Sébastien Pédron <js.pedron@meetic-corp.com>
|
||||
|
||||
* src/ejabberd_local.erl: Fix a bug where an error stanza was not
|
||||
@ -9,6 +13,10 @@
|
||||
* src/mod_private.erl, src/mod_private_odbc.erl, src/mod_version.erl:
|
||||
Convert to exmpp. Thanks to Pablo Polvorin!
|
||||
|
||||
2008-10-07 Jerome Sautret <jerome.sautret@process-one.net>
|
||||
|
||||
* src/mod_roster_odbc.erl: fix MySQL multiple requests issue.
|
||||
|
||||
2008-10-06 Jean-Sébastien Pédron <js.pedron@meetic-corp.com>
|
||||
|
||||
* src/ejabberd_sm.erl (process_iq/3): Fix a bug where we were matching
|
||||
@ -32,6 +40,29 @@
|
||||
mixing lists and binaries in a non-working way. Thanks to Pablo
|
||||
Polvorin!
|
||||
|
||||
2008-10-06 Badlop <badlop@process-one.net>
|
||||
|
||||
* doc/guide.html: Regenerated
|
||||
|
||||
2008-10-06 Jerome Sautret <jerome.sautret@process-one.net>
|
||||
|
||||
* src/ejabberd_rdbms.erl: fix SQL database reconnection
|
||||
issues (EJAB-764) and add odbc_start_interval configuration
|
||||
directive (default to 30 seconds).
|
||||
* src/odbc/ejabberd_odbc.erl: likewise.
|
||||
* src/odbc/ejabberd_odbc_sup.erl: likewise.
|
||||
* doc/guide.tex: likewise.
|
||||
|
||||
2008-10-03 Jerome Sautret <jerome.sautret@process-one.net>
|
||||
|
||||
* src/odbc/odbc_queries.erl: Fix empty query that fail on MySQL.
|
||||
|
||||
2008-10-03 Jerome Sautret <jerome.sautret@process-one.net>
|
||||
|
||||
* src/mod_vcard_odbc: added vCard support for MS SQL Server 2005.
|
||||
* src/odbc/odbc_queries.erl: likewise.
|
||||
* src/odbc/mssql2005.sql: likewise.
|
||||
|
||||
2008-10-02 Jean-Sébastien Pédron <js.pedron@meetic-corp.com>
|
||||
|
||||
* src/mod_roster_odbc.erl: Fix a bug where a JID represented as a
|
||||
@ -59,6 +90,17 @@
|
||||
src/mod_roster_odbc.erl: Fix multiple bugs in ODBC mods, thanks to
|
||||
Pablo Polvorin!
|
||||
|
||||
2008-10-01 Mickael Remond <mremond@process-one.net>
|
||||
|
||||
* src/mod_shared_roster.erl: Correct roster push when changing
|
||||
a shared roster entry name (EJAB-738).
|
||||
|
||||
2008-09-30 Badlop <badlop@process-one.net>
|
||||
|
||||
* src/*/Makefile.win32: Provide explicit beam filenames because
|
||||
nmake does not accept wildcards (thanks to Attila
|
||||
Vangel)(EJAB-543)
|
||||
|
||||
2008-09-29 Jean-Sébastien Pédron <js.pedron@meetic-corp.com>
|
||||
|
||||
* src/jlib.erl (parse_xdata_submit, parse_xdata_fields): Fix a bug
|
||||
@ -99,6 +141,25 @@
|
||||
Ejabberd expects new structures. Add table conversion. Add try/catch
|
||||
block around exmpp_stringprep:*prep/1 uses.
|
||||
|
||||
2008-09-24 Christophe Romain <christophe.romain@process-one.net>
|
||||
|
||||
* src/mod_pubsub/mod_pubsub.erl: Allow PEP node type to be mapped with
|
||||
namespace (EJAB-739). Change get_items to use From (EJAB-751). (Thanks
|
||||
to Eric Cestari)
|
||||
* src/mod_pubsub/gen_pubsub_node.erl: Likewise
|
||||
* src/mod_pubsub/node_dispatch.erl: Likewise
|
||||
* src/mod_pubsub/node_buddy.erl: Likewise
|
||||
* src/mod_pubsub/node_zoo.erl: Likewise
|
||||
* src/mod_pubsub/node.template: Likewise
|
||||
* src/mod_pubsub/node_private.erl: Likewise
|
||||
* src/mod_pubsub/node_public.erl: Likewise
|
||||
* src/mod_pubsub/node_default.erl: Likewise
|
||||
* src/mod_pubsub/node_pep.erl: Likewise
|
||||
* src/mod_pubsub/node_club.erl: Likewise
|
||||
|
||||
* src/mod_pubsub/node_mb.erl: Added PEP microglobing node (Thanks to
|
||||
Eric Cestari)
|
||||
|
||||
2008-09-23 Jean-Sébastien Pédron <js.pedron@meetic-corp.com>
|
||||
|
||||
* src/mod_vcard.erl (process_sm_iq): Fix a bug where a badmatch
|
||||
@ -126,6 +187,11 @@
|
||||
|
||||
* src/mod_vcard_ldap.erl, src/mod_vcard_odbc.erl: Convert to exmpp.
|
||||
|
||||
2008-09-22 Mickael Remond <mremond@process-one.net>
|
||||
|
||||
* src/mod_configure.erl: Fix adhoc commands reply types for
|
||||
"get-online-users-num" and "get-registered-users-num" (EJAB-756).
|
||||
|
||||
2008-09-18 Jean-Sébastien Pédron <js.pedron@meetic-corp.com>
|
||||
|
||||
* src/mod_roster_odbc.erl: Convert to exmpp.
|
||||
|
274
doc/guide.html
274
doc/guide.html
@ -272,8 +272,8 @@ Support for virtual hosting.
|
||||
</LI></UL><P> <A NAME="installing"></A> </P><!--TOC chapter Installing <TT>ejabberd</TT>-->
|
||||
<H1 CLASS="chapter"><!--SEC ANCHOR --><A NAME="htoc4">Chapter 2</A>  <A HREF="#installing">Installing <TT>ejabberd</TT></A></H1><!--SEC END --><P> <A NAME="installing"></A> </P><P> <A NAME="install.binary"></A> </P><!--TOC section Installing <TT>ejabberd</TT> with Binary Installer-->
|
||||
<H2 CLASS="section"><!--SEC ANCHOR --><A NAME="htoc5">2.1</A>  <A HREF="#install.binary">Installing <TT>ejabberd</TT> with Binary Installer</A></H2><!--SEC END --><P> <A NAME="install.binary"></A> </P><P>Probably the easiest way to install an <TT>ejabberd</TT> instant messaging server
|
||||
is using the binary installer published by ProcessOne.
|
||||
The binary installers of released <TT>ejabberd</TT> versions
|
||||
is using the binary installer published by ProcessOne.
|
||||
The binary installers of released <TT>ejabberd</TT> versions
|
||||
are available in the ProcessOne <TT>ejabberd</TT> downloads page:
|
||||
<A HREF="http://www.process-one.net/en/ejabberd/downloads"><TT>http://www.process-one.net/en/ejabberd/downloads</TT></A></P><P>The installer will deploy and configure a full featured <TT>ejabberd</TT>
|
||||
server and does not require any extra dependencies.</P><P>In *nix systems, remember to set executable the binary installer before starting it. For example:
|
||||
@ -282,13 +282,13 @@ server and does not require any extra dependencies.</P><P>In *nix systems, remem
|
||||
</PRE><P><TT>ejabberd</TT> can be started manually at any time,
|
||||
or automatically by the operating system at system boot time.</P><P>To start and stop <TT>ejabberd</TT> manually,
|
||||
use the desktop shortcuts created by the installer.
|
||||
If the machine doesn’t have a graphical system, use the scripts ’start’
|
||||
If the machine doesn’t have a graphical system, use the scripts ’start’
|
||||
and ’stop’ in the ’bin’ directory where <TT>ejabberd</TT> is installed.</P><P>The Windows installer also adds ejabberd as a system service,
|
||||
and a shortcut to a debug console for experienced administrators.
|
||||
If you want ejabberd to be started automatically at boot time,
|
||||
If you want ejabberd to be started automatically at boot time,
|
||||
go to the Windows service settings and set ejabberd to be automatically started.
|
||||
Note that the Windows service is a feature still in development,
|
||||
and for example it doesn’t read the file ejabberdctl.cfg.</P><P>On a *nix system, if you want ejabberd to be started as daemon at boot time,
|
||||
Note that the Windows service is a feature still in development,
|
||||
and for example it doesn’t read the file ejabberdctl.cfg.</P><P>On a *nix system, if you want ejabberd to be started as daemon at boot time,
|
||||
copy <TT>ejabberd.init</TT> from the ’bin’ directory to something like <TT>/etc/init.d/ejabberd</TT>
|
||||
(depending on your distribution) and call <TT>/etc/inid.d/ejabberd start</TT> to start it.</P><P>If <TT>ejabberd</TT> doesn’t start correctly in Windows,
|
||||
try to start it using the shortcut in desktop or start menu.
|
||||
@ -305,9 +305,9 @@ This way you see the error message provided by Erlang
|
||||
and can identify what is exactly the problem.</P><P>The <TT>ejabberdctl</TT> administration script is included in the <TT>bin</TT> directory.
|
||||
Please refer to the section <A HREF="#ejabberdctl">4.1</A> for details about <TT>ejabberdctl</TT>,
|
||||
and configurable options to fine tune the Erlang runtime system.</P><P> <A NAME="install.os"></A> </P><!--TOC section Installing <TT>ejabberd</TT> with Operating System specific packages-->
|
||||
<H2 CLASS="section"><!--SEC ANCHOR --><A NAME="htoc6">2.2</A>  <A HREF="#install.os">Installing <TT>ejabberd</TT> with Operating System specific packages</A></H2><!--SEC END --><P> <A NAME="install.os"></A> </P><P>Some Operating Systems provide a specific <TT>ejabberd</TT> package adapted to
|
||||
<H2 CLASS="section"><!--SEC ANCHOR --><A NAME="htoc6">2.2</A>  <A HREF="#install.os">Installing <TT>ejabberd</TT> with Operating System specific packages</A></H2><!--SEC END --><P> <A NAME="install.os"></A> </P><P>Some Operating Systems provide a specific <TT>ejabberd</TT> package adapted to
|
||||
the system architecture and libraries.
|
||||
It usually also checks dependencies
|
||||
It usually also checks dependencies
|
||||
and performs basic configuration tasks like creating the initial
|
||||
administrator account. Some examples are Debian and Gentoo. Consult the
|
||||
resources provided by your Operating System for more information.</P><P>Usually those packages create a script like <TT>/etc/init.d/ejabberd</TT>
|
||||
@ -317,12 +317,12 @@ to start and stop <TT>ejabberd</TT> as a service at boot time.</P><P> <A NAME="i
|
||||
packages from many Erlang programs, including <TT>ejabberd</TT> and all its dependencies.
|
||||
The binaries are available for many different system architectures, so this is an
|
||||
alternative to the binary installer and Operating System’s <TT>ejabberd</TT> packages.</P><P>You will have to create your own <TT>ejabberd</TT> start
|
||||
script depending of how you handle your CEAN installation.
|
||||
script depending of how you handle your CEAN installation.
|
||||
The default <TT>ejabberdctl</TT> script is located
|
||||
into <TT>ejabberd</TT>’s priv directory and can be used as an example.</P><P> <A NAME="installation"></A> </P><!--TOC section Installing <TT>ejabberd</TT> from Source Code-->
|
||||
<H2 CLASS="section"><!--SEC ANCHOR --><A NAME="htoc8">2.4</A>  <A HREF="#installation">Installing <TT>ejabberd</TT> from Source Code</A></H2><!--SEC END --><P> <A NAME="installation"></A>
|
||||
</P><P>The canonical form for distribution of <TT>ejabberd</TT> stable releases is the source code package.
|
||||
Compiling <TT>ejabberd</TT> from source code is quite easy in *nix systems,
|
||||
Compiling <TT>ejabberd</TT> from source code is quite easy in *nix systems,
|
||||
as long as your system have all the dependencies.</P><P> <A NAME="installreq"></A> </P><!--TOC subsection Requirements-->
|
||||
<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc9">2.4.1</A>  <A HREF="#installreq">Requirements</A></H3><!--SEC END --><P> <A NAME="installreq"></A>
|
||||
</P><P>To compile <TT>ejabberd</TT> on a ‘Unix-like’ operating system, you need:
|
||||
@ -350,10 +350,10 @@ To get the full list run the command:
|
||||
</P><PRE CLASS="verbatim">./configure --help
|
||||
</PRE><P>Some options that you may be interested in modifying:
|
||||
</P><DL CLASS="description"><DT CLASS="dt-description">
|
||||
<B><TT>--prefix=/</TT></B></DT><DD CLASS="dd-description">
|
||||
<B><TT>--prefix=/</TT></B></DT><DD CLASS="dd-description">
|
||||
Specify the path prefix where the files will be copied when running
|
||||
the <TT>make install</TT> command.<P> </P></DD><DT CLASS="dt-description"><B><TT>--enable-user[=USER]</TT></B></DT><DD CLASS="dd-description">
|
||||
Allow this normal system user to execute the ejabberdctl script
|
||||
Allow this normal system user to execute the ejabberdctl script
|
||||
(see section <A HREF="#ejabberdctl">4.1</A>),
|
||||
read the configuration files,
|
||||
read and write in the spool directory,
|
||||
@ -361,14 +361,14 @@ To get the full list run the command:
|
||||
The account user and group must exist in the machine
|
||||
before running <TT>make install</TT>.
|
||||
This account doesn’t need an explicit HOME directory, because
|
||||
<TT>/var/lib/ejabberd/</TT> will be used by default.<P> </P></DD><DT CLASS="dt-description"><B><TT>--enable-pam</TT></B></DT><DD CLASS="dd-description">
|
||||
<TT>/var/lib/ejabberd/</TT> will be used by default.<P> </P></DD><DT CLASS="dt-description"><B><TT>--enable-pam</TT></B></DT><DD CLASS="dd-description">
|
||||
Enable the PAM authentication method (see section <A HREF="#pam">3.1.4</A>).<P> </P></DD><DT CLASS="dt-description"><B><TT>--enable-odbc or --enable-mssql</TT></B></DT><DD CLASS="dd-description">
|
||||
Required if you want to use an external database.
|
||||
See section <A HREF="#database">3.2</A> for more information.<P> </P></DD><DT CLASS="dt-description"><B><TT>--enable-full-xml</TT></B></DT><DD CLASS="dd-description">
|
||||
See section <A HREF="#database">3.2</A> for more information.<P> </P></DD><DT CLASS="dt-description"><B><TT>--enable-full-xml</TT></B></DT><DD CLASS="dd-description">
|
||||
Enable the use of XML based optimisations.
|
||||
It will for example use CDATA to escape characters in the XMPP stream.
|
||||
It will for example use CDATA to escape characters in the XMPP stream.
|
||||
Use this option only if you are sure your Jabber clients include a fully compliant XML parser.<P> </P></DD><DT CLASS="dt-description"><B><TT>--disable-transient-supervisors</TT></B></DT><DD CLASS="dd-description">
|
||||
Disable the use of Erlang/OTP supervision for transient processes.
|
||||
Disable the use of Erlang/OTP supervision for transient processes.
|
||||
</DD></DL><P> <A NAME="install"></A> </P><!--TOC subsection Install-->
|
||||
<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc12">2.4.4</A>  <A HREF="#install">Install</A></H3><!--SEC END --><P> <A NAME="install"></A>
|
||||
</P><P>To install <TT>ejabberd</TT> in the destination directories, run the command:
|
||||
@ -432,8 +432,8 @@ and configurable options to fine tune the Erlang runtime system.</P><P> <A NAME=
|
||||
</P><P>You need to have <TT>GNU install</TT>,
|
||||
but it isn’t included in Solaris.
|
||||
It can be easily installed if your Solaris system
|
||||
is set up for <A HREF="http://www.blastwave.org/">blastwave.org</A>
|
||||
package repository.
|
||||
is set up for <A HREF="http://www.blastwave.org/">blastwave.org</A>
|
||||
package repository.
|
||||
Make sure <TT>/opt/csw/bin</TT> is in your <TT>PATH</TT> and run:
|
||||
</P><PRE CLASS="verbatim">pkg-get -i fileutils
|
||||
</PRE><P>If that program is called <TT>ginstall</TT>,
|
||||
@ -471,8 +471,8 @@ directory, you can add the directories
|
||||
<CODE>C:\sdk\GnuWin32\bin</CODE> to the <CODE>PATH</CODE> environment
|
||||
variable.
|
||||
</P></LI><LI CLASS="li-enumerate">Install OpenSSL in <CODE>C:\sdk\OpenSSL</CODE> and add <CODE>C:\sdk\OpenSSL\lib\VC</CODE> to your path or copy the binaries to your system directory.
|
||||
</LI><LI CLASS="li-enumerate">Install ZLib in <CODE>C:\sdk\gnuWin32</CODE>. Copy
|
||||
<CODE>C:\sdk\GnuWin32\bin\zlib1.dll</CODE> to your system directory. If you change your path it should already be set after libiconv install.
|
||||
</LI><LI CLASS="li-enumerate">Install ZLib in <CODE>C:\sdk\gnuWin32</CODE>. Copy
|
||||
<CODE>C:\sdk\GnuWin32\bin\zlib1.dll</CODE> to your system directory. If you change your path it should already be set after libiconv install.
|
||||
</LI><LI CLASS="li-enumerate">Make sure the you can access Erlang binaries from your path. For example: <CODE>set PATH=%PATH%;"C:\sdk\erl5.5.5\bin"</CODE>
|
||||
</LI><LI CLASS="li-enumerate">Depending on how you end up actually installing the library you might need to check and tweak the paths in the file configure.erl.
|
||||
</LI><LI CLASS="li-enumerate">While in the directory <CODE>ejabberd\src</CODE> run:
|
||||
@ -484,7 +484,7 @@ nmake -f Makefile.win32
|
||||
<H2 CLASS="section"><!--SEC ANCHOR --><A NAME="htoc17">2.5</A>  <A HREF="#initialadmin">Create a Jabber Account for Administration</A></H2><!--SEC END --><P> <A NAME="initialadmin"></A> </P><P>You need a Jabber account and grant him administrative privileges
|
||||
to enter the <TT>ejabberd</TT> Web Admin:
|
||||
</P><OL CLASS="enumerate" type=1><LI CLASS="li-enumerate">
|
||||
Register a Jabber account on your <TT>ejabberd</TT> server, for example <TT>admin1@example.org</TT>.
|
||||
Register a Jabber account on your <TT>ejabberd</TT> server, for example <TT>admin1@example.org</TT>.
|
||||
There are two ways to register a Jabber account:
|
||||
<OL CLASS="enumerate" type=a><LI CLASS="li-enumerate">
|
||||
Using <TT>ejabberdctl</TT> (see section <A HREF="#ejabberdctl">4.1</A>):
|
||||
@ -504,7 +504,7 @@ suffix, is because <TT>ejabberd</TT>’s virtual hosting support.
|
||||
</LI></OL><P> <A NAME="upgrade"></A> </P><!--TOC section Upgrading <TT>ejabberd</TT>-->
|
||||
<H2 CLASS="section"><!--SEC ANCHOR --><A NAME="htoc18">2.6</A>  <A HREF="#upgrade">Upgrading <TT>ejabberd</TT></A></H2><!--SEC END --><P> <A NAME="upgrade"></A> </P><P>To upgrade an ejabberd installation to a new version,
|
||||
simply uninstall the old version, and then install the new one.
|
||||
Of course, it is important that the configuration file
|
||||
Of course, it is important that the configuration file
|
||||
and Mnesia database spool directory are not removed.</P><P><TT>ejabberd</TT> automatically updates the Mnesia table definitions at startup when needed.
|
||||
If you also use an external database for storage of some modules,
|
||||
check if the release notes of the new ejabberd version
|
||||
@ -514,7 +514,7 @@ indicates you need to also update those tables.</P><P> <A NAME="configure"></A>
|
||||
<H2 CLASS="section"><!--SEC ANCHOR --><A NAME="htoc20">3.1</A>  <A HREF="#basicconfig">Basic Configuration</A></H2><!--SEC END --><P> <A NAME="basicconfig"></A> </P><P>The configuration file will be loaded the first time you start <TT>ejabberd</TT>. The
|
||||
content from this file will be parsed and stored in the internal <TT>ejabberd</TT> database. Subsequently the
|
||||
configuration will be loaded from the database and any commands in the
|
||||
configuration file are appended to the entries in the database. </P><P>Note that <TT>ejabberd</TT> never edits the configuration file.
|
||||
configuration file are appended to the entries in the database.</P><P>Note that <TT>ejabberd</TT> never edits the configuration file.
|
||||
So, the configuration changes done using the Web Admin
|
||||
are stored in the database, but are not reflected in the configuration file.
|
||||
If you want those changes to be use after <TT>ejabberd</TT> restart, you can either
|
||||
@ -625,7 +625,7 @@ Port number.
|
||||
</LI></UL><P>
|
||||
The available modules, their purpose and the options allowed by each one are:
|
||||
</P><DL CLASS="description"><DT CLASS="dt-description">
|
||||
<B><TT>ejabberd_c2s</TT></B></DT><DD CLASS="dd-description">
|
||||
<B><TT>ejabberd_c2s</TT></B></DT><DD CLASS="dd-description">
|
||||
Handles c2s connections.<BR>
|
||||
Options: <TT>access</TT>, <TT>certfile</TT>, <TT>inet6</TT>,
|
||||
<TT>ip</TT>, <TT>max_stanza_size</TT>, <TT>shaper</TT>,
|
||||
@ -635,7 +635,7 @@ Handles c2s connections.<BR>
|
||||
Handles incoming s2s connections.<BR>
|
||||
Options: <TT>inet6</TT>, <TT>ip</TT>, <TT>max_stanza_size</TT>
|
||||
</DD><DT CLASS="dt-description"><B><TT>ejabberd_service</TT></B></DT><DD CLASS="dd-description">
|
||||
Interacts with <A HREF="http://www.ejabberd.im/tutorials-transports">external components</A>
|
||||
Interacts with an <A HREF="http://www.ejabberd.im/tutorials-transports">external component</A>
|
||||
(as defined in the Jabber Component Protocol (<A HREF="http://www.xmpp.org/extensions/xep-0114.html">XEP-0114</A>).<BR>
|
||||
Options: <TT>access</TT>, <TT>hosts</TT>, <TT>inet6</TT>,
|
||||
<TT>ip</TT>, <TT>shaper</TT>, <TT>service_check_from</TT>
|
||||
@ -655,9 +655,10 @@ used to disable control on the from field on packets send by an
|
||||
external components. The option can be either <TT>true</TT> or
|
||||
<TT>false</TT>. The default value is <TT>true</TT> which conforms to <A HREF="http://www.xmpp.org/extensions/xep-0114.html">XEP-0114</A>.
|
||||
</DD><DT CLASS="dt-description"><B><TT>{hosts, [Hostnames], [HostOptions]}</TT></B></DT><DD CLASS="dd-description">
|
||||
This option of <TT>ejabberd_service</TT> allows to define one or more hostnames
|
||||
of external Jabber components that provide a service.
|
||||
In <TT>HostOptions</TT> it is possible to define the password required to those components
|
||||
The external Jabber component that connects to this <TT>ejabberd_service</TT>
|
||||
can serve one or more hostnames.
|
||||
In <TT>HostOptions</TT> you can define options for the component;
|
||||
currently the only allowed option is the password required to the component
|
||||
when attempt to connect to ejabberd: <TT>{password, Secret}</TT>.
|
||||
Note that you cannot define in a single <TT>ejabberd_service</TT> components of
|
||||
different services: add an <TT>ejabberd_service</TT> for each service,
|
||||
@ -669,7 +670,7 @@ do not allow outgoing sockets on port 5222.<P>Remember that you must also instal
|
||||
<CODE>http://server:port/http-bind/</CODE>. Be aware that support for HTTP Bind
|
||||
is also needed in the Jabber client. Remark also that HTTP Bind can be
|
||||
interesting to host a web-based Jabber client such as
|
||||
<A HREF="http://jwchat.sourceforge.net/">JWChat</A>
|
||||
<A HREF="http://jwchat.sourceforge.net/">JWChat</A>
|
||||
(check the tutorials to install JWChat with ejabberd and an
|
||||
<A HREF="http://www.ejabberd.im/jwchat-localserver">embedded local web server</A>
|
||||
or <A HREF="http://www.ejabberd.im/jwchat-apache">Apache</A>).
|
||||
@ -683,7 +684,7 @@ interesting to host a web-based Jabber client such as
|
||||
<A HREF="http://jwchat.sourceforge.net/">JWChat</A>.
|
||||
</P></DD><DT CLASS="dt-description"><B><TT>inet6</TT></B></DT><DD CLASS="dd-description"> Set up the socket for IPv6 instead of IPv4.
|
||||
Note: this option is not required for S2S outgoing connections,
|
||||
because when ejabberd attempts to establish a S2S outgoing connection
|
||||
because when ejabberd attempts to establish a S2S outgoing connection
|
||||
it first tries IPv4, and if that fails it attempts with IPv6.
|
||||
</DD><DT CLASS="dt-description"><B><TT>{ip, IPAddress}</TT></B></DT><DD CLASS="dd-description"> This option specifies which network
|
||||
interface to listen for. For example <CODE>{ip, {192, 168, 1, 1}}</CODE>.
|
||||
@ -715,7 +716,7 @@ You should also set the <TT>certfile</TT> option.
|
||||
You can define a certificate file for a specific domain using the global option <TT>domain_certfile</TT>.
|
||||
</DD><DT CLASS="dt-description"><B><TT>starttls_required</TT></B></DT><DD CLASS="dd-description"> This option
|
||||
specifies that STARTTLS encryption is required on connections to the port.
|
||||
No unencrypted connections will be allowed.
|
||||
No unencrypted connections will be allowed.
|
||||
You should also set the <TT>certfile</TT> option.
|
||||
You can define a certificate file for a specific domain using the global option <TT>domain_certfile</TT>.
|
||||
</DD><DT CLASS="dt-description"><B><TT>tls</TT></B></DT><DD CLASS="dd-description"> This option specifies that traffic on
|
||||
@ -746,7 +747,7 @@ The default policy for incoming and outgoing s2s connections to other Jabber ser
|
||||
The default value is <TT>allow</TT>.
|
||||
</DD><DT CLASS="dt-description"><B><TT>{{s2s_host, Host}, allow|deny}</TT></B></DT><DD CLASS="dd-description">
|
||||
Defines if incoming and outgoing s2s connections with a specific remote host are allowed or denied.
|
||||
This allows to restrict ejabberd to only establish s2s connections
|
||||
This allows to restrict ejabberd to only establish s2s connections
|
||||
with a small list of trusted servers, or to block some specific servers.
|
||||
</DD><DT CLASS="dt-description"><B><TT>{s2s_max_retry_delay, Seconds}</TT></B></DT><DD CLASS="dd-description">
|
||||
The maximum allowed delay for retry to connect after a failed connection attempt.
|
||||
@ -755,7 +756,7 @@ Specified in seconds. The default value is 300 seconds (5 minutes).
|
||||
</P><UL CLASS="itemize"><LI CLASS="li-itemize">
|
||||
There are three domains. The default certificate file is <TT>server.pem</TT>.
|
||||
However, the c2s and s2s connections to the domain <TT>example.com</TT> use the file <TT>example_com.pem</TT>.
|
||||
</LI><LI CLASS="li-itemize">Port 5222 listens for c2s connections with STARTTLS,
|
||||
</LI><LI CLASS="li-itemize">Port 5222 listens for c2s connections with STARTTLS,
|
||||
and also allows plain connections for old clients.
|
||||
</LI><LI CLASS="li-itemize">Port 5223 listens for c2s connections with the old SSL.
|
||||
</LI><LI CLASS="li-itemize">Port 5269 listens for s2s connections with STARTTLS.
|
||||
@ -766,7 +767,7 @@ section <A HREF="#webadmin">4.2</A>.
|
||||
{listen,
|
||||
[
|
||||
{5222, ejabberd_c2s, [
|
||||
{access, c2s},
|
||||
{access, c2s},
|
||||
{shaper, c2s_shaper},
|
||||
starttls, {certfile, "/etc/ejabberd/server.pem"},
|
||||
{max_stanza_size, 65536}
|
||||
@ -804,7 +805,7 @@ only two servers can connect: "jabber.example.org" and "example.com".
|
||||
</LI><LI CLASS="li-itemize">Port 5280 is serving the Web Admin and the HTTP Polling service. Note
|
||||
that it is also possible to serve them on different ports. The second
|
||||
example in section <A HREF="#webadmin">4.2</A> shows how exactly this can be done.
|
||||
</LI><LI CLASS="li-itemize">All users except for the administrators have a traffic of limit
|
||||
</LI><LI CLASS="li-itemize">All users except for the administrators have a traffic of limit
|
||||
1,000 Bytes/second
|
||||
</LI><LI CLASS="li-itemize">The
|
||||
<A HREF="http://www.ejabberd.im/pyaimt">AIM transport</A>
|
||||
@ -1122,7 +1123,7 @@ following syntax:
|
||||
</P><PRE CLASS="verbatim">{maxrate, <rate>}
|
||||
</PRE><P>where <TT><rate></TT> stands for the maximum allowed incoming rate in bytes per
|
||||
second.
|
||||
When a connection exceeds this limit, <TT>ejabberd</TT> stops reading from the socket
|
||||
When a connection exceeds this limit, <TT>ejabberd</TT> stops reading from the socket
|
||||
until the average rate is again below the allowed maximum.</P><P>Examples:
|
||||
</P><UL CLASS="itemize"><LI CLASS="li-itemize">
|
||||
To define a shaper named ‘<TT>normal</TT>’ with traffic speed limited to
|
||||
@ -1166,7 +1167,7 @@ The default value is: <TT>all</TT>
|
||||
If such an option is present, the option will not be accepted.
|
||||
The file is in a subdirectory from where the main configuration file is.
|
||||
</P><PRE CLASS="verbatim">{include_config_file, "./example.org/additional_not_listen.cfg", [{disallow, [listen]}]}.
|
||||
</PRE><P>In this example, <TT>ejabberd.cfg</TT> defines some ACL and Access rules,
|
||||
</PRE><P>In this example, <TT>ejabberd.cfg</TT> defines some ACL and Access rules,
|
||||
and later includes another file with additional rules:
|
||||
</P><PRE CLASS="verbatim">{acl, admin, {user, "admin", "localhost"}}.
|
||||
{access, announce, [{allow, admin}]}.
|
||||
@ -1256,11 +1257,14 @@ you. This file contains the <TT>ejabberd</TT> schema for MySQL. At the end of th
|
||||
you can find information to update your database schema.</P><P>By default <TT>ejabberd</TT> opens 10 connections to the database for each virtual host.
|
||||
Use this option to modify the value:
|
||||
</P><PRE CLASS="verbatim">{odbc_pool_size, 10}.
|
||||
</PRE><P>You can configure an interval to make a dummy SQL request
|
||||
to keep alive the connections to the database.
|
||||
The default value is ’undefined’, so no keepalive requests are made.
|
||||
</PRE><P>You can configure an interval to make a dummy SQL request
|
||||
to keep alive the connections to the database.
|
||||
The default value is ’undefined’, so no keepalive requests are made.
|
||||
Specify in seconds: for example 28800 means 8 hours.
|
||||
</P><PRE CLASS="verbatim">{odbc_keepalive_interval, undefined}.
|
||||
</PRE><P>If the connection to the database fails, <TT>ejabberd</TT> waits 30 seconds before retrying.
|
||||
You can modify this interval with this option:
|
||||
</P><PRE CLASS="verbatim">{odbc_start_interval, 30}.
|
||||
</PRE><P> <A NAME="compilemysql"></A> </P><!--TOC subsubsection Driver Compilation-->
|
||||
<H4 CLASS="subsubsection"><!--SEC ANCHOR --><A HREF="#compilemysql">Driver Compilation</A></H4><!--SEC END --><P> <A NAME="compilemysql"></A>
|
||||
</P><P>You can skip this step if you installed <TT>ejabberd</TT> using a binary installer or
|
||||
@ -1313,9 +1317,9 @@ you. This file contains the <TT>ejabberd</TT> schema for Microsoft SQL Server. A
|
||||
of the file you can find information to update your database schema.</P><P>By default <TT>ejabberd</TT> opens 10 connections to the database for each virtual host.
|
||||
Use this option to modify the value:
|
||||
</P><PRE CLASS="verbatim">{odbc_pool_size, 10}.
|
||||
</PRE><P>You can configure an interval to make a dummy SQL request
|
||||
to keep alive the connections to the database.
|
||||
The default value is ’undefined’, so no keepalive requests are made.
|
||||
</PRE><P>You can configure an interval to make a dummy SQL request
|
||||
to keep alive the connections to the database.
|
||||
The default value is ’undefined’, so no keepalive requests are made.
|
||||
Specify in seconds: for example 28800 means 8 hours.
|
||||
</P><PRE CLASS="verbatim">{odbc_keepalive_interval, undefined}.
|
||||
</PRE><P> <A NAME="compilemssql"></A> </P><!--TOC subsubsection Driver Compilation-->
|
||||
@ -1348,9 +1352,9 @@ This file contains the <TT>ejabberd</TT> schema for PostgreSQL. At the end of th
|
||||
you can find information to update your database schema.</P><P>By default <TT>ejabberd</TT> opens 10 connections to the database for each virtual host.
|
||||
Use this option to modify the value:
|
||||
</P><PRE CLASS="verbatim">{odbc_pool_size, 10}.
|
||||
</PRE><P>You can configure an interval to make a dummy SQL request
|
||||
to keep alive the connections to the database.
|
||||
The default value is ’undefined’, so no keepalive requests are made.
|
||||
</PRE><P>You can configure an interval to make a dummy SQL request
|
||||
to keep alive the connections to the database.
|
||||
The default value is ’undefined’, so no keepalive requests are made.
|
||||
Specify in seconds: for example 28800 means 8 hours.
|
||||
</P><PRE CLASS="verbatim">{odbc_keepalive_interval, undefined}.
|
||||
</PRE><P> <A NAME="compilepgsql"></A> </P><!--TOC subsubsection Driver Compilation-->
|
||||
@ -1359,7 +1363,7 @@ Specify in seconds: for example 28800 means 8 hours.
|
||||
if the binary packages of <TT>ejabberd</TT> you are using include support for
|
||||
PostgreSQL.</P><OL CLASS="enumerate" type=1><LI CLASS="li-enumerate">
|
||||
First, install the Erlang pgsql library from
|
||||
<A HREF="http://www.ejabberd.im/ejabberd-modules/">ejabberd-modules SVN repository</A>.
|
||||
<A HREF="http://www.ejabberd.im/ejabberd-modules/">ejabberd-modules SVN repository</A>.
|
||||
Make sure the compiled
|
||||
files are in your Erlang path; you can put them for example in the same
|
||||
directory as your <TT>ejabberd</TT> .beam files.
|
||||
@ -1405,9 +1409,9 @@ contains information about <TT>ejabberd</TT>’s configuration which is dup
|
||||
this section.</P><P>By default <TT>ejabberd</TT> opens 10 connections to the database for each virtual host.
|
||||
Use this option to modify the value:
|
||||
</P><PRE CLASS="verbatim">{odbc_pool_size, 10}.
|
||||
</PRE><P>You can configure an interval to make a dummy SQL request
|
||||
to keep alive the connections to the database.
|
||||
The default value is ’undefined’, so no keepalive requests are made.
|
||||
</PRE><P>You can configure an interval to make a dummy SQL request
|
||||
to keep alive the connections to the database.
|
||||
The default value is ’undefined’, so no keepalive requests are made.
|
||||
Specify in seconds: for example 28800 means 8 hours.
|
||||
</P><PRE CLASS="verbatim">{odbc_keepalive_interval, undefined}.
|
||||
</PRE><P> <A NAME="compileodbc"></A> </P><!--TOC subsubsection Driver Compilation-->
|
||||
@ -1444,17 +1448,17 @@ module loaded!</P><P> <A NAME="ldap"></A> </P><!--TOC subsection LDAP-->
|
||||
</P><P><TT>ejabberd</TT> has built-in LDAP support. You can authenticate users against LDAP
|
||||
server and use LDAP directory as vCard storage. Shared rosters are not supported
|
||||
yet.</P><P>Note that <TT>ejabberd</TT> treats LDAP as a read-only storage:
|
||||
it is possible to consult data, but not possible to
|
||||
it is possible to consult data, but not possible to
|
||||
create accounts, change password or edit vCard that is stored in LDAP.</P><P> <A NAME="ldapconnection"></A> </P><!--TOC subsubsection Connection-->
|
||||
<H4 CLASS="subsubsection"><!--SEC ANCHOR --><A HREF="#ldapconnection">Connection</A></H4><!--SEC END --><P> <A NAME="ldapconnection"></A> </P><P>Parameters:
|
||||
</P><DL CLASS="description"><DT CLASS="dt-description">
|
||||
<B><TT>ldap_servers</TT></B></DT><DD CLASS="dd-description"> List of IP addresses or DNS names of your
|
||||
LDAP servers. This option is required.
|
||||
</DD><DT CLASS="dt-description"><B><TT>ldap_port</TT></B></DT><DD CLASS="dd-description"> Port to connect to your LDAP server.
|
||||
The initial default value is 389, so it is used when nothing is set into the
|
||||
configuration file.
|
||||
If you configure a value, it is stored in <TT>ejabberd</TT>’s database.
|
||||
Then, if you remove that value from the configuration file,
|
||||
The initial default value is 389, so it is used when nothing is set into the
|
||||
configuration file.
|
||||
If you configure a value, it is stored in <TT>ejabberd</TT>’s database.
|
||||
Then, if you remove that value from the configuration file,
|
||||
the value previously stored in the database will be used instead of the default 389.
|
||||
</DD><DT CLASS="dt-description"><B><TT>ldap_rootdn</TT></B></DT><DD CLASS="dd-description"> Bind DN. The default value
|
||||
is <TT>""</TT> which means ‘anonymous connection’.
|
||||
@ -1738,7 +1742,7 @@ number of processes (32000 by default).
|
||||
<H4 CLASS="subsubsection"><!--SEC ANCHOR --><A HREF="#modhostoption"><TT>host</TT></A></H4><!--SEC END --><P> <A NAME="modhostoption"></A>
|
||||
</P><P>This option defines the Jabber ID of a service provided by an <TT>ejabberd</TT> module.
|
||||
The keyword "@HOST@" is replaced at start time with the real virtual host string.</P><P>This example configures
|
||||
the echo module to provide its echoing service
|
||||
the echo module to provide its echoing service
|
||||
in the Jabber ID <TT>mirror.example.org</TT>:
|
||||
</P><PRE CLASS="verbatim">{modules,
|
||||
[
|
||||
@ -1757,7 +1761,7 @@ the "@HOST@" keyword must be used:
|
||||
</PRE><P> <A NAME="modannounce"></A> </P><!--TOC subsection <TT>mod_announce</TT>-->
|
||||
<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc39">3.3.3</A>  <A HREF="#modannounce"><TT>mod_announce</TT></A></H3><!--SEC END --><P> <A NAME="modannounce"></A>
|
||||
</P><P>This module enables configured users to broadcast announcements and to set
|
||||
the message of the day (MOTD).
|
||||
the message of the day (MOTD).
|
||||
Configured users can perform these actions with a
|
||||
Jabber client either using Ad-hoc commands
|
||||
or sending messages to specific JIDs.</P><P>The Ad-hoc commands are listed in the Server Discovery.
|
||||
@ -1831,7 +1835,7 @@ for the superseded Jabber Browsing (<A HREF="http://www.xmpp.org/extensions/xep-
|
||||
the newer Service Discovery protocol if you want them be able to discover
|
||||
the services you offer.</P><P>Options:
|
||||
</P><DL CLASS="description"><DT CLASS="dt-description">
|
||||
<B><TT>iqdisc</TT></B></DT><DD CLASS="dd-description"> This specifies
|
||||
<B><TT>iqdisc</TT></B></DT><DD CLASS="dd-description"> This specifies
|
||||
the processing discipline for Service Discovery (<TT>http://jabber.org/protocol/disco#items</TT> and
|
||||
<TT>http://jabber.org/protocol/disco#info</TT>) IQ queries (see section <A HREF="#modiqdiscoption">3.3.2</A>).
|
||||
</DD><DT CLASS="dt-description"><B><TT>extra_domains</TT></B></DT><DD CLASS="dd-description"> With this option,
|
||||
@ -1947,7 +1951,7 @@ discover when a disconnected user last accessed the server, to know when a
|
||||
connected user was last active on the server, or to query the uptime of the
|
||||
<TT>ejabberd</TT> server.</P><P>Options:
|
||||
</P><DL CLASS="description"><DT CLASS="dt-description">
|
||||
<B><TT>iqdisc</TT></B></DT><DD CLASS="dd-description"> This specifies
|
||||
<B><TT>iqdisc</TT></B></DT><DD CLASS="dd-description"> This specifies
|
||||
the processing discipline for Last activity (<TT>jabber:iq:last</TT>) IQ queries (see section <A HREF="#modiqdiscoption">3.3.2</A>).
|
||||
</DD></DL><P> <A NAME="modmuc"></A> </P><!--TOC subsection <TT>mod_muc</TT>-->
|
||||
<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc44">3.3.8</A>  <A HREF="#modmuc"><TT>mod_muc</TT></A></H3><!--SEC END --><P> <A NAME="modmuc"></A>
|
||||
@ -1962,7 +1966,7 @@ Sending public and private messages to room occupants.
|
||||
</LI><LI CLASS="li-itemize">Kicking and banning occupants.
|
||||
</LI></UL><P>The MUC service allows any Jabber ID to register a nickname,
|
||||
so nobody else can use that nickname in any room in the MUC service.
|
||||
To register a nickname, open the Service Discovery in your
|
||||
To register a nickname, open the Service Discovery in your
|
||||
Jabber client and register in the MUC service.</P><P>This module supports clustering and load
|
||||
balancing. One module can be started per cluster node. Rooms are
|
||||
distributed at creation time on all available MUC module
|
||||
@ -2041,7 +2045,7 @@ interval delay. Intermediate presence packets are silently
|
||||
discarded. A good value for this option is 4 seconds.
|
||||
</DD><DT CLASS="dt-description"><B><TT>default_room_options</TT></B></DT><DD CLASS="dd-description">
|
||||
This module option allows to define the desired default room options.
|
||||
Note that the creator of a room can modify the options of his room
|
||||
Note that the creator of a room can modify the options of his room
|
||||
at any time using a Jabber client with MUC capability.
|
||||
The available room options and the default values are:
|
||||
<DL CLASS="description"><DT CLASS="dt-description">
|
||||
@ -2055,7 +2059,9 @@ change nickname.
|
||||
status text in presence updates. If disallowed, the <TT>status</TT>
|
||||
text is stripped before broadcasting the presence update to all
|
||||
the room occupants.
|
||||
</DD><DT CLASS="dt-description"><B><TT>{anonymous, true}</TT></B></DT><DD CLASS="dd-description"> Occupants are allowed to see the real JIDs of other occupants.
|
||||
</DD><DT CLASS="dt-description"><B><TT>{anonymous, true}</TT></B></DT><DD CLASS="dd-description"> The room is anonymous:
|
||||
occupants don’t see the real JIDs of other occupants.
|
||||
Note that the room moderators can always see the real JIDs of the occupants.
|
||||
</DD><DT CLASS="dt-description"><B><TT>{logging, false}</TT></B></DT><DD CLASS="dd-description"> The public messages are logged using <TT>mod_muc_log</TT>.
|
||||
</DD><DT CLASS="dt-description"><B><TT>{max_users, 200}</TT></B></DT><DD CLASS="dd-description"> Maximum number of occupants in the room.
|
||||
</DD><DT CLASS="dt-description"><B><TT>{members_by_default, true}</TT></B></DT><DD CLASS="dd-description"> The occupants that enter the room are participants by default, so they have ’voice’.
|
||||
@ -2214,7 +2220,7 @@ directory. The default value is <TT>"www/muc"</TT>.
|
||||
To prevent spam, the <TT>spam_prevention</TT> option adds a special attribute
|
||||
to links that prevent their indexation by search engines. The default value
|
||||
is <TT>true</TT>, which mean that nofollow attributes will be added to user
|
||||
submitted links.
|
||||
submitted links.
|
||||
</DD><DT CLASS="dt-description"><B><TT>timezone</TT></B></DT><DD CLASS="dd-description">
|
||||
The time zone for the logs is configurable with this option. Allowed values
|
||||
are <TT>local</TT> and <TT>universal</TT>. With the first value, the local time,
|
||||
@ -2310,7 +2316,7 @@ subscription type (or globally).
|
||||
(from <A HREF="http://www.xmpp.org/specs/rfc3921.html#privacy"><TT>http://www.xmpp.org/specs/rfc3921.html#privacy</TT></A>)
|
||||
</BLOCKQUOTE><P>Options:
|
||||
</P><DL CLASS="description"><DT CLASS="dt-description">
|
||||
<B><TT>iqdisc</TT></B></DT><DD CLASS="dd-description"> This specifies
|
||||
<B><TT>iqdisc</TT></B></DT><DD CLASS="dd-description"> This specifies
|
||||
the processing discipline for Blocking Communication (<TT>jabber:iq:privacy</TT>) IQ queries (see section <A HREF="#modiqdiscoption">3.3.2</A>).
|
||||
</DD></DL><P> <A NAME="modprivate"></A> </P><!--TOC subsection <TT>mod_private</TT>-->
|
||||
<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc48">3.3.12</A>  <A HREF="#modprivate"><TT>mod_private</TT></A></H3><!--SEC END --><P> <A NAME="modprivate"></A>
|
||||
@ -2322,7 +2328,7 @@ it is valid XML. One typical usage for this namespace is the server-side storage
|
||||
of client-specific preferences; another is Bookmark Storage (<A HREF="http://www.xmpp.org/extensions/xep-0048.html">XEP-0048</A>).
|
||||
</BLOCKQUOTE><P>Options:
|
||||
</P><DL CLASS="description"><DT CLASS="dt-description">
|
||||
<B><TT>iqdisc</TT></B></DT><DD CLASS="dd-description"> This specifies
|
||||
<B><TT>iqdisc</TT></B></DT><DD CLASS="dd-description"> This specifies
|
||||
the processing discipline for Private XML Storage (<TT>jabber:iq:private</TT>) IQ queries (see section <A HREF="#modiqdiscoption">3.3.2</A>).
|
||||
</DD></DL><P> <A NAME="modproxy"></A> </P><!--TOC subsection <TT>mod_proxy65</TT>-->
|
||||
<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc49">3.3.13</A>  <A HREF="#modproxy"><TT>mod_proxy65</TT></A></H3><!--SEC END --><P> <A NAME="modproxy"></A>
|
||||
@ -2399,7 +2405,7 @@ ACL and ACCESS. The default value is <TT>pubsub_createnode</TT>. </DD><DT CLASS=
|
||||
pubsub plugin is always used.
|
||||
</DD><DT CLASS="dt-description"><B><TT>nodetree</TT></B></DT><DD CLASS="dd-description"> To specify which nodetree to use. If not defined, the default pubsub
|
||||
nodetree is used. Nodetrees are default and virtual. Only one nodetree can be used
|
||||
and is shared by all node plugins.
|
||||
and is shared by all node plugins.
|
||||
</DD></DL><P>Example:
|
||||
</P><PRE CLASS="verbatim">{modules,
|
||||
[
|
||||
@ -2425,12 +2431,12 @@ rules to restrict registration. If a rule returns ‘deny’ on the re
|
||||
user name, registration for that user name is denied. (there are no
|
||||
restrictions by default).
|
||||
</DD><DT CLASS="dt-description"><B><TT>welcome_message</TT></B></DT><DD CLASS="dd-description"> Set a welcome message that
|
||||
is sent to each newly registered account. The first string is the subject, and
|
||||
is sent to each newly registered account. The first string is the subject, and
|
||||
the second string is the message body.
|
||||
In the body you can set a newline with the characters: <CODE>\n</CODE>
|
||||
</DD><DT CLASS="dt-description"><B><TT>registration_watchers</TT></B></DT><DD CLASS="dd-description"> This option defines a
|
||||
</DD><DT CLASS="dt-description"><B><TT>registration_watchers</TT></B></DT><DD CLASS="dd-description"> This option defines a
|
||||
list of JIDs which will be notified each time a new account is registered.
|
||||
</DD><DT CLASS="dt-description"><B><TT>iqdisc</TT></B></DT><DD CLASS="dd-description"> This specifies
|
||||
</DD><DT CLASS="dt-description"><B><TT>iqdisc</TT></B></DT><DD CLASS="dd-description"> This specifies
|
||||
the processing discipline for In-Band Registration (<TT>jabber:iq:register</TT>) IQ queries (see section <A HREF="#modiqdiscoption">3.3.2</A>).
|
||||
</DD></DL><P>This module reads also another option defined globably for the server:
|
||||
<TT>{registration_timeout, Timeout}</TT>.
|
||||
@ -2487,7 +2493,7 @@ Also define a registration timeout of one hour:
|
||||
<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc52">3.3.16</A>  <A HREF="#modroster"><TT>mod_roster</TT></A></H3><!--SEC END --><P> <A NAME="modroster"></A>
|
||||
</P><P>This module implements roster management as defined in <A HREF="http://www.xmpp.org/specs/rfc3921.html#roster">RFC 3921: XMPP IM</A>.</P><P>Options:
|
||||
</P><DL CLASS="description"><DT CLASS="dt-description">
|
||||
<B><TT>iqdisc</TT></B></DT><DD CLASS="dd-description"> This specifies
|
||||
<B><TT>iqdisc</TT></B></DT><DD CLASS="dd-description"> This specifies
|
||||
the processing discipline for Roster Management (<TT>jabber:iq:roster</TT>) IQ queries (see section <A HREF="#modiqdiscoption">3.3.2</A>).
|
||||
</DD></DL><P> <A NAME="modservicelog"></A> </P><!--TOC subsection <TT>mod_service_log</TT>-->
|
||||
<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc53">3.3.17</A>  <A HREF="#modservicelog"><TT>mod_service_log</TT></A></H3><!--SEC END --><P> <A NAME="modservicelog"></A>
|
||||
@ -2510,7 +2516,7 @@ To log all end user packets to the Bandersnatch service running on
|
||||
...
|
||||
]}.
|
||||
</PRE></LI><LI CLASS="li-itemize">To log all end user packets to the Bandersnatch service running on
|
||||
<TT>bandersnatch.example.com</TT> and the backup service on
|
||||
<TT>bandersnatch.example.com</TT> and the backup service on
|
||||
<TT>bandersnatch.example.org</TT>:
|
||||
<PRE CLASS="verbatim">{modules,
|
||||
[
|
||||
@ -2525,9 +2531,9 @@ To log all end user packets to the Bandersnatch service running on
|
||||
create groups of people that can see members from (other) groups in their
|
||||
rosters. The big advantages of this feature are that end users do not need to
|
||||
manually add all users to their rosters, and that they cannot permanently delete
|
||||
users from the shared roster groups.
|
||||
users from the shared roster groups.
|
||||
A shared roster group can have members from any Jabber server,
|
||||
but the presence will only be available from and to members
|
||||
but the presence will only be available from and to members
|
||||
of the same virtual host where the group is created.</P><P>Shared roster groups can be edited <EM>only</EM> via the Web Admin. Each group
|
||||
has a unique identification and the following parameters:
|
||||
</P><DL CLASS="description"><DT CLASS="dt-description">
|
||||
@ -2605,7 +2611,7 @@ Total number of registered users on the current virtual host (users/total).
|
||||
</LI><LI CLASS="li-itemize">Total number of online users on all virtual hosts (users/all-hosts/online).
|
||||
</LI></UL><P>Options:
|
||||
</P><DL CLASS="description"><DT CLASS="dt-description">
|
||||
<B><TT>iqdisc</TT></B></DT><DD CLASS="dd-description"> This specifies
|
||||
<B><TT>iqdisc</TT></B></DT><DD CLASS="dd-description"> This specifies
|
||||
the processing discipline for Statistics Gathering (<TT>http://jabber.org/protocol/stats</TT>) IQ queries (see section <A HREF="#modiqdiscoption">3.3.2</A>).
|
||||
</DD></DL><P>As there are only a small amount of clients (for example
|
||||
<A HREF="http://tkabber.jabber.ru/">Tkabber</A>) and software libraries with
|
||||
@ -2631,7 +2637,7 @@ by sending:
|
||||
</P><P>This module features support for Entity Time (<A HREF="http://www.xmpp.org/extensions/xep-0090.html">XEP-0090</A>). By using this XEP,
|
||||
you are able to discover the time at another entity’s location.</P><P>Options:
|
||||
</P><DL CLASS="description"><DT CLASS="dt-description">
|
||||
<B><TT>iqdisc</TT></B></DT><DD CLASS="dd-description"> This specifies
|
||||
<B><TT>iqdisc</TT></B></DT><DD CLASS="dd-description"> This specifies
|
||||
the processing discipline for Entity Time (<TT>jabber:iq:time</TT>) IQ queries (see section <A HREF="#modiqdiscoption">3.3.2</A>).
|
||||
</DD></DL><P> <A NAME="modvcard"></A> </P><!--TOC subsection <TT>mod_vcard</TT>-->
|
||||
<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc57">3.3.21</A>  <A HREF="#modvcard"><TT>mod_vcard</TT></A></H3><!--SEC END --><P> <A NAME="modvcard"></A>
|
||||
@ -2646,7 +2652,7 @@ service. If the <TT>host</TT> option is not specified, the Jabber ID will be the
|
||||
hostname of the virtual host with the prefix ‘<TT>vjud.</TT>’. The keyword "@HOST@"
|
||||
is replaced at start time with the real virtual host name.
|
||||
|
||||
</DD><DT CLASS="dt-description"><B><TT>iqdisc</TT></B></DT><DD CLASS="dd-description"> This specifies
|
||||
</DD><DT CLASS="dt-description"><B><TT>iqdisc</TT></B></DT><DD CLASS="dd-description"> This specifies
|
||||
the processing discipline for <TT>vcard-temp</TT> IQ queries (see section <A HREF="#modiqdiscoption">3.3.2</A>).
|
||||
</DD><DT CLASS="dt-description"><B><TT>search</TT></B></DT><DD CLASS="dd-description">This option specifies whether the search
|
||||
functionality is enabled (value: <TT>true</TT>) or disabled (value:
|
||||
@ -2693,7 +2699,7 @@ and that all virtual hosts will be searched instead of only the current one:
|
||||
</P><P><TT>ejabberd</TT> can map LDAP attributes to vCard fields. This behaviour is
|
||||
implemented in the <TT>mod_vcard_ldap</TT> module. This module does not depend on the
|
||||
authentication method (see <A HREF="#ldapauth">3.2.5</A>).</P><P>Note that <TT>ejabberd</TT> treats LDAP as a read-only storage:
|
||||
it is possible to consult data, but not possible to
|
||||
it is possible to consult data, but not possible to
|
||||
create accounts, change password or edit vCard that is stored in LDAP.</P><P>The <TT>mod_vcard_ldap</TT> module has
|
||||
its own optional parameters. The first group of parameters has the same
|
||||
meaning as the top-level LDAP parameters to set the authentication method:
|
||||
@ -2709,7 +2715,7 @@ service. If the <TT>host</TT> option is not specified, the Jabber ID will be the
|
||||
hostname of the virtual host with the prefix ‘<TT>vjud.</TT>’. The keyword "@HOST@"
|
||||
is replaced at start time with the real virtual host name.
|
||||
|
||||
</DD><DT CLASS="dt-description"><B><TT>iqdisc</TT></B></DT><DD CLASS="dd-description"> This specifies
|
||||
</DD><DT CLASS="dt-description"><B><TT>iqdisc</TT></B></DT><DD CLASS="dd-description"> This specifies
|
||||
the processing discipline for <TT>vcard-temp</TT> IQ queries (see section <A HREF="#modiqdiscoption">3.3.2</A>).
|
||||
</DD><DT CLASS="dt-description"><B><TT>search</TT></B></DT><DD CLASS="dd-description">This option specifies whether the search
|
||||
functionality is enabled (value: <TT>true</TT>) or disabled (value:
|
||||
@ -2871,14 +2877,14 @@ answers <TT>ejabberd</TT>’s version when queried.</P><P>Options:
|
||||
</P><DL CLASS="description"><DT CLASS="dt-description">
|
||||
<B><TT>show_os</TT></B></DT><DD CLASS="dd-description">Should the operating system be revealed or not.
|
||||
The default value is <TT>true</TT>.
|
||||
</DD><DT CLASS="dt-description"><B><TT>iqdisc</TT></B></DT><DD CLASS="dd-description"> This specifies
|
||||
</DD><DT CLASS="dt-description"><B><TT>iqdisc</TT></B></DT><DD CLASS="dd-description"> This specifies
|
||||
the processing discipline for Software Version (<TT>jabber:iq:version</TT>) IQ queries (see section <A HREF="#modiqdiscoption">3.3.2</A>).
|
||||
</DD></DL><P> <A NAME="manage"></A> </P><!--TOC chapter Managing an <TT>ejabberd</TT> server-->
|
||||
<H1 CLASS="chapter"><!--SEC ANCHOR --><A NAME="htoc60">Chapter 4</A>  <A HREF="#manage">Managing an <TT>ejabberd</TT> server</A></H1><!--SEC END --><P> <A NAME="manage"></A> </P><P> <A NAME="ejabberdctl"></A> </P><!--TOC section <TT>ejabberdctl</TT>-->
|
||||
<H2 CLASS="section"><!--SEC ANCHOR --><A NAME="htoc61">4.1</A>  <A HREF="#ejabberdctl"><TT>ejabberdctl</TT></A></H2><!--SEC END --><P> <A NAME="ejabberdctl"></A> </P><P> <A NAME="commands"></A> </P><!--TOC subsection Commands-->
|
||||
<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc62">4.1.1</A>  <A HREF="#commands">Commands</A></H3><!--SEC END --><P> <A NAME="commands"></A> </P><P>The <TT>ejabberdctl</TT> command line administration script allows to start, stop and perform
|
||||
<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc62">4.1.1</A>  <A HREF="#commands">Commands</A></H3><!--SEC END --><P> <A NAME="commands"></A> </P><P>The <TT>ejabberdctl</TT> command line administration script allows to start, stop and perform
|
||||
many other administrative tasks in a local or remote <TT>ejabberd</TT> server.</P><P>When <TT>ejabberdctl</TT> is executed without any parameter,
|
||||
it displays the available options. If there isn’t an <TT>ejabberd</TT> server running,
|
||||
it displays the available options. If there isn’t an <TT>ejabberd</TT> server running,
|
||||
the available parameters are:
|
||||
</P><DL CLASS="description"><DT CLASS="dt-description">
|
||||
<B><TT>start</TT></B></DT><DD CLASS="dd-description"> Start <TT>ejabberd</TT> in background mode. This is the default method.
|
||||
@ -2893,7 +2899,7 @@ The more interesting ones are:
|
||||
</DD><DT CLASS="dt-description"><B><TT>reopen-log</TT></B></DT><DD CLASS="dd-description"> If you use a tool to rotate logs, you have to configure it
|
||||
so that this command is executed after each rotation.
|
||||
</DD><DT CLASS="dt-description"><B><TT>backup, restore, install-fallback, dump, load</TT></B></DT><DD CLASS="dd-description"> You can use these
|
||||
commands to create and restore backups.
|
||||
commands to create and restore backups.
|
||||
</DD><DT CLASS="dt-description"><B><TT>import-file, import-dir</TT></B></DT><DD CLASS="dd-description">
|
||||
These options can be used to migrate from other Jabber/XMPP servers. There
|
||||
exist tutorials to <A HREF="http://www.ejabberd.im/migrate-to-ejabberd">migrate from other software to ejabberd</A>.
|
||||
@ -2912,66 +2918,66 @@ for example using: <TT>echo $?</TT></P><P> <A NAME="erlangconfiguration"></A> </
|
||||
<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc63">4.1.2</A>  <A HREF="#erlangconfiguration">Erlang runtime system</A></H3><!--SEC END --><P> <A NAME="erlangconfiguration"></A> </P><P><TT>ejabberd</TT> is an Erlang/OTP application that runs inside an Erlang runtime system.
|
||||
This system is configured using environment variables and command line parameters.
|
||||
The <TT>ejabberdctl</TT> administration script uses many of those possibilities.
|
||||
You can configure some of them with the file <TT>ejabberdctl.cfg</TT>,
|
||||
You can configure some of them with the file <TT>ejabberdctl.cfg</TT>,
|
||||
which includes detailed description about them.
|
||||
This section describes for reference purposes
|
||||
This section describes for reference purposes
|
||||
all the environment variables and command line parameters.</P><P>The environment variables:
|
||||
</P><DL CLASS="description"><DT CLASS="dt-description">
|
||||
<B><TT>EJABBERD_CONFIG_PATH</TT></B></DT><DD CLASS="dd-description">
|
||||
<B><TT>EJABBERD_CONFIG_PATH</TT></B></DT><DD CLASS="dd-description">
|
||||
Path to the ejabberd configuration file.
|
||||
</DD><DT CLASS="dt-description"><B><TT>EJABBERD_MSGS_PATH</TT></B></DT><DD CLASS="dd-description">
|
||||
</DD><DT CLASS="dt-description"><B><TT>EJABBERD_MSGS_PATH</TT></B></DT><DD CLASS="dd-description">
|
||||
Path to the directory with translated strings.
|
||||
</DD><DT CLASS="dt-description"><B><TT>EJABBERD_LOG_PATH</TT></B></DT><DD CLASS="dd-description">
|
||||
</DD><DT CLASS="dt-description"><B><TT>EJABBERD_LOG_PATH</TT></B></DT><DD CLASS="dd-description">
|
||||
Path to the ejabberd service log file.
|
||||
</DD><DT CLASS="dt-description"><B><TT>EJABBERD_SO_PATH</TT></B></DT><DD CLASS="dd-description">
|
||||
</DD><DT CLASS="dt-description"><B><TT>EJABBERD_SO_PATH</TT></B></DT><DD CLASS="dd-description">
|
||||
Path to the directory with binary system libraries.
|
||||
</DD><DT CLASS="dt-description"><B><TT>HOME</TT></B></DT><DD CLASS="dd-description">
|
||||
</DD><DT CLASS="dt-description"><B><TT>HOME</TT></B></DT><DD CLASS="dd-description">
|
||||
Path to the directory that is considered <TT>ejabberd</TT>’s home.
|
||||
This path is used to read the file <TT>.erlang.cookie</TT>.
|
||||
</DD><DT CLASS="dt-description"><B><TT>ERL_CRASH_DUMP</TT></B></DT><DD CLASS="dd-description">
|
||||
</DD><DT CLASS="dt-description"><B><TT>ERL_CRASH_DUMP</TT></B></DT><DD CLASS="dd-description">
|
||||
Path to the file where crash reports will be dumped.
|
||||
</DD><DT CLASS="dt-description"><B><TT>ERL_INETRC</TT></B></DT><DD CLASS="dd-description">
|
||||
</DD><DT CLASS="dt-description"><B><TT>ERL_INETRC</TT></B></DT><DD CLASS="dd-description">
|
||||
Indicates which IP name resolution to use.
|
||||
If using <TT>-sname</TT>, specify either this option or <TT>-kernel inetrc filepath</TT>.
|
||||
</DD><DT CLASS="dt-description"><B><TT>ERL_MAX_PORTS</TT></B></DT><DD CLASS="dd-description">
|
||||
</DD><DT CLASS="dt-description"><B><TT>ERL_MAX_PORTS</TT></B></DT><DD CLASS="dd-description">
|
||||
Maximum number of simultaneously open Erlang ports.
|
||||
</DD><DT CLASS="dt-description"><B><TT>ERL_MAX_ETS_TABLES</TT></B></DT><DD CLASS="dd-description">
|
||||
</DD><DT CLASS="dt-description"><B><TT>ERL_MAX_ETS_TABLES</TT></B></DT><DD CLASS="dd-description">
|
||||
Maximum number of ETS and Mnesia tables.
|
||||
</DD></DL><P>The command line parameters:
|
||||
</P><DL CLASS="description"><DT CLASS="dt-description">
|
||||
<B><TT>-sname ejabberd</TT></B></DT><DD CLASS="dd-description">
|
||||
<B><TT>-sname ejabberd</TT></B></DT><DD CLASS="dd-description">
|
||||
The Erlang node will be identified using only the first part
|
||||
of the host name, i. e. other Erlang nodes outside this domain cannot contact
|
||||
this node. This is the preferable option in most cases.
|
||||
</DD><DT CLASS="dt-description"><B><TT>-name ejabberd</TT></B></DT><DD CLASS="dd-description">
|
||||
</DD><DT CLASS="dt-description"><B><TT>-name ejabberd</TT></B></DT><DD CLASS="dd-description">
|
||||
The Erlang node will be fully identified.
|
||||
This is only useful if you plan to setup an <TT>ejabberd</TT> cluster with nodes in different networks.
|
||||
</DD><DT CLASS="dt-description"><B><TT>-kernel inetrc "/etc/ejabberd/inetrc"</TT></B></DT><DD CLASS="dd-description">
|
||||
Indicates which IP name resolution to use.
|
||||
</DD><DT CLASS="dt-description"><B><TT>-kernel inetrc "/etc/ejabberd/inetrc"</TT></B></DT><DD CLASS="dd-description">
|
||||
Indicates which IP name resolution to use.
|
||||
If using <TT>-sname</TT>, specify either this option or <TT>ERL_INETRC</TT>.
|
||||
</DD><DT CLASS="dt-description"><B><TT>-kernel inet_dist_listen_min 4200 inet_dist_listen_min 4210</TT></B></DT><DD CLASS="dd-description">
|
||||
</DD><DT CLASS="dt-description"><B><TT>-kernel inet_dist_listen_min 4200 inet_dist_listen_min 4210</TT></B></DT><DD CLASS="dd-description">
|
||||
Define the first and last ports that <TT>epmd</TT> (section <A HREF="#epmd">5.2</A>) can listen to.
|
||||
</DD><DT CLASS="dt-description"><B><TT>-detached</TT></B></DT><DD CLASS="dd-description">
|
||||
Starts the Erlang system detached from the system console.
|
||||
Useful for running daemons and backgrounds processes.
|
||||
</DD><DT CLASS="dt-description"><B><TT>-noinput</TT></B></DT><DD CLASS="dd-description">
|
||||
</DD><DT CLASS="dt-description"><B><TT>-detached</TT></B></DT><DD CLASS="dd-description">
|
||||
Starts the Erlang system detached from the system console.
|
||||
Useful for running daemons and backgrounds processes.
|
||||
</DD><DT CLASS="dt-description"><B><TT>-noinput</TT></B></DT><DD CLASS="dd-description">
|
||||
Ensures that the Erlang system never tries to read any input.
|
||||
Useful for running daemons and backgrounds processes.
|
||||
</DD><DT CLASS="dt-description"><B><TT>-pa /var/lib/ejabberd/ebin</TT></B></DT><DD CLASS="dd-description">
|
||||
Useful for running daemons and backgrounds processes.
|
||||
</DD><DT CLASS="dt-description"><B><TT>-pa /var/lib/ejabberd/ebin</TT></B></DT><DD CLASS="dd-description">
|
||||
Specify the directory where Erlang binary files (*.beam) are located.
|
||||
</DD><DT CLASS="dt-description"><B><TT>-s ejabberd</TT></B></DT><DD CLASS="dd-description">
|
||||
</DD><DT CLASS="dt-description"><B><TT>-s ejabberd</TT></B></DT><DD CLASS="dd-description">
|
||||
Tell Erlang runtime system to start the <TT>ejabberd</TT> application.
|
||||
</DD><DT CLASS="dt-description"><B><TT>-mnesia dir "/var/lib/ejabberd/"</TT></B></DT><DD CLASS="dd-description">
|
||||
Specify the Mnesia database directory.
|
||||
</DD><DT CLASS="dt-description"><B><TT>-sasl sasl_error_logger {file, "/var/log/ejabberd/sasl.log"}</TT></B></DT><DD CLASS="dd-description">
|
||||
Path to the Erlang/OTP system log file.
|
||||
</DD><DT CLASS="dt-description"><B><TT>+K [true|false]</TT></B></DT><DD CLASS="dd-description">
|
||||
</DD><DT CLASS="dt-description"><B><TT>+K [true|false]</TT></B></DT><DD CLASS="dd-description">
|
||||
Kernel polling.
|
||||
</DD><DT CLASS="dt-description"><B><TT>-smp [auto|enable|disable]</TT></B></DT><DD CLASS="dd-description">
|
||||
</DD><DT CLASS="dt-description"><B><TT>-smp [auto|enable|disable]</TT></B></DT><DD CLASS="dd-description">
|
||||
SMP support.
|
||||
</DD><DT CLASS="dt-description"><B><TT>+P 250000</TT></B></DT><DD CLASS="dd-description">
|
||||
</DD><DT CLASS="dt-description"><B><TT>+P 250000</TT></B></DT><DD CLASS="dd-description">
|
||||
Maximum number of Erlang processes.
|
||||
</DD><DT CLASS="dt-description"><B><TT>-remsh ejabberd@localhost</TT></B></DT><DD CLASS="dd-description">
|
||||
</DD><DT CLASS="dt-description"><B><TT>-remsh ejabberd@localhost</TT></B></DT><DD CLASS="dd-description">
|
||||
Open an Erlang shell in a remote Erlang node.
|
||||
</DD></DL><P>
|
||||
Note that some characters need to be escaped when used in shell scripts, for instance <CODE>"</CODE> and <CODE>{}</CODE>.
|
||||
@ -2979,7 +2985,7 @@ You can find other options in the Erlang manual page (<TT>erl -man erl</TT>).</P
|
||||
<H2 CLASS="section"><!--SEC ANCHOR --><A NAME="htoc64">4.2</A>  <A HREF="#webadmin">Web Admin</A></H2><!--SEC END --><P> <A NAME="webadmin"></A>
|
||||
</P><P>The <TT>ejabberd</TT> Web Admin allows to administer most of <TT>ejabberd</TT> using a web browser.</P><P>This feature is enabled by default:
|
||||
a <TT>ejabberd_http</TT> listener with the option <TT>web_admin</TT> (see
|
||||
section <A HREF="#listened">3.1.3</A>) is included in the listening ports. Then you can open
|
||||
section <A HREF="#listened">3.1.3</A>) is included in the listening ports. Then you can open
|
||||
<CODE>http://server:port/admin/</CODE> in your favourite web browser. You
|
||||
will be asked to enter the username (the <EM>full</EM> Jabber ID) and password
|
||||
of an <TT>ejabberd</TT> user with administrator rights. After authentication
|
||||
@ -3042,7 +3048,7 @@ with a Jabber client.
|
||||
The client must support Ad-Hoc Commands (<A HREF="http://www.xmpp.org/extensions/xep-0050.html">XEP-0050</A>),
|
||||
and you must login in the Jabber server with
|
||||
an account with proper privileges.</P><P> <A NAME="changeerlangnodename"></A> </P><!--TOC section Change Computer Hostname-->
|
||||
<H2 CLASS="section"><!--SEC ANCHOR --><A NAME="htoc66">4.4</A>  <A HREF="#changeerlangnodename">Change Computer Hostname</A></H2><!--SEC END --><P> <A NAME="changeerlangnodename"></A> </P><P><TT>ejabberd</TT> uses the distributed Mnesia database.
|
||||
<H2 CLASS="section"><!--SEC ANCHOR --><A NAME="htoc66">4.4</A>  <A HREF="#changeerlangnodename">Change Computer Hostname</A></H2><!--SEC END --><P> <A NAME="changeerlangnodename"></A> </P><P><TT>ejabberd</TT> uses the distributed Mnesia database.
|
||||
Being distributed, Mnesia enforces consistency of its file,
|
||||
so it stores the name of the Erlang node in it (see section <A HREF="#nodename">5.4</A>).
|
||||
The name of an Erlang node includes the hostname of the computer.
|
||||
@ -3052,7 +3058,7 @@ or when you move <TT>ejabberd</TT> to a different machine.</P><P>So, if you want
|
||||
you must follow these instructions:
|
||||
</P><OL CLASS="enumerate" type=1><LI CLASS="li-enumerate">
|
||||
In the old server, backup the Mnesia database using the Web Admin or <TT>ejabberdctl</TT>.
|
||||
For example:
|
||||
For example:
|
||||
<PRE CLASS="verbatim">ejabberdctl backup /tmp/ejabberd-oldhost.backup
|
||||
</PRE> </LI><LI CLASS="li-enumerate">In the new server, restore the backup file using the Web Admin or <TT>ejabberdctl</TT>.
|
||||
For example:
|
||||
@ -3071,13 +3077,13 @@ you must follow these instructions:
|
||||
</TABLE>
|
||||
<DIV CLASS="center"><HR WIDTH="80%" SIZE=2></DIV></DIV></BLOCKQUOTE><P> <A NAME="epmd"></A> </P><!--TOC section epmd-->
|
||||
<H2 CLASS="section"><!--SEC ANCHOR --><A NAME="htoc69">5.2</A>  <A HREF="#epmd">epmd</A></H2><!--SEC END --><P> <A NAME="epmd"></A> </P><P><A HREF="http://www.erlang.org/doc/man/epmd.html">epmd (Erlang Port Mapper Daemon)</A>
|
||||
is a small name server included in Erlang/OTP
|
||||
and used by Erlang programs when establishing distributed Erlang communications.
|
||||
<TT>ejabberd</TT> needs <TT>epmd</TT> to use <TT>ejabberdctl</TT> and also when clustering <TT>ejabberd</TT> nodes.
|
||||
is a small name server included in Erlang/OTP
|
||||
and used by Erlang programs when establishing distributed Erlang communications.
|
||||
<TT>ejabberd</TT> needs <TT>epmd</TT> to use <TT>ejabberdctl</TT> and also when clustering <TT>ejabberd</TT> nodes.
|
||||
This small program is automatically started by Erlang, and is never stopped.
|
||||
If <TT>ejabberd</TT> is stopped, and there aren’t any other Erlang programs
|
||||
running in the system, you can safely stop <TT>epmd</TT> if you want.</P><P><TT>ejabberd</TT> runs inside an Erlang node.
|
||||
To communicate with <TT>ejabberd</TT>, the script <TT>ejabberdctl</TT> starts a new Erlang node
|
||||
If <TT>ejabberd</TT> is stopped, and there aren’t any other Erlang programs
|
||||
running in the system, you can safely stop <TT>epmd</TT> if you want.</P><P><TT>ejabberd</TT> runs inside an Erlang node.
|
||||
To communicate with <TT>ejabberd</TT>, the script <TT>ejabberdctl</TT> starts a new Erlang node
|
||||
and connects to the Erlang node that holds <TT>ejabberd</TT>.
|
||||
In order for this communication to work,
|
||||
<TT>epmd</TT> must be running and listening for name requests in the port 4369.
|
||||
@ -3090,32 +3096,32 @@ So, if you plan to build a cluster of <TT>ejabberd</TT> nodes
|
||||
you must open the port 4369 for the machines involved in the cluster.
|
||||
Remember to block the port so Internet doesn’t have access to it.</P><P>Once an Erlang node solved the node name of another Erlang node using EPMD and port 4369,
|
||||
the nodes communicate directly.
|
||||
The ports used in this case by default are random,
|
||||
The ports used in this case by default are random,
|
||||
but can be configured in the file <TT>ejabberdctl.cfg</TT>.
|
||||
The Erlang command-line parameter used internally is, for example:
|
||||
</P><PRE CLASS="verbatim">erl ... -kernel inet_dist_listen_min 4370 inet_dist_listen_max 4375
|
||||
</PRE><P> <A NAME="cookie"></A> </P><!--TOC section Erlang Cookie-->
|
||||
<H2 CLASS="section"><!--SEC ANCHOR --><A NAME="htoc70">5.3</A>  <A HREF="#cookie">Erlang Cookie</A></H2><!--SEC END --><P> <A NAME="cookie"></A> </P><P>The Erlang cookie is a string with numbers and letters.
|
||||
<H2 CLASS="section"><!--SEC ANCHOR --><A NAME="htoc70">5.3</A>  <A HREF="#cookie">Erlang Cookie</A></H2><!--SEC END --><P> <A NAME="cookie"></A> </P><P>The Erlang cookie is a string with numbers and letters.
|
||||
An Erlang node reads the cookie at startup from the command-line parameter <TT>-setcookie</TT>.
|
||||
If not indicated, the cookie is read from the cookie file <TT>$HOME/.erlang.cookie</TT>.
|
||||
If this file does not exist, it is created immediately with a random cookie.
|
||||
Two Erlang nodes communicate only if they have the same cookie.
|
||||
Setting a cookie on the Erlang node allows you to structure your Erlang network
|
||||
Setting a cookie on the Erlang node allows you to structure your Erlang network
|
||||
and define which nodes are allowed to connect to which.</P><P>Thanks to Erlang cookies, you can prevent access to the Erlang node by mistake,
|
||||
for example when there are several Erlang nodes running different programs in the same machine.</P><P>Setting a secret cookie is a simple method
|
||||
to difficult unauthorized access to your Erlang node.
|
||||
However, the cookie system is not ultimately effective
|
||||
However, the cookie system is not ultimately effective
|
||||
to prevent unauthorized access or intrusion to an Erlang node.
|
||||
The communication between Erlang nodes are not encrypted,
|
||||
so the cookie could be read sniffing the traffic on the network.
|
||||
The recommended way to secure the Erlang node is to block the port 4369.</P><P> <A NAME="nodename"></A> </P><!--TOC section Erlang node name-->
|
||||
<H2 CLASS="section"><!--SEC ANCHOR --><A NAME="htoc71">5.4</A>  <A HREF="#nodename">Erlang node name</A></H2><!--SEC END --><P> <A NAME="nodename"></A> </P><P>An Erlang node may have a node name.
|
||||
The name can be short (if indicated with the command-line parameter <TT>-sname</TT>)
|
||||
or long (if indicated with the parameter <TT>-name</TT>).
|
||||
Starting an Erlang node with -sname limits the communication between Erlang nodes to the LAN.</P><P>Using the option <TT>-sname</TT> instead of <TT>-name</TT> is a simple method
|
||||
The name can be short (if indicated with the command-line parameter <TT>-sname</TT>)
|
||||
or long (if indicated with the parameter <TT>-name</TT>).
|
||||
Starting an Erlang node with -sname limits the communication between Erlang nodes to the LAN.</P><P>Using the option <TT>-sname</TT> instead of <TT>-name</TT> is a simple method
|
||||
to difficult unauthorized access to your Erlang node.
|
||||
However, it is not ultimately effective to prevent access to the Erlang node,
|
||||
because it may be possible to fake the fact that you are on another network
|
||||
because it may be possible to fake the fact that you are on another network
|
||||
using a modified version of Erlang <TT>epmd</TT>.
|
||||
The recommended way to secure the Erlang node is to block the port 4369.</P><P> <A NAME="secure-files"></A> </P><!--TOC section Securing sensible files-->
|
||||
<H2 CLASS="section"><!--SEC ANCHOR --><A NAME="htoc72">5.5</A>  <A HREF="#secure-files">Securing sensible files</A></H2><!--SEC END --><P> <A NAME="secure-files"></A> </P><P><TT>ejabberd</TT> stores sensible data in the file system either in plain text or binary files.
|
||||
@ -3184,11 +3190,15 @@ Copy <CODE>~ejabberd/.erlang.cookie</CODE> file from <TT>first</TT> to
|
||||
<TT>second</TT>.<P>(alt) You can also add ‘<CODE>-cookie content_of_.erlang.cookie</CODE>’
|
||||
option to all ‘<TT>erl</TT>’ commands below.</P></LI><LI CLASS="li-enumerate">On <TT>second</TT> run the following command as the <TT>ejabberd</TT> daemon user,
|
||||
in the working directory of <TT>ejabberd</TT>:<PRE CLASS="verbatim">erl -sname ejabberd \
|
||||
-mnesia dir "/var/lib/ejabberd/" \
|
||||
-mnesia extra_db_nodes "['ejabberd@first']" \
|
||||
-s mnesia
|
||||
</PRE><P>This will start Mnesia serving the same database as <TT>ejabberd@first</TT>.
|
||||
You can check this by running the command ‘<CODE>mnesia:info().</CODE>’. You
|
||||
should see a lot of remote tables and a line like the following:</P><PRE CLASS="verbatim">running db nodes = [ejabberd@first, ejabberd@second]
|
||||
should see a lot of remote tables and a line like the following:</P><P>Note: the Mnesia directory may be different in your system.
|
||||
To know where does ejabberd expect Mnesia to be installed by default,
|
||||
call <A HREF="#ejabberdctl">4.1</A> without options and it will show some help,
|
||||
including the Mnesia database spool dir.</P><PRE CLASS="verbatim">running db nodes = [ejabberd@first, ejabberd@second]
|
||||
</PRE></LI><LI CLASS="li-enumerate">Now run the following in the same ‘<TT>erl</TT>’ session:<PRE CLASS="verbatim">mnesia:change_table_copy_type(schema, node(), disc_copies).
|
||||
</PRE><P>This will create local disc storage for the database.</P><P>(alt) Change storage type of the <TT>scheme</TT> table to ‘RAM and disc
|
||||
copy’ on the second node via the Web Admin.</P></LI><LI CLASS="li-enumerate">Now you can add replicas of various tables to this node with
|
||||
@ -3214,7 +3224,7 @@ domain.</P><P> <A NAME="servicelb"></A> </P><!--TOC section Service Load-Balanci
|
||||
</P><P> <A NAME="componentlb"></A> </P><!--TOC subsection Components Load-Balancing-->
|
||||
<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc81">6.3.1</A>  <A HREF="#componentlb">Components Load-Balancing</A></H3><!--SEC END --><P> <A NAME="componentlb"></A> </P><P> <A NAME="domainlb"></A> </P><!--TOC subsection Domain Load-Balancing Algorithm-->
|
||||
<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc82">6.3.2</A>  <A HREF="#domainlb">Domain Load-Balancing Algorithm</A></H3><!--SEC END --><P> <A NAME="domainlb"></A>
|
||||
</P><P><TT>ejabberd</TT> includes an algorithm to load balance the components that are plugged on an <TT>ejabberd</TT> cluster. It means that you can plug one or several instances of the same component on each <TT>ejabberd</TT> cluster and that the traffic will be automatically distributed.</P><P>The default distribution algorithm try to deliver to a local instance of a component. If several local instances are available, one instance is chosen randomly. If no instance is available locally, one instance is chosen randomly among the remote component instances.</P><P>If you need a different behaviour, you can change the load balancing behaviour with the option <TT>domain_balancing</TT>. The syntax of the option is the following:</P><PRE CLASS="verbatim">{domain_balancing, "component.example.com", <balancing_criterium>}.
|
||||
</P><P><TT>ejabberd</TT> includes an algorithm to load balance the components that are plugged on an <TT>ejabberd</TT> cluster. It means that you can plug one or several instances of the same component on each <TT>ejabberd</TT> cluster and that the traffic will be automatically distributed.</P><P>The default distribution algorithm try to deliver to a local instance of a component. If several local instances are available, one instance is chosen randomly. If no instance is available locally, one instance is chosen randomly among the remote component instances.</P><P>If you need a different behaviour, you can change the load balancing behaviour with the option <TT>domain_balancing</TT>. The syntax of the option is the following:</P><PRE CLASS="verbatim">{domain_balancing, "component.example.com", <balancing_criterium>}.
|
||||
</PRE><P>Several balancing criteria are available:
|
||||
</P><UL CLASS="itemize"><LI CLASS="li-itemize">
|
||||
<TT>destination</TT>: the full JID of the packet <TT>to</TT> attribute is used.
|
||||
@ -3260,12 +3270,12 @@ For example, the default configuration is:
|
||||
<H2 CLASS="section"><!--SEC ANCHOR --><A NAME="htoc87">7.3</A>  <A HREF="#debugconsole">Debug Console</A></H2><!--SEC END --><P> <A NAME="debugconsole"></A> </P><P>The Debug Console is an Erlang shell attached to an already running <TT>ejabberd</TT> server.
|
||||
With this Erlang shell, an experienced administrator can perform complex tasks.</P><P>This shell gives complete control over the <TT>ejabberd</TT> server,
|
||||
so it is important to use it with extremely care.
|
||||
There are some simple and safe examples in the article
|
||||
There are some simple and safe examples in the article
|
||||
<A HREF="http://www.ejabberd.im/interconnect-erl-nodes">Interconnecting Erlang Nodes</A></P><P>To exit the shell, close the window or press the keys: control+c control+c.</P><P> <A NAME="i18ni10n"></A> </P><!--TOC chapter Internationalization and Localization-->
|
||||
<H1 CLASS="chapter"><!--SEC ANCHOR --><A NAME="htoc88">Appendix A</A>  <A HREF="#i18ni10n">Internationalization and Localization</A></H1><!--SEC END --><P> <A NAME="i18ni10n"></A>
|
||||
</P><P>The source code of <TT>ejabberd</TT> supports localization.
|
||||
The translators can edit the
|
||||
<A HREF="http://www.gnu.org/software/gettext/">gettext</A> .po files
|
||||
The translators can edit the
|
||||
<A HREF="http://www.gnu.org/software/gettext/">gettext</A> .po files
|
||||
using any capable program (KBabel, Lokalize, Poedit...) or a simple text editor.</P><P>Then gettext
|
||||
is used to extract, update and export those .po files to the .msg format read by <TT>ejabberd</TT>.
|
||||
To perform those management tasks, in the <TT>src/</TT> directory execute <TT>make translations</TT>.
|
||||
@ -3292,7 +3302,7 @@ Figure <A HREF="#fig:discorus">A.1</A>, for example, shows the reply to the
|
||||
<IMG SRC="webadmmainru.png" ALT="webadmmainru.png">
|
||||
|
||||
|
||||
<DIV CLASS="caption"><TABLE CELLSPACING=6 CELLPADDING=0><TR><TD VALIGN=top ALIGN=left>Figure A.2: Web Admin showing a virtual host when the web browser provides the
|
||||
<DIV CLASS="caption"><TABLE CELLSPACING=6 CELLPADDING=0><TR><TD VALIGN=top ALIGN=left>Figure A.2: Web Admin showing a virtual host when the web browser provides the
|
||||
HTTP header ‘Accept-Language: ru’</TD></TR>
|
||||
</TABLE></DIV>
|
||||
<A NAME="fig:webadmmainru"></A>
|
||||
|
317
doc/guide.tex
317
doc/guide.tex
@ -102,7 +102,7 @@
|
||||
\include{contributed_modules}
|
||||
|
||||
%% Common options
|
||||
\newcommand{\iqdiscitem}[1]{\titem{iqdisc} \ind{options!iqdisc}This specifies
|
||||
\newcommand{\iqdiscitem}[1]{\titem{iqdisc} \ind{options!iqdisc}This specifies
|
||||
the processing discipline for #1 IQ queries (see section~\ref{modiqdiscoption}).}
|
||||
\newcommand{\hostitem}[1]{
|
||||
\titem{host} \ind{options!host} This option defines the Jabber ID of the
|
||||
@ -159,8 +159,8 @@ ejabberd Development Team
|
||||
\newstyle{table[border="1"]}{border-collapse:collapse;margin-bottom:1em;}
|
||||
\newstyle{table[border="1"] td}{border:1px solid \#aaa;padding:2px}
|
||||
% Don't display <hr> before and after tables or images:
|
||||
\newstyle{BLOCKQUOTE.table DIV.center DIV.center HR}{display:none;}
|
||||
\newstyle{BLOCKQUOTE.figure DIV.center DIV.center HR}{display:none;}
|
||||
\newstyle{BLOCKQUOTE.table DIV.center DIV.center HR}{display:none;}
|
||||
\newstyle{BLOCKQUOTE.figure DIV.center DIV.center HR}{display:none;}
|
||||
|
||||
%% Footnotes
|
||||
\begin{latexonly}
|
||||
@ -208,8 +208,8 @@ ejabberd Development Team
|
||||
\makesection{install.binary}{Installing \ejabberd{} with Binary Installer}
|
||||
|
||||
Probably the easiest way to install an \ejabberd{} instant messaging server
|
||||
is using the binary installer published by ProcessOne.
|
||||
The binary installers of released \ejabberd{} versions
|
||||
is using the binary installer published by ProcessOne.
|
||||
The binary installers of released \ejabberd{} versions
|
||||
are available in the ProcessOne \ejabberd{} downloads page:
|
||||
\ahrefurl{http://www.process-one.net/en/ejabberd/downloads}
|
||||
|
||||
@ -227,17 +227,17 @@ or automatically by the operating system at system boot time.
|
||||
|
||||
To start and stop \ejabberd{} manually,
|
||||
use the desktop shortcuts created by the installer.
|
||||
If the machine doesn't have a graphical system, use the scripts 'start'
|
||||
If the machine doesn't have a graphical system, use the scripts 'start'
|
||||
and 'stop' in the 'bin' directory where \ejabberd{} is installed.
|
||||
|
||||
The Windows installer also adds ejabberd as a system service,
|
||||
and a shortcut to a debug console for experienced administrators.
|
||||
If you want ejabberd to be started automatically at boot time,
|
||||
If you want ejabberd to be started automatically at boot time,
|
||||
go to the Windows service settings and set ejabberd to be automatically started.
|
||||
Note that the Windows service is a feature still in development,
|
||||
Note that the Windows service is a feature still in development,
|
||||
and for example it doesn't read the file ejabberdctl.cfg.
|
||||
|
||||
On a *nix system, if you want ejabberd to be started as daemon at boot time,
|
||||
On a *nix system, if you want ejabberd to be started as daemon at boot time,
|
||||
copy \term{ejabberd.init} from the 'bin' directory to something like \term{/etc/init.d/ejabberd}
|
||||
(depending on your distribution) and call \term{/etc/inid.d/ejabberd start} to start it.
|
||||
|
||||
@ -263,9 +263,9 @@ and configurable options to fine tune the Erlang runtime system.
|
||||
|
||||
\makesection{install.os}{Installing \ejabberd{} with Operating System specific packages}
|
||||
|
||||
Some Operating Systems provide a specific \ejabberd{} package adapted to
|
||||
Some Operating Systems provide a specific \ejabberd{} package adapted to
|
||||
the system architecture and libraries.
|
||||
It usually also checks dependencies
|
||||
It usually also checks dependencies
|
||||
and performs basic configuration tasks like creating the initial
|
||||
administrator account. Some examples are Debian and Gentoo. Consult the
|
||||
resources provided by your Operating System for more information.
|
||||
@ -282,7 +282,7 @@ The binaries are available for many different system architectures, so this is a
|
||||
alternative to the binary installer and Operating System's \ejabberd{} packages.
|
||||
|
||||
You will have to create your own \ejabberd{} start
|
||||
script depending of how you handle your CEAN installation.
|
||||
script depending of how you handle your CEAN installation.
|
||||
The default \term{ejabberdctl} script is located
|
||||
into \ejabberd{}'s priv directory and can be used as an example.
|
||||
|
||||
@ -290,7 +290,7 @@ into \ejabberd{}'s priv directory and can be used as an example.
|
||||
\ind{install}
|
||||
|
||||
The canonical form for distribution of \ejabberd{} stable releases is the source code package.
|
||||
Compiling \ejabberd{} from source code is quite easy in *nix systems,
|
||||
Compiling \ejabberd{} from source code is quite easy in *nix systems,
|
||||
as long as your system have all the dependencies.
|
||||
|
||||
\makesubsection{installreq}{Requirements}
|
||||
@ -337,12 +337,12 @@ To get the full list run the command:
|
||||
|
||||
Some options that you may be interested in modifying:
|
||||
\begin{description}
|
||||
\titem{--prefix=/}
|
||||
\titem{--prefix=/}
|
||||
Specify the path prefix where the files will be copied when running
|
||||
the \term{make install} command.
|
||||
|
||||
\titem{--enable-user[=USER]}
|
||||
Allow this normal system user to execute the ejabberdctl script
|
||||
Allow this normal system user to execute the ejabberdctl script
|
||||
(see section~\ref{ejabberdctl}),
|
||||
read the configuration files,
|
||||
read and write in the spool directory,
|
||||
@ -352,20 +352,20 @@ Some options that you may be interested in modifying:
|
||||
This account doesn't need an explicit HOME directory, because
|
||||
\term{/var/lib/ejabberd/} will be used by default.
|
||||
|
||||
\titem{--enable-pam}
|
||||
\titem{--enable-pam}
|
||||
Enable the PAM authentication method (see section \ref{pam}).
|
||||
|
||||
\titem{--enable-odbc or --enable-mssql}
|
||||
Required if you want to use an external database.
|
||||
See section~\ref{database} for more information.
|
||||
|
||||
\titem{--enable-full-xml}
|
||||
\titem{--enable-full-xml}
|
||||
Enable the use of XML based optimisations.
|
||||
It will for example use CDATA to escape characters in the XMPP stream.
|
||||
It will for example use CDATA to escape characters in the XMPP stream.
|
||||
Use this option only if you are sure your Jabber clients include a fully compliant XML parser.
|
||||
|
||||
\titem{--disable-transient-supervisors}
|
||||
Disable the use of Erlang/OTP supervision for transient processes.
|
||||
Disable the use of Erlang/OTP supervision for transient processes.
|
||||
\end{description}
|
||||
|
||||
|
||||
@ -456,8 +456,8 @@ gmake
|
||||
You need to have \term{GNU install},
|
||||
but it isn't included in Solaris.
|
||||
It can be easily installed if your Solaris system
|
||||
is set up for \footahref{http://www.blastwave.org/}{blastwave.org}
|
||||
package repository.
|
||||
is set up for \footahref{http://www.blastwave.org/}{blastwave.org}
|
||||
package repository.
|
||||
Make sure \term{/opt/csw/bin} is in your \term{PATH} and run:
|
||||
\begin{verbatim}
|
||||
pkg-get -i fileutils
|
||||
@ -519,8 +519,8 @@ We assume that we will try to put as much library as possible into \verb|C:\sdk\
|
||||
\verb|C:\sdk\GnuWin32\bin| to the \verb|PATH| environment
|
||||
variable.
|
||||
\item Install OpenSSL in \verb|C:\sdk\OpenSSL| and add \verb|C:\sdk\OpenSSL\lib\VC| to your path or copy the binaries to your system directory.
|
||||
\item Install ZLib in \verb|C:\sdk\gnuWin32|. Copy
|
||||
\verb|C:\sdk\GnuWin32\bin\zlib1.dll| to your system directory. If you change your path it should already be set after libiconv install.
|
||||
\item Install ZLib in \verb|C:\sdk\gnuWin32|. Copy
|
||||
\verb|C:\sdk\GnuWin32\bin\zlib1.dll| to your system directory. If you change your path it should already be set after libiconv install.
|
||||
\item Make sure the you can access Erlang binaries from your path. For example: \verb|set PATH=%PATH%;"C:\sdk\erl5.5.5\bin"|
|
||||
\item Depending on how you end up actually installing the library you might need to check and tweak the paths in the file configure.erl.
|
||||
\item While in the directory \verb|ejabberd\src| run:
|
||||
@ -542,20 +542,20 @@ werl -s ejabberd -name ejabberd
|
||||
You need a Jabber account and grant him administrative privileges
|
||||
to enter the \ejabberd{} Web Admin:
|
||||
\begin{enumerate}
|
||||
\item Register a Jabber account on your \ejabberd{} server, for example \term{admin1@example.org}.
|
||||
\item Register a Jabber account on your \ejabberd{} server, for example \term{admin1@example.org}.
|
||||
There are two ways to register a Jabber account:
|
||||
\begin{enumerate}
|
||||
\item Using \term{ejabberdctl}\ind{ejabberdctl} (see section~\ref{ejabberdctl}):
|
||||
\begin{verbatim}
|
||||
ejabberdctl register admin1 example.org FgT5bk3
|
||||
\end{verbatim}
|
||||
\end{verbatim}
|
||||
\item Using a Jabber client and In-Band Registration (see section~\ref{modregister}).
|
||||
\end{enumerate}
|
||||
\item Edit the \ejabberd{} configuration file to give administration rights to the Jabber account you created:
|
||||
\begin{verbatim}
|
||||
{acl, admins, {user, "admin1", "example.org"}}.
|
||||
{access, configure, [{allow, admins}]}.
|
||||
\end{verbatim}
|
||||
\end{verbatim}
|
||||
You can grant administrative privileges to many Jabber accounts,
|
||||
and also to accounts in other Jabber servers.
|
||||
\item Restart \ejabberd{} to load the new configuration.
|
||||
@ -569,7 +569,7 @@ ejabberdctl register admin1 example.org FgT5bk3
|
||||
|
||||
To upgrade an ejabberd installation to a new version,
|
||||
simply uninstall the old version, and then install the new one.
|
||||
Of course, it is important that the configuration file
|
||||
Of course, it is important that the configuration file
|
||||
and Mnesia database spool directory are not removed.
|
||||
|
||||
\ejabberd{} automatically updates the Mnesia table definitions at startup when needed.
|
||||
@ -586,9 +586,9 @@ indicates you need to also update those tables.
|
||||
The configuration file will be loaded the first time you start \ejabberd{}. The
|
||||
content from this file will be parsed and stored in the internal \ejabberd{} database. Subsequently the
|
||||
configuration will be loaded from the database and any commands in the
|
||||
configuration file are appended to the entries in the database.
|
||||
configuration file are appended to the entries in the database.
|
||||
|
||||
Note that \ejabberd{} never edits the configuration file.
|
||||
Note that \ejabberd{} never edits the configuration file.
|
||||
So, the configuration changes done using the Web Admin
|
||||
are stored in the database, but are not reflected in the configuration file.
|
||||
If you want those changes to be use after \ejabberd{} restart, you can either
|
||||
@ -675,7 +675,7 @@ Examples:
|
||||
{ldap_password, ""}]}.
|
||||
\end{verbatim}
|
||||
\end{itemize}
|
||||
|
||||
|
||||
To define specific ejabberd modules in a virtual host,
|
||||
you can define the global \term{modules} option with the common modules,
|
||||
and later add specific modules to certain virtual hosts.
|
||||
@ -740,7 +740,7 @@ tuple with the following elements:
|
||||
\ind{modules!ejabberd\_c2s}\ind{modules!ejabberd\_s2s\_in}\ind{modules!ejabberd\_service}\ind{modules!ejabberd\_http}\ind{protocols!XEP-0114: Jabber Component Protocol}
|
||||
The available modules, their purpose and the options allowed by each one are:
|
||||
\begin{description}
|
||||
\titem{\texttt{ejabberd\_c2s}}
|
||||
\titem{\texttt{ejabberd\_c2s}}
|
||||
Handles c2s connections.\\
|
||||
Options: \texttt{access}, \texttt{certfile}, \texttt{inet6},
|
||||
\texttt{ip}, \texttt{max\_stanza\_size}, \texttt{shaper},
|
||||
@ -750,7 +750,7 @@ The available modules, their purpose and the options allowed by each one are:
|
||||
Handles incoming s2s connections.\\
|
||||
Options: \texttt{inet6}, \texttt{ip}, \texttt{max\_stanza\_size}
|
||||
\titem{\texttt{ejabberd\_service}}
|
||||
Interacts with an \footahref{http://www.ejabberd.im/tutorials-transports}{external component}
|
||||
Interacts with an \footahref{http://www.ejabberd.im/tutorials-transports}{external component}
|
||||
(as defined in the Jabber Component Protocol (\xepref{0114}).\\
|
||||
Options: \texttt{access}, \texttt{hosts}, \texttt{inet6},
|
||||
\texttt{ip}, \texttt{shaper}, \texttt{service\_check\_from}
|
||||
@ -791,7 +791,7 @@ This is a detailed description of each option allowed by the listening modules:
|
||||
\verb|http://server:port/http-bind/|. Be aware that support for HTTP Bind
|
||||
is also needed in the \Jabber{} client. Remark also that HTTP Bind can be
|
||||
interesting to host a web-based \Jabber{} client such as
|
||||
\footahref{http://jwchat.sourceforge.net/}{JWChat}
|
||||
\footahref{http://jwchat.sourceforge.net/}{JWChat}
|
||||
(check the tutorials to install JWChat with ejabberd and an
|
||||
\footahref{http://www.ejabberd.im/jwchat-localserver}{embedded local web server}
|
||||
or \footahref{http://www.ejabberd.im/jwchat-apache}{Apache}).
|
||||
@ -807,7 +807,7 @@ This is a detailed description of each option allowed by the listening modules:
|
||||
\footahref{http://jwchat.sourceforge.net/}{JWChat}.
|
||||
\titem{inet6} \ind{options!inet6}\ind{IPv6}Set up the socket for IPv6 instead of IPv4.
|
||||
Note: this option is not required for S2S outgoing connections,
|
||||
because when ejabberd attempts to establish a S2S outgoing connection
|
||||
because when ejabberd attempts to establish a S2S outgoing connection
|
||||
it first tries IPv4, and if that fails it attempts with IPv6.
|
||||
\titem{\{ip, IPAddress\}} \ind{options!ip}This option specifies which network
|
||||
interface to listen for. For example \verb|{ip, {192, 168, 1, 1}}|.
|
||||
@ -839,7 +839,7 @@ This is a detailed description of each option allowed by the listening modules:
|
||||
You can define a certificate file for a specific domain using the global option \option{domain\_certfile}.
|
||||
\titem{starttls\_required} \ind{options!starttls\_required}This option
|
||||
specifies that STARTTLS encryption is required on connections to the port.
|
||||
No unencrypted connections will be allowed.
|
||||
No unencrypted connections will be allowed.
|
||||
You should also set the \option{certfile} option.
|
||||
You can define a certificate file for a specific domain using the global option \option{domain\_certfile}.
|
||||
\titem{tls} \ind{options!tls}\ind{TLS}This option specifies that traffic on
|
||||
@ -872,7 +872,7 @@ There are some additional global options:
|
||||
The default value is \term{allow}.
|
||||
\titem{\{\{s2s\_host, Host\}, allow|deny\}}
|
||||
Defines if incoming and outgoing s2s connections with a specific remote host are allowed or denied.
|
||||
This allows to restrict ejabberd to only establish s2s connections
|
||||
This allows to restrict ejabberd to only establish s2s connections
|
||||
with a small list of trusted servers, or to block some specific servers.
|
||||
\titem{\{s2s\_max\_retry\_delay, Seconds\}} \ind{options!s2s\_max\_retry\_delay}
|
||||
The maximum allowed delay for retry to connect after a failed connection attempt.
|
||||
@ -883,7 +883,7 @@ For example, the following simple configuration defines:
|
||||
\begin{itemize}
|
||||
\item There are three domains. The default certificate file is \term{server.pem}.
|
||||
However, the c2s and s2s connections to the domain \term{example.com} use the file \term{example\_com.pem}.
|
||||
\item Port 5222 listens for c2s connections with STARTTLS,
|
||||
\item Port 5222 listens for c2s connections with STARTTLS,
|
||||
and also allows plain connections for old clients.
|
||||
\item Port 5223 listens for c2s connections with the old SSL.
|
||||
\item Port 5269 listens for s2s connections with STARTTLS.
|
||||
@ -896,7 +896,7 @@ However, the c2s and s2s connections to the domain \term{example.com} use the fi
|
||||
{listen,
|
||||
[
|
||||
{5222, ejabberd_c2s, [
|
||||
{access, c2s},
|
||||
{access, c2s},
|
||||
{shaper, c2s_shaper},
|
||||
starttls, {certfile, "/etc/ejabberd/server.pem"},
|
||||
{max_stanza_size, 65536}
|
||||
@ -936,7 +936,7 @@ In this example, the following configuration defines that:
|
||||
\item Port 5280 is serving the Web Admin and the HTTP Polling service. Note
|
||||
that it is also possible to serve them on different ports. The second
|
||||
example in section~\ref{webadmin} shows how exactly this can be done.
|
||||
\item All users except for the administrators have a traffic of limit
|
||||
\item All users except for the administrators have a traffic of limit
|
||||
1,000\,Bytes/second
|
||||
\item \ind{transports!AIM}The
|
||||
\footahref{http://www.ejabberd.im/pyaimt}{AIM transport}
|
||||
@ -1380,7 +1380,7 @@ following syntax:
|
||||
\end{verbatim}
|
||||
where \term{<rate>} stands for the maximum allowed incoming rate in bytes per
|
||||
second.
|
||||
When a connection exceeds this limit, \ejabberd{} stops reading from the socket
|
||||
When a connection exceeds this limit, \ejabberd{} stops reading from the socket
|
||||
until the average rate is again below the allowed maximum.
|
||||
|
||||
Examples:
|
||||
@ -1462,7 +1462,7 @@ The file is in a subdirectory from where the main configuration file is.
|
||||
{include_config_file, "./example.org/additional_not_listen.cfg", [{disallow, [listen]}]}.
|
||||
\end{verbatim}
|
||||
|
||||
In this example, \term{ejabberd.cfg} defines some ACL and Access rules,
|
||||
In this example, \term{ejabberd.cfg} defines some ACL and Access rules,
|
||||
and later includes another file with additional rules:
|
||||
\begin{verbatim}
|
||||
{acl, admin, {user, "admin", "localhost"}}.
|
||||
@ -1609,14 +1609,21 @@ Use this option to modify the value:
|
||||
{odbc_pool_size, 10}.
|
||||
\end{verbatim}
|
||||
|
||||
You can configure an interval to make a dummy SQL request
|
||||
to keep alive the connections to the database.
|
||||
The default value is 'undefined', so no keepalive requests are made.
|
||||
You can configure an interval to make a dummy SQL request
|
||||
to keep alive the connections to the database.
|
||||
The default value is 'undefined', so no keepalive requests are made.
|
||||
Specify in seconds: for example 28800 means 8 hours.
|
||||
\begin{verbatim}
|
||||
{odbc_keepalive_interval, undefined}.
|
||||
\end{verbatim}
|
||||
|
||||
If the connection to the database fails, \ejabberd{} waits 30 seconds before retrying.
|
||||
You can modify this interval with this option:
|
||||
\begin{verbatim}
|
||||
{odbc_start_interval, 30}.
|
||||
\end{verbatim}
|
||||
|
||||
|
||||
\makesubsubsection{compilemysql}{Driver Compilation}
|
||||
\ind{MySQL!Driver Compilation}
|
||||
|
||||
@ -1706,9 +1713,9 @@ Use this option to modify the value:
|
||||
{odbc_pool_size, 10}.
|
||||
\end{verbatim}
|
||||
|
||||
You can configure an interval to make a dummy SQL request
|
||||
to keep alive the connections to the database.
|
||||
The default value is 'undefined', so no keepalive requests are made.
|
||||
You can configure an interval to make a dummy SQL request
|
||||
to keep alive the connections to the database.
|
||||
The default value is 'undefined', so no keepalive requests are made.
|
||||
Specify in seconds: for example 28800 means 8 hours.
|
||||
\begin{verbatim}
|
||||
{odbc_keepalive_interval, undefined}.
|
||||
@ -1766,9 +1773,9 @@ Use this option to modify the value:
|
||||
{odbc_pool_size, 10}.
|
||||
\end{verbatim}
|
||||
|
||||
You can configure an interval to make a dummy SQL request
|
||||
to keep alive the connections to the database.
|
||||
The default value is 'undefined', so no keepalive requests are made.
|
||||
You can configure an interval to make a dummy SQL request
|
||||
to keep alive the connections to the database.
|
||||
The default value is 'undefined', so no keepalive requests are made.
|
||||
Specify in seconds: for example 28800 means 8 hours.
|
||||
\begin{verbatim}
|
||||
{odbc_keepalive_interval, undefined}.
|
||||
@ -1783,7 +1790,7 @@ PostgreSQL.
|
||||
|
||||
\begin{enumerate}
|
||||
\item First, install the Erlang pgsql library from
|
||||
\footahref{http://www.ejabberd.im/ejabberd-modules/}{ejabberd-modules SVN repository}.
|
||||
\footahref{http://www.ejabberd.im/ejabberd-modules/}{ejabberd-modules SVN repository}.
|
||||
Make sure the compiled
|
||||
files are in your Erlang path; you can put them for example in the same
|
||||
directory as your \ejabberd{} .beam files.
|
||||
@ -1860,9 +1867,9 @@ Use this option to modify the value:
|
||||
{odbc_pool_size, 10}.
|
||||
\end{verbatim}
|
||||
|
||||
You can configure an interval to make a dummy SQL request
|
||||
to keep alive the connections to the database.
|
||||
The default value is 'undefined', so no keepalive requests are made.
|
||||
You can configure an interval to make a dummy SQL request
|
||||
to keep alive the connections to the database.
|
||||
The default value is 'undefined', so no keepalive requests are made.
|
||||
Specify in seconds: for example 28800 means 8 hours.
|
||||
\begin{verbatim}
|
||||
{odbc_keepalive_interval, undefined}.
|
||||
@ -1924,7 +1931,7 @@ server and use LDAP directory as vCard storage. Shared rosters are not supported
|
||||
yet.
|
||||
|
||||
Note that \ejabberd{} treats LDAP as a read-only storage:
|
||||
it is possible to consult data, but not possible to
|
||||
it is possible to consult data, but not possible to
|
||||
create accounts, change password or edit vCard that is stored in LDAP.
|
||||
|
||||
|
||||
@ -1935,10 +1942,10 @@ Parameters:
|
||||
\titem{ldap\_servers} \ind{options!ldap\_server}List of IP addresses or DNS names of your
|
||||
LDAP servers. This option is required.
|
||||
\titem{ldap\_port} \ind{options!ldap\_port}Port to connect to your LDAP server.
|
||||
The initial default value is~389, so it is used when nothing is set into the
|
||||
configuration file.
|
||||
If you configure a value, it is stored in \ejabberd{}'s database.
|
||||
Then, if you remove that value from the configuration file,
|
||||
The initial default value is~389, so it is used when nothing is set into the
|
||||
configuration file.
|
||||
If you configure a value, it is stored in \ejabberd{}'s database.
|
||||
Then, if you remove that value from the configuration file,
|
||||
the value previously stored in the database will be used instead of the default 389.
|
||||
\titem{ldap\_rootdn} \ind{options!ldap\_rootdn}Bind DN. The default value
|
||||
is~\term{""} which means `anonymous connection'.
|
||||
@ -2181,38 +2188,38 @@ The following table lists all modules included in \ejabberd{}.
|
||||
\begin{table}[H]
|
||||
\centering
|
||||
\begin{tabular}{|l|l|l|}
|
||||
\hline {\bf Module} & {\bf Feature} & {\bf Dependencies} \\
|
||||
\hline {\bf Module} & {\bf Feature} & {\bf Dependencies} \\
|
||||
\hline
|
||||
\hline \modadhoc{} & Ad-Hoc Commands (\xepref{0050}) & \\
|
||||
\hline \ahrefloc{modannounce}{\modannounce{}} & Manage announcements & recommends \modadhoc{} \\
|
||||
\hline \modcaps{} & Entity Capabilities (\xepref{0115}) & \\
|
||||
\hline \modconfigure{} & Server configuration using Ad-Hoc & \modadhoc{} \\
|
||||
\hline \ahrefloc{moddisco}{\moddisco{}} & Service Discovery (\xepref{0030}) & \\
|
||||
\hline \ahrefloc{modecho}{\modecho{}} & Echoes Jabber packets & \\
|
||||
\hline \ahrefloc{modirc}{\modirc{}} & IRC transport & \\
|
||||
\hline \ahrefloc{modlast}{\modlast{}} & Last Activity (\xepref{0012}) & \\
|
||||
\hline \ahrefloc{modlast}{\modlastodbc{}} & Last Activity (\xepref{0012}) & supported DB (*) \\
|
||||
\hline \ahrefloc{modmuc}{\modmuc{}} & Multi-User Chat (\xepref{0045}) & \\
|
||||
\hline \ahrefloc{modmuclog}{\modmuclog{}} & Multi-User Chat room logging & \modmuc{} \\
|
||||
\hline \ahrefloc{modoffline}{\modoffline{}} & Offline message storage (\xepref{0160}) & \\
|
||||
\hline \ahrefloc{modoffline}{\modofflineodbc{}} & Offline message storage (\xepref{0160}) & supported DB (*) \\
|
||||
\hline \ahrefloc{modprivacy}{\modprivacy{}} & Blocking Communication (XMPP IM) & \\
|
||||
\hline \ahrefloc{modprivacy}{\modprivacyodbc{}} & Blocking Communication (XMPP IM) & supported DB (*) \\
|
||||
\hline \ahrefloc{modprivate}{\modprivate{}} & Private XML Storage (\xepref{0049}) & \\
|
||||
\hline \ahrefloc{modprivate}{\modprivateodbc{}} & Private XML Storage (\xepref{0049}) & supported DB (*) \\
|
||||
\hline \modadhoc{} & Ad-Hoc Commands (\xepref{0050}) & \\
|
||||
\hline \ahrefloc{modannounce}{\modannounce{}} & Manage announcements & recommends \modadhoc{} \\
|
||||
\hline \modcaps{} & Entity Capabilities (\xepref{0115}) & \\
|
||||
\hline \modconfigure{} & Server configuration using Ad-Hoc & \modadhoc{} \\
|
||||
\hline \ahrefloc{moddisco}{\moddisco{}} & Service Discovery (\xepref{0030}) & \\
|
||||
\hline \ahrefloc{modecho}{\modecho{}} & Echoes Jabber packets & \\
|
||||
\hline \ahrefloc{modirc}{\modirc{}} & IRC transport & \\
|
||||
\hline \ahrefloc{modlast}{\modlast{}} & Last Activity (\xepref{0012}) & \\
|
||||
\hline \ahrefloc{modlast}{\modlastodbc{}} & Last Activity (\xepref{0012}) & supported DB (*) \\
|
||||
\hline \ahrefloc{modmuc}{\modmuc{}} & Multi-User Chat (\xepref{0045}) & \\
|
||||
\hline \ahrefloc{modmuclog}{\modmuclog{}} & Multi-User Chat room logging & \modmuc{} \\
|
||||
\hline \ahrefloc{modoffline}{\modoffline{}} & Offline message storage (\xepref{0160}) & \\
|
||||
\hline \ahrefloc{modoffline}{\modofflineodbc{}} & Offline message storage (\xepref{0160}) & supported DB (*) \\
|
||||
\hline \ahrefloc{modprivacy}{\modprivacy{}} & Blocking Communication (XMPP IM) & \\
|
||||
\hline \ahrefloc{modprivacy}{\modprivacyodbc{}} & Blocking Communication (XMPP IM) & supported DB (*) \\
|
||||
\hline \ahrefloc{modprivate}{\modprivate{}} & Private XML Storage (\xepref{0049}) & \\
|
||||
\hline \ahrefloc{modprivate}{\modprivateodbc{}} & Private XML Storage (\xepref{0049}) & supported DB (*) \\
|
||||
\hline \ahrefloc{modproxy}{\modproxy{}} & SOCKS5 Bytestreams (\xepref{0065}) & \\
|
||||
\hline \ahrefloc{modpubsub}{\modpubsub{}} & Pub-Sub (\xepref{0060}), PEP (\xepref{0163}) & \modcaps{} \\
|
||||
\hline \ahrefloc{modregister}{\modregister{}} & In-Band Registration (\xepref{0077}) & \\
|
||||
\hline \ahrefloc{modroster}{\modroster{}} & Roster management (XMPP IM) & \\
|
||||
\hline \ahrefloc{modroster}{\modrosterodbc{}} & Roster management (XMPP IM) & supported DB (*) \\
|
||||
\hline \ahrefloc{modservicelog}{\modservicelog{}} & Copy user messages to logger service & \\
|
||||
\hline \ahrefloc{modsharedroster}{\modsharedroster{}} & Shared roster management & \modroster{} or \\
|
||||
& & \modrosterodbc\\
|
||||
\hline \ahrefloc{modstats}{\modstats{}} & Statistics Gathering (\xepref{0039}) & \\
|
||||
\hline \ahrefloc{modtime}{\modtime{}} & Entity Time (\xepref{0090}) & \\
|
||||
\hline \ahrefloc{modvcard}{\modvcard{}} & vcard-temp (\xepref{0054}) & \\
|
||||
\hline \ahrefloc{modvcardldap}{\modvcardldap{}} & vcard-temp (\xepref{0054}) & LDAP server \\
|
||||
\hline \ahrefloc{modvcard}{\modvcardodbc{}} & vcard-temp (\xepref{0054}) & supported DB (*) \\
|
||||
\hline \ahrefloc{modpubsub}{\modpubsub{}} & Pub-Sub (\xepref{0060}), PEP (\xepref{0163}) & \modcaps{} \\
|
||||
\hline \ahrefloc{modregister}{\modregister{}} & In-Band Registration (\xepref{0077}) & \\
|
||||
\hline \ahrefloc{modroster}{\modroster{}} & Roster management (XMPP IM) & \\
|
||||
\hline \ahrefloc{modroster}{\modrosterodbc{}} & Roster management (XMPP IM) & supported DB (*) \\
|
||||
\hline \ahrefloc{modservicelog}{\modservicelog{}} & Copy user messages to logger service & \\
|
||||
\hline \ahrefloc{modsharedroster}{\modsharedroster{}} & Shared roster management & \modroster{} or \\
|
||||
& & \modrosterodbc\\
|
||||
\hline \ahrefloc{modstats}{\modstats{}} & Statistics Gathering (\xepref{0039}) & \\
|
||||
\hline \ahrefloc{modtime}{\modtime{}} & Entity Time (\xepref{0090}) & \\
|
||||
\hline \ahrefloc{modvcard}{\modvcard{}} & vcard-temp (\xepref{0054}) & \\
|
||||
\hline \ahrefloc{modvcardldap}{\modvcardldap{}} & vcard-temp (\xepref{0054}) & LDAP server \\
|
||||
\hline \ahrefloc{modvcard}{\modvcardodbc{}} & vcard-temp (\xepref{0054}) & supported DB (*) \\
|
||||
\hline \ahrefloc{modversion}{\modversion{}} & Software Version (\xepref{0092}) & \\
|
||||
\hline
|
||||
\end{tabular}
|
||||
@ -2303,7 +2310,7 @@ This option defines the Jabber ID of a service provided by an \ejabberd{} module
|
||||
The keyword "@HOST@" is replaced at start time with the real virtual host string.
|
||||
|
||||
This example configures
|
||||
the \ind{modules!\modecho{}}echo module to provide its echoing service
|
||||
the \ind{modules!\modecho{}}echo module to provide its echoing service
|
||||
in the Jabber ID \jid{mirror.example.org}:
|
||||
\begin{verbatim}
|
||||
{modules,
|
||||
@ -2329,7 +2336,7 @@ the "@HOST@" keyword must be used:
|
||||
\ind{modules!\modannounce{}}\ind{MOTD}\ind{message of the day}\ind{announcements}
|
||||
|
||||
This module enables configured users to broadcast announcements and to set
|
||||
the message of the day (MOTD).
|
||||
the message of the day (MOTD).
|
||||
Configured users can perform these actions with a
|
||||
\Jabber{} client either using Ad-hoc commands
|
||||
or sending messages to specific JIDs.
|
||||
@ -2587,7 +2594,7 @@ Some of the features of Multi-User Chat:
|
||||
|
||||
The MUC service allows any Jabber ID to register a nickname,
|
||||
so nobody else can use that nickname in any room in the MUC service.
|
||||
To register a nickname, open the Service Discovery in your
|
||||
To register a nickname, open the Service Discovery in your
|
||||
Jabber client and register in the MUC service.
|
||||
|
||||
This module supports clustering and load
|
||||
@ -2665,7 +2672,7 @@ Module options:
|
||||
discarded. A good value for this option is 4 seconds.
|
||||
\titem{default\_room\_options} \ind{options!default\_room\_options}
|
||||
This module option allows to define the desired default room options.
|
||||
Note that the creator of a room can modify the options of his room
|
||||
Note that the creator of a room can modify the options of his room
|
||||
at any time using a Jabber client with MUC capability.
|
||||
The available room options and the default values are:
|
||||
\begin{description}
|
||||
@ -2861,7 +2868,7 @@ Options:
|
||||
To prevent spam, the \term{spam\_prevention} option adds a special attribute
|
||||
to links that prevent their indexation by search engines. The default value
|
||||
is \term{true}, which mean that nofollow attributes will be added to user
|
||||
submitted links.
|
||||
submitted links.
|
||||
\titem{timezone}\ind{options!timezone}
|
||||
The time zone for the logs is configurable with this option. Allowed values
|
||||
are \term{local} and \term{universal}. With the first value, the local time,
|
||||
@ -3078,7 +3085,7 @@ Options:
|
||||
pubsub plugin is always used.
|
||||
\titem{nodetree} To specify which nodetree to use. If not defined, the default pubsub
|
||||
nodetree is used. Nodetrees are default and virtual. Only one nodetree can be used
|
||||
and is shared by all node plugins.
|
||||
and is shared by all node plugins.
|
||||
%\titem{served\_hosts} \ind{options!served\_hosts}
|
||||
% This option allows to create additional pubsub virtual hosts in a single module instance.
|
||||
\end{description}
|
||||
@ -3116,10 +3123,10 @@ Options:
|
||||
user name, registration for that user name is denied. (there are no
|
||||
restrictions by default).
|
||||
\titem{welcome\_message} \ind{options!welcomem}Set a welcome message that
|
||||
is sent to each newly registered account. The first string is the subject, and
|
||||
is sent to each newly registered account. The first string is the subject, and
|
||||
the second string is the message body.
|
||||
In the body you can set a newline with the characters: \verb|\n|
|
||||
\titem{registration\_watchers} \ind{options!rwatchers}This option defines a
|
||||
\titem{registration\_watchers} \ind{options!rwatchers}This option defines a
|
||||
list of JIDs which will be notified each time a new account is registered.
|
||||
\iqdiscitem{In-Band Registration (\ns{jabber:iq:register})}
|
||||
\end{description}
|
||||
@ -3223,7 +3230,7 @@ Examples:
|
||||
]}.
|
||||
\end{verbatim}
|
||||
\item To log all end user packets to the Bandersnatch service running on
|
||||
\jid{bandersnatch.example.com} and the backup service on
|
||||
\jid{bandersnatch.example.com} and the backup service on
|
||||
\jid{bandersnatch.example.org}:
|
||||
\begin{verbatim}
|
||||
{modules,
|
||||
@ -3243,9 +3250,9 @@ This module enables you to create shared roster groups. This means that you can
|
||||
create groups of people that can see members from (other) groups in their
|
||||
rosters. The big advantages of this feature are that end users do not need to
|
||||
manually add all users to their rosters, and that they cannot permanently delete
|
||||
users from the shared roster groups.
|
||||
users from the shared roster groups.
|
||||
A shared roster group can have members from any Jabber server,
|
||||
but the presence will only be available from and to members
|
||||
but the presence will only be available from and to members
|
||||
of the same virtual host where the group is created.
|
||||
|
||||
Shared roster groups can be edited \emph{only} via the Web Admin. Each group
|
||||
@ -3467,7 +3474,7 @@ implemented in the \modvcardldap{} module. This module does not depend on the
|
||||
authentication method (see~\ref{ldapauth}).
|
||||
|
||||
Note that \ejabberd{} treats LDAP as a read-only storage:
|
||||
it is possible to consult data, but not possible to
|
||||
it is possible to consult data, but not possible to
|
||||
create accounts, change password or edit vCard that is stored in LDAP.
|
||||
|
||||
The \modvcardldap{} module has
|
||||
@ -3571,7 +3578,7 @@ consists of the following \modvcardldap{}-specific options:
|
||||
%TODO: this examples still should be organised better
|
||||
Examples:
|
||||
\begin{itemize}
|
||||
\item
|
||||
\item
|
||||
|
||||
Let's say \term{ldap.example.org} is the name of our LDAP server. We have
|
||||
users with their passwords in \term{"ou=Users,dc=example,dc=org"} directory.
|
||||
@ -3689,11 +3696,11 @@ Options:
|
||||
|
||||
\makesubsection{commands}{Commands}
|
||||
|
||||
The \term{ejabberdctl} command line administration script allows to start, stop and perform
|
||||
The \term{ejabberdctl} command line administration script allows to start, stop and perform
|
||||
many other administrative tasks in a local or remote \ejabberd{} server.
|
||||
|
||||
When \term{ejabberdctl} is executed without any parameter,
|
||||
it displays the available options. If there isn't an \ejabberd{} server running,
|
||||
it displays the available options. If there isn't an \ejabberd{} server running,
|
||||
the available parameters are:
|
||||
\begin{description}
|
||||
\titem{start} Start \ejabberd{} in background mode. This is the default method.
|
||||
@ -3710,7 +3717,7 @@ The more interesting ones are:
|
||||
\titem{reopen-log} If you use a tool to rotate logs, you have to configure it
|
||||
so that this command is executed after each rotation.
|
||||
\titem {backup, restore, install-fallback, dump, load} You can use these
|
||||
commands to create and restore backups.
|
||||
commands to create and restore backups.
|
||||
%%More information about backuping can
|
||||
%% be found in section~\ref{backup}.
|
||||
\titem{import-file, import-dir} \ind{migration from other software}
|
||||
@ -3741,70 +3748,70 @@ for example using: \term{echo \$?}
|
||||
\ejabberd{} is an Erlang/OTP application that runs inside an Erlang runtime system.
|
||||
This system is configured using environment variables and command line parameters.
|
||||
The \term{ejabberdctl} administration script uses many of those possibilities.
|
||||
You can configure some of them with the file \term{ejabberdctl.cfg},
|
||||
You can configure some of them with the file \term{ejabberdctl.cfg},
|
||||
which includes detailed description about them.
|
||||
This section describes for reference purposes
|
||||
This section describes for reference purposes
|
||||
all the environment variables and command line parameters.
|
||||
|
||||
The environment variables:
|
||||
\begin{description}
|
||||
\titem{EJABBERD\_CONFIG\_PATH}
|
||||
\titem{EJABBERD\_CONFIG\_PATH}
|
||||
Path to the ejabberd configuration file.
|
||||
\titem{EJABBERD\_MSGS\_PATH}
|
||||
\titem{EJABBERD\_MSGS\_PATH}
|
||||
Path to the directory with translated strings.
|
||||
\titem{EJABBERD\_LOG\_PATH}
|
||||
\titem{EJABBERD\_LOG\_PATH}
|
||||
Path to the ejabberd service log file.
|
||||
\titem{EJABBERD\_SO\_PATH}
|
||||
\titem{EJABBERD\_SO\_PATH}
|
||||
Path to the directory with binary system libraries.
|
||||
\titem{HOME}
|
||||
\titem{HOME}
|
||||
Path to the directory that is considered \ejabberd{}'s home.
|
||||
This path is used to read the file \term{.erlang.cookie}.
|
||||
\titem{ERL\_CRASH\_DUMP}
|
||||
\titem{ERL\_CRASH\_DUMP}
|
||||
Path to the file where crash reports will be dumped.
|
||||
\titem{ERL\_INETRC}
|
||||
\titem{ERL\_INETRC}
|
||||
Indicates which IP name resolution to use.
|
||||
If using \term{-sname}, specify either this option or \term{-kernel inetrc filepath}.
|
||||
\titem{ERL\_MAX\_PORTS}
|
||||
\titem{ERL\_MAX\_PORTS}
|
||||
Maximum number of simultaneously open Erlang ports.
|
||||
\titem{ERL\_MAX\_ETS\_TABLES}
|
||||
\titem{ERL\_MAX\_ETS\_TABLES}
|
||||
Maximum number of ETS and Mnesia tables.
|
||||
\end{description}
|
||||
|
||||
The command line parameters:
|
||||
\begin{description}
|
||||
\titem{-sname ejabberd}
|
||||
\titem{-sname ejabberd}
|
||||
The Erlang node will be identified using only the first part
|
||||
of the host name, i.\,e. other Erlang nodes outside this domain cannot contact
|
||||
this node. This is the preferable option in most cases.
|
||||
\titem{-name ejabberd}
|
||||
\titem{-name ejabberd}
|
||||
The Erlang node will be fully identified.
|
||||
This is only useful if you plan to setup an \ejabberd{} cluster with nodes in different networks.
|
||||
\titem{-kernel inetrc "/etc/ejabberd/inetrc"}
|
||||
Indicates which IP name resolution to use.
|
||||
\titem{-kernel inetrc "/etc/ejabberd/inetrc"}
|
||||
Indicates which IP name resolution to use.
|
||||
If using \term{-sname}, specify either this option or \term{ERL\_INETRC}.
|
||||
\titem{-kernel inet\_dist\_listen\_min 4200 inet\_dist\_listen\_min 4210}
|
||||
\titem{-kernel inet\_dist\_listen\_min 4200 inet\_dist\_listen\_min 4210}
|
||||
Define the first and last ports that \term{epmd} (section \ref{epmd}) can listen to.
|
||||
\titem{-detached}
|
||||
Starts the Erlang system detached from the system console.
|
||||
Useful for running daemons and backgrounds processes.
|
||||
\titem{-noinput}
|
||||
\titem{-detached}
|
||||
Starts the Erlang system detached from the system console.
|
||||
Useful for running daemons and backgrounds processes.
|
||||
\titem{-noinput}
|
||||
Ensures that the Erlang system never tries to read any input.
|
||||
Useful for running daemons and backgrounds processes.
|
||||
\titem{-pa /var/lib/ejabberd/ebin}
|
||||
Useful for running daemons and backgrounds processes.
|
||||
\titem{-pa /var/lib/ejabberd/ebin}
|
||||
Specify the directory where Erlang binary files (*.beam) are located.
|
||||
\titem{-s ejabberd}
|
||||
\titem{-s ejabberd}
|
||||
Tell Erlang runtime system to start the \ejabberd{} application.
|
||||
\titem{-mnesia dir "/var/lib/ejabberd/"}
|
||||
Specify the Mnesia database directory.
|
||||
\titem{-sasl sasl\_error\_logger \{file, "/var/log/ejabberd/sasl.log"\}}
|
||||
Path to the Erlang/OTP system log file.
|
||||
\titem{+K [true|false]}
|
||||
\titem{+K [true|false]}
|
||||
Kernel polling.
|
||||
\titem{-smp [auto|enable|disable]}
|
||||
\titem{-smp [auto|enable|disable]}
|
||||
SMP support.
|
||||
\titem{+P 250000}
|
||||
\titem{+P 250000}
|
||||
Maximum number of Erlang processes.
|
||||
\titem{-remsh ejabberd@localhost}
|
||||
\titem{-remsh ejabberd@localhost}
|
||||
Open an Erlang shell in a remote Erlang node.
|
||||
\end{description}
|
||||
Note that some characters need to be escaped when used in shell scripts, for instance \verb|"| and \verb|{}|.
|
||||
@ -3818,7 +3825,7 @@ The \ejabberd{} Web Admin allows to administer most of \ejabberd{} using a web b
|
||||
|
||||
This feature is enabled by default:
|
||||
a \term{ejabberd\_http} listener with the option \term{web\_admin} (see
|
||||
section~\ref{listened}) is included in the listening ports. Then you can open
|
||||
section~\ref{listened}) is included in the listening ports. Then you can open
|
||||
\verb|http://server:port/admin/| in your favourite web browser. You
|
||||
will be asked to enter the username (the \emph{full} \Jabber{} ID) and password
|
||||
of an \ejabberd{} user with administrator rights. After authentication
|
||||
@ -3894,7 +3901,7 @@ an account with proper privileges.
|
||||
|
||||
\makesection{changeerlangnodename}{Change Computer Hostname}
|
||||
|
||||
\ejabberd{} uses the distributed Mnesia database.
|
||||
\ejabberd{} uses the distributed Mnesia database.
|
||||
Being distributed, Mnesia enforces consistency of its file,
|
||||
so it stores the name of the Erlang node in it (see section \ref{nodename}).
|
||||
The name of an Erlang node includes the hostname of the computer.
|
||||
@ -3906,7 +3913,7 @@ So, if you want to change the computer hostname where \ejabberd{} is installed,
|
||||
you must follow these instructions:
|
||||
\begin{enumerate}
|
||||
\item In the old server, backup the Mnesia database using the Web Admin or \term{ejabberdctl}.
|
||||
For example:
|
||||
For example:
|
||||
\begin{verbatim}
|
||||
ejabberdctl backup /tmp/ejabberd-oldhost.backup
|
||||
\end{verbatim}
|
||||
@ -3940,15 +3947,15 @@ You need to take the following TCP ports in mind when configuring your firewall:
|
||||
\makesection{epmd}{epmd}
|
||||
|
||||
\footahref{http://www.erlang.org/doc/man/epmd.html}{epmd (Erlang Port Mapper Daemon)}
|
||||
is a small name server included in Erlang/OTP
|
||||
and used by Erlang programs when establishing distributed Erlang communications.
|
||||
\ejabberd{} needs \term{epmd} to use \term{ejabberdctl} and also when clustering \ejabberd{} nodes.
|
||||
is a small name server included in Erlang/OTP
|
||||
and used by Erlang programs when establishing distributed Erlang communications.
|
||||
\ejabberd{} needs \term{epmd} to use \term{ejabberdctl} and also when clustering \ejabberd{} nodes.
|
||||
This small program is automatically started by Erlang, and is never stopped.
|
||||
If \ejabberd{} is stopped, and there aren't any other Erlang programs
|
||||
If \ejabberd{} is stopped, and there aren't any other Erlang programs
|
||||
running in the system, you can safely stop \term{epmd} if you want.
|
||||
|
||||
\ejabberd{} runs inside an Erlang node.
|
||||
To communicate with \ejabberd{}, the script \term{ejabberdctl} starts a new Erlang node
|
||||
\ejabberd{} runs inside an Erlang node.
|
||||
To communicate with \ejabberd{}, the script \term{ejabberdctl} starts a new Erlang node
|
||||
and connects to the Erlang node that holds \ejabberd{}.
|
||||
In order for this communication to work,
|
||||
\term{epmd} must be running and listening for name requests in the port 4369.
|
||||
@ -3965,7 +3972,7 @@ Remember to block the port so Internet doesn't have access to it.
|
||||
|
||||
Once an Erlang node solved the node name of another Erlang node using EPMD and port 4369,
|
||||
the nodes communicate directly.
|
||||
The ports used in this case by default are random,
|
||||
The ports used in this case by default are random,
|
||||
but can be configured in the file \term{ejabberdctl.cfg}.
|
||||
The Erlang command-line parameter used internally is, for example:
|
||||
\begin{verbatim}
|
||||
@ -3975,12 +3982,12 @@ erl ... -kernel inet_dist_listen_min 4370 inet_dist_listen_max 4375
|
||||
|
||||
\makesection{cookie}{Erlang Cookie}
|
||||
|
||||
The Erlang cookie is a string with numbers and letters.
|
||||
The Erlang cookie is a string with numbers and letters.
|
||||
An Erlang node reads the cookie at startup from the command-line parameter \term{-setcookie}.
|
||||
If not indicated, the cookie is read from the cookie file \term{\$HOME/.erlang.cookie}.
|
||||
If this file does not exist, it is created immediately with a random cookie.
|
||||
Two Erlang nodes communicate only if they have the same cookie.
|
||||
Setting a cookie on the Erlang node allows you to structure your Erlang network
|
||||
Setting a cookie on the Erlang node allows you to structure your Erlang network
|
||||
and define which nodes are allowed to connect to which.
|
||||
|
||||
Thanks to Erlang cookies, you can prevent access to the Erlang node by mistake,
|
||||
@ -3988,7 +3995,7 @@ for example when there are several Erlang nodes running different programs in th
|
||||
|
||||
Setting a secret cookie is a simple method
|
||||
to difficult unauthorized access to your Erlang node.
|
||||
However, the cookie system is not ultimately effective
|
||||
However, the cookie system is not ultimately effective
|
||||
to prevent unauthorized access or intrusion to an Erlang node.
|
||||
The communication between Erlang nodes are not encrypted,
|
||||
so the cookie could be read sniffing the traffic on the network.
|
||||
@ -3998,14 +4005,14 @@ The recommended way to secure the Erlang node is to block the port 4369.
|
||||
\makesection{nodename}{Erlang node name}
|
||||
|
||||
An Erlang node may have a node name.
|
||||
The name can be short (if indicated with the command-line parameter \term{-sname})
|
||||
or long (if indicated with the parameter \term{-name}).
|
||||
The name can be short (if indicated with the command-line parameter \term{-sname})
|
||||
or long (if indicated with the parameter \term{-name}).
|
||||
Starting an Erlang node with -sname limits the communication between Erlang nodes to the LAN.
|
||||
|
||||
Using the option \term{-sname} instead of \term{-name} is a simple method
|
||||
Using the option \term{-sname} instead of \term{-name} is a simple method
|
||||
to difficult unauthorized access to your Erlang node.
|
||||
However, it is not ultimately effective to prevent access to the Erlang node,
|
||||
because it may be possible to fake the fact that you are on another network
|
||||
because it may be possible to fake the fact that you are on another network
|
||||
using a modified version of Erlang \term{epmd}.
|
||||
The recommended way to secure the Erlang node is to block the port 4369.
|
||||
|
||||
@ -4194,7 +4201,7 @@ The default distribution algorithm try to deliver to a local instance of a compo
|
||||
If you need a different behaviour, you can change the load balancing behaviour with the option \option{domain\_balancing}. The syntax of the option is the following:
|
||||
|
||||
\begin{verbatim}
|
||||
{domain_balancing, "component.example.com", <balancing_criterium>}.
|
||||
{domain_balancing, "component.example.com", <balancing_criterium>}.
|
||||
\end{verbatim}
|
||||
|
||||
Several balancing criteria are available:
|
||||
@ -4281,7 +4288,7 @@ With this Erlang shell, an experienced administrator can perform complex tasks.
|
||||
|
||||
This shell gives complete control over the \ejabberd{} server,
|
||||
so it is important to use it with extremely care.
|
||||
There are some simple and safe examples in the article
|
||||
There are some simple and safe examples in the article
|
||||
\footahref{http://www.ejabberd.im/interconnect-erl-nodes}{Interconnecting Erlang Nodes}
|
||||
|
||||
To exit the shell, close the window or press the keys: control+c control+c.
|
||||
@ -4293,8 +4300,8 @@ To exit the shell, close the window or press the keys: control+c control+c.
|
||||
\ind{xml:lang}\ind{internationalization}\ind{localization}\ind{i18n}\ind{l10n}
|
||||
|
||||
The source code of \ejabberd{} supports localization.
|
||||
The translators can edit the
|
||||
\footahref{http://www.gnu.org/software/gettext/}{gettext} .po files
|
||||
The translators can edit the
|
||||
\footahref{http://www.gnu.org/software/gettext/}{gettext} .po files
|
||||
using any capable program (KBabel, Lokalize, Poedit...) or a simple text editor.
|
||||
|
||||
Then gettext
|
||||
@ -4327,7 +4334,7 @@ The Web Admin also supports the \verb|Accept-Language| HTTP header.
|
||||
\begin{figure}[htbp]
|
||||
\centering
|
||||
\insimg{webadmmainru.png}
|
||||
\caption{Web Admin showing a virtual host when the web browser provides the
|
||||
\caption{Web Admin showing a virtual host when the web browser provides the
|
||||
HTTP header `Accept-Language: ru'}
|
||||
\label{fig:webadmmainru}
|
||||
\end{figure}
|
||||
@ -4382,7 +4389,7 @@ Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
%\ind{glossary}
|
||||
|
||||
%\begin{description}
|
||||
%\titem{c2s}
|
||||
%\titem{c2s}
|
||||
%\titem{s2s}
|
||||
%\titem{STARTTLS}
|
||||
%\titem{XEP} (\XMPP{} Extension Protocol)
|
||||
|
@ -16,7 +16,7 @@
|
||||
%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
%%% General Public License for more details.
|
||||
%%%
|
||||
%%%
|
||||
%%% You should have received a copy of the GNU General Public License
|
||||
%%% along with this program; if not, write to the Free Software
|
||||
%%% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
@ -52,14 +52,21 @@ start_hosts() ->
|
||||
|
||||
%% Start the ODBC module on the given host
|
||||
start_odbc(Host) ->
|
||||
Supervisor_name = gen_mod:get_module_proc(Host, ejabberd_odbc_sup),
|
||||
ChildSpec =
|
||||
{gen_mod:get_module_proc(Host, ejabberd_odbc_sup),
|
||||
{Supervisor_name,
|
||||
{ejabberd_odbc_sup, start_link, [Host]},
|
||||
temporary,
|
||||
transient,
|
||||
infinity,
|
||||
supervisor,
|
||||
[ejabberd_odbc_sup]},
|
||||
supervisor:start_child(ejabberd_sup, ChildSpec).
|
||||
case supervisor:start_child(ejabberd_sup, ChildSpec) of
|
||||
{ok, _PID} ->
|
||||
ok;
|
||||
_Error ->
|
||||
?ERROR_MSG("Start of supervisor ~p failed:~n~p~nRetrying...~n", [Supervisor_name, _Error]),
|
||||
start_odbc(Host)
|
||||
end.
|
||||
|
||||
%% Returns true if we have configured odbc_server for the given host
|
||||
needs_odbc(Host) ->
|
||||
|
@ -4,8 +4,7 @@ include ..\Makefile.inc
|
||||
EFLAGS = -I .. -pz ..
|
||||
|
||||
OUTDIR = ..
|
||||
SOURCES = $(wildcard *.erl)
|
||||
BEAMS = $(addprefix $(OUTDIR)/,$(SOURCES:.erl=.beam))
|
||||
BEAMS = ..\ejabberd_zlib.beam
|
||||
|
||||
SOURCE = ejabberd_zlib_drv.c
|
||||
OBJECT = ejabberd_zlib_drv.o
|
||||
|
@ -4,8 +4,7 @@ include ..\Makefile.inc
|
||||
EFLAGS = -I .. -pz ..
|
||||
|
||||
OUTDIR = ..
|
||||
SOURCES = $(wildcard *.erl)
|
||||
BEAMS = $(addprefix $(OUTDIR)/,$(SOURCES:.erl=.beam))
|
||||
BEAMS = ..\eldap.beam ..\eldap_filter.beam ..\eldap_pool.beam ..\eldap_utils.beam
|
||||
|
||||
ALL : $(BEAMS)
|
||||
|
||||
|
@ -1240,7 +1240,7 @@ get_form(Host, ?NS_ADMINL("get-registered-users-num"), Lang) ->
|
||||
[#xmlel{ns = ?NS_DATA_FORMS, name = 'x', children =
|
||||
[?HFIELD(),
|
||||
#xmlel{ns = ?NS_DATA_FORMS, name = 'field', attrs =
|
||||
[#xmlattr{name = 'type', value = "jid-single"},
|
||||
[#xmlattr{name = 'type', value = "text-single"},
|
||||
#xmlattr{name = 'label', value = ?T(Lang, "Number of registered users")},
|
||||
#xmlattr{name = 'var', value = "registeredusersnum"}], children =
|
||||
[#xmlel{ns = ?NS_DATA_FORMS, name = 'value', children = [#xmlcdata{cdata = list_to_binary(Num)}]}]
|
||||
@ -1252,7 +1252,7 @@ get_form(Host, ?NS_ADMINL("get-online-users-num"), Lang) ->
|
||||
[#xmlel{ns = ?NS_DATA_FORMS, name = 'x', children =
|
||||
[?HFIELD(),
|
||||
#xmlel{ns = ?NS_DATA_FORMS, name = 'field', attrs =
|
||||
[#xmlattr{name = 'type', value = "jid-single"},
|
||||
[#xmlattr{name = 'type', value = "text-single"},
|
||||
#xmlattr{name = 'label', value = ?T(Lang, "Number of online users")},
|
||||
#xmlattr{name = 'var', value = "onlineusersnum"}], children =
|
||||
[#xmlel{ns = ?NS_DATA_FORMS, name = 'value', children = [#xmlcdata{cdata = list_to_binary(Num)}]}]
|
||||
|
@ -4,8 +4,7 @@ include ..\Makefile.inc
|
||||
EFLAGS = -I .. -pz ..
|
||||
|
||||
OUTDIR = ..
|
||||
SOURCES = $(wildcard *.erl)
|
||||
BEAMS = $(addprefix $(OUTDIR)/,$(SOURCES:.erl=.beam))
|
||||
BEAMS = ..\iconv.beam ..\mod_irc.beam ..\mod_irc_connection.beam
|
||||
|
||||
SOURCE = iconv_erl.c
|
||||
OBJECT = iconv_erl.o
|
||||
|
@ -4,8 +4,7 @@ include ..\Makefile.inc
|
||||
EFLAGS = -I .. -pz ..
|
||||
|
||||
OUTDIR = ..
|
||||
SOURCES = $(wildcard *.erl)
|
||||
BEAMS = $(addprefix $(OUTDIR)/,$(SOURCES:.erl=.beam))
|
||||
BEAMS = ..\mod_muc.beam ..\mod_muc_log.beam ..\mod_muc_room.beam
|
||||
|
||||
ALL : $(BEAMS)
|
||||
|
||||
|
@ -4,8 +4,7 @@ include ..\Makefile.inc
|
||||
EFLAGS = -I .. -pz ..
|
||||
|
||||
OUTDIR = ..
|
||||
SOURCES = $(wildcard *.erl)
|
||||
BEAMS = $(addprefix $(OUTDIR)/,$(SOURCES:.erl=.beam))
|
||||
BEAMS = ..\mod_proxy65.beam ..\mod_proxy65_lib.beam ..\mod_proxy65_service.beam ..\mod_proxy65_sm.beam ..\mod_proxy65_stream.beam
|
||||
|
||||
ALL : $(BEAMS)
|
||||
|
||||
@ -19,7 +18,7 @@ $(OUTDIR)\mod_proxy65_service.beam : mod_proxy65_service.erl
|
||||
erlc -W $(EFLAGS) -o $(OUTDIR) mod_proxy65_service.erl
|
||||
|
||||
$(OUTDIR)\mod_proxy65_sm.beam : mod_proxy65_sm.erl
|
||||
erlc -W $(EFLAGS) -o $(OUTDIR) mod_mod_proxy65_sm.erl
|
||||
erlc -W $(EFLAGS) -o $(OUTDIR) mod_proxy65_sm.erl
|
||||
|
||||
$(OUTDIR)\mod_proxy65_stream.beam : mod_proxy65_stream.erl
|
||||
erlc -W $(EFLAGS) -o $(OUTDIR) mod_proxy65_stream.erl
|
||||
|
@ -4,8 +4,7 @@ include ..\Makefile.inc
|
||||
EFLAGS = -I .. -pz ..
|
||||
|
||||
OUTDIR = ..
|
||||
SOURCES = $(wildcard *.erl)
|
||||
BEAMS = $(addprefix $(OUTDIR)/,$(SOURCES:.erl=.beam))
|
||||
BEAMS = ..\gen_pubsub_node.beam ..\gen_pubsub_nodetree.beam ..\mod_pubsub.beam ..\nodetree_default.beam ..\nodetree_virtual.beam ..\node_buddy.beam ..\node_club.beam ..\node_default.beam ..\node_dispatch.beam ..\node_pep.beam ..\node_private.beam ..\node_public.beam
|
||||
|
||||
ALL : $(BEAMS)
|
||||
|
||||
@ -27,9 +26,23 @@ $(OUTDIR)\nodetree_default.beam : nodetree_default.erl
|
||||
$(OUTDIR)\nodetree_virtual.beam : nodetree_virtual.erl
|
||||
erlc -W $(EFLAGS) -o $(OUTDIR) nodetree_virtual.erl
|
||||
|
||||
$(OUTDIR)\node_buddy.beam : node_buddy.erl
|
||||
erlc -W $(EFLAGS) -o $(OUTDIR) node_buddy.erl
|
||||
|
||||
$(OUTDIR)\node_club.beam : node_club.erl
|
||||
erlc -W $(EFLAGS) -o $(OUTDIR) node_club.erl
|
||||
|
||||
$(OUTDIR)\node_default.beam : node_default.erl
|
||||
erlc -W $(EFLAGS) -o $(OUTDIR) node_default.erl
|
||||
|
||||
$(OUTDIR)\node_dispatch.beam : node_dispatch.erl
|
||||
erlc -W $(EFLAGS) -o $(OUTDIR) node_dispatch.erl
|
||||
|
||||
$(OUTDIR)\node_pep.beam : node_pep.erl
|
||||
erlc -W $(EFLAGS) -o $(OUTDIR) node_pep.erl
|
||||
|
||||
$(OUTDIR)\node_private.beam : node_private.erl
|
||||
erlc -W $(EFLAGS) -o $(OUTDIR) node_private.erl
|
||||
|
||||
$(OUTDIR)\node_public.beam : node_public.erl
|
||||
erlc -W $(EFLAGS) -o $(OUTDIR) node_public.erl
|
||||
|
@ -63,7 +63,7 @@ behaviour_info(callbacks) ->
|
||||
{get_state, 3},
|
||||
{set_state, 1},
|
||||
{get_items, 7},
|
||||
{get_items, 2},
|
||||
{get_items, 3},
|
||||
{get_item, 8},
|
||||
{get_item, 3},
|
||||
{set_item, 1},
|
||||
|
@ -77,7 +77,8 @@
|
||||
delete_item/4,
|
||||
get_configure/4,
|
||||
set_configure/5,
|
||||
get_items/2,
|
||||
get_items/3,
|
||||
tree_action/3,
|
||||
node_action/3,
|
||||
node_action/4
|
||||
]).
|
||||
@ -114,6 +115,7 @@
|
||||
-record(state, {server_host,
|
||||
host,
|
||||
access,
|
||||
pep_mapping = [],
|
||||
nodetree = ?STDTREE,
|
||||
plugins = [?STDNODE]}).
|
||||
|
||||
@ -175,7 +177,7 @@ init([ServerHost, Opts]) ->
|
||||
{?NS_PUBSUB, ejabberd_sm, iq_sm},
|
||||
{?NS_PUBSUB_OWNER, ejabberd_sm, iq_sm}]),
|
||||
ejabberd_router:register_route(Host),
|
||||
{Plugins, NodeTree} = init_plugins(Host, ServerHost, Opts),
|
||||
{Plugins, NodeTree, PepMapping} = init_plugins(Host, ServerHost, Opts),
|
||||
update_database(Host),
|
||||
ets:new(gen_mod:get_module_proc(Host, pubsub_state), [set, named_table]),
|
||||
ets:insert(gen_mod:get_module_proc(Host, pubsub_state), {nodetree, NodeTree}),
|
||||
@ -183,10 +185,12 @@ init([ServerHost, Opts]) ->
|
||||
ets:new(gen_mod:get_module_proc(ServerHost, pubsub_state), [set, named_table]),
|
||||
ets:insert(gen_mod:get_module_proc(ServerHost, pubsub_state), {nodetree, NodeTree}),
|
||||
ets:insert(gen_mod:get_module_proc(ServerHost, pubsub_state), {plugins, Plugins}),
|
||||
ets:insert(gen_mod:get_module_proc(ServerHost, pubsub_state), {pep_mapping, PepMapping}),
|
||||
init_nodes(Host, ServerHost),
|
||||
{ok, #state{host = Host,
|
||||
server_host = ServerHost,
|
||||
access = Access,
|
||||
pep_mapping = PepMapping,
|
||||
nodetree = NodeTree,
|
||||
plugins = Plugins}}.
|
||||
|
||||
@ -209,12 +213,14 @@ init_plugins(Host, ServerHost, Opts) ->
|
||||
?DEBUG("** tree plugin is ~p",[TreePlugin]),
|
||||
TreePlugin:init(Host, ServerHost, Opts),
|
||||
Plugins = lists:usort(gen_mod:get_opt(plugins, Opts, []) ++ [?STDNODE]),
|
||||
PepMapping = lists:usort(gen_mod:get_opt(pep_mapping, Opts, [])),
|
||||
?DEBUG("** PEP Mapping : ~p~n",[PepMapping]),
|
||||
lists:foreach(fun(Name) ->
|
||||
?DEBUG("** init ~s plugin",[Name]),
|
||||
Plugin = list_to_atom(?PLUGIN_PREFIX ++ Name),
|
||||
Plugin:init(Host, ServerHost, Opts)
|
||||
end, Plugins),
|
||||
{Plugins, TreePlugin}.
|
||||
{Plugins, TreePlugin, PepMapping}.
|
||||
|
||||
terminate_plugins(Host, ServerHost, Plugins, TreePlugin) ->
|
||||
lists:foreach(fun(Name) ->
|
||||
@ -371,11 +377,11 @@ disco_sm_items(Acc, _From, To, [], _Lang) ->
|
||||
{result, NodeItems ++ Items}
|
||||
end;
|
||||
|
||||
disco_sm_items(Acc, _From, To, Node, _Lang) ->
|
||||
disco_sm_items(Acc, From, To, Node, _Lang) ->
|
||||
%% TODO, use iq_disco_items(Host, Node, From)
|
||||
Host = To#jid.lserver,
|
||||
LJID = jlib:jid_tolower(jlib:jid_remove_resource(To)),
|
||||
case get_items(Host, Node) of
|
||||
case get_items(Host, Node, From) of
|
||||
[] ->
|
||||
Acc;
|
||||
AllItems ->
|
||||
@ -430,6 +436,8 @@ handle_call(server_host, _From, State) ->
|
||||
{reply, State#state.server_host, State};
|
||||
handle_call(plugins, _From, State) ->
|
||||
{reply, State#state.plugins, State};
|
||||
handle_call(pep_mapping, _From, State) ->
|
||||
{reply, State#state.pep_mapping, State};
|
||||
handle_call(nodetree, _From, State) ->
|
||||
{reply, State#state.nodetree, State};
|
||||
handle_call(stop, _From, State) ->
|
||||
@ -717,7 +725,7 @@ node_disco_info(Host, Node, From, Identity, Features) ->
|
||||
[] ->
|
||||
["leaf"]; %% No sub-nodes: it's a leaf node
|
||||
_ ->
|
||||
case node_call(Type, get_items, [Host, Node]) of
|
||||
case node_call(Type, get_items, [Host, Node, From]) of
|
||||
{result, []} -> ["collection"];
|
||||
{result, _} -> ["leaf", "collection"];
|
||||
_ -> []
|
||||
@ -782,7 +790,7 @@ iq_disco_items(Host, Item, From) ->
|
||||
%% TODO That is, remove name attribute
|
||||
Action =
|
||||
fun(#pubsub_node{type = Type}) ->
|
||||
NodeItems = case node_call(Type, get_items, [Host, Node]) of
|
||||
NodeItems = case node_call(Type, get_items, [Host, Node, From]) of
|
||||
{result, I} -> I;
|
||||
_ -> []
|
||||
end,
|
||||
@ -1183,10 +1191,7 @@ create_node(Host, ServerHost, [], Owner, Type, Access, Configuration) ->
|
||||
{error, extended_error(?ERR_NOT_ACCEPTABLE, "nodeid-required")}
|
||||
end;
|
||||
create_node(Host, ServerHost, Node, Owner, GivenType, Access, Configuration) ->
|
||||
Type = case Host of
|
||||
{_User, _Server, _Resource} -> ?PEPNODE;
|
||||
_ -> GivenType
|
||||
end,
|
||||
Type = select_type(ServerHost, Host, Node, GivenType),
|
||||
Parent = lists:sublist(Node, length(Node) - 1),
|
||||
%% TODO, check/set node_type = Type
|
||||
ParseOptions = case xml:remove_cdata(Configuration) of
|
||||
@ -1488,12 +1493,7 @@ publish_item(Host, ServerHost, Node, Publisher, ItemId, Payload) ->
|
||||
%% handles auto-create feature
|
||||
%% for automatic node creation. we'll take the default node type:
|
||||
%% first listed into the plugins configuration option, or pep
|
||||
Type = case Host of
|
||||
{_User, _Server, _Resource} ->
|
||||
?PEPNODE;
|
||||
_ ->
|
||||
hd(plugins(ServerHost))
|
||||
end,
|
||||
Type = select_type(ServerHost, Host, Node),
|
||||
case lists:member("auto-create", features(Type)) of
|
||||
true ->
|
||||
case create_node(Host, ServerHost, Node, Publisher, Type) of
|
||||
@ -1712,8 +1712,8 @@ get_items(Host, Node, From, SubId, SMaxItems, ItemIDs) ->
|
||||
end
|
||||
end.
|
||||
|
||||
get_items(Host, Node) ->
|
||||
case node_action(Host, Node, get_items, [Host, Node]) of
|
||||
get_items(Host, Node, From) ->
|
||||
case node_action(Host, Node, get_items, [Host, Node, From]) of
|
||||
{result, Items} -> Items;
|
||||
_ -> []
|
||||
end.
|
||||
@ -1723,15 +1723,15 @@ get_items(Host, Node) ->
|
||||
%% Node = pubsubNode()
|
||||
%% LJID = {U, S, []}
|
||||
%% @doc <p>Resend the items of a node to the user.</p>
|
||||
send_all_items(Host, Node, LJID) ->
|
||||
send_items(Host, Node, LJID, all).
|
||||
%send_all_items(Host, Node, LJID) ->
|
||||
% send_items(Host, Node, LJID, all).
|
||||
|
||||
send_last_item(Host, Node, LJID) ->
|
||||
send_items(Host, Node, LJID, last).
|
||||
|
||||
%% TODO use cache-last-item feature
|
||||
send_items(Host, Node, LJID, Number) ->
|
||||
ToSend = case get_items(Host, Node) of
|
||||
ToSend = case get_items(Host, Node, LJID) of
|
||||
[] ->
|
||||
[];
|
||||
Items ->
|
||||
@ -2411,11 +2411,8 @@ get_configure(Host, Node, From, Lang) ->
|
||||
end,
|
||||
transaction(Host, Node, Action, sync_dirty).
|
||||
|
||||
get_default(Host, _Node, _From, Lang) ->
|
||||
Type = case Host of
|
||||
{_, _, _} -> ?PEPNODE;
|
||||
_ -> hd(plugins(Host))
|
||||
end,
|
||||
get_default(Host, Node, _From, Lang) ->
|
||||
Type=select_type(Host, Host, Node),
|
||||
Options = node_options(Type),
|
||||
{result, [{xmlelement, "pubsub", [{"xmlns", ?NS_PUBSUB_OWNER}],
|
||||
[{xmlelement, "default", [],
|
||||
@ -2663,6 +2660,19 @@ plugins(Host) ->
|
||||
[{plugins, PL}] -> PL;
|
||||
_ -> [?STDNODE]
|
||||
end.
|
||||
select_type(ServerHost, Host, Node, Type)->
|
||||
?DEBUG("SELECT_TYPE : ~p~n", [Node]),
|
||||
case Host of
|
||||
{_User, _Server, _Resource} ->
|
||||
case ets:lookup(gen_mod:get_module_proc(ServerHost, pubsub_state), pep_mapping) of
|
||||
[{pep_mapping, PM}] -> ?DEBUG("SELECT_TYPE : ~p~n", [PM]), proplists:get_value(Node, PM,?PEPNODE);
|
||||
R -> ?DEBUG("SELECT_TYPE why ?: ~p~n", [R]), ?PEPNODE
|
||||
end;
|
||||
_ ->
|
||||
Type
|
||||
end.
|
||||
select_type(ServerHost, Host, Node) ->
|
||||
select_type(ServerHost, Host, Node,hd(plugins(ServerHost))).
|
||||
|
||||
features() ->
|
||||
[
|
||||
@ -2811,3 +2821,4 @@ uniqid() ->
|
||||
get_item_name(Host, Node, Id) ->
|
||||
{result, Name} = node_action(Host, Node, get_item_name, [Host, Node, Id]),
|
||||
Name.
|
||||
|
||||
|
@ -62,7 +62,7 @@
|
||||
get_state/3,
|
||||
set_state/1,
|
||||
get_items/7,
|
||||
get_items/2,
|
||||
get_items/3,
|
||||
get_item/8,
|
||||
get_item/3,
|
||||
set_item/1
|
||||
@ -168,8 +168,8 @@ get_state(Host, Node, JID) ->
|
||||
set_state(State) ->
|
||||
node_default:set_state(State).
|
||||
|
||||
get_items(Host, Node) ->
|
||||
node_default:get_items(Host, Node).
|
||||
get_items(Host, Node, From) ->
|
||||
node_default:get_items(Host, Node, From).
|
||||
|
||||
get_items(Host, Node, JID, AccessModel, PresenceSubscription, RosterGroup, SubId)
|
||||
node_default:get_items(Host, Node, JID, AccessModel, PresenceSubscription, RosterGroup, SubId).
|
||||
|
@ -63,7 +63,7 @@
|
||||
get_state/3,
|
||||
set_state/1,
|
||||
get_items/7,
|
||||
get_items/2,
|
||||
get_items/3,
|
||||
get_item/8,
|
||||
get_item/3,
|
||||
set_item/1,
|
||||
@ -171,8 +171,8 @@ get_state(Host, Node, JID) ->
|
||||
set_state(State) ->
|
||||
node_default:set_state(State).
|
||||
|
||||
get_items(Host, Node) ->
|
||||
node_default:get_items(Host, Node).
|
||||
get_items(Host, Node, From) ->
|
||||
node_default:get_items(Host, Node, From).
|
||||
|
||||
get_items(Host, Node, JID, AccessModel, PresenceSubscription, RosterGroup, SubId) ->
|
||||
node_default:get_items(Host, Node, JID, AccessModel, PresenceSubscription, RosterGroup, SubId).
|
||||
|
@ -63,7 +63,7 @@
|
||||
get_state/3,
|
||||
set_state/1,
|
||||
get_items/7,
|
||||
get_items/2,
|
||||
get_items/3,
|
||||
get_item/8,
|
||||
get_item/3,
|
||||
set_item/1,
|
||||
@ -170,8 +170,8 @@ get_state(Host, Node, JID) ->
|
||||
set_state(State) ->
|
||||
node_default:set_state(State).
|
||||
|
||||
get_items(Host, Node) ->
|
||||
node_default:get_items(Host, Node).
|
||||
get_items(Host, Node, From) ->
|
||||
node_default:get_items(Host, Node, From).
|
||||
|
||||
get_items(Host, Node, JID, AccessModel, PresenceSubscription, RosterGroup, SubId) ->
|
||||
node_default:get_items(Host, Node, JID, AccessModel, PresenceSubscription, RosterGroup, SubId).
|
||||
|
@ -70,7 +70,7 @@
|
||||
get_state/3,
|
||||
set_state/1,
|
||||
get_items/7,
|
||||
get_items/2,
|
||||
get_items/3,
|
||||
get_item/8,
|
||||
get_item/3,
|
||||
set_item/1,
|
||||
@ -705,9 +705,9 @@ set_state(_) ->
|
||||
%% relational database), or they can even decide not to persist any items.</p>
|
||||
%% <p>If a PubSub plugin wants to delegate the item storage to the default node,
|
||||
%% they can implement this function like this:
|
||||
%% ```get_items(Host, Node) ->
|
||||
%% node_default:get_items(Host, Node).'''</p>
|
||||
get_items(Host, Node) ->
|
||||
%% ```get_items(Host, Node, From) ->
|
||||
%% node_default:get_items(Host, Node, From).'''</p>
|
||||
get_items(Host, Node, _From) ->
|
||||
Items = mnesia:match_object(
|
||||
#pubsub_item{itemid = {'_', {Host, Node}}, _ = '_'}),
|
||||
{result, Items}.
|
||||
@ -747,7 +747,7 @@ get_items(Host, Node, JID, AccessModel, PresenceSubscription, RosterGroup, _SubI
|
||||
%% % Payment is required for a subscription
|
||||
%% {error, ?ERR_PAYMENT_REQUIRED};
|
||||
true ->
|
||||
get_items(Host, Node)
|
||||
get_items(Host, Node, JID)
|
||||
end.
|
||||
|
||||
%% @spec (Host, Node, ItemId) -> [Item] | []
|
||||
|
@ -61,7 +61,7 @@
|
||||
get_state/3,
|
||||
set_state/1,
|
||||
get_items/7,
|
||||
get_items/2,
|
||||
get_items/3,
|
||||
get_item/8,
|
||||
get_item/3,
|
||||
set_item/1,
|
||||
@ -173,8 +173,8 @@ get_state(Host, Node, JID) ->
|
||||
set_state(State) ->
|
||||
node_default:set_state(State).
|
||||
|
||||
get_items(Host, Node) ->
|
||||
node_default:get_items(Host, Node).
|
||||
get_items(Host, Node, From) ->
|
||||
node_default:get_items(Host, Node, From).
|
||||
|
||||
get_items(Host, Node, JID, AccessModel, PresenceSubscription, RosterGroup, SubId) ->
|
||||
node_default:get_items(Host, Node, JID, AccessModel, PresenceSubscription, RosterGroup, SubId).
|
||||
|
197
src/mod_pubsub/node_mb.erl
Normal file
197
src/mod_pubsub/node_mb.erl
Normal file
@ -0,0 +1,197 @@
|
||||
%%% ====================================================================
|
||||
%%% ``The contents of this file are subject to the Erlang Public License,
|
||||
%%% Version 1.1, (the "License"); you may not use this file except in
|
||||
%%% compliance with the License. You should have received a copy of the
|
||||
%%% Erlang Public License along with this software. If not, it can be
|
||||
%%% retrieved via the world wide web at http://www.erlang.org/.
|
||||
%%%
|
||||
%%% Software distributed under the License is distributed on an "AS IS"
|
||||
%%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
|
||||
%%% the License for the specific language governing rights and limitations
|
||||
%%% under the License.
|
||||
%%%
|
||||
%%% The Initial Developer of the Original Code is ProcessOne.
|
||||
%%% Portions created by ProcessOne are Copyright 2006-2008, ProcessOne
|
||||
%%% All Rights Reserved.''
|
||||
%%% This software is copyright 2006-2008, ProcessOne.
|
||||
%%%
|
||||
%%%
|
||||
%%% @copyright 2006-2008 ProcessOne
|
||||
%%% @author Eric Cestari <eric@ohmforce.com>
|
||||
%%% @version {@vsn}, {@date} {@time}
|
||||
%%% @end
|
||||
%%% ====================================================================
|
||||
|
||||
|
||||
%%% @doc The module <strong>{@module}</strong> is the pep microblog PubSub plugin.
|
||||
%%% <p> To be used, mod_pubsub must be configured :
|
||||
%%% {mod_pubsub, [ % requires mod_caps
|
||||
%%% {access_createnode, pubsub_createnode},
|
||||
%%% {plugins, ["default", "pep","mb"]},
|
||||
%%% {pep_mapping, [{"urn:xmpp:microblog", "mb"}]}
|
||||
%%% ]},
|
||||
%%% <p>PubSub plugin nodes are using the {@link gen_pubsub_node} behaviour.</p>
|
||||
|
||||
-module(node_mb).
|
||||
-author('eric@ohmforce.com').
|
||||
|
||||
-include("ejabberd.hrl").
|
||||
-include("pubsub.hrl").
|
||||
-include("jlib.hrl").
|
||||
|
||||
-behaviour(gen_pubsub_node).
|
||||
|
||||
%% API definition
|
||||
-export([init/3, terminate/2,
|
||||
options/0, features/0,
|
||||
create_node_permission/6,
|
||||
create_node/3,
|
||||
delete_node/2,
|
||||
purge_node/3,
|
||||
subscribe_node/8,
|
||||
unsubscribe_node/5,
|
||||
publish_item/7,
|
||||
delete_item/4,
|
||||
remove_extra_items/4,
|
||||
get_entity_affiliations/2,
|
||||
get_node_affiliations/2,
|
||||
get_affiliation/3,
|
||||
set_affiliation/4,
|
||||
get_entity_subscriptions/2,
|
||||
get_node_subscriptions/2,
|
||||
get_subscription/3,
|
||||
set_subscription/4,
|
||||
get_states/2,
|
||||
get_state/3,
|
||||
set_state/1,
|
||||
get_items/7,
|
||||
get_items/3,
|
||||
get_item/8,
|
||||
get_item/3,
|
||||
set_item/1,
|
||||
get_item_name/3
|
||||
]).
|
||||
|
||||
init(Host, ServerHost, Opts) ->
|
||||
node_pep:init(Host, ServerHost, Opts).
|
||||
|
||||
terminate(Host, ServerHost) ->
|
||||
node_pep:terminate(Host, ServerHost),
|
||||
ok.
|
||||
|
||||
options() ->
|
||||
[{node_type, pep},
|
||||
{deliver_payloads, true},
|
||||
{notify_config, false},
|
||||
{notify_delete, false},
|
||||
{notify_retract, false},
|
||||
{persist_items, true},
|
||||
{max_items, ?MAXITEMS},
|
||||
{subscribe, true},
|
||||
{access_model, presence},
|
||||
{roster_groups_allowed, []},
|
||||
{publish_model, publishers},
|
||||
{max_payload_size, ?MAX_PAYLOAD_SIZE},
|
||||
{send_last_published_item, on_sub_and_presence},
|
||||
{deliver_notifications, true},
|
||||
{presence_based_delivery, true}].
|
||||
|
||||
features() ->
|
||||
["create-nodes", %*
|
||||
"auto-create", %*
|
||||
"auto-subscribe", %*
|
||||
"delete-nodes", %*
|
||||
"filtered-notifications", %*
|
||||
"modify-affiliations",
|
||||
"outcast-affiliation",
|
||||
"persistent-items",
|
||||
"publish", %*
|
||||
"purge-nodes",
|
||||
"retract-items",
|
||||
"retrieve-affiliations",
|
||||
"retrieve-items", %*
|
||||
"retrieve-subscriptions",
|
||||
"subscribe" %*
|
||||
].
|
||||
|
||||
create_node_permission(Host, ServerHost, Node, ParentNode, Owner, Access) ->
|
||||
node_pep:create_node_permission(Host, ServerHost, Node, ParentNode, Owner, Access).
|
||||
|
||||
create_node(Host, Node, Owner) ->
|
||||
node_pep:create_node(Host, Node, Owner).
|
||||
|
||||
delete_node(Host, Removed) ->
|
||||
node_pep:delete_node(Host, Removed).
|
||||
|
||||
subscribe_node(Host, Node, Sender, Subscriber, AccessModel,
|
||||
SendLast, PresenceSubscription, RosterGroup) ->
|
||||
node_pep:subscribe_node(
|
||||
Host, Node, Sender, Subscriber, AccessModel, SendLast,
|
||||
PresenceSubscription, RosterGroup).
|
||||
|
||||
unsubscribe_node(Host, Node, Sender, Subscriber, SubID) ->
|
||||
node_pep:unsubscribe_node(Host, Node, Sender, Subscriber, SubID).
|
||||
|
||||
publish_item(Host, Node, Publisher, Model, MaxItems, ItemId, Payload) ->
|
||||
node_pep:publish_item(Host, Node, Publisher, Model, MaxItems, ItemId, Payload).
|
||||
|
||||
remove_extra_items(Host, Node, MaxItems, ItemIds) ->
|
||||
node_pep:remove_extra_items(Host, Node, MaxItems, ItemIds).
|
||||
|
||||
delete_item(Host, Node, JID, ItemId) ->
|
||||
node_pep:delete_item(Host, Node, JID, ItemId).
|
||||
|
||||
purge_node(Host, Node, Owner) ->
|
||||
node_pep:purge_node(Host, Node, Owner).
|
||||
|
||||
get_entity_affiliations(Host, Owner) ->
|
||||
node_pep:get_entity_affiliations(Host, Owner).
|
||||
|
||||
get_node_affiliations(Host, Node) ->
|
||||
node_pep:get_node_affiliations(Host, Node).
|
||||
|
||||
get_affiliation(Host, Node, Owner) ->
|
||||
node_pep:get_affiliation(Host, Node, Owner).
|
||||
|
||||
set_affiliation(Host, Node, Owner, Affiliation) ->
|
||||
node_pep:set_affiliation(Host, Node, Owner, Affiliation).
|
||||
|
||||
get_entity_subscriptions(Host,Owner) ->
|
||||
node_pep:get_entity_subscriptions(Host, Owner).
|
||||
|
||||
get_node_subscriptions(Host, Node) ->
|
||||
node_pep:get_node_subscriptions(Host, Node).
|
||||
|
||||
get_subscription(Host,Node,Owner) ->
|
||||
node_pep:get_subscription(Host,Node,Owner).
|
||||
|
||||
set_subscription(Host, Node, Owner, Subscription) ->
|
||||
node_pep:set_subscription(Host, Node, Owner, Subscription).
|
||||
|
||||
get_states(Host, Node) ->
|
||||
node_pep:get_states(Host, Node).
|
||||
|
||||
get_state(Host, Node, JID) ->
|
||||
node_pep:get_state(Host, Node, JID).
|
||||
|
||||
set_state(State) ->
|
||||
node_pep:set_state(State).
|
||||
|
||||
get_items(Host, Node, From) ->
|
||||
node_pep:get_items(Host, Node, From).
|
||||
|
||||
get_items(Host, Node, JID, AccessModel, PresenceSubscription, RosterGroup, SubId) ->
|
||||
node_pep:get_items(Host, Node, JID, AccessModel, PresenceSubscription, RosterGroup, SubId).
|
||||
|
||||
get_item(Host, Node, ItemId) ->
|
||||
node_pep:get_item(Host, Node, ItemId).
|
||||
|
||||
get_item(Host, Node, ItemId, JID, AccessModel, PresenceSubscription, RosterGroup, SubId) ->
|
||||
node_pep:get_item(Host, Node, ItemId, JID, AccessModel, PresenceSubscription, RosterGroup, SubId).
|
||||
|
||||
set_item(Item) ->
|
||||
node_pep:set_item(Item).
|
||||
|
||||
get_item_name(Host, Node, Id) ->
|
||||
node_pep:get_item_name(Host, Node, Id).
|
||||
|
@ -59,7 +59,7 @@
|
||||
get_state/3,
|
||||
set_state/1,
|
||||
get_items/7,
|
||||
get_items/2,
|
||||
get_items/3,
|
||||
get_item/8,
|
||||
get_item/3,
|
||||
set_item/1,
|
||||
@ -123,7 +123,8 @@ create_node_permission(Host, ServerHost, _Node, _ParentNode, Owner, Access) ->
|
||||
{User, Server, _} -> true;
|
||||
_ -> false
|
||||
end;
|
||||
_ ->
|
||||
E ->
|
||||
?DEBUG("Create not allowed : ~p~n", [E]),
|
||||
false
|
||||
end
|
||||
end,
|
||||
@ -215,8 +216,8 @@ get_state(Host, Node, JID) ->
|
||||
set_state(State) ->
|
||||
node_default:set_state(State).
|
||||
|
||||
get_items(Host, Node) ->
|
||||
node_default:get_items(Host, Node).
|
||||
get_items(Host, Node, From) ->
|
||||
node_default:get_items(Host, Node, From).
|
||||
|
||||
get_items(Host, Node, JID, AccessModel, PresenceSubscription, RosterGroup, SubId) ->
|
||||
node_default:get_items(Host, Node, JID, AccessModel, PresenceSubscription, RosterGroup, SubId).
|
||||
|
@ -63,7 +63,7 @@
|
||||
get_state/3,
|
||||
set_state/1,
|
||||
get_items/7,
|
||||
get_items/2,
|
||||
get_items/3,
|
||||
get_item/8,
|
||||
get_item/3,
|
||||
set_item/1,
|
||||
@ -173,8 +173,8 @@ get_state(Host, Node, JID) ->
|
||||
set_state(State) ->
|
||||
node_default:set_state(State).
|
||||
|
||||
get_items(Host, Node) ->
|
||||
node_default:get_items(Host, Node).
|
||||
get_items(Host, Node, From) ->
|
||||
node_default:get_items(Host, Node, From).
|
||||
|
||||
get_items(Host, Node, JID, AccessModel, PresenceSubscription, RosterGroup, SubId) ->
|
||||
node_default:get_items(Host, Node, JID, AccessModel, PresenceSubscription, RosterGroup, SubId).
|
||||
|
@ -63,7 +63,7 @@
|
||||
get_state/3,
|
||||
set_state/1,
|
||||
get_items/7,
|
||||
get_items/2,
|
||||
get_items/3,
|
||||
get_item/8,
|
||||
get_item/3,
|
||||
set_item/1,
|
||||
@ -170,8 +170,8 @@ get_state(Host, Node, JID) ->
|
||||
set_state(State) ->
|
||||
node_default:set_state(State).
|
||||
|
||||
get_items(Host, Node) ->
|
||||
node_default:get_items(Host, Node).
|
||||
get_items(Host, Node, From) ->
|
||||
node_default:get_items(Host, Node, From).
|
||||
|
||||
get_items(Host, Node, JID, AccessModel, PresenceSubscription, RosterGroup, SubId) ->
|
||||
node_default:get_items(Host, Node, JID, AccessModel, PresenceSubscription, RosterGroup, SubId).
|
||||
|
@ -54,7 +54,7 @@
|
||||
get_state/3,
|
||||
set_state/1,
|
||||
get_items/7,
|
||||
get_items/2,
|
||||
get_items/3,
|
||||
get_item/8,
|
||||
get_item/3,
|
||||
set_item/1,
|
||||
@ -163,8 +163,8 @@ get_state(Host, Node, JID) ->
|
||||
set_state(State) ->
|
||||
node_default:set_state(State).
|
||||
|
||||
get_items(Host, Node) ->
|
||||
node_default:get_items(Host, Node).
|
||||
get_items(Host, Node, From) ->
|
||||
node_default:get_items(Host, Node, From).
|
||||
|
||||
get_items(Host, Node, JID, AccessModel, PresenceSubscription, RosterGroup, SubId) ->
|
||||
node_default:get_items(Host, Node, JID, AccessModel, PresenceSubscription, RosterGroup, SubId).
|
||||
|
@ -16,7 +16,7 @@
|
||||
%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
%%% General Public License for more details.
|
||||
%%%
|
||||
%%%
|
||||
%%% You should have received a copy of the GNU General Public License
|
||||
%%% along with this program; if not, write to the Free Software
|
||||
%%% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
@ -638,7 +638,7 @@ set_items(User, Server, #xmlel{children = Els}) ->
|
||||
LServer = exmpp_stringprep:nameprep(Server),
|
||||
catch odbc_queries:sql_transaction(
|
||||
LServer,
|
||||
lists:map(fun(El) ->
|
||||
lists:flatmap(fun(El) ->
|
||||
process_item_set_t(LUser, LServer, El)
|
||||
end, Els))
|
||||
catch
|
||||
@ -877,7 +877,7 @@ groups_to_string(#roster{us = {User, _Server},
|
||||
%% Empty groups do not need to be converted to string to be inserted in
|
||||
%% the database
|
||||
lists:foldl(fun([], Acc) -> Acc;
|
||||
(Group, Acc) ->
|
||||
(Group, Acc) ->
|
||||
String = ["'", Username, "',"
|
||||
"'", SJID, "',"
|
||||
"'", ejabberd_odbc:escape(binary_to_list(Group)), "'"],
|
||||
@ -1060,4 +1060,3 @@ us_to_list({User, Server}) ->
|
||||
|
||||
webadmin_user(Acc, _User, _Server, Lang) ->
|
||||
Acc ++ [?XE("h3", [?ACT("roster/", "Roster")])].
|
||||
|
||||
|
@ -161,6 +161,7 @@ get_user_roster(Items, US) ->
|
||||
process_item(RosterItem, Host) ->
|
||||
USFrom = {UserFrom, ServerFrom} = RosterItem#roster.us,
|
||||
{UserTo, ServerTo, ResourceTo} = RosterItem#roster.jid,
|
||||
NameTo = RosterItem#roster.name,
|
||||
USTo = {UserTo, ServerTo},
|
||||
DisplayedGroups = get_user_displayed_groups(USFrom),
|
||||
CommonGroups = lists:filter(fun(Group) ->
|
||||
@ -188,24 +189,24 @@ process_item(RosterItem, Host) ->
|
||||
PersonalGroups ->
|
||||
%% Store roster items in From and To rosters
|
||||
set_new_rosteritems(UserFrom, ServerFrom,
|
||||
UserTo, ServerTo, ResourceTo,
|
||||
UserTo, ServerTo, ResourceTo, NameTo,
|
||||
PersonalGroups)
|
||||
end
|
||||
end.
|
||||
|
||||
build_roster_record(User1, Server1, User2, Server2, Groups) ->
|
||||
build_roster_record(User1, Server1, User2, Server2, Name2, Groups) ->
|
||||
USR2 = {User2, Server2, undefined},
|
||||
#roster{usj = {User1, Server1, USR2},
|
||||
us = {User1, Server1},
|
||||
jid = USR2,
|
||||
name = User2,
|
||||
name = Name2,
|
||||
subscription = both,
|
||||
ask = none,
|
||||
groups = Groups
|
||||
}.
|
||||
|
||||
set_new_rosteritems(UserFrom, ServerFrom,
|
||||
UserTo, ServerTo, ResourceTo, GroupsFrom) ->
|
||||
UserTo, ServerTo, ResourceTo, NameTo, GroupsFrom) ->
|
||||
Mod = case lists:member(mod_roster_odbc,
|
||||
gen_mod:loaded_modules(ServerFrom)) of
|
||||
true -> mod_roster_odbc;
|
||||
@ -213,13 +214,13 @@ set_new_rosteritems(UserFrom, ServerFrom,
|
||||
end,
|
||||
|
||||
RIFrom = build_roster_record(UserFrom, ServerFrom,
|
||||
UserTo, ServerTo, GroupsFrom),
|
||||
UserTo, ServerTo, NameTo, GroupsFrom),
|
||||
set_item(UserFrom, ServerFrom, ResourceTo, RIFrom),
|
||||
JIDTo = exmpp_jid:make_bare_jid(UserTo, ServerTo),
|
||||
|
||||
JIDFrom = exmpp_jid:make_bare_jid(UserFrom, ServerFrom),
|
||||
RITo = build_roster_record(UserTo, ServerTo,
|
||||
UserFrom, ServerFrom, []),
|
||||
UserFrom, ServerFrom, UserFrom,[]),
|
||||
set_item(UserTo, ServerTo, undefined, RITo),
|
||||
|
||||
%% From requests
|
||||
|
@ -16,7 +16,7 @@
|
||||
%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
%%% General Public License for more details.
|
||||
%%%
|
||||
%%%
|
||||
%%% You should have received a copy of the GNU General Public License
|
||||
%%% along with this program; if not, write to the Free Software
|
||||
%%% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
@ -97,7 +97,7 @@ stop(Host) ->
|
||||
|
||||
get_sm_features({error, _Error} = Acc, _From, _To, _Node, _Lang) ->
|
||||
Acc;
|
||||
|
||||
|
||||
get_sm_features(Acc, _From, _To, Node, _Lang) ->
|
||||
case Node of
|
||||
[] ->
|
||||
@ -131,10 +131,7 @@ process_local_iq(_From, _To, #iq{type = set} = IQ_Rec) ->
|
||||
process_sm_iq(_From, To, #iq{type = get} = IQ_Rec) ->
|
||||
#jid{lnode = LUser, ldomain = LServer} = To,
|
||||
Username = ejabberd_odbc:escape(LUser),
|
||||
case catch ejabberd_odbc:sql_query(
|
||||
LServer,
|
||||
["select vcard from vcard "
|
||||
"where username='", Username, "';"]) of
|
||||
case catch odbc_queries:get_vcard(LServer, Username) of
|
||||
{selected, ["vcard"], [{SVCARD}]} ->
|
||||
try exmpp_xml:parse_document(SVCARD,
|
||||
[namespace, name_as_atom, autoload_known]) of
|
||||
@ -233,30 +230,13 @@ set_vcard(User, LServer, VCARD) ->
|
||||
SOrgUnit = ejabberd_odbc:escape(OrgUnit),
|
||||
SLOrgUnit = ejabberd_odbc:escape(LOrgUnit),
|
||||
|
||||
ejabberd_odbc:sql_transaction(
|
||||
LServer,
|
||||
[["delete from vcard where username='", LUsername, "';"],
|
||||
["insert into vcard(username, vcard) "
|
||||
"values ('", LUsername, "', '", SVCARD, "');"],
|
||||
["delete from vcard_search where lusername='", LUsername, "';"],
|
||||
["insert into vcard_search("
|
||||
" username, lusername, fn, lfn, family, lfamily,"
|
||||
" given, lgiven, middle, lmiddle, nickname, lnickname,"
|
||||
" bday, lbday, ctry, lctry, locality, llocality,"
|
||||
" email, lemail, orgname, lorgname, orgunit, lorgunit)"
|
||||
"values (",
|
||||
" '", Username, "', '", LUsername, "',"
|
||||
" '", SFN, "', '", SLFN, "',"
|
||||
" '", SFamily, "', '", SLFamily, "',"
|
||||
" '", SGiven, "', '", SLGiven, "',"
|
||||
" '", SMiddle, "', '", SLMiddle, "',"
|
||||
" '", SNickname, "', '", SLNickname, "',"
|
||||
" '", SBDay, "', '", SLBDay, "',"
|
||||
" '", SCTRY, "', '", SLCTRY, "',"
|
||||
" '", SLocality, "', '", SLLocality, "',"
|
||||
" '", SEMail, "', '", SLEMail, "',"
|
||||
" '", SOrgName, "', '", SLOrgName, "',"
|
||||
" '", SOrgUnit, "', '", SLOrgUnit, "');"]])
|
||||
odbc_queries:set_vcard(LServer, LUsername, SBDay, SCTRY, SEMail,
|
||||
SFN, SFamily, SGiven, SLBDay, SLCTRY,
|
||||
SLEMail, SLFN, SLFamily, SLGiven,
|
||||
SLLocality, SLMiddle, SLNickname,
|
||||
SLOrgName, SLOrgUnit, SLocality,
|
||||
SMiddle, SNickname, SOrgName,
|
||||
SOrgUnit, SVCARD, Username)
|
||||
catch
|
||||
_ ->
|
||||
{error, badarg}
|
||||
@ -612,18 +592,18 @@ make_val(Match, Field, Val) ->
|
||||
% true ->
|
||||
% mnesia:write(
|
||||
% #vcard_search{us = US,
|
||||
% user = User, luser = LUser,
|
||||
% fn = FN, lfn = LFN,
|
||||
% family = Family, lfamily = LFamily,
|
||||
% given = Given, lgiven = LGiven,
|
||||
% middle = Middle, lmiddle = LMiddle,
|
||||
% nickname = Nickname, lnickname = LNickname,
|
||||
% bday = BDay, lbday = LBDay,
|
||||
% ctry = CTRY, lctry = LCTRY,
|
||||
% locality = Locality, llocality = LLocality,
|
||||
% email = EMail, lemail = LEMail,
|
||||
% orgname = OrgName, lorgname = LOrgName,
|
||||
% orgunit = OrgUnit, lorgunit = LOrgUnit
|
||||
% user = User, luser = LUser,
|
||||
% fn = FN, lfn = LFN,
|
||||
% family = Family, lfamily = LFamily,
|
||||
% given = Given, lgiven = LGiven,
|
||||
% middle = Middle, lmiddle = LMiddle,
|
||||
% nickname = Nickname, lnickname = LNickname,
|
||||
% bday = BDay, lbday = LBDay,
|
||||
% ctry = CTRY, lctry = LCTRY,
|
||||
% locality = Locality, llocality = LLocality,
|
||||
% email = EMail, lemail = LEMail,
|
||||
% orgname = OrgName, lorgname = LOrgName,
|
||||
% orgunit = OrgUnit, lorgunit = LOrgUnit
|
||||
% })
|
||||
% end.
|
||||
%
|
||||
@ -643,5 +623,3 @@ remove_user(User, Server) ->
|
||||
LServer,
|
||||
[["delete from vcard where username='", Username, "';"],
|
||||
["delete from vcard_search where lusername='", Username, "';"]]).
|
||||
|
||||
|
||||
|
@ -4,8 +4,7 @@ include ..\Makefile.inc
|
||||
EFLAGS = -I .. -pz ..
|
||||
|
||||
OUTDIR = ..
|
||||
SOURCES = $(wildcard *.erl)
|
||||
BEAMS = $(addprefix $(OUTDIR)/,$(SOURCES:.erl=.beam))
|
||||
BEAMS = ..\ejabberd_odbc.beam ..\ejabberd_odbc_sup.beam ..\odbc_queries.beam
|
||||
|
||||
ALL : $(BEAMS)
|
||||
|
||||
|
@ -30,7 +30,7 @@
|
||||
-behaviour(gen_server).
|
||||
|
||||
%% External exports
|
||||
-export([start/1, start_link/1,
|
||||
-export([start/1, start_link/2,
|
||||
sql_query/2,
|
||||
sql_query_t/1,
|
||||
sql_transaction/2,
|
||||
@ -63,8 +63,8 @@
|
||||
start(Host) ->
|
||||
gen_server:start(ejabberd_odbc, [Host], []).
|
||||
|
||||
start_link(Host) ->
|
||||
gen_server:start_link(ejabberd_odbc, [Host], []).
|
||||
start_link(Host, StartInterval) ->
|
||||
gen_server:start_link(ejabberd_odbc, [Host, StartInterval], []).
|
||||
|
||||
sql_query(Host, Query) ->
|
||||
gen_server:call(ejabberd_odbc_sup:get_random_pid(Host),
|
||||
@ -131,10 +131,10 @@ escape_like(C) -> odbc_queries:escape(C).
|
||||
%% ignore |
|
||||
%% {stop, Reason}
|
||||
%%----------------------------------------------------------------------
|
||||
init([Host]) ->
|
||||
init([Host, StartInterval]) ->
|
||||
case ejabberd_config:get_local_option({odbc_keepalive_interval, Host}) of
|
||||
Interval when is_integer(Interval) ->
|
||||
timer:apply_interval(Interval*1000, ?MODULE, keep_alive, [self()]);
|
||||
KeepaliveInterval when is_integer(KeepaliveInterval) ->
|
||||
timer:apply_interval(KeepaliveInterval*1000, ?MODULE, keep_alive, [self()]);
|
||||
undefined ->
|
||||
ok;
|
||||
_Other ->
|
||||
@ -144,16 +144,16 @@ init([Host]) ->
|
||||
case SQLServer of
|
||||
%% Default pgsql port
|
||||
{pgsql, Server, DB, Username, Password} ->
|
||||
pgsql_connect(Server, ?PGSQL_PORT, DB, Username, Password);
|
||||
pgsql_connect(Server, ?PGSQL_PORT, DB, Username, Password, StartInterval);
|
||||
{pgsql, Server, Port, DB, Username, Password} when is_integer(Port) ->
|
||||
pgsql_connect(Server, Port, DB, Username, Password);
|
||||
pgsql_connect(Server, Port, DB, Username, Password, StartInterval);
|
||||
%% Default mysql port
|
||||
{mysql, Server, DB, Username, Password} ->
|
||||
mysql_connect(Server, ?MYSQL_PORT, DB, Username, Password);
|
||||
mysql_connect(Server, ?MYSQL_PORT, DB, Username, Password, StartInterval);
|
||||
{mysql, Server, Port, DB, Username, Password} when is_integer(Port) ->
|
||||
mysql_connect(Server, Port, DB, Username, Password);
|
||||
mysql_connect(Server, Port, DB, Username, Password, StartInterval);
|
||||
_ when is_list(SQLServer) ->
|
||||
odbc_connect(SQLServer)
|
||||
odbc_connect(SQLServer, StartInterval)
|
||||
end.
|
||||
|
||||
%%----------------------------------------------------------------------
|
||||
@ -259,7 +259,7 @@ execute_transaction(State, F, NRestarts) ->
|
||||
|
||||
%% part of init/1
|
||||
%% Open an ODBC database connection
|
||||
odbc_connect(SQLServer) ->
|
||||
odbc_connect(SQLServer, StartInterval) ->
|
||||
application:start(odbc),
|
||||
case odbc:connect(SQLServer,[{scrollable_cursors, off}]) of
|
||||
{ok, Ref} ->
|
||||
@ -268,8 +268,8 @@ odbc_connect(SQLServer) ->
|
||||
{error, Reason} ->
|
||||
?ERROR_MSG("ODBC connection (~s) failed: ~p~n",
|
||||
[SQLServer, Reason]),
|
||||
%% If we can't connect we wait for 30 seconds before retrying
|
||||
timer:sleep(30000),
|
||||
%% If we can't connect we wait before retrying
|
||||
timer:sleep(StartInterval),
|
||||
{stop, odbc_connection_failed}
|
||||
end.
|
||||
|
||||
@ -278,15 +278,15 @@ odbc_connect(SQLServer) ->
|
||||
|
||||
%% part of init/1
|
||||
%% Open a database connection to PostgreSQL
|
||||
pgsql_connect(Server, Port, DB, Username, Password) ->
|
||||
pgsql_connect(Server, Port, DB, Username, Password, StartInterval) ->
|
||||
case pgsql:connect(Server, DB, Username, Password, Port) of
|
||||
{ok, Ref} ->
|
||||
erlang:monitor(process, Ref),
|
||||
{ok, #state{db_ref = Ref, db_type = pgsql}};
|
||||
{error, Reason} ->
|
||||
?ERROR_MSG("PostgreSQL connection failed: ~p~n", [Reason]),
|
||||
%% If we can't connect we wait for 30 seconds before retrying
|
||||
timer:sleep(30000),
|
||||
%% If we can't connect we wait before retrying
|
||||
timer:sleep(StartInterval),
|
||||
{stop, pgsql_connection_failed}
|
||||
end.
|
||||
|
||||
@ -317,7 +317,7 @@ pgsql_item_to_odbc(_) ->
|
||||
|
||||
%% part of init/1
|
||||
%% Open a database connection to MySQL
|
||||
mysql_connect(Server, Port, DB, Username, Password) ->
|
||||
mysql_connect(Server, Port, DB, Username, Password, StartInterval) ->
|
||||
NoLogFun = fun(_Level,_Format,_Argument) -> ok end,
|
||||
case mysql_conn:start(Server, Port, Username, Password, DB, NoLogFun) of
|
||||
{ok, Ref} ->
|
||||
@ -330,9 +330,10 @@ mysql_connect(Server, Port, DB, Username, Password) ->
|
||||
"SERIALIZABLE;"], self()),
|
||||
{ok, #state{db_ref = Ref, db_type = mysql}};
|
||||
{error, Reason} ->
|
||||
?ERROR_MSG("MySQL connection failed: ~p~n", [Reason]),
|
||||
%% If we can't connect we wait for 30 seconds before retrying
|
||||
timer:sleep(30000),
|
||||
?ERROR_MSG("MySQL connection failed: ~p~nWaiting ~p seconds before retrying...~n",
|
||||
[Reason, StartInterval div 1000]),
|
||||
%% If we can't connect we wait before retrying
|
||||
timer:sleep(StartInterval),
|
||||
{stop, mysql_connection_failed}
|
||||
end.
|
||||
|
||||
|
@ -16,7 +16,7 @@
|
||||
%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
%%% General Public License for more details.
|
||||
%%%
|
||||
%%%
|
||||
%%% You should have received a copy of the GNU General Public License
|
||||
%%% along with this program; if not, write to the Free Software
|
||||
%%% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
@ -37,32 +37,44 @@
|
||||
-include("ejabberd.hrl").
|
||||
|
||||
-define(DEFAULT_POOL_SIZE, 10).
|
||||
-define(DEFAULT_ODBC_START_INTERVAL, 30). % 30 seconds
|
||||
|
||||
start_link(Host) ->
|
||||
supervisor:start_link({local, gen_mod:get_module_proc(Host, ?MODULE)},
|
||||
?MODULE, [Host]).
|
||||
|
||||
init([Host]) ->
|
||||
N = case ejabberd_config:get_local_option({odbc_pool_size, Host}) of
|
||||
I when is_integer(I) ->
|
||||
I;
|
||||
PoolSize = case ejabberd_config:get_local_option({odbc_pool_size, Host}) of
|
||||
I when is_integer(I) ->
|
||||
I;
|
||||
undefined ->
|
||||
?DEFAULT_POOL_SIZE;
|
||||
Other ->
|
||||
?ERROR_MSG("Wrong odbc_pool_size definition '~p' for host ~p, default to ~p~n",
|
||||
[Other, Host, ?DEFAULT_POOL_SIZE]),
|
||||
?DEFAULT_POOL_SIZE
|
||||
end,
|
||||
{ok, {{one_for_one, 10, 6},
|
||||
?DEFAULT_POOL_SIZE;
|
||||
Other ->
|
||||
?ERROR_MSG("Wrong odbc_pool_size definition '~p' for host ~p, default to ~p~n",
|
||||
[Other, Host, ?DEFAULT_POOL_SIZE]),
|
||||
?DEFAULT_POOL_SIZE
|
||||
end,
|
||||
StartInterval = case ejabberd_config:get_local_option({odbc_start_interval, Host}) of
|
||||
Interval when is_integer(Interval) ->
|
||||
Interval;
|
||||
undefined ->
|
||||
?DEFAULT_ODBC_START_INTERVAL;
|
||||
_Other2 ->
|
||||
?ERROR_MSG("Wrong odbc_start_interval definition '~p' for host ~p"
|
||||
", defaulting to ~p~n",
|
||||
[_Other2, Host, ?DEFAULT_ODBC_START_INTERVAL]),
|
||||
?DEFAULT_ODBC_START_INTERVAL
|
||||
end,
|
||||
{ok, {{one_for_one, PoolSize+1, StartInterval},
|
||||
lists:map(
|
||||
fun(I) ->
|
||||
{I,
|
||||
{ejabberd_odbc, start_link, [Host]},
|
||||
{ejabberd_odbc, start_link, [Host, StartInterval*1000]},
|
||||
transient,
|
||||
brutal_kill,
|
||||
worker,
|
||||
[?MODULE]}
|
||||
end, lists:seq(1, N))}}.
|
||||
end, lists:seq(1, PoolSize))}}.
|
||||
|
||||
get_pids(Host) ->
|
||||
Proc = gen_mod:get_module_proc(Host, ?MODULE),
|
||||
|
@ -10,7 +10,7 @@
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
@ -104,6 +104,10 @@ if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[vcard]') a
|
||||
drop table [dbo].[vcard]
|
||||
GO
|
||||
|
||||
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[vcard_search]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
|
||||
drop table [dbo].[vcard_search]
|
||||
GO
|
||||
|
||||
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[private_storage]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
|
||||
drop table [dbo].[private_storage]
|
||||
GO
|
||||
@ -119,7 +123,7 @@ GO
|
||||
CREATE TABLE [dbo].[rostergroups] (
|
||||
[username] [varchar] (250) NOT NULL ,
|
||||
[jid] [varchar] (250) NOT NULL ,
|
||||
[grp] [varchar] (100) NOT NULL
|
||||
[grp] [varchar] (100) NOT NULL
|
||||
) ON [PRIMARY]
|
||||
GO
|
||||
|
||||
@ -133,7 +137,7 @@ CREATE TABLE [dbo].[rosterusers] (
|
||||
[server] [char] (1) NOT NULL ,
|
||||
[subscribe] [varchar] (200) NULL ,
|
||||
[type] [varchar] (50) NULL ,
|
||||
CONSTRAINT [PK_rosterusers] PRIMARY KEY NONCLUSTERED
|
||||
CONSTRAINT [PK_rosterusers] PRIMARY KEY NONCLUSTERED
|
||||
(
|
||||
[username] ASC,
|
||||
[jid] ASC
|
||||
@ -154,31 +158,41 @@ GO
|
||||
CREATE TABLE [dbo].[users] (
|
||||
[username] [varchar] (250) NOT NULL ,
|
||||
[password] [varchar] (50) NOT NULL ,
|
||||
[created] [datetime] NULL
|
||||
[created] [datetime] NULL
|
||||
) ON [PRIMARY]
|
||||
GO
|
||||
|
||||
CREATE TABLE [dbo].[vcard] (
|
||||
[username] [varchar] (250) NOT NULL ,
|
||||
[full_name] [varchar] (250) NULL ,
|
||||
[first_name] [varchar] (50) NULL ,
|
||||
[last_name] [varchar] (50) NULL ,
|
||||
[nick_name] [varchar] (50) NULL ,
|
||||
[url] [varchar] (1024) NULL ,
|
||||
[address1] [varchar] (50) NULL ,
|
||||
[address2] [varchar] (50) NULL ,
|
||||
[locality] [varchar] (50) NULL ,
|
||||
[region] [varchar] (50) NULL ,
|
||||
[pcode] [varchar] (50) NULL ,
|
||||
[country] [varchar] (50) NULL ,
|
||||
[telephone] [varchar] (50) NULL ,
|
||||
[email] [varchar] (250) NULL ,
|
||||
[orgname] [varchar] (50) NULL ,
|
||||
[orgunit] [varchar] (50) NULL ,
|
||||
[title] [varchar] (50) NULL ,
|
||||
[role] [varchar] (50) NULL ,
|
||||
[b_day] [datetime] NULL ,
|
||||
[descr] [varchar] (500) NULL
|
||||
[vcard] [text] NOT NULL
|
||||
) ON [PRIMARY]
|
||||
GO
|
||||
|
||||
CREATE TABLE [dbo].[vcard_search] (
|
||||
[username] [varchar] (250) NOT NULL ,
|
||||
[lusername] [varchar] (250) NOT NULL ,
|
||||
[fn] [text] NOT NULL ,
|
||||
[lfn] [varchar] (250) NOT NULL ,
|
||||
[family] [text] NOT NULL ,
|
||||
[lfamily] [varchar] (250) NOT NULL ,
|
||||
[given] [text] NOT NULL ,
|
||||
[lgiven] [varchar] (250) NOT NULL ,
|
||||
[middle] [text] NOT NULL ,
|
||||
[lmiddle] [varchar] (250) NOT NULL ,
|
||||
[nickname] [text] NOT NULL ,
|
||||
[lnickname] [varchar] (250) NOT NULL ,
|
||||
[bday] [text] NOT NULL ,
|
||||
[lbday] [varchar] (250) NOT NULL ,
|
||||
[ctry] [text] NOT NULL ,
|
||||
[lctry] [varchar] (250) NOT NULL ,
|
||||
[locality] [text] NOT NULL ,
|
||||
[llocality] [varchar] (250) NOT NULL ,
|
||||
[email] [text] NOT NULL ,
|
||||
[lemail] [varchar] (250) NOT NULL ,
|
||||
[orgname] [text] NOT NULL ,
|
||||
[lorgname] [varchar] (250) NOT NULL ,
|
||||
[orgunit] [text] NOT NULL ,
|
||||
[lorgunit] [varchar] (250) NOT NULL
|
||||
) ON [PRIMARY]
|
||||
GO
|
||||
|
||||
@ -199,7 +213,7 @@ CREATE TABLE [dbo].[privacy_list](
|
||||
[username] [varchar](250) NOT NULL,
|
||||
[name] [varchar](250) NOT NULL,
|
||||
[id] [bigint] IDENTITY(1,1) NOT NULL,
|
||||
CONSTRAINT [PK_privacy_list] PRIMARY KEY CLUSTERED
|
||||
CONSTRAINT [PK_privacy_list] PRIMARY KEY CLUSTERED
|
||||
(
|
||||
[id] ASC
|
||||
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
|
||||
@ -224,73 +238,98 @@ GO
|
||||
- id in privacy_list is a SERIAL autogenerated number
|
||||
- id in privacy_list_data must exist in the table privacy_list */
|
||||
|
||||
ALTER TABLE [dbo].[last] WITH NOCHECK ADD
|
||||
CONSTRAINT [PK_last] PRIMARY KEY CLUSTERED
|
||||
ALTER TABLE [dbo].[last] WITH NOCHECK ADD
|
||||
CONSTRAINT [PK_last] PRIMARY KEY CLUSTERED
|
||||
(
|
||||
[username]
|
||||
) WITH FILLFACTOR = 90 ON [PRIMARY]
|
||||
) WITH FILLFACTOR = 90 ON [PRIMARY]
|
||||
GO
|
||||
|
||||
ALTER TABLE [dbo].[rostergroups] WITH NOCHECK ADD
|
||||
CONSTRAINT [PK_rostergroups] PRIMARY KEY CLUSTERED
|
||||
ALTER TABLE [dbo].[rostergroups] WITH NOCHECK ADD
|
||||
CONSTRAINT [PK_rostergroups] PRIMARY KEY CLUSTERED
|
||||
(
|
||||
[username],
|
||||
[jid],
|
||||
[grp]
|
||||
) WITH FILLFACTOR = 90 ON [PRIMARY]
|
||||
) WITH FILLFACTOR = 90 ON [PRIMARY]
|
||||
GO
|
||||
|
||||
ALTER TABLE [dbo].[spool] WITH NOCHECK ADD
|
||||
CONSTRAINT [PK_spool] PRIMARY KEY CLUSTERED
|
||||
ALTER TABLE [dbo].[spool] WITH NOCHECK ADD
|
||||
CONSTRAINT [PK_spool] PRIMARY KEY CLUSTERED
|
||||
(
|
||||
[username],
|
||||
[id]
|
||||
) WITH FILLFACTOR = 90 ON [PRIMARY]
|
||||
) WITH FILLFACTOR = 90 ON [PRIMARY]
|
||||
GO
|
||||
|
||||
ALTER TABLE [dbo].[users] WITH NOCHECK ADD
|
||||
CONSTRAINT [PK_users] PRIMARY KEY CLUSTERED
|
||||
ALTER TABLE [dbo].[users] WITH NOCHECK ADD
|
||||
CONSTRAINT [PK_users] PRIMARY KEY CLUSTERED
|
||||
(
|
||||
[username]
|
||||
) WITH FILLFACTOR = 90 ON [PRIMARY]
|
||||
) WITH FILLFACTOR = 90 ON [PRIMARY]
|
||||
GO
|
||||
|
||||
ALTER TABLE [dbo].[vcard] WITH NOCHECK ADD
|
||||
CONSTRAINT [PK_vcard] PRIMARY KEY CLUSTERED
|
||||
ALTER TABLE [dbo].[vcard] WITH NOCHECK ADD
|
||||
CONSTRAINT [PK_vcard] PRIMARY KEY CLUSTERED
|
||||
(
|
||||
[username]
|
||||
) WITH FILLFACTOR = 90 ON [PRIMARY]
|
||||
) WITH FILLFACTOR = 90 ON [PRIMARY]
|
||||
GO
|
||||
|
||||
|
||||
CREATE INDEX [IX_vcard_search_lfn] ON [dbo].[vcard_search]([lfn]) WITH FILLFACTOR = 90 ON [PRIMARY]
|
||||
GO
|
||||
CREATE INDEX [IX_vcard_search_lfamily] ON [dbo].[vcard_search]([lfamily]) WITH FILLFACTOR = 90 ON [PRIMARY]
|
||||
GO
|
||||
CREATE INDEX [IX_vcard_search_lgiven] ON [dbo].[vcard_search]([lgiven]) WITH FILLFACTOR = 90 ON [PRIMARY]
|
||||
GO
|
||||
CREATE INDEX [IX_vcard_search_lmiddle] ON [dbo].[vcard_search]([lmiddle]) WITH FILLFACTOR = 90 ON [PRIMARY]
|
||||
GO
|
||||
CREATE INDEX [IX_vcard_search_lnickname] ON [dbo].[vcard_search]([lnickname]) WITH FILLFACTOR = 90 ON [PRIMARY]
|
||||
GO
|
||||
CREATE INDEX [IX_vcard_search_lbday] ON [dbo].[vcard_search]([lbday]) WITH FILLFACTOR = 90 ON [PRIMARY]
|
||||
GO
|
||||
CREATE INDEX [IX_vcard_search_lctry] ON [dbo].[vcard_search]([lctry]) WITH FILLFACTOR = 90 ON [PRIMARY]
|
||||
GO
|
||||
CREATE INDEX [IX_vcard_search_llocality] ON [dbo].[vcard_search]([llocality]) WITH FILLFACTOR = 90 ON [PRIMARY]
|
||||
GO
|
||||
CREATE INDEX [IX_vcard_search_lemail] ON [dbo].[vcard_search]([lemail]) WITH FILLFACTOR = 90 ON [PRIMARY]
|
||||
GO
|
||||
CREATE INDEX [IX_vcard_search_lorgname] ON [dbo].[vcard_search]([lorgname]) WITH FILLFACTOR = 90 ON [PRIMARY]
|
||||
GO
|
||||
CREATE INDEX [IX_vcard_search_lorgunit] ON [dbo].[vcard_search]([lorgunit]) WITH FILLFACTOR = 90 ON [PRIMARY]
|
||||
GO
|
||||
|
||||
|
||||
CREATE CLUSTERED INDEX [IX_rosterusers_user] ON [dbo].[rosterusers]([username]) WITH FILLFACTOR = 90 ON [PRIMARY]
|
||||
GO
|
||||
|
||||
ALTER TABLE [dbo].[last] WITH NOCHECK ADD
|
||||
ALTER TABLE [dbo].[last] WITH NOCHECK ADD
|
||||
CONSTRAINT [DF_last_updated] DEFAULT (getdate()) FOR [Modify_Date]
|
||||
GO
|
||||
|
||||
ALTER TABLE [dbo].[spool] WITH NOCHECK ADD
|
||||
ALTER TABLE [dbo].[spool] WITH NOCHECK ADD
|
||||
CONSTRAINT [DF_spool_notifyprocessed] DEFAULT (0) FOR [notifyprocessed],
|
||||
CONSTRAINT [DF_spool_created] DEFAULT (getdate()) FOR [created],
|
||||
CONSTRAINT [DF_spool_MustDelete] DEFAULT (0) FOR [MustDelete]
|
||||
GO
|
||||
|
||||
ALTER TABLE [dbo].[users] WITH NOCHECK ADD
|
||||
ALTER TABLE [dbo].[users] WITH NOCHECK ADD
|
||||
CONSTRAINT [DF_users_created] DEFAULT (getdate()) FOR [created]
|
||||
GO
|
||||
|
||||
ALTER TABLE [dbo].[privacy_default_list] WITH NOCHECK ADD
|
||||
CONSTRAINT [PK_privacy_defaut_list] PRIMARY KEY CLUSTERED
|
||||
ALTER TABLE [dbo].[privacy_default_list] WITH NOCHECK ADD
|
||||
CONSTRAINT [PK_privacy_defaut_list] PRIMARY KEY CLUSTERED
|
||||
(
|
||||
[username]
|
||||
) WITH FILLFACTOR = 90 ON [PRIMARY]
|
||||
) WITH FILLFACTOR = 90 ON [PRIMARY]
|
||||
GO
|
||||
|
||||
CREATE INDEX [IX_rostergroups_jid] ON [dbo].[rostergroups]([jid]) WITH FILLFACTOR = 90 ON [PRIMARY]
|
||||
GO
|
||||
|
||||
CREATE INDEX [IX_rostergroups_user] ON [dbo].[rostergroups]([username]) WITH FILLFACTOR = 90 ON [PRIMARY]
|
||||
GO
|
||||
GO
|
||||
|
||||
CREATE INDEX [IX_spool_user] ON [dbo].[spool]([username]) WITH FILLFACTOR = 90 ON [PRIMARY]
|
||||
GO
|
||||
@ -385,7 +424,7 @@ BEGIN
|
||||
@Type
|
||||
);
|
||||
END
|
||||
|
||||
|
||||
--- Update Roster Groups if exist else add group entry
|
||||
IF NOT EXISTS (SELECT username FROM rostergroups WITH (NOLOCK) WHERE rostergroups.username=@Username AND rostergroups.jid=@JID AND rostergroups.grp=@Grp)
|
||||
BEGIN
|
||||
@ -543,12 +582,12 @@ CREATE PROCEDURE [dbo].[add_user]
|
||||
@Password varchar(50)
|
||||
AS
|
||||
BEGIN
|
||||
INSERT INTO users
|
||||
( [username],
|
||||
INSERT INTO users
|
||||
( [username],
|
||||
[password]
|
||||
)
|
||||
VALUES
|
||||
( @Username,
|
||||
)
|
||||
VALUES
|
||||
( @Username,
|
||||
@Password
|
||||
);
|
||||
END
|
||||
@ -559,7 +598,7 @@ GO
|
||||
/** Update users password **/
|
||||
/******************************************************************/
|
||||
CREATE PROCEDURE [dbo].[set_password]
|
||||
@Username varchar(200),
|
||||
@Username varchar(200),
|
||||
@Password varchar(50)
|
||||
AS
|
||||
BEGIN
|
||||
@ -582,7 +621,7 @@ CREATE PROCEDURE [dbo].[get_password]
|
||||
@Username varchar(200)
|
||||
AS
|
||||
BEGIN
|
||||
SELECT users.password as password
|
||||
SELECT users.password as password
|
||||
FROM users WITH (NOLOCK)
|
||||
WHERE username=@Username;
|
||||
END
|
||||
@ -594,7 +633,7 @@ GO
|
||||
/***************************************************************/
|
||||
CREATE PROCEDURE [dbo].[clean_spool_msg]
|
||||
AS
|
||||
DECLARE
|
||||
DECLARE
|
||||
@dt datetime,
|
||||
@myRowCount int
|
||||
BEGIN
|
||||
@ -606,7 +645,7 @@ BEGIN
|
||||
BEGIN
|
||||
BEGIN TRANSACTION
|
||||
SELECT @dt = DATEADD(d, -3, GETDATE())
|
||||
DELETE FROM spool
|
||||
DELETE FROM spool
|
||||
WITH (ROWLOCK)
|
||||
WHERE (MustDelete=1) OR (Created < @dt);
|
||||
|
||||
@ -640,11 +679,11 @@ CREATE PROCEDURE [dbo].[del_roster]
|
||||
AS
|
||||
BEGIN
|
||||
BEGIN TRANSACTION
|
||||
DELETE FROM rosterusers
|
||||
DELETE FROM rosterusers
|
||||
WITH (ROWLOCK)
|
||||
WHERE (rosterusers.username = @Username) AND (rosterusers.jid = @JID);
|
||||
|
||||
DELETE FROM rostergroups
|
||||
|
||||
DELETE FROM rostergroups
|
||||
WITH (ROWLOCK)
|
||||
WHERE (rostergroups.username = @Username) AND (rostergroups.jid = @JID);
|
||||
COMMIT
|
||||
@ -660,7 +699,7 @@ CREATE PROCEDURE [dbo].[del_spool_msg]
|
||||
@Username varchar(250)
|
||||
AS
|
||||
BEGIN
|
||||
DELETE FROM spool
|
||||
DELETE FROM spool
|
||||
WITH (ROWLOCK)
|
||||
WHERE spool.username=@Username;
|
||||
END
|
||||
@ -674,7 +713,7 @@ CREATE PROCEDURE [dbo].[del_user]
|
||||
@Username varchar(200)
|
||||
AS
|
||||
BEGIN
|
||||
DELETE FROM users
|
||||
DELETE FROM users
|
||||
WITH (ROWLOCK)
|
||||
WHERE username=@Username;
|
||||
END
|
||||
@ -691,7 +730,7 @@ DECLARE
|
||||
@Pwd varchar(50)
|
||||
BEGIN
|
||||
EXECUTE @Pwd = dbo.get_password @Username
|
||||
DELETE FROM users
|
||||
DELETE FROM users
|
||||
WITH (ROWLOCK)
|
||||
WHERE username=@Username
|
||||
|
||||
@ -709,11 +748,11 @@ CREATE PROCEDURE [dbo].[del_user_roster]
|
||||
AS
|
||||
BEGIN
|
||||
BEGIN TRANSACTION
|
||||
DELETE FROM rosterusers
|
||||
DELETE FROM rosterusers
|
||||
WITH (ROWLOCK)
|
||||
WHERE rosterusers.username = @Username;
|
||||
|
||||
DELETE FROM rostergroups
|
||||
|
||||
DELETE FROM rostergroups
|
||||
WITH (ROWLOCK)
|
||||
WHERE rostergroups.username = @Username;
|
||||
COMMIT
|
||||
@ -739,9 +778,9 @@ BEGIN
|
||||
FROM spool WITH (NOLOCK)
|
||||
WHERE spool.username=@Username;
|
||||
|
||||
DELETE spool
|
||||
DELETE spool
|
||||
WITH (ROWLOCK)
|
||||
WHERE spool.username=@Username
|
||||
WHERE spool.username=@Username
|
||||
END
|
||||
ELSE
|
||||
BEGIN
|
||||
@ -758,7 +797,7 @@ CREATE PROCEDURE [dbo].[get_last]
|
||||
@Username varchar(250)
|
||||
AS
|
||||
BEGIN
|
||||
SELECT last.seconds AS seconds,
|
||||
SELECT last.seconds AS seconds,
|
||||
last.state AS state
|
||||
FROM last WITH (NOLOCK)
|
||||
WHERE last.username=@Username;
|
||||
@ -773,26 +812,26 @@ CREATE PROCEDURE [dbo].[get_roster]
|
||||
@Username varchar(250)
|
||||
AS
|
||||
DECLARE
|
||||
@vRosterusers table( username varchar(1),
|
||||
jid varchar(1),
|
||||
nick varchar(1),
|
||||
subscription varchar(1),
|
||||
ask varchar(1),
|
||||
askmessage varchar(1),
|
||||
server varchar(1),
|
||||
subscribe varchar(1),
|
||||
@vRosterusers table( username varchar(1),
|
||||
jid varchar(1),
|
||||
nick varchar(1),
|
||||
subscription varchar(1),
|
||||
ask varchar(1),
|
||||
askmessage varchar(1),
|
||||
server varchar(1),
|
||||
subscribe varchar(1),
|
||||
type varchar(1))
|
||||
BEGIN
|
||||
IF EXISTS (SELECT username FROM rosterusers with (nolock) WHERE rosterusers.username = @Username)
|
||||
BEGIN
|
||||
SELECT rosterusers.username AS username,
|
||||
rosterusers.jid AS jid,
|
||||
rosterusers.nick AS nick,
|
||||
rosterusers.subscription AS subscription,
|
||||
SELECT rosterusers.username AS username,
|
||||
rosterusers.jid AS jid,
|
||||
rosterusers.nick AS nick,
|
||||
rosterusers.subscription AS subscription,
|
||||
rosterusers.ask AS ask,
|
||||
rosterusers.askmessage AS askmessage,
|
||||
rosterusers.server AS server,
|
||||
rosterusers.subscribe AS subscribe,
|
||||
rosterusers.server AS server,
|
||||
rosterusers.subscribe AS subscribe,
|
||||
rosterusers.type AS type
|
||||
FROM rosterusers WITH (NOLOCK)
|
||||
WHERE rosterusers.username = @Username;
|
||||
@ -813,26 +852,26 @@ CREATE PROCEDURE [dbo].[get_roster_by_jid]
|
||||
@JID varchar(250)
|
||||
AS
|
||||
DECLARE
|
||||
@vRosterusers table( username varchar(1),
|
||||
jid varchar(1),
|
||||
nick varchar(1),
|
||||
subscription varchar(1),
|
||||
@vRosterusers table( username varchar(1),
|
||||
jid varchar(1),
|
||||
nick varchar(1),
|
||||
subscription varchar(1),
|
||||
ask varchar(1),
|
||||
askmessage varchar(1),
|
||||
server varchar(1),
|
||||
subscribe varchar(1),
|
||||
server varchar(1),
|
||||
subscribe varchar(1),
|
||||
type varchar(1))
|
||||
BEGIN
|
||||
IF EXISTS (SELECT username FROM rosterusers with (nolock) WHERE (rosterusers.username = @Username) AND (rosterusers.jid = @JID))
|
||||
BEGIN
|
||||
SELECT rosterusers.username AS username,
|
||||
rosterusers.jid AS jid,
|
||||
rosterusers.nick AS nick,
|
||||
rosterusers.subscription AS subscription,
|
||||
SELECT rosterusers.username AS username,
|
||||
rosterusers.jid AS jid,
|
||||
rosterusers.nick AS nick,
|
||||
rosterusers.subscription AS subscription,
|
||||
rosterusers.ask AS ask,
|
||||
rosterusers.askmessage AS askmessage,
|
||||
rosterusers.server AS server,
|
||||
rosterusers.subscribe AS subscribe,
|
||||
rosterusers.server AS server,
|
||||
rosterusers.subscribe AS subscribe,
|
||||
rosterusers.type AS type
|
||||
FROM rosterusers WITH (NOLOCK)
|
||||
WHERE (rosterusers.username = @Username) AND (rosterusers.jid = @JID);
|
||||
@ -852,12 +891,12 @@ CREATE PROCEDURE [dbo].[get_roster_jid_groups]
|
||||
@Username varchar(200)
|
||||
AS
|
||||
DECLARE
|
||||
@vrostergroups table( jid varchar(1),
|
||||
@vrostergroups table( jid varchar(1),
|
||||
grp varchar(1))
|
||||
BEGIN
|
||||
IF EXISTS (SELECT username FROM rostergroups with (nolock) WHERE rostergroups.username = @Username)
|
||||
BEGIN
|
||||
SELECT rostergroups.jid AS jid,
|
||||
SELECT rostergroups.jid AS jid,
|
||||
rostergroups.grp AS grp
|
||||
FROM rostergroups WITH (NOLOCK)
|
||||
WHERE rostergroups.username = @Username;
|
||||
@ -930,7 +969,7 @@ DECLARE
|
||||
BEGIN
|
||||
IF EXISTS (SELECT username FROM rosterusers with (nolock) WHERE rosterusers.username=@Username AND rosterusers.jid=@JID)
|
||||
BEGIN
|
||||
SELECT rosterusers.subscription AS subscription
|
||||
SELECT rosterusers.subscription AS subscription
|
||||
FROM rosterusers WITH (NOLOCK)
|
||||
WHERE rosterusers.username=@Username AND rosterusers.jid=@JID;
|
||||
END
|
||||
@ -958,7 +997,7 @@ GO
|
||||
/******************************************************************/
|
||||
CREATE PROCEDURE [dbo].[set_last]
|
||||
@Username varchar(250),
|
||||
@Seconds varchar(50),
|
||||
@Seconds varchar(50),
|
||||
@State varchar(100)
|
||||
AS
|
||||
BEGIN
|
||||
@ -1050,4 +1089,151 @@ END
|
||||
GO
|
||||
|
||||
|
||||
/******************************************************************/
|
||||
/****** Object: StoredProcedure [dbo].[set_vcard] **/
|
||||
/** Set the user's vCard **/
|
||||
/******************************************************************/
|
||||
CREATE PROCEDURE [dbo].[set_vcard]
|
||||
@VCard varchar(8000),
|
||||
@Username varchar(250),
|
||||
@Lusername varchar(250),
|
||||
@Fn varchar(8000),
|
||||
@Lfn varchar(250),
|
||||
@Family varchar(8000),
|
||||
@Lfamily varchar(250),
|
||||
@Given varchar(8000),
|
||||
@Lgiven varchar(250),
|
||||
@Middle varchar(8000),
|
||||
@Lmiddle varchar(250),
|
||||
@Nickname varchar(8000),
|
||||
@Lnickname varchar(250),
|
||||
@Bday varchar(8000),
|
||||
@Lbday varchar(250),
|
||||
@Ctry varchar(8000),
|
||||
@Lctry varchar(250),
|
||||
@Locality varchar(8000),
|
||||
@Llocality varchar(250),
|
||||
@Email varchar(8000),
|
||||
@Lemail varchar(250),
|
||||
@Orgname varchar(8000),
|
||||
@Lorgname varchar(250),
|
||||
@Orgunit varchar(8000),
|
||||
@Lorgunit varchar(250)
|
||||
AS
|
||||
BEGIN
|
||||
IF EXISTS (SELECT username FROM vcard with (nolock) WHERE vcard.username = @Username)
|
||||
BEGIN
|
||||
UPDATE [vcard]
|
||||
SET [vcard].username = @LUsername,
|
||||
[vcard].vcard = @Vcard
|
||||
WHERE vcard.username = @LUsername;
|
||||
|
||||
UPDATE [vcard_search]
|
||||
SET [vcard_search].username = @Username,
|
||||
[vcard_search].lusername = @Lusername,
|
||||
[vcard_search].fn = @Fn,
|
||||
[vcard_search].lfn = @Lfn,
|
||||
[vcard_search].family = @Family,
|
||||
[vcard_search].lfamily = @Lfamily,
|
||||
[vcard_search].given = @Given,
|
||||
[vcard_search].lgiven = @Lgiven,
|
||||
[vcard_search].middle = @Middle,
|
||||
[vcard_search].lmiddle = @Lmiddle,
|
||||
[vcard_search].nickname = @Nickname,
|
||||
[vcard_search].lnickname = @Lnickname,
|
||||
[vcard_search].bday = @Bday,
|
||||
[vcard_search].lbday = @Lbday,
|
||||
[vcard_search].ctry = @Ctry,
|
||||
[vcard_search].lctry = @Lctry,
|
||||
[vcard_search].locality = @Locality,
|
||||
[vcard_search].llocality = @Llocality,
|
||||
[vcard_search].email = @Email,
|
||||
[vcard_search].lemail = @Lemail,
|
||||
[vcard_search].orgname = @Orgname,
|
||||
[vcard_search].lorgname = @Lorgname,
|
||||
[vcard_search].orgunit = @Orgunit,
|
||||
[vcard_search].lorgunit = @Lorgunit
|
||||
WHERE vcard_search.lusername = @LUsername;
|
||||
END
|
||||
ELSE
|
||||
BEGIN
|
||||
INSERT INTO [vcard]
|
||||
( [vcard].username,
|
||||
[vcard].vcard
|
||||
)
|
||||
VALUES
|
||||
( @lUsername,
|
||||
@Vcard
|
||||
);
|
||||
|
||||
INSERT INTO [vcard_search]
|
||||
(
|
||||
[vcard_search].username ,
|
||||
[vcard_search].lusername ,
|
||||
[vcard_search].fn ,
|
||||
[vcard_search].lfn ,
|
||||
[vcard_search].family ,
|
||||
[vcard_search].lfamily ,
|
||||
[vcard_search].given ,
|
||||
[vcard_search].lgiven ,
|
||||
[vcard_search].middle ,
|
||||
[vcard_search].lmiddle ,
|
||||
[vcard_search].nickname,
|
||||
[vcard_search].lnickname,
|
||||
[vcard_search].bday,
|
||||
[vcard_search].lbday,
|
||||
[vcard_search].ctry,
|
||||
[vcard_search].lctry,
|
||||
[vcard_search].locality,
|
||||
[vcard_search].llocality,
|
||||
[vcard_search].email,
|
||||
[vcard_search].lemail,
|
||||
[vcard_search].orgname,
|
||||
[vcard_search].lorgname,
|
||||
[vcard_search].orgunit,
|
||||
[vcard_search].lorgunit
|
||||
)
|
||||
VALUES
|
||||
(
|
||||
@Username,
|
||||
@Lusername,
|
||||
@Fn,
|
||||
@Lfn,
|
||||
@Family,
|
||||
@Lfamily,
|
||||
@Given,
|
||||
@Lgiven,
|
||||
@Middle,
|
||||
@Lmiddle,
|
||||
@Nickname,
|
||||
@Lnickname,
|
||||
@Bday,
|
||||
@Lbday,
|
||||
@Ctry,
|
||||
@Lctry,
|
||||
@Locality,
|
||||
@Llocality,
|
||||
@Email,
|
||||
@Lemail,
|
||||
@Orgname,
|
||||
@Lorgname,
|
||||
@Orgunit,
|
||||
@Lorgunit
|
||||
)
|
||||
END
|
||||
END
|
||||
GO
|
||||
|
||||
/******************************************************************/
|
||||
/****** Object: StoredProcedure [dbo].[get_vcard] **/
|
||||
/** Retrive the user's vCard **/
|
||||
/******************************************************************/
|
||||
CREATE PROCEDURE [dbo].[get_vcard]
|
||||
@Username varchar(250)
|
||||
AS
|
||||
BEGIN
|
||||
SELECT vcard.vcard as vcard
|
||||
FROM vcard WITH (NOLOCK)
|
||||
WHERE username=@Username;
|
||||
END
|
||||
GO
|
||||
|
@ -61,6 +61,8 @@
|
||||
set_private_data_sql/3,
|
||||
get_private_data/3,
|
||||
del_user_private_storage/2,
|
||||
set_vcard/26,
|
||||
get_vcard/2,
|
||||
escape/1,
|
||||
count_records_where/3]).
|
||||
|
||||
@ -327,11 +329,11 @@ update_roster_sql(Username, SJID, ItemVals, ItemGroups) ->
|
||||
" values (", ItemVals, ");"],
|
||||
["delete from rostergroups "
|
||||
" where username='", Username, "' "
|
||||
" and jid='", SJID, "';"],
|
||||
" and jid='", SJID, "';"]] ++
|
||||
[["insert into rostergroups("
|
||||
" username, jid, grp) "
|
||||
" values (", ItemGroup, ");"] ||
|
||||
ItemGroup <- ItemGroups]].
|
||||
ItemGroup <- ItemGroups].
|
||||
|
||||
roster_subscribe(_LServer, Username, SJID, ItemVals) ->
|
||||
ejabberd_odbc:sql_query_t(
|
||||
@ -378,6 +380,42 @@ del_user_private_storage(LServer, Username) ->
|
||||
LServer,
|
||||
["delete from private_storage where username='", Username, "';"]).
|
||||
|
||||
|
||||
set_vcard(LServer, LUsername, SBDay, SCTRY, SEMail, SFN, SFamily, SGiven,
|
||||
SLBDay, SLCTRY, SLEMail, SLFN, SLFamily, SLGiven, SLLocality,
|
||||
SLMiddle, SLNickname, SLOrgName, SLOrgUnit, SLocality, SMiddle,
|
||||
SNickname, SOrgName, SOrgUnit, SVCARD, Username) ->
|
||||
ejabberd_odbc:sql_transaction(
|
||||
LServer,
|
||||
[["delete from vcard where username='", LUsername, "';"],
|
||||
["insert into vcard(username, vcard) "
|
||||
"values ('", LUsername, "', '", SVCARD, "');"],
|
||||
["delete from vcard_search where lusername='", LUsername, "';"],
|
||||
["insert into vcard_search("
|
||||
" username, lusername, fn, lfn, family, lfamily,"
|
||||
" given, lgiven, middle, lmiddle, nickname, lnickname,"
|
||||
" bday, lbday, ctry, lctry, locality, llocality,"
|
||||
" email, lemail, orgname, lorgname, orgunit, lorgunit)"
|
||||
"values (",
|
||||
" '", Username, "', '", LUsername, "',"
|
||||
" '", SFN, "', '", SLFN, "',"
|
||||
" '", SFamily, "', '", SLFamily, "',"
|
||||
" '", SGiven, "', '", SLGiven, "',"
|
||||
" '", SMiddle, "', '", SLMiddle, "',"
|
||||
" '", SNickname, "', '", SLNickname, "',"
|
||||
" '", SBDay, "', '", SLBDay, "',"
|
||||
" '", SCTRY, "', '", SLCTRY, "',"
|
||||
" '", SLocality, "', '", SLLocality, "',"
|
||||
" '", SEMail, "', '", SLEMail, "',"
|
||||
" '", SOrgName, "', '", SLOrgName, "',"
|
||||
" '", SOrgUnit, "', '", SLOrgUnit, "');"]]).
|
||||
|
||||
get_vcard(LServer, Username) ->
|
||||
ejabberd_odbc:sql_query(
|
||||
LServer,
|
||||
["select vcard from vcard "
|
||||
"where username='", Username, "';"]).
|
||||
|
||||
%% Characters to escape
|
||||
escape($\0) -> "\\0";
|
||||
escape($\n) -> "\\n";
|
||||
@ -597,6 +635,25 @@ del_user_private_storage(LServer, Username) ->
|
||||
LServer,
|
||||
["EXECUTE dbo.del_user_storage '", Username, "'"]).
|
||||
|
||||
set_vcard(LServer, LUsername, SBDay, SCTRY, SEMail, SFN, SFamily, SGiven,
|
||||
SLBDay, SLCTRY, SLEMail, SLFN, SLFamily, SLGiven, SLLocality,
|
||||
SLMiddle, SLNickname, SLOrgName, SLOrgUnit, SLocality, SMiddle,
|
||||
SNickname, SOrgName, SOrgUnit, SVCARD, Username) ->
|
||||
ejabberd_odbc:sql_query(
|
||||
LServer,
|
||||
["EXECUTE dbo.set_vcard '", SVCARD, "' , '", Username, "' , '", LUsername, "' , '",
|
||||
SFN, "' , '", SLFN, "' , '", SFamily, "' , '", SLFamily, "' , '",
|
||||
SGiven, "' , '", SLGiven, "' , '", SMiddle, "' , '", SLMiddle, "' , '",
|
||||
SNickname, "' , '", SLNickname, "' , '", SBDay, "' , '", SLBDay, "' , '",
|
||||
SCTRY, "' , '", SLCTRY, "' , '", SLocality, "' , '", SLLocality, "' , '",
|
||||
SEMail, "' , '", SLEMail, "' , '", SOrgName, "' , '", SLOrgName, "' , '",
|
||||
SOrgUnit, "' , '", SLOrgUnit, "'"]).
|
||||
|
||||
get_vcard(LServer, Username) ->
|
||||
ejabberd_odbc:sql_query(
|
||||
LServer,
|
||||
["EXECUTE dbo.get_vcard '", Username, "'"]).
|
||||
|
||||
%% Characters to escape
|
||||
escape($\0) -> "\\0";
|
||||
escape($\t) -> "\\t";
|
||||
|
@ -4,8 +4,7 @@ include ..\Makefile.inc
|
||||
EFLAGS = -I .. -pz ..
|
||||
|
||||
OUTDIR = ..
|
||||
SOURCES = $(wildcard *.erl)
|
||||
BEAMS = $(addprefix $(OUTDIR)/,$(SOURCES:.erl=.beam))
|
||||
BEAMS = ..\stringprep.beam ..\stringprep_sup.beam
|
||||
|
||||
SOURCE = stringprep_drv.c
|
||||
AUXIL = uni_data.c uni_norm.c
|
||||
|
@ -4,8 +4,7 @@ include ..\Makefile.inc
|
||||
EFLAGS = -I .. -pz ..
|
||||
|
||||
OUTDIR = ..
|
||||
SOURCES = $(wildcard *.erl)
|
||||
BEAMS = $(addprefix $(OUTDIR)/,$(SOURCES:.erl=.beam))
|
||||
BEAMS = ..\tls.beam
|
||||
|
||||
SOURCE = tls_drv.c
|
||||
OBJECT = tls_drv.o
|
||||
|
@ -4,8 +4,7 @@ include ..\Makefile.inc
|
||||
EFLAGS = -I .. -pz ..
|
||||
|
||||
OUTDIR = ..
|
||||
SOURCES = $(wildcard *.erl)
|
||||
BEAMS = $(addprefix $(OUTDIR)/,$(SOURCES:.erl=.beam))
|
||||
BEAMS = ..\ejabberd_http.beam ..\ejabberd_http_bind.beam ..\ejabberd_http_poll.beam ..\ejabberd_web.beam ..\ejabberd_web_admin.beam ..\mod_http_bind.beam ..\mod_http_fileserver.beam
|
||||
|
||||
ALL : $(BEAMS)
|
||||
|
||||
@ -21,5 +20,14 @@ $(OUTDIR)\ejabberd_web.beam : ejabberd_web.erl
|
||||
$(OUTDIR)\ejabberd_web_admin.beam : ejabberd_web_admin.erl
|
||||
erlc -W $(EFLAGS) -o $(OUTDIR) ejabberd_web_admin.erl
|
||||
|
||||
$(OUTDIR)\ejabberd_http_bind.beam : ejabberd_http_bind.erl
|
||||
erlc -W $(EFLAGS) -o $(OUTDIR) ejabberd_http_bind.erl
|
||||
|
||||
$(OUTDIR)\ejabberd_http_poll.beam : ejabberd_http_poll.erl
|
||||
erlc -W $(EFLAGS) -o $(OUTDIR) ejabberd_http_poll.erl
|
||||
|
||||
$(OUTDIR)\mod_http_bind.beam : mod_http_bind.erl
|
||||
erlc -W $(EFLAGS) -o $(OUTDIR) mod_http_bind.erl
|
||||
|
||||
$(OUTDIR)\mod_http_fileserver.beam : mod_http_fileserver.erl
|
||||
erlc -W $(EFLAGS) -o $(OUTDIR) mod_http_fileserver.erl
|
||||
|
Loading…
Reference in New Issue
Block a user