From b88da95b514780a673e38fc1fb3c5124364c9fb7 Mon Sep 17 00:00:00 2001 From: Alexey Shchepin Date: Tue, 6 Jul 2004 21:34:50 +0000 Subject: [PATCH] * src/Makefile.win32: Updated (thanks to Sergei Golovan) * src/Makefile.in: Added installation of ejabberd.cfg (thanks to Sergei Golovan) * src/web/ejabberd_http.erl: Fixed support for HTTP/1.0 clients * doc/guide.tex: Updated (thanks to Sergei Golovan) SVN Revision: 240 --- ChangeLog | 11 + doc/guide.html | 692 +++++++++++++++++++----------- doc/guide.tex | 876 ++++++++++++++++++++++---------------- src/Makefile.in | 5 + src/Makefile.win32 | 1 + src/web/ejabberd_http.erl | 30 +- 6 files changed, 985 insertions(+), 630 deletions(-) diff --git a/ChangeLog b/ChangeLog index 476cd708c..12d55cb63 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,16 @@ +2004-07-07 Alexey Shchepin + + * src/Makefile.win32: Updated (thanks to Sergei Golovan) + + * src/Makefile.in: Added installation of ejabberd.cfg (thanks to + Sergei Golovan) + + * src/web/ejabberd_http.erl: Fixed support for HTTP/1.0 clients + 2004-07-06 Alexey Shchepin + * doc/guide.tex: Updated (thanks to Sergei Golovan) + * src/ejabberd_auth.erl: Minor fix * src/ejabberd_c2s.erl: Fixed sending of presence to own resources diff --git a/doc/guide.html b/doc/guide.html index f139dac6a..c896d836a 100644 --- a/doc/guide.html +++ b/doc/guide.html @@ -21,7 +21,7 @@ mailto:alexey@sevcom.net
xmpp:aleksey@jabber.ru -

May 8, 2004

+

June 24, 2004

@@ -88,19 +88,24 @@ A.1.1  Option iqdisc
  • A.1.2  Option host -
  • A.2  mod_register -
  • A.3  mod_roster -
  • A.4  mod_configure -
  • A.5  mod_disco -
  • A.6  mod_stats -
  • A.7  mod_vcard +
  • A.2  mod_configure +
  • A.3  mod_disco +
  • A.4  mod_echo +
  • A.5  mod_irc +
  • A.6  mod_last +
  • A.7  mod_muc
  • A.8  mod_offline -
  • A.9  mod_echo +
  • A.9  mod_privacy
  • A.10  mod_private -
  • A.11  mod_time -
  • A.12  mod_version +
  • A.11  mod_pubsub +
  • A.12  mod_register +
  • A.13  mod_roster +
  • A.14  mod_stats +
  • A.15  mod_time +
  • A.16  mod_vcard +
  • A.17  mod_version -
  • B  I18n/L10n +
  • B  I18n/L10n @@ -109,43 +114,34 @@ ejabberd is a Free and Open Source fault-tolerant distributed Jabber -server. It is writen mostly in Erlang.
    +server. It is written mostly in Erlang.

    -The main features of ejabberd is: +The main features of ejabberd are:
    • Works on most of popular platforms: *nix (tested on Linux, FreeBSD and NetBSD) and Win32 -
    • Distributed: You can run ejabberd on a cluster of machines and all of - them will serve one Jabber domain. +
    • Distributed: You can run ejabberd on a cluster of machines to let all of + them serve one Jabber domain.
    • Fault-tolerance: You can setup an ejabberd cluster so that all the information required for a properly working service will be stored permanently on more than one node. This means that if one of the nodes crashes, then the others will continue working without disruption. - You can also add or replace more nodes ``on the fly''. -
    • Built-in Multi-User - Chat service + You can also add or replace nodes ``on the fly''. +
    • Built-in Multi-User Chat service
    • Built-in IRC transport -
    • Built-in - Publish-Subscribe - service +
    • Built-in Publish-Subscribe service
    • Built-in Jabber Users Directory service based on users vCards -
    • Built-in - HTTP Polling - service +
    • Built-in HTTP Polling service
    • SSL support
    • Support for LDAP authentification -
    • Ability to interface with external components (JIT, MSN-t, Yahoo-t, etc) +
    • Ability to interface with external components (JIT, MSN-t, Yahoo-t, etc.)
    • Migration from jabberd14 is possible
    • Mostly XMPP-compliant -
    • Support for - JEP-0030 - (Service Discovery). -
    • Support for - JEP-0039 - (Statistics Gathering). +
    • Support for JEP-0030 (Service Discovery). +
    • Support for JEP-0039 (Statistics Gathering).
    • Support for xml:lang
    -The misfeatures of ejabberd is: +The misfeatures of ejabberd are:
    • No support for virtual domains
    • No support for STARTTLS @@ -180,12 +176,12 @@ GNU Make; To compile ejabberd in MS Windows environment, you will need the following packages: @@ -193,15 +189,16 @@ MS Visual C++ 6.0 Compiler

      2.2  Obtaining

      -Currently no stable version has been released.
      +Stable ejabberd release can be obtained at +http://www.jabberstudio.org/projects/ejabberd/releases/.

      The latest alpha version can be retrieved from CVS. -
      • -export CVSROOT=:pserver:anonymous@jabberstudio.org:/home/cvs -
      • cvs login -
      • Press Enter when asked for a password -
      • cvs -z3 co ejabberd -
      +
      +  export CVSROOT=:pserver:anonymous@jabberstudio.org:/home/cvs
      +  cvs login
      +  <press Enter when asked for a password>
      +  cvs -z3 co ejabberd
      +

      2.3  Compilation

      @@ -213,24 +210,31 @@ The latest alpha version can be retrieved from CVS.
      -./configure
      -make
      +  ./configure
      +  make
      +  su
      +  make install
       
      -TBD
      +This will install ejabberd to /var/lib/ejabberd directory, +ejabberd.cfg to /etc/ejabberd directory and create +/var/log/ejabberd directory for log files.

      2.3.2  Windows

      -
      1. +
        • Install Erlang emulator (for example, into C:\Program Files\erl5.3).
        • Install Expat library into C:\Program Files\Expat-1.95.7 - directory. Copy file C:\Program Files\Expat-1.95.7\Libs\libexpat.dll + directory.
          +
          +Copy file C:\Program Files\Expat-1.95.7\Libs\libexpat.dll to your Windows system directory (for example, C:\WINNT or C:\WINNT\System32) -
        • Build and install Iconv library into C:\Program Files\iconv-1.9.1 directory. - Copy file C:\Program Files\iconv-1.9.1\bin\iconv.dll to your +
        • Build and install Iconv library into C:\Program Files\iconv-1.9.1 directory.
          +
          +Copy file C:\Program Files\iconv-1.9.1\bin\iconv.dll to your Windows system directory.

          Note: Instead of copying libexpat.dll and iconv.dll to Windows @@ -240,13 +244,12 @@ Note: Instead of copying libexpat.dll and iconv.dll to Windows variable.
        • Being in ejabberd\src directory run:
          -configure
          +configure.bat
           nmake -f Makefile.win32
           
        • Edit file ejabberd\src\ejabberd.cfg and run
           werl -s ejabberd -name ejabberd
          -
        • Enjoy! -
      +

    2.4  Starting

    @@ -254,28 +257,41 @@ werl -s ejabberd -name ejabberd To start ejabberd, use the following command:
    -erl -name ejabberd -s ejabberd
    +  erl -pa /var/lib/ejabberd/ebin -name ejabberd -s ejabberd
     
    or
    -erl -sname ejabberd -s ejabberd
    -
    In second case Erlang node will be identified using only first part of host -name, i. e. other Erlang nodes not inside this domain can't contact this node.
    + erl -pa /var/lib/ejabberd/ebin -sname ejabberd -s ejabberd +In the latter case Erlang node will be identified using only first part of host +name, i. e. other Erlang nodes outside this domain can't contact this node.

    -To specify path to config file, use command like this: +Note that when using above command ejabberd will search for config file +in current directory and will use current directory for storing user database +and logging.
    +
    +To specify path to config file, log files and Mnesia database directory, +you may use the following command:
    -erl -sname ejabberd -s ejabberd -ejabberd config \"/etc/ejabberd/ejabberd.cfg\"
    +  erl -pa /var/lib/ejabberd/ebin \
    +      -sname ejabberd \
    +      -s ejabberd \
    +      -ejabberd config \"/etc/ejabberd/ejabberd.cfg\" \
    +                log_path \"/var/log/ejabberd/ejabberd.log\" \
    +      -sasl sasl_error_logger \{file,\"/var/log/ejabberd/sasl.log\"\} \
    +      -mnesia dir \"/var/lib/ejabberd/spool\"
     
    -To use more than 1024 connections, you will need to set environment variable +You can find other useful options in Erlang manual page (erl -man erl).
    +
    +To use more than 1024 connections, you should set environment variable ERL_MAX_PORTS:
    -export ERL_MAX_PORTS=32000
    +  export ERL_MAX_PORTS=32000
     
    Note that with this value ejabberd will use more memory (approximately 6MB more).

    -To reduce memory usage, you can set environment variable +To reduce memory usage, you may set environment variable ERL_FULLSWEEP_AFTER:
    -export ERL_FULLSWEEP_AFTER=0
    +  export ERL_FULLSWEEP_AFTER=0
     
    But in this case ejabberd can start to work slower.

    @@ -289,7 +305,7 @@ export ERL_FULLSWEEP_AFTER=0 The configuration file is initially loaded the first time ejabberd is -executed, when it is parsed and stored in a database. Subsiquently the +executed, when it is parsed and stored in a database. Subsequently the configuration is loaded from the database and any commands in the configuration file are appended to the entries in the database. The configuration file consists of a sequence of Erlang terms. Parts of lines after `%' sign @@ -300,9 +316,9 @@ definition, then old value stored in the database will be used.
    To override old values stored in the database the following lines can be added in config:
    -override_global.
    -override_local.
    -override_acls.
    +  override_global.
    +  override_local.
    +  override_acls.
     
    With this lines old global or local options or ACLs will be removed before adding new ones.

    @@ -314,7 +330,7 @@ adding new ones.
    Option hostname defines name of Jabber domain that ejabberd serves. E. g. to use jabber.org domain add following line in config:
    -{host, "jabber.org"}.
    +  {host, "jabber.org"}.
     
    @@ -324,7 +340,7 @@ serves. E. g. to use jabber.org domain add following line in confi Access control in ejabberd is performed via Access Control Lists (ACL). The declarations of ACL in config file have following syntax:
    -{acl, <aclname>, {<acltype>, ...}}.
    +  {acl, <aclname>, {<acltype>, ...}}.
     
    <acltype> can be one of following:
    @@ -359,7 +375,7 @@ declarations of ACL in config file have following syntax: with name that matches <user_regexp> and from server that matches <server_regexp>. Example:
    -{acl, aleksey, {node_regexp, "^aleksey", "^jabber.(ru|org)$"}}.
    +{acl, aleksey, {node_regexp, "^aleksey$", "^jabber.(ru|org)$"}}.
     
    {user_glob, <glob>}
    {user_glob, <glob>, <server>}
    {server_glob, <glob>}
    @@ -382,10 +398,10 @@ The following ACLs pre-defined:
    An entry allowing or denying different services would look similar to this:
    -{access, <accessname>, [{allow, <aclname>},
    -                        {deny, <aclname>},
    -                        ...
    -                       ]}.
    +  {access, <accessname>, [{allow, <aclname>},
    +                          {deny, <aclname>},
    +                          ...
    +                         ]}.
     
    When a JID is checked to have access to <accessname>, the server sequentially checks if this JID mathes one of the ACLs that are second elements in each tuple in list. If it is matched, then the first element of matched @@ -393,9 +409,9 @@ tuple is returned else ``deny'' is returned.

    Example:
    -{access, configure, [{allow, admin}]}.
    -{access, something, [{deny, badmans},
    -                     {allow, all}]}.
    +  {access, configure, [{allow, admin}]}.
    +  {access, something, [{deny, badmans},
    +                       {allow, all}]}.
     
    Following access rules pre-defined:
    @@ -410,16 +426,16 @@ Following access rules pre-defined: With shapers is possible to bound connection traffic. The declarations of shapers in config file have following syntax:
    -{shaper, <shapername>, <kind>}.
    +  {shaper, <shapername>, <kind>}.
     
    Currently implemented only one kind of shaper: maxrate. It have following syntax:
    -{maxrate, <rate>}
    +  {maxrate, <rate>}
     
    where <rate> means maximum allowed incomig rate in bytes/second. E. g. to define shaper with name ``normal'' and maximum allowed rate 1000 bytes/s, add following line in config:
    -{shaper, normal, {maxrate, 1000}}.
    +  {shaper, normal, {maxrate, 1000}}.
     
    @@ -433,27 +449,50 @@ Port number;
  • Module that serves this port;
  • Options to this module. -Currently three modules are implemented: +Currently these modules are implemented:
    -ejabberd_c2s
    This module serves C2S connections.
    + ejabberd_c2s
    This module serves C2S connections.

    The following options are defined:
    - {access, <access rule>}
    This option defines access of users + {access, <access rule>}
    This option defines access of users to this C2S port. Default value is ``all''. -
    {shaper, <access rule>}
    This option is like previous, but +
    {shaper, <access rule>}
    This option is like previous, but use shapers instead of ``allow'' and ``deny''. Default value is ``none''. -
    {ip, IPAddress}
    This option specifies which network interface to - listen on. -
    inet6
    Set up the socket for IPv6. -
    ssl
    This option specifies that traffic on this port will be +
    {ip, IPAddress}
    This option specifies which network interface to + listen on. For example {ip, {192, 168, 1, 1}}. +
    inet6
    Set up the socket for IPv6. +
    ssl
    This option specifies that traffic on this port will be encrypted using SSL. You should also set ``certfile'' option. -
    {certfile, Path}
    Path to a file containing the SSL certificate. +
    {certfile, Path}
    Path to a file containing the SSL certificate. +
    +
    ejabberd_s2s_in
    This module serves incoming S2S connections. +
    ejabberd_service
    This module serves connections from Jabber + services (i. e. that use the jabber:component:accept namespace).
    +
    +The following additional options are defined for ejabberd_service + (options access, shaper, ip, inet6 are + still valid): +
    + {host, Hostname, [HostOptions]}
    This option defines hostname of connected + service and allows to specify additional options, e. g. + {password, Secret}. +
    {hosts, [Hostnames], [HostOptions]}
    The same as above, but allows to + specify several hostnames. +
    +
    ejabberd_http
    This module serves incoming HTTP connections.
    +
    +The following options are defined: +
    + http_poll
    This option enables HTTP Polling . + support. It is available then at http://server:port/http-poll/.
    +
    +
    web_admin
    This option enables web-based interface for ejabberd + administration which is available at http://server:port/admin/, + login and password should be equal to username and password of one of + registered users who have permission defined in ``configure'' access rule.
    -
    ejabberd_s2s_in
    This module serves incoming S2S connections. -
    ejabberd_service
    This module serves connections from Jabber - services (i. e. that use the jabber:component:accept namespace).
    For example, the following configuration defines that:
    • @@ -467,69 +506,63 @@ C2S connections are listened on port 5222 and 5223 (SSL) and denied for connected to port 5234 with password ``jitsecret''
    • MSN service msn.example.org is connected to port 5235 with password ``msnsecret'' -
    • YAHOO service yahoo.example.org is connected to port 5236 with +
    • Yahoo! service yahoo.example.org is connected to port 5236 with password ``yahoosecret''
    • ILE service ile.example.org is connected to port 5237 with password ``ilesecret''
    -
    -{acl, blocked, {user, "bad"}}.
    -{access, c2s, [{deny, blocked},
    -               {allow, all}]}.
    -{shaper, normal, {maxrate, 1000}}.
    -{access, c2s_shaper, [{none, admin},
    -                      {normal, all}]}.
    -{listen,
    - [{5222, ejabberd_c2s,     [{access, c2s}, {shaper, c2s_shaper}]},
    -  {5223, ejabberd_c2s,     [{access, c2s},
    -                            ssl, {certfile, "/path/to/ssl.pem"}]},
    -  {5269, ejabberd_s2s_in,  []},
    -  {5233, ejabberd_service, [{host, "aim.example.org",
    -                             [{password, "aimsecret"}]}]},
    -  {5234, ejabberd_service, [{hosts, ["icq.example.org", "sms.example.org"],
    -                             [{password, "jitsecret"}]}]},
    -  {5235, ejabberd_service, [{host, "msn.example.org",
    -                             [{password, "msnsecret"}]}]},
    -  {5236, ejabberd_service, [{host, "yahoo.example.org",
    -                             [{password, "yahoosecret"}]}]},
    -  {5237, ejabberd_service, [{host, "gg.example.org",
    -                             [{password, "ggsecret"}]}]},
    -  {5238, ejabberd_service, [{host, "ile.example.org",
    -                             [{password, "ilesecret"}]}]}
    - ]
    -}.
    -
    Note, that for jabberd14- or wpjabberd-based services you need to make the -transports log and do xdb by themselves: +
    +  {acl, blocked, {user, "bad"}}.
    +  {access, c2s, [{deny, blocked},
    +                 {allow, all}]}.
    +  {shaper, normal, {maxrate, 1000}}.
    +  {access, c2s_shaper, [{none, admin},
    +                        {normal, all}]}.
    +  {listen,
    +   [{5222, ejabberd_c2s,     [{access, c2s}, {shaper, c2s_shaper}]},
    +    {5223, ejabberd_c2s,     [{access, c2s},
    +                              ssl, {certfile, "/path/to/ssl.pem"}]},
    +    {5269, ejabberd_s2s_in,  []},
    +    {5233, ejabberd_service, [{host, "aim.example.org",
    +                               [{password, "aimsecret"}]}]},
    +    {5234, ejabberd_service, [{hosts, ["icq.example.org", "sms.example.org"],
    +                               [{password, "jitsecret"}]}]},
    +    {5235, ejabberd_service, [{host, "msn.example.org",
    +                               [{password, "msnsecret"}]}]},
    +    {5236, ejabberd_service, [{host, "yahoo.example.org",
    +                               [{password, "yahoosecret"}]}]},
    +    {5237, ejabberd_service, [{host, "gg.example.org",
    +                               [{password, "ggsecret"}]}]},
    +    {5238, ejabberd_service, [{host, "ile.example.org",
    +                               [{password, "ilesecret"}]}]}
    +   ]
    +  }.
    +
    Note, that for jabberd14- or wpjabberd-based services you have to make the +transports log and do XDB by themselves:
       <!--
    -     You need to add elogger and rlogger entries here when using ejabberd.
    +     You have to add elogger and rlogger entries here when using ejabberd.
          In this case the transport will do the logging.
       -->
     
    -  <log id='elogger'>
    +  <log id='logger'>
         <host/>
         <logtype/>
         <format>%d: [%t] (%h): %s</format>
    -    <file>/var/log/jabber/error/aim-t.log</file>
    -  </log>
    -
    -  <log id='rlogger'>
    -    <host/>
    -    <logtype>record</logtype>
    -    <format>%d %h %s</format>
    -    <file>/var/log/jabber/record/aim-t.log</file>
    +    <file>/var/log/jabber/service.log</file>
       </log>
     
       <!--
          Some Jabber server implementations do not provide
          XDB services (for example jabberd 2.0 and ejabberd).
    -     AIM-t is loaded into handle all XDB requests.
    +     xdb_file_so is loaded in to handle all XDB requests.
       -->
     
       <xdb id="xdb">
         <host/>
         <load>
    -      <xdb_file>/usr/lib/jabber/xdb_file.so</xdb_file> <!-- this is a lib of wpjabber or jabberd -->
    +      <!-- this is a lib of wpjabber or jabberd -->
    +      <xdb_file>/usr/lib/jabber/xdb_file.so</xdb_file>
           </load>
         <xdb_file xmlns="jabber:config:xdb_file">
           <spool><jabberd:cmdline flag='s'>/var/spool/jabber</jabberd:cmdline></spool>
    @@ -548,19 +581,24 @@ section A for detailed information on each modul
     
    Example:
    -{modules, [
    -           {mod_register,  []},
    -           {mod_roster,    []},
    -           {mod_configure, []},
    -           {mod_disco,     []},
    -           {mod_stats,     []},
    -           {mod_vcard,     []},
    -           {mod_offline,   []},
    -           {mod_echo,      [{host, "echo.localhost"}]},
    -           {mod_private,   []},
    -           {mod_time,      [{iqdisc, no_queue}]},
    -           {mod_version,   []}
    -          ]}.
    +  {modules,
    +   [{mod_register,  []},
    +    {mod_roster,    []},
    +    {mod_privacy,   []},
    +    {mod_configure, []},
    +    {mod_disco,     []},
    +    {mod_stats,     []},
    +    {mod_vcard,     []},
    +    {mod_offline,   []},
    +    {mod_echo,      [{host, "echo.localhost"}]},
    +    {mod_private,   []},
    +    {mod_irc,       []},
    +    {mod_muc,       []},
    +    {mod_pubsub,    []},
    +    {mod_time,      [{iqdisc, no_queue}]},
    +    {mod_last,      []},
    +    {mod_version,   []}
    +   ]}.
     
    @@ -568,15 +606,15 @@ Example: To perform online reconfiguration of ejabberd you will need to have -mod_configure loaded (see section A.4). It is also highly -recommended to load mod_disco as well (see section A.5), +mod_configure loaded (see section A.2). It is also highly +recommended to load mod_disco as well (see section A.3), because mod_configure is highly integrated with it. Additionally it is recommended to use a disco- and xdata-capable client such as -Tkabber +Tkabber (which was developed synchronously with ejabberd, its CVS version supports most of ejabberd features).

    -On disco query ejabberd returns following items: +On disco query ejabberd returns following items (see figure 1):
    • Identity of server.
    • List of features, including defined namespaces. @@ -597,13 +635,13 @@ Identity of server.

      3.2.1  Node config: Global Configuration

      -Under this node the following nodes exists:
      +Under this node the following nodes exist:

      Node config/hostname
      -Via jabber:x:data queries to this node possible to change host name of +Via ejabberd:config queries to this node possible to change host name of this ejabberd server. (See figure 2) (Currently this works correctly only after a restart)

      @@ -620,7 +658,7 @@ correctly only after a restart)
      Node config/acls
      -Via jabber:x:data queries to this node it is possible to edit ACLs list. +Via ejabberd:config queries to this node it is possible to edit ACLs list. (See figure 3)

      @@ -636,14 +674,14 @@ Via jabber:x:data queries to this node it is possible to edit ACLs list
      Node config/access
      -Via jabber:x:data queries to this node it is possible to edit access +Via ejabberd:config queries to this node it is possible to edit access rules.

      Node config/remusers
      -Via jabber:x:data queries to this node it is possible to remove users. If +Via ejabberd:config queries to this node it is possible to remove users. If removed user is online, then he will be disconnected. Also user-related data (e.g. his roster) is removed (but appropriate module must be loaded).

      @@ -771,6 +809,7 @@ separate section.

      A.1.1  Option iqdisc

      + Many modules define handlers for processing IQ queries of different namespaces to this server or to user (e. g. to example.org or to user@example.org). This option defines processing discipline of @@ -779,7 +818,7 @@ these queries. Possible values are: no_queue
      All queries of namespace with this processing discipline processed immediately. This also means that no other packets can be processed until finished this. Hence this discipline is not recommended - if processing of query can take relative many time. + if processing of query can take relatively long time.
      one_queue
      In this case created separate queue for processing of IQ queries of namespace with this discipline, and processing of this queue is done in parallel with processing of other packets. This discipline is most @@ -792,175 +831,308 @@ these queries. Possible values are:
  • Example:
    -{modules, [
    -           ...
    -           {mod_time,      [{iqdisc, no_queue}]},
    -           ...
    -          ]}.
    +  {modules,
    +   [
    +    ...
    +    {mod_time, [{iqdisc, no_queue}]},
    +    ...
    +   ]}.
     

    A.1.2  Option host

    -Some modules may act as services, and wants to have different domain name. -This option explicitly defines this name.
    + +This option explicitly defines hostname for the module which acts as a service.

    Example:
    -{modules, [
    -           ...
    -           {mod_echo,      [{host, "echo.example.org"}]},
    -           ...
    -          ]}.
    +  {modules,
    +   [
    +    ...
    +    {mod_echo, [{host, "echo.example.org"}]},
    +    ...
    +   ]}.
    +
    + + +

    A.2  mod_configure

    + + +Options: +
    +iqdisc
    ejabberd:config IQ queries processing +discipline (see A.1.1). +
    + + +

    A.3  mod_disco

    + + +This module adds support for JEP-0030 (Service Discovery).
    +
    +Options: +
    +iqdisc
    http://jabber.org/protocol/disco#items and + http://jabber.org/protocol/disco#info IQ queries processing +discipline (see A.1.1). +
    extra_domains
    List of domains that will be added to server + items reply +
    +Example: +
    +  {modules,
    +   [
    +    ...
    +    {mod_disco, [{extra_domains, ["jit.example.com",
    +                                  "etc.example.com"]}]},
    +    ...
    +   ]}.
    +
    + + +

    A.4  mod_echo

    + + +This module acts as a service and simply returns to sender any Jabber packet. Module may be +useful for debugging.
    +
    +Options: +
    +host
    Defines hostname of service +(see A.1.2). If not present +then prefix echo. is added to main ejabberd hostname. +
    + + +

    A.5  mod_irc

    + + +This module implements IRC transport.
    +
    +Options: +
    +host
    Defines hostname of service +(see A.1.2). If not present +then prefix irc. is added to main ejabberd hostname. +
    + + +

    A.6  mod_last

    + + +This module adds support for JEP-0012 (Last Activity)
    +
    +Options: +
    +iqdisc
    jabber:iq:last IQ queries processing +discipline (see A.1.1). +
    + + +

    A.7  mod_muc

    + + +This module implements JEP-0045 (Multi-User Chat) service.
    +
    +Options: +
    +host
    Defines hostname of service +(see A.1.2). If not present +then prefix conference. is added to main ejabberd hostname. +
    access
    Specifies who is allowed to use MUC service (default value is all). +
    access_create
    Specifies who is allowed to create new rooms at + MUC service (default value is all). +
    access_admin
    Specifies who is allowed to administrate MUC service +(default value is none, which means that only creator may administer her room). +
    +Example: +
    +  % Define admin ACL
    +  {acl, admin, {user, "admin"}}
    +
    +  % Define MUC admin access rule
    +  {access, muc_admin, [{allow, admin}]}
    +
    +  {modules,
    +   [
    +    ...
    +    {mod_muc, [{access, all},
    +               {access_create, all},
    +               {access_admin, muc_admin}]},
    +    ...
    +   ]}.
    +
    + + +

    A.8  mod_offline

    + + +This module implements offline message storage.
    +
    + + +

    A.9  mod_privacy

    + + +This module implements Privacy Rules as defined in XMPP IM +(see http://www.jabber.org/ietf/).
    +
    +Options: +
    +iqdisc
    jabber:iq:privacy IQ queries processing +discipline (see A.1.1). +
    + + +

    A.10  mod_private

    + + +This module adds support of JEP-0049 (Private XML Storage).
    +
    +Options: +
    +iqdisc
    jabber:iq:private IQ queries processing +discipline (see A.1.1). +
    + + +

    A.11  mod_pubsub

    + + +This module implements JEP-0060 (Publish-Subscribe Service).
    +
    +Options: +
    +host
    Defines hostname of service +(see A.1.2). If not present +then prefix pubsub. is added to main ejabberd hostname. +
    served_hosts
    Specifies which hosts are served by the service. +If absent then only main ejabberd host is served. +
    +Example: +
    +  {modules,
    +   [
    +    ...
    +    {mod_pubsub, [{served_hosts, ["example.com",
    +                                  "example.org"]}]}
    +    ...
    +   ]}.
     
    -

    A.2  mod_register

    +

    A.12  mod_register

    -This module adds support for -JEP-0077 (In-Band -Registration). There is possible to restrict registration via ``register'' +This module adds support for JEP-0077 (In-Band Registration). +It is possible to restrict registration via ``register'' access rule. If this rule returns ``deny'' on requested user name, then registration is not allowed for it.

    Options:
    iqdisc
    jabber:iq:register IQ queries processing - discipline. +discipline (see A.1.1).
    Example:
    -% Deny registration for users with too short name
    -{acl, shortname, {user_glob, "?"}}.
    -{acl, shortname, {user_glob, "??"}}.
    -% Another variant: {acl, shortname, {user_regexp, "^..?$"}}.
    +  % Deny registration for users with too short name
    +  {acl, shortname, {user_glob, "?"}}.
    +  {acl, shortname, {user_glob, "??"}}.
    +  % Another variant: {acl, shortname, {user_regexp, "^..?$"}}.
     
    -{access, register, [{deny, shortname},
    -                    {allow, all}]}.
    +  {access, register, [{deny, shortname},
    +                      {allow, all}]}.
     
    -{modules, [
    -           ...
    -           {mod_register, []},
    -           ...
    -          ]}.
    +  {modules,
    +   [
    +    ...
    +    {mod_register, []},
    +    ...
    +   ]}.
     
    -

    A.3  mod_roster

    +

    A.13  mod_roster

    - - -

    A.4  mod_configure

    - - - - -

    A.5  mod_disco

    - - -This module adds support for -JEP-0030 (Service -Discovery).
    +This module implements roster management.

    Options:
    -iqdisc
    http://jabber.org/protocol/disco#items and - http://jabber.org/protocol/disco#info IQ queries processing discipline. -
    extra_domains
    List of domains that will be added to server - items reply +iqdisc
    jabber:iq:roster IQ queries processing +discipline (see A.1.1).
    -Example: -
    -{modules, [
    -           ...
    -           {mod_disco, [{extra_domains, ["jit.example.com",
    -                                         "etc.example.com"]}]},
    -           ...
    -          ]}.
    -
    -

    A.6  mod_stats

    +

    A.14  mod_stats

    -This module adds support for -JEP-0039 (Statistics -Gathering).
    +This module adds support for JEP-0039 (Statistics Gathering).

    Options:
    -iqdisc
    http://jabber.org/protocol/stats IQ queries - processing discipline. +iqdisc
    http://jabber.org/protocol/stats IQ queries processing +discipline (see A.1.1).
    TBD about access.

    - - -

    A.7  mod_vcard

    - - - - -

    A.8  mod_offline

    - - - - -

    A.9  mod_echo

    - - - - -

    A.10  mod_private

    - - -This module adds support of -JEP-0049 (Private XML -Storage).
    -
    -Options: -
    -iqdisc
    jabber:iq:private IQ queries processing discipline. -
    -

    A.11  mod_time

    +

    A.15  mod_time

    This module answers UTC time on jabber:iq:time queries.

    Options:
    -iqdisc
    jabber:iq:time IQ queries processing discipline. +iqdisc
    jabber:iq:time IQ queries processing +discipline (see A.1.1). +
    + + +

    A.16  mod_vcard

    + + +This module implements simple Jabber User Directory (based on user vCards) +and answers server vCard on vcard-temp queries.
    +
    +Options: +
    +host
    Defines hostname of service +(see A.1.2). If not present +then prefix vjud. is added to main ejabberd hostname. +
    iqdisc
    vcard-temp IQ queries processing +discipline (see A.1.1).
    -

    A.12  mod_version

    +

    A.17  mod_version

    This module answers ejabberd version on jabber:iq:version queries.

    Options:
    -iqdisc
    jabber:iq:version IQ queries processing discipline. +iqdisc
    jabber:iq:version IQ queries processing +discipline (see A.1.1).
    -

    B  I18n/L10n

    +

    B  I18n/L10n

    -Many modules supports xml:lang attribute inside IQ queries. E. g. -on figure 6 (compare it with figure 1) showed -reply on following query: +All built-in modules support xml:lang attribute inside IQ queries. +E. g. on figure 6 (compare it with figure 1) +showed reply on following query:
    -<iq id='5'
    -    to='e.localhost'
    -    type='get'>
    -  <query xmlns='http://jabber.org/protocol/disco#items'
    -         xml:lang='ru'/>
    -</iq>
    +  <iq id='5'
    +      to='e.localhost'
    +      type='get'
    +      xml:lang='ru'>
    +    <query xmlns='http://jabber.org/protocol/disco#items'/>
    +  </iq>
     

    diff --git a/doc/guide.tex b/doc/guide.tex index 1d9bbe9e0..c763710a7 100644 --- a/doc/guide.tex +++ b/doc/guide.tex @@ -1,9 +1,14 @@ -\documentclass[10pt]{article} +\documentclass[a4paper,10pt]{article} \usepackage{graphics} \usepackage{hevea} \usepackage{verbatim} +\usepackage[twosideshift=0pt]{geometry} + +\usepackage[pdftex,colorlinks,unicode,urlcolor=blue,linkcolor=blue,pdftitle=Ejabberd\ + Installation\ and\ Operation\ Guide,pdfauthor=Alexey\ + Shchepin,pdfsubject=ejabberd,pdfkeywords=ejabberd]{hyperref} \newcommand{\logoscale}{0.7} \newcommand{\imgscale}{0.58} @@ -16,30 +21,61 @@ \end{latexonly} } +\newcommand{\bracehack}{\def\{{\char"7B}\def\}{\char"7D}} + \newcommand{\ns}[1]{\texttt{#1}} +\newcommand{\jid}[1]{\texttt{#1}} +\newcommand{\option}[1]{\texttt{#1}} +\newcommand{\poption}[1]{{\bracehack\texttt{#1}}} +\newcommand{\node}[1]{\texttt{#1}} +\newcommand{\term}[1]{\texttt{#1}} +\newcommand{\shell}[1]{\texttt{#1}} \newcommand{\ejabberd}{\texttt{ejabberd}} \newcommand{\Jabber}{Jabber} -\newcommand{\modregister}{\texttt{mod\_register}} -\newcommand{\modroster}{\texttt{mod\_roster}} -\newcommand{\modconfigure}{\texttt{mod\_configure}} -\newcommand{\moddisco}{\texttt{mod\_disco}} -\newcommand{\modstats}{\texttt{mod\_stats}} -\newcommand{\modvcard}{\texttt{mod\_vcard}} -\newcommand{\modoffline}{\texttt{mod\_offline}} -\newcommand{\modecho}{\texttt{mod\_echo}} -\newcommand{\modprivate}{\texttt{mod\_private}} -\newcommand{\modtime}{\texttt{mod\_time}} -\newcommand{\modversion}{\texttt{mod\_version}} -c -%\setcounter{tocdepth}{3} +\newcommand{\module}[1]{\texttt{#1}} +\newcommand{\modconfigure}{\module{mod\_configure}} +\newcommand{\moddisco}{\module{mod\_disco}} +\newcommand{\modirc}{\module{mod\_irc}} +\newcommand{\modlast}{\module{mod\_last}} +\newcommand{\modmuc}{\module{mod\_muc}} +\newcommand{\modecho}{\module{mod\_echo}} +\newcommand{\modoffline}{\module{mod\_offline}} +\newcommand{\modprivacy}{\module{mod\_privacy}} +\newcommand{\modprivate}{\module{mod\_private}} +\newcommand{\modpubsub}{\module{mod\_pubsub}} +\newcommand{\modregister}{\module{mod\_register}} +\newcommand{\modroster}{\module{mod\_roster}} +\newcommand{\modstats}{\module{mod\_stats}} +\newcommand{\modtime}{\module{mod\_time}} +\newcommand{\modvcard}{\module{mod\_vcard}} +\newcommand{\modversion}{\module{mod\_version}} +\newcommand{\titem}[1]{\item[\bracehack\texttt{#1}]} + +%\setcounter{tocdepth}{3} +\begin{latexonly} +\global\parskip=9pt plus 3pt minus 1pt +\global\parindent=0pt + +\gdef\ahrefurl#1{\href{#1}{\texttt{#1}}} +\gdef\footahref#1#2{#2\footnote{\href{#1}{\texttt{#1}}}} +\end{latexonly} + +\newcommand{\tjepref}[2]{\footahref{http://www.jabber.org/jeps/jep-#1.html}{#2}} +\newcommand{\jepref}[1]{\tjepref{#1}{JEP-#1}} + +\newcommand{\iqdiscitem}[1]{\titem{iqdisc} #1 IQ queries processing +discipline (see~\ref{sec:modiqdiscoption}).} +\newcommand{\hostitem}[1]{\titem{host} Defines hostname of service +(see~\ref{sec:modhostoption}). If not present +then prefix \jid{#1.} is added to main \ejabberd{} hostname.} \title{Ejabberd Installation and Operation Guide} \author{Alexey Shchepin \\ \ahrefurl{mailto:alexey@sevcom.net} \\ \ahrefurl{xmpp:aleksey@jabber.ru}} -\date{May 8, 2004} +\date{June 24, 2004} \begin{document} \begin{titlepage} @@ -58,44 +94,35 @@ c \label{sec:intro} \ejabberd{} is a Free and Open Source fault-tolerant distributed \Jabber{} -server. It is writen mostly in Erlang. +server. It is written mostly in Erlang. -The main features of \ejabberd{} is: +The main features of \ejabberd{} are: \begin{itemize} \item Works on most of popular platforms: *nix (tested on Linux, FreeBSD and NetBSD) and Win32 -\item Distributed: You can run \ejabberd{} on a cluster of machines and all of - them will serve one Jabber domain. +\item Distributed: You can run \ejabberd{} on a cluster of machines to let all of + them serve one Jabber domain. \item Fault-tolerance: You can setup an \ejabberd{} cluster so that all the information required for a properly working service will be stored permanently on more than one node. This means that if one of the nodes crashes, then the others will continue working without disruption. - You can also add or replace more nodes ``on the fly''. -\item Built-in \footahref{http://www.jabber.org/jeps/jep-0045.html}{Multi-User - Chat} service + You can also add or replace nodes ``on the fly''. +\item Built-in \tjepref{0045}{Multi-User Chat} service \item Built-in IRC transport -\item Built-in - \footahref{http://www.jabber.org/jeps/jep-0060.html}{Publish-Subscribe} - service +\item Built-in \tjepref{0060}{Publish-Subscribe} service \item Built-in Jabber Users Directory service based on users vCards -\item Built-in - \footahref{http://www.jabber.org/jeps/jep-0025.html}{HTTP Polling} - service +\item Built-in \tjepref{0025}{HTTP Polling} service \item SSL support \item Support for LDAP authentification -\item Ability to interface with external components (JIT, MSN-t, Yahoo-t, etc) +\item Ability to interface with external components (JIT, MSN-t, Yahoo-t, etc.) \item Migration from jabberd14 is possible \item Mostly XMPP-compliant -\item Support for - \footahref{http://www.jabber.org/jeps/jep-0030.html}{JEP-0030} - (Service Discovery). -\item Support for - \footahref{http://www.jabber.org/jeps/jep-0039.html}{JEP-0039} - (Statistics Gathering). +\item Support for \jepref{0030} (Service Discovery). +\item Support for \jepref{0039} (Statistics Gathering). \item Support for \ns{xml:lang} \end{itemize} -The misfeatures of \ejabberd{} is: +The misfeatures of \ejabberd{} are: \begin{itemize} \item No support for virtual domains \item No support for STARTTLS @@ -105,7 +132,6 @@ The misfeatures of \ejabberd{} is: \section{Installation} \label{sec:installation} - \subsection{Installation Requirements} \label{sec:installreq} @@ -126,13 +152,13 @@ To compile \ejabberd{}, you will need the following packages: To compile \ejabberd{} in MS Windows environment, you will need the following packages: \begin{itemize} -\item MS Visual C++~6.0 Compiler -\item \footahref{http://www.erlang.org/download/otp_win32_R9C-0.exe}{Erlang emulator version~5.3} -\item \footahref{http://prdownloads.sourceforge.net/expat/expat_win32bin_1_95_7.exe?download}{Expat~1.95.7} +\item MS Visual C++ 6.0 Compiler +\item \footahref{http://www.erlang.org/download/otp\_win32\_R9C-0.exe}{Erlang/OTP R9C-0} +\item \footahref{http://prdownloads.sourceforge.net/expat/expat\_win32bin\_1\_95\_7.exe?download}{Expat 1.95.7} \item -\footahref{http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.9.1.tar.gz}{Iconv~1.9.1} +\footahref{http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.9.1.tar.gz}{Iconv 1.9.1} (optional) -\item \footahref{http://www.slproweb.com/download/Win32OpenSSL-v0.9.7d.exe}{Shining Light OpenSSL} +\item \footahref{http://www.slproweb.com/products/Win32OpenSSL.html}{Shining Light OpenSSL} (to enable SSL connections) \end{itemize} @@ -140,16 +166,16 @@ packages: \subsection{Obtaining} \label{sec:obtaining} -Currently no stable version has been released. +Stable \ejabberd{} release can be obtained at +\ahrefurl{http://www.jabberstudio.org/projects/ejabberd/releases/}. The latest alpha version can be retrieved from CVS\@. -\begin{itemize} -\item \texttt{export CVSROOT=:pserver:anonymous@jabberstudio.org:/home/cvs} -\item \texttt{cvs login} -\item Press Enter when asked for a password -\item \texttt{cvs -z3 co ejabberd} -\end{itemize} - +\begin{verbatim} + export CVSROOT=:pserver:anonymous@jabberstudio.org:/home/cvs + cvs login + + cvs -z3 co ejabberd +\end{verbatim} \subsection{Compilation} @@ -158,22 +184,29 @@ The latest alpha version can be retrieved from CVS\@. \label{sec:compilationunix} \begin{verbatim} -./configure -make + ./configure + make + su + make install \end{verbatim} -TBD +This will install \ejabberd{} to \verb|/var/lib/ejabberd| directory, +\verb|ejabberd.cfg| to \verb|/etc/ejabberd| directory and create +\verb|/var/log/ejabberd| directory for log files. \subsubsection{Windows} \label{sec:compilationwin} -\begin{enumerate} +\begin{itemize} \item Install Erlang emulator (for example, into \verb|C:\Program Files\erl5.3|). \item Install Expat library into \verb|C:\Program Files\Expat-1.95.7| - directory. Copy file \verb|C:\Program Files\Expat-1.95.7\Libs\libexpat.dll| + directory. + + Copy file \verb|C:\Program Files\Expat-1.95.7\Libs\libexpat.dll| to your Windows system directory (for example, \verb|C:\WINNT| or \verb|C:\WINNT\System32|) \item Build and install Iconv library into \verb|C:\Program Files\iconv-1.9.1| directory. + Copy file \verb|C:\Program Files\iconv-1.9.1\bin\iconv.dll| to your Windows system directory. @@ -184,15 +217,14 @@ TBD variable. \item Being in \verb|ejabberd\src| directory run: \begin{verbatim} -configure +configure.bat nmake -f Makefile.win32 \end{verbatim} \item Edit file \verb|ejabberd\src\ejabberd.cfg| and run \begin{verbatim} werl -s ejabberd -name ejabberd \end{verbatim} -\item Enjoy! -\end{enumerate} +\end{itemize} %\subsection{Initial Configuration} %\label{sec:initconfig} @@ -203,39 +235,49 @@ werl -s ejabberd -name ejabberd To start \ejabberd{}, use the following command: \begin{verbatim} -erl -name ejabberd -s ejabberd + erl -pa /var/lib/ejabberd/ebin -name ejabberd -s ejabberd \end{verbatim} or \begin{verbatim} -erl -sname ejabberd -s ejabberd + erl -pa /var/lib/ejabberd/ebin -sname ejabberd -s ejabberd \end{verbatim} -In second case Erlang node will be identified using only first part of host -name, i.\,e. other Erlang nodes not inside this domain can't contact this node. +In the latter case Erlang node will be identified using only first part of host +name, i.\,e. other Erlang nodes outside this domain can't contact this node. -To specify path to config file, use command like this: +Note that when using above command \ejabberd{} will search for config file +in current directory and will use current directory for storing user database +and logging. + +To specify path to config file, log files and Mnesia database directory, +you may use the following command: \begin{verbatim} -erl -sname ejabberd -s ejabberd -ejabberd config \"/etc/ejabberd/ejabberd.cfg\" + erl -pa /var/lib/ejabberd/ebin \ + -sname ejabberd \ + -s ejabberd \ + -ejabberd config \"/etc/ejabberd/ejabberd.cfg\" \ + log_path \"/var/log/ejabberd/ejabberd.log\" \ + -sasl sasl_error_logger \{file,\"/var/log/ejabberd/sasl.log\"\} \ + -mnesia dir \"/var/lib/ejabberd/spool\" \end{verbatim} +You can find other useful options in Erlang manual page (\shell{erl -man erl}). -To use more than 1024 connections, you will need to set environment variable +To use more than 1024 connections, you should set environment variable \verb|ERL_MAX_PORTS|: \begin{verbatim} -export ERL_MAX_PORTS=32000 + export ERL_MAX_PORTS=32000 \end{verbatim} Note that with this value \ejabberd{} will use more memory (approximately 6MB more). -To reduce memory usage, you can set environment variable +To reduce memory usage, you may set environment variable \verb|ERL_FULLSWEEP_AFTER|: \begin{verbatim} -export ERL_FULLSWEEP_AFTER=0 + export ERL_FULLSWEEP_AFTER=0 \end{verbatim} But in this case \ejabberd{} can start to work slower. - - \section{Configuration} \label{sec:configuration} @@ -245,10 +287,10 @@ But in this case \ejabberd{} can start to work slower. %\verbatiminput{../src/ejabberd.cfg} The configuration file is initially loaded the first time \ejabberd{} is -executed, when it is parsed and stored in a database. Subsiquently the +executed, when it is parsed and stored in a database. Subsequently the configuration is loaded from the database and any commands in the configuration file are appended to the entries in the database. The configuration file -consists of a sequence of Erlang terms. Parts of lines after \texttt{`\%'} sign +consists of a sequence of Erlang terms. Parts of lines after \term{`\%'} sign are ignored. Each term is tuple, where first element is name of option, and other are option values. E.\,g.\ if this file does not contain a ``host'' definition, then old value stored in the database will be used. @@ -257,9 +299,9 @@ definition, then old value stored in the database will be used. To override old values stored in the database the following lines can be added in config: \begin{verbatim} -override_global. -override_local. -override_acls. + override_global. + override_local. + override_acls. \end{verbatim} With this lines old global or local options or ACLs will be removed before adding new ones. @@ -268,145 +310,140 @@ adding new ones. \subsubsection{Host Name} \label{sec:confighostname} -Option \texttt{hostname} defines name of \Jabber{} domain that \ejabberd{} -serves. E.\,g.\ to use \texttt{jabber.org} domain add following line in config: +Option \option{hostname} defines name of \Jabber{} domain that \ejabberd{} +serves. E.\,g.\ to use \jid{jabber.org} domain add following line in config: \begin{verbatim} -{host, "jabber.org"}. + {host, "jabber.org"}. \end{verbatim} %This option is mandatory. - \subsubsection{Access Rules} \label{sec:configaccess} Access control in \ejabberd{} is performed via Access Control Lists (ACL). The declarations of ACL in config file have following syntax: \begin{verbatim} -{acl, , {, ...}}. + {acl, , {, ...}}. \end{verbatim} -\texttt{} can be one of following: +\term{} can be one of following: \begin{description} -\item[\texttt{all}] Matches all JIDs. Example: +\titem{all} Matches all JIDs. Example: \begin{verbatim} {acl, all, all}. \end{verbatim} -\item[\texttt{\{user, \}}] Matches local user with name - \texttt{}. Example: +\titem{\{user, \}} Matches local user with name + \term{}. Example: \begin{verbatim} {acl, admin, {user, "aleksey"}}. \end{verbatim} -\item[\texttt{\{user, , \}}] Matches user with JID - \texttt{@} and any resource. Example: +\titem{\{user, , \}} Matches user with JID + \term{@} and any resource. Example: \begin{verbatim} {acl, admin, {user, "aleksey", "jabber.ru"}}. \end{verbatim} -\item[\texttt{\{server, \}}] Matches any JID from server - \texttt{}. Example: +\titem{\{server, \}} Matches any JID from server + \term{}. Example: \begin{verbatim} {acl, jabberorg, {server, "jabber.org"}}. \end{verbatim} -\item[\texttt{\{user\_regexp, \}}] Matches local user with name that - matches \texttt{}. Example: +\titem{\{user\_regexp, \}} Matches local user with name that + matches \term{}. Example: \begin{verbatim} {acl, tests, {user, "^test[0-9]*$"}}. \end{verbatim} %$ -\item[\texttt{\{user\_regexp, , \}}] Matches user with name - that matches \texttt{} and from server \texttt{}. Example: +\titem{\{user\_regexp, , \}} Matches user with name + that matches \term{} and from server \term{}. Example: \begin{verbatim} {acl, tests, {user, "^test", "localhost"}}. \end{verbatim} -\item[\texttt{\{server\_regexp, \}}] Matches any JID from server that - matches \texttt{}. Example: +\titem{\{server\_regexp, \}} Matches any JID from server that + matches \term{}. Example: \begin{verbatim} {acl, icq, {server, "^icq\\."}}. \end{verbatim} -\item[\texttt{\{node\_regexp, , \}}] Matches user - with name that matches \texttt{} and from server that matches - \texttt{}. Example: +\titem{\{node\_regexp, , \}} Matches user + with name that matches \term{} and from server that matches + \term{}. Example: \begin{verbatim} -{acl, aleksey, {node_regexp, "^aleksey", "^jabber.(ru|org)$"}}. +{acl, aleksey, {node_regexp, "^aleksey$", "^jabber.(ru|org)$"}}. \end{verbatim} -%$ -\item[\texttt{\{user\_glob, \}}] -\item[\texttt{\{user\_glob, , \}}] -\item[\texttt{\{server\_glob, \}}] -\item[\texttt{\{node\_glob, , \}}] This is same as +\titem{\{user\_glob, \}} +\titem{\{user\_glob, , \}} +\titem{\{server\_glob, \}} +\titem{\{node\_glob, , \}} This is same as above, but uses shell glob patterns instead of regexp. These patterns can have following special characters: \begin{description} - \item[\texttt{*}] matches any string including the null string. - \item[\texttt{?}] matches any single character. - \item[\texttt{[\ldots{}]}] matches any of the enclosed characters. Character - ranges are specified by a pair of characters separated by a \texttt{`-'}. - If the first character after \texttt{`['} is a \texttt{`!'}, then any + \titem{*} matches any string including the null string. + \titem{?} matches any single character. + \titem{[...]} matches any of the enclosed characters. Character + ranges are specified by a pair of characters separated by a \term{`-'}. + If the first character after \term{`['} is a \term{`!'}, then any character not enclosed is matched. \end{description} \end{description} The following ACLs pre-defined: \begin{description} -\item[\texttt{all}] Matches all JIDs. -\item[\texttt{none}] Matches none JIDs. +\titem{all} Matches all JIDs. +\titem{none} Matches none JIDs. \end{description} An entry allowing or denying different services would look similar to this: \begin{verbatim} -{access, , [{allow, }, - {deny, }, - ... - ]}. + {access, , [{allow, }, + {deny, }, + ... + ]}. \end{verbatim} -When a JID is checked to have access to \texttt{}, the server +When a JID is checked to have access to \term{}, the server sequentially checks if this JID mathes one of the ACLs that are second elements in each tuple in list. If it is matched, then the first element of matched -tuple is returned else ``\texttt{deny}'' is returned. +tuple is returned else ``\term{deny}'' is returned. Example: \begin{verbatim} -{access, configure, [{allow, admin}]}. -{access, something, [{deny, badmans}, - {allow, all}]}. + {access, configure, [{allow, admin}]}. + {access, something, [{deny, badmans}, + {allow, all}]}. \end{verbatim} Following access rules pre-defined: \begin{description} -\item[\texttt{all}] Always return ``\texttt{allow}'' -\item[\texttt{none}] Always return ``\texttt{deny}'' +\titem{all} Always return ``\term{allow}'' +\titem{none} Always return ``\term{deny}'' \end{description} - \subsubsection{Shapers Configuration} \label{sec:configshaper} With shapers is possible to bound connection traffic. The declarations of shapers in config file have following syntax: \begin{verbatim} -{shaper, , }. + {shaper, , }. \end{verbatim} -Currently implemented only one kind of shaper: \texttt{maxrate}. It have +Currently implemented only one kind of shaper: \term{maxrate}. It have following syntax: \begin{verbatim} -{maxrate, } + {maxrate, } \end{verbatim} -where \texttt{} means maximum allowed incomig rate in bytes/second. -E.\,g.\ to define shaper with name ``\texttt{normal}'' and maximum allowed rate +where \term{} means maximum allowed incomig rate in bytes/second. +E.\,g.\ to define shaper with name ``\term{normal}'' and maximum allowed rate 1000\,bytes/s, add following line in config: \begin{verbatim} -{shaper, normal, {maxrate, 1000}}. + {shaper, normal, {maxrate, 1000}}. \end{verbatim} - - \subsubsection{Listened Sockets} \label{sec:configlistened} -Option \texttt{listen} defines list of listened sockets and what services +Option \option{listen} defines list of listened sockets and what services runned on them. Each element of list is a tuple with following elements: \begin{itemize} \item Port number; @@ -414,105 +451,125 @@ runned on them. Each element of list is a tuple with following elements: \item Options to this module. \end{itemize} -Currently three modules are implemented: +Currently these modules are implemented: \begin{description} -\item[\verb|ejabberd_c2s|] This module serves C2S connections. + \titem{ejabberd\_c2s} This module serves C2S connections. The following options are defined: \begin{description} - \item[\verb|{access, }|] This option defines access of users - to this C2S port. Default value is ``\texttt{all}''. - \item[\verb|{shaper, }|] This option is like previous, but - use shapers instead of ``\texttt{allow}'' and ``\texttt{deny}''. Default - value is ``\texttt{none}''. - \item[\verb|{ip, IPAddress}|] This option specifies which network interface to - listen on. - \item[\verb|inet6|] Set up the socket for IPv6. - \item[\verb|ssl|] This option specifies that traffic on this port will be + \titem{\{access, \}} This option defines access of users + to this C2S port. Default value is ``\term{all}''. + \titem{\{shaper, \}} This option is like previous, but + use shapers instead of ``\term{allow}'' and ``\term{deny}''. Default + value is ``\term{none}''. + \titem{\{ip, IPAddress\}} This option specifies which network interface to + listen on. For example \verb|{ip, {192, 168, 1, 1}}|. + \titem{inet6} Set up the socket for IPv6. + \titem{ssl} This option specifies that traffic on this port will be encrypted using SSL. You should also set ``\verb|certfile|'' option. - \item[\verb|{certfile, Path}|] Path to a file containing the SSL certificate. + \titem{\{certfile, Path\}} Path to a file containing the SSL certificate. + \end{description} + \titem{ejabberd\_s2s\_in} This module serves incoming S2S connections. + \titem{ejabberd\_service} This module serves connections from \Jabber{} + services (i.\,e.\ that use the \ns{jabber:component:accept} namespace). + + The following additional options are defined for \term{ejabberd\_service} + (options \option{access}, \option{shaper}, \option{ip}, \option{inet6} are + still valid): + \begin{description} + \titem{\{host, Hostname, [HostOptions]\}} This option defines hostname of connected + service and allows to specify additional options, e.\,g.\ + \poption{\{password, Secret\}}. + \titem{\{hosts, [Hostnames], [HostOptions]\}} The same as above, but allows to + specify several hostnames. + \end{description} + \titem{ejabberd\_http} This module serves incoming HTTP connections. + + The following options are defined: + \begin{description} + \titem{http\_poll} This option enables \tjepref{0025}{HTTP Polling} . + support. It is available then at \verb|http://server:port/http-poll/|. + + \titem{web\_admin} This option enables web-based interface for \ejabberd{} + administration which is available at \verb|http://server:port/admin/|, + login and password should be equal to username and password of one of + registered users who have permission defined in ``configure'' access rule. \end{description} -\item[\verb|ejabberd_s2s_in|] This module serves incoming S2S connections. -\item[\verb|ejabberd_service|] This module serves connections from \Jabber{} - services (i.\,e.\ that use the \texttt{jabber:component:accept} namespace). \end{description} For example, the following configuration defines that: \begin{itemize} \item C2S connections are listened on port 5222 and 5223 (SSL) and denied for - user ``\texttt{bad}'' + user ``\term{bad}'' \item S2S connections are listened on port 5269 +\item HTTP connections are listened on port 5280 and administration interface + and HTTP Polling support are enabled \item All users except admins have traffic limit 1000\,B/s -\item AIM service \texttt{aim.example.org} is connected to port 5233 with - password ``\texttt{aimsecret}'' -\item JIT services \texttt{icq.example.org} and \texttt{sms.example.org} are - connected to port 5234 with password ``\texttt{jitsecret}'' -\item MSN service \texttt{msn.example.org} is connected to port 5235 with - password ``\texttt{msnsecret}'' -\item YAHOO service \texttt{yahoo.example.org} is connected to port 5236 with - password ``\texttt{yahoosecret}'' -\item ILE service \texttt{ile.example.org} is connected to port 5237 with - password ``\texttt{ilesecret}'' +\item AIM service \jid{aim.example.org} is connected to port 5233 with + password ``\term{aimsecret}'' +\item JIT services \jid{icq.example.org} and \jid{sms.example.org} are + connected to port 5234 with password ``\term{jitsecret}'' +\item MSN service \jid{msn.example.org} is connected to port 5235 with + password ``\term{msnsecret}'' +\item Yahoo! service \jid{yahoo.example.org} is connected to port 5236 with + password ``\term{yahoosecret}'' +\item ILE service \jid{ile.example.org} is connected to port 5237 with + password ``\term{ilesecret}'' \end{itemize} -\begin{verbatim} -{acl, blocked, {user, "bad"}}. -{access, c2s, [{deny, blocked}, - {allow, all}]}. -{shaper, normal, {maxrate, 1000}}. -{access, c2s_shaper, [{none, admin}, - {normal, all}]}. -{listen, - [{5222, ejabberd_c2s, [{access, c2s}, {shaper, c2s_shaper}]}, - {5223, ejabberd_c2s, [{access, c2s}, - ssl, {certfile, "/path/to/ssl.pem"}]}, - {5269, ejabberd_s2s_in, []}, - {5233, ejabberd_service, [{host, "aim.example.org", - [{password, "aimsecret"}]}]}, - {5234, ejabberd_service, [{hosts, ["icq.example.org", "sms.example.org"], - [{password, "jitsecret"}]}]}, - {5235, ejabberd_service, [{host, "msn.example.org", - [{password, "msnsecret"}]}]}, - {5236, ejabberd_service, [{host, "yahoo.example.org", - [{password, "yahoosecret"}]}]}, - {5237, ejabberd_service, [{host, "gg.example.org", - [{password, "ggsecret"}]}]}, - {5238, ejabberd_service, [{host, "ile.example.org", - [{password, "ilesecret"}]}]} - ] -}. + \begin{verbatim} + {acl, blocked, {user, "bad"}}. + {access, c2s, [{deny, blocked}, + {allow, all}]}. + {shaper, normal, {maxrate, 1000}}. + {access, c2s_shaper, [{none, admin}, + {normal, all}]}. + {listen, + [{5222, ejabberd_c2s, [{access, c2s}, {shaper, c2s_shaper}]}, + {5223, ejabberd_c2s, [{access, c2s}, + ssl, {certfile, "/path/to/ssl.pem"}]}, + {5269, ejabberd_s2s_in, []}, + {5280, ejabberd_http, [http_poll, web_admin]}, + {5233, ejabberd_service, [{host, "aim.example.org", + [{password, "aimsecret"}]}]}, + {5234, ejabberd_service, [{hosts, ["icq.example.org", "sms.example.org"], + [{password, "jitsecret"}]}]}, + {5235, ejabberd_service, [{host, "msn.example.org", + [{password, "msnsecret"}]}]}, + {5236, ejabberd_service, [{host, "yahoo.example.org", + [{password, "yahoosecret"}]}]}, + {5237, ejabberd_service, [{host, "gg.example.org", + [{password, "ggsecret"}]}]}, + {5238, ejabberd_service, [{host, "ile.example.org", + [{password, "ilesecret"}]}]} + ] + }. \end{verbatim} -Note, that for jabberd14- or wpjabberd-based services you need to make the -transports log and do xdb by themselves: +Note, that for jabberd14- or wpjabberd-based services you have to make the +transports log and do XDB by themselves: \begin{verbatim} - + %d: [%t] (%h): %s - /var/log/jabber/error/aim-t.log - - - - - record - %d %h %s - /var/log/jabber/record/aim-t.log + /var/log/jabber/service.log - /usr/lib/jabber/xdb_file.so + + /usr/lib/jabber/xdb_file.so /var/spool/jabber @@ -524,26 +581,31 @@ transports log and do xdb by themselves: \subsubsection{Modules} \label{sec:configmodules} -Option \texttt{modules} defines the list of modules that will be loaded after +Option \term{modules} defines the list of modules that will be loaded after \ejabberd{} startup. Each list element is a tuple where first element is a name of a module and second is list of options to this module. See section~\ref{sec:modules} for detailed information on each module. Example: \begin{verbatim} -{modules, [ - {mod_register, []}, - {mod_roster, []}, - {mod_configure, []}, - {mod_disco, []}, - {mod_stats, []}, - {mod_vcard, []}, - {mod_offline, []}, - {mod_echo, [{host, "echo.localhost"}]}, - {mod_private, []}, - {mod_time, [{iqdisc, no_queue}]}, - {mod_version, []} - ]}. + {modules, + [{mod_register, []}, + {mod_roster, []}, + {mod_privacy, []}, + {mod_configure, []}, + {mod_disco, []}, + {mod_stats, []}, + {mod_vcard, []}, + {mod_offline, []}, + {mod_echo, [{host, "echo.localhost"}]}, + {mod_private, []}, + {mod_irc, []}, + {mod_muc, []}, + {mod_pubsub, []}, + {mod_time, [{iqdisc, no_queue}]}, + {mod_last, []}, + {mod_version, []} + ]}. \end{verbatim} @@ -555,14 +617,12 @@ To perform online reconfiguration of \ejabberd{} you will need to have recommended to load \moddisco{} as well (see section~\ref{sec:moddisco}), because \modconfigure{} is highly integrated with it. Additionally it is recommended to use a disco- and xdata-capable client such as -\footahref{http://www.jabber.ru/projects/tkabber/index\_en.html}{Tkabber} +\footahref{http://tkabber.jabber.ru/}{Tkabber} (which was developed synchronously with \ejabberd{}, its CVS version supports most of \ejabberd{} features). - - -On disco query \ejabberd{} returns following items: +On disco query \ejabberd{} returns following items (see figure~\ref{fig:disco}): \begin{itemize} \item Identity of server. \item List of features, including defined namespaces. @@ -576,13 +636,13 @@ On disco query \ejabberd{} returns following items: \label{fig:disco} \end{figure} -\subsubsection{Node \texttt{config}: Global Configuration} +\subsubsection{Node \node{config}: Global Configuration} -Under this node the following nodes exists: +Under this node the following nodes exist: -\paragraph{Node \texttt{config/hostname}} +\paragraph{Node \node{config/hostname}} -Via \ns{jabber:x:data} queries to this node possible to change host name of +Via \ns{ejabberd:config} queries to this node possible to change host name of this \ejabberd{} server. (See figure~\ref{fig:hostname}) (Currently this works correctly only after a restart) \begin{figure}[htbp] @@ -592,10 +652,9 @@ correctly only after a restart) \label{fig:hostname} \end{figure} +\paragraph{Node \node{config/acls}} -\paragraph{Node \texttt{config/acls}} - -Via \ns{jabber:x:data} queries to this node it is possible to edit ACLs list. +Via \ns{ejabberd:config} queries to this node it is possible to edit ACLs list. (See figure~\ref{fig:acls}) \begin{figure}[htbp] \centering @@ -605,27 +664,21 @@ Via \ns{jabber:x:data} queries to this node it is possible to edit ACLs list. \end{figure} -\paragraph{Node \texttt{config/access}} +\paragraph{Node \node{config/access}} -Via \ns{jabber:x:data} queries to this node it is possible to edit access +Via \ns{ejabberd:config} queries to this node it is possible to edit access rules. -\paragraph{Node \texttt{config/remusers}} +\paragraph{Node \node{config/remusers}} -Via \ns{jabber:x:data} queries to this node it is possible to remove users. If +Via \ns{ejabberd:config} queries to this node it is possible to remove users. If removed user is online, then he will be disconnected. Also user-related data (e.g. his roster) is removed (but appropriate module must be loaded). +\subsubsection{Node \node{online users}: List of Online Users} - - -\subsubsection{Node \texttt{online users}: List of Online Users} - - - - -\subsubsection{Node \texttt{all users}: List of Registered Users} +\subsubsection{Node \node{all users}: List of Registered Users} \begin{figure}[htbp] \centering @@ -635,9 +688,9 @@ removed user is online, then he will be disconnected. Also user-related data \end{figure} -\subsubsection{Node \texttt{outgoing s2s}: List of Outgoing S2S connections} +\subsubsection{Node \node{outgoing s2s}: List of Outgoing S2S connections} -\subsubsection{Node \texttt{running nodes}: List of Running \ejabberd{} Nodes} +\subsubsection{Node \node{running nodes}: List of Running \ejabberd{} Nodes} \begin{figure}[htbp] \centering @@ -646,7 +699,7 @@ removed user is online, then he will be disconnected. Also user-related data \label{fig:discorunnodes} \end{figure} -\subsubsection{Node \texttt{stopped nodes}: List of Stopped Nodes} +\subsubsection{Node \node{stopped nodes}: List of Stopped Nodes} @@ -663,18 +716,14 @@ TBD \subsection{How it works} \label{sec:howitworks} - - A \Jabber{} domain is served by one or more \ejabberd{} nodes. These nodes can be run on different machines that are connected via a network. They all must have the ability to connect to port 4369 of all another nodes, and must have the same magic cookie (see Erlang/OTP documentation, in other words the file -\texttt{\~{}ejabberd/.erlang.cookie} must be the same on all nodes). This is +\term{\~{}ejabberd/.erlang.cookie} must be the same on all nodes). This is needed because all nodes exchange information about connected users, S2S connections, registered services, etc\ldots - - Each \ejabberd{} node have following modules: \begin{itemize} \item router; @@ -720,7 +769,6 @@ it is routed to the process that serves this connection, and if a connection does not exist, then it is opened and registered. - \appendix{} \section{Built-in Modules} @@ -732,22 +780,23 @@ does not exist, then it is opened and registered. The following options are used by many modules, so they are described in separate section. -\subsubsection{Option \texttt{iqdisc}} +\subsubsection{Option \option{iqdisc}} +\label{sec:modiqdiscoption} Many modules define handlers for processing IQ queries of different namespaces -to this server or to user (e.\,g.\ to \texttt{example.org} or to -\texttt{user@example.org}). This option defines processing discipline of +to this server or to user (e.\,g.\ to \jid{example.org} or to +\jid{user@example.org}). This option defines processing discipline of these queries. Possible values are: \begin{description} -\item[\texttt{no\_queue}] All queries of namespace with this processing +\titem{no\_queue} All queries of namespace with this processing discipline processed immediately. This also means that no other packets can be processed until finished this. Hence this discipline is not recommended - if processing of query can take relative many time. -\item[\texttt{one\_queue}] In this case created separate queue for processing + if processing of query can take relatively long time. +\titem{one\_queue} In this case created separate queue for processing of IQ queries of namespace with this discipline, and processing of this queue is done in parallel with processing of other packets. This discipline is most recommended. -\item[\texttt{parallel}] In this case for all packets with this discipline +\titem{parallel} In this case for all packets with this discipline spawned separate Erlang process, so all these packets processed in parallel. Although spawning of Erlang process have relatively low cost, this can broke server normal work, because Erlang emulator have limit on number of processes @@ -756,143 +805,241 @@ these queries. Possible values are: Example: \begin{verbatim} -{modules, [ - ... - {mod_time, [{iqdisc, no_queue}]}, - ... - ]}. + {modules, + [ + ... + {mod_time, [{iqdisc, no_queue}]}, + ... + ]}. \end{verbatim} +\subsubsection{Option \option{host}} +\label{sec:modhostoption} -\subsubsection{Option \texttt{host}} - -Some modules may act as services, and wants to have different domain name. -This option explicitly defines this name. +This option explicitly defines hostname for the module which acts as a service. Example: \begin{verbatim} -{modules, [ - ... - {mod_echo, [{host, "echo.example.org"}]}, - ... - ]}. + {modules, + [ + ... + {mod_echo, [{host, "echo.example.org"}]}, + ... + ]}. \end{verbatim} - -\subsection{\modregister{}} -\label{sec:modregister} - -This module adds support for -\footahref{http://www.jabber.org/jeps/jep-0077.html}{JEP-0077} (In-Band -Registration). There is possible to restrict registration via ``register'' -access rule. If this rule returns ``deny'' on requested user name, then -registration is not allowed for it. - -Options: -\begin{description} -\item[\texttt{iqdisc}] \ns{jabber:iq:register} IQ queries processing - discipline. -\end{description} - -Example: -\begin{verbatim} -% Deny registration for users with too short name -{acl, shortname, {user_glob, "?"}}. -{acl, shortname, {user_glob, "??"}}. -% Another variant: {acl, shortname, {user_regexp, "^..?$"}}. - -{access, register, [{deny, shortname}, - {allow, all}]}. - -{modules, [ - ... - {mod_register, []}, - ... - ]}. -\end{verbatim} - - - - -\subsection{\modroster{}} -\label{sec:modroster} - - - \subsection{\modconfigure{}} \label{sec:modconfigure} +Options: +\begin{description} +\iqdiscitem{\ns{ejabberd:config}} +\end{description} \subsection{\moddisco{}} \label{sec:moddisco} -This module adds support for -\footahref{http://www.jabber.org/jeps/jep-0030.html}{JEP-0030} (Service -Discovery). +This module adds support for \jepref{0030} (Service Discovery). Options: \begin{description} -\item[\texttt{iqdisc}] \ns{http://jabber.org/protocol/disco#items} and - \ns{http://jabber.org/protocol/disco#info} IQ queries processing discipline. -\item[\texttt{extra\_domains}] List of domains that will be added to server +\iqdiscitem{\ns{http://jabber.org/protocol/disco\#items} and + \ns{http://jabber.org/protocol/disco\#info}} +\titem{extra\_domains} List of domains that will be added to server items reply \end{description} Example: \begin{verbatim} -{modules, [ - ... - {mod_disco, [{extra_domains, ["jit.example.com", - "etc.example.com"]}]}, - ... - ]}. + {modules, + [ + ... + {mod_disco, [{extra_domains, ["jit.example.com", + "etc.example.com"]}]}, + ... + ]}. \end{verbatim} -\subsection{\modstats{}} -\label{sec:modstats} - -This module adds support for -\footahref{http://www.jabber.org/jeps/jep-0039.html}{JEP-0039} (Statistics -Gathering). - -Options: -\begin{description} -\item[\texttt{iqdisc}] \ns{http://jabber.org/protocol/stats} IQ queries - processing discipline. -\end{description} - -TBD about access. - -\subsection{\modvcard{}} -\label{sec:modvcard} - - - -\subsection{\modoffline{}} -\label{sec:modoffline} - - - \subsection{\modecho{}} \label{sec:modecho} +This module acts as a service and simply returns to sender any \Jabber{} packet. Module may be +useful for debugging. + +Options: +\begin{description} +\hostitem{echo} +\end{description} + + +\subsection{\modirc{}} +\label{sec:modirc} + +This module implements IRC transport. + +Options: +\begin{description} +\hostitem{irc} +\end{description} + + +\subsection{\modlast{}} +\label{sec:modlast} + +This module adds support for \jepref{0012} (Last Activity) + +Options: +\begin{description} +\iqdiscitem{\ns{jabber:iq:last}} +\end{description} + + +\subsection{\modmuc{}} +\label{sec:modmuc} + +This module implements \jepref{0045} (Multi-User Chat) service. + +Options: +\begin{description} +\hostitem{conference} +\titem{access} Specifies who is allowed to use MUC service (default value is \term{all}). +\titem{access\_create} Specifies who is allowed to create new rooms at + MUC service (default value is \term{all}). +\titem{access\_admin} Specifies who is allowed to administrate MUC service +(default value is \term{none}, which means that only creator may administer her room). +\end{description} + +Example: +\begin{verbatim} + % Define admin ACL + {acl, admin, {user, "admin"}} + + % Define MUC admin access rule + {access, muc_admin, [{allow, admin}]} + + {modules, + [ + ... + {mod_muc, [{access, all}, + {access_create, all}, + {access_admin, muc_admin}]}, + ... + ]}. +\end{verbatim} + + +\subsection{\modoffline{}} +\label{sec:modoffline} + +This module implements offline message storage. + + +\subsection{\modprivacy{}} +\label{sec:modprivacy} + +This module implements Privacy Rules as defined in XMPP IM +(see \ahrefurl{http://www.jabber.org/ietf/}). + +Options: +\begin{description} +\iqdiscitem{\ns{jabber:iq:privacy}} +\end{description} \subsection{\modprivate{}} \label{sec:modprivate} -This module adds support of -\footahref{http://www.jabber.org/jeps/jep-0049.html}{JEP-0049} (Private XML -Storage). +This module adds support of \jepref{0049} (Private XML Storage). Options: \begin{description} -\item[\texttt{iqdisc}] \ns{jabber:iq:private} IQ queries processing discipline. +\iqdiscitem{\ns{jabber:iq:private}} \end{description} + +\subsection{\modpubsub{}} +\label{sec:modpubsub} + +This module implements \jepref{0060} (Publish-Subscribe Service). + +Options: +\begin{description} +\hostitem{pubsub} +\titem{served\_hosts} Specifies which hosts are served by the service. +If absent then only main \ejabberd{} host is served. +\end{description} + +Example: +\begin{verbatim} + {modules, + [ + ... + {mod_pubsub, [{served_hosts, ["example.com", + "example.org"]}]} + ... + ]}. +\end{verbatim} + + +\subsection{\modregister{}} +\label{sec:modregister} + +This module adds support for \jepref{0077} (In-Band Registration). +It is possible to restrict registration via ``register'' +access rule. If this rule returns ``deny'' on requested user name, then +registration is not allowed for it. + +Options: +\begin{description} +\iqdiscitem{\ns{jabber:iq:register}} +\end{description} + +Example: +\begin{verbatim} + % Deny registration for users with too short name + {acl, shortname, {user_glob, "?"}}. + {acl, shortname, {user_glob, "??"}}. + % Another variant: {acl, shortname, {user_regexp, "^..?$"}}. + + {access, register, [{deny, shortname}, + {allow, all}]}. + + {modules, + [ + ... + {mod_register, []}, + ... + ]}. +\end{verbatim} + + +\subsection{\modroster{}} +\label{sec:modroster} + +This module implements roster management. + +Options: +\begin{description} +\iqdiscitem{\ns{jabber:iq:roster}} +\end{description} + + +\subsection{\modstats{}} +\label{sec:modstats} + +This module adds support for \jepref{0039} (Statistics Gathering). + +Options: +\begin{description} +\iqdiscitem{\ns{http://jabber.org/protocol/stats}} +\end{description} + +TBD about access. + + \subsection{\modtime{}} \label{sec:modtime} @@ -900,7 +1047,20 @@ This module answers UTC time on \ns{jabber:iq:time} queries. Options: \begin{description} -\item[\texttt{iqdisc}] \ns{jabber:iq:time} IQ queries processing discipline. +\iqdiscitem{\ns{jabber:iq:time}} +\end{description} + + +\subsection{\modvcard{}} +\label{sec:modvcard} + +This module implements simple Jabber User Directory (based on user vCards) +and answers server vCard on \ns{vcard-temp} queries. + +Options: +\begin{description} +\hostitem{vjud} +\iqdiscitem{\ns{vcard-temp}} \end{description} @@ -911,25 +1071,23 @@ This module answers \ejabberd{} version on \ns{jabber:iq:version} queries. Options: \begin{description} -\item[\texttt{iqdisc}] \ns{jabber:iq:version} IQ queries processing discipline. +\iqdiscitem{\ns{jabber:iq:version}} \end{description} - - \section{I18n/L10n} \label{sec:i18nl10n} -Many modules supports \texttt{xml:lang} attribute inside IQ queries. E.\,g.\ -on figure~\ref{fig:discorus} (compare it with figure~\ref{fig:disco}) showed -reply on following query: +All built-in modules support \texttt{xml:lang} attribute inside IQ queries. +E.\,g.\ on figure~\ref{fig:discorus} (compare it with figure~\ref{fig:disco}) +showed reply on following query: \begin{verbatim} - - - + + + \end{verbatim} \begin{figure}[htbp] diff --git a/src/Makefile.in b/src/Makefile.in index 70e49f541..b6eaa886c 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -23,6 +23,8 @@ BEAMDIR = $(EJABBERDDIR)/ebin PRIVDIR = $(EJABBERDDIR)/priv SODIR = $(PRIVDIR)/lib MSGSDIR = $(PRIVDIR)/msgs +LOGDIR = $(DESTDIR)/var/log/ejabberd +ETCDIR = $(DESTDIR)/etc/ejabberd all: $(ERLSHLIBS) compile-beam all-recursive @@ -57,6 +59,9 @@ install: all install -m 644 *.so $(SODIR) install -d $(MSGSDIR) install -m 644 msgs/*.msg $(MSGSDIR) + install -d $(ETCDIR) + install -b -m 644 ejabberd.cfg.example $(ETCDIR)/ejabberd.cfg + install -d $(LOGDIR) clean: clean-recursive clean-local diff --git a/src/Makefile.win32 b/src/Makefile.win32 index d03ffcfda..57fd239be 100644 --- a/src/Makefile.win32 +++ b/src/Makefile.win32 @@ -33,6 +33,7 @@ release : build release_clean mkdir $(EREL) mkdir $(EBIN_DIR) copy *.beam $(EBIN_DIR) + @erase $(EBIN_DIR)\configure.beam copy *.app $(EBIN_DIR) mkdir $(PRIV_DIR) mkdir $(SO_DIR) diff --git a/src/web/ejabberd_http.erl b/src/web/ejabberd_http.erl index 0723fd572..ddd164fc3 100644 --- a/src/web/ejabberd_http.erl +++ b/src/web/ejabberd_http.erl @@ -22,6 +22,7 @@ -record(state, {sockmod, socket, request_method, + request_version, request_path, request_auth, request_content_length, @@ -72,8 +73,9 @@ receive_headers(State) -> Data = SockMod:recv(Socket, 0, 300000), ?DEBUG("recv: ~p~n", [Data]), case Data of - {ok, {http_request, Method, Path, _Version}} -> + {ok, {http_request, Method, Path, Version}} -> receive_headers(State#state{request_method = Method, + request_version = Version, request_path = Path}); {ok, {http_header, _, 'Authorization', _, Auth}} -> receive_headers(State#state{request_auth = parse_auth(Auth)}); @@ -95,16 +97,22 @@ receive_headers(State) -> element(2, State#state.request_path)]), Out = process_request(State), send_text(State, Out), - case SockMod of - gen_tcp -> - inet:setopts(Socket, [{packet, http}]); - ssl -> - ssl:setopts(Socket, [{packet, http}]) - end, - receive_headers(#state{sockmod = SockMod, - socket = Socket, - use_http_poll = State#state.use_http_poll, - use_web_admin = State#state.use_web_admin}); + case State#state.request_version of + {1,1} -> + case SockMod of + gen_tcp -> + inet:setopts(Socket, [{packet, http}]); + ssl -> + ssl:setopts(Socket, [{packet, http}]) + end, + receive_headers( + #state{sockmod = SockMod, + socket = Socket, + use_http_poll = State#state.use_http_poll, + use_web_admin = State#state.use_web_admin}); + _ -> + ok + end; {error, _Reason} -> ok; _ ->