From 38f5b8f093eaf66c869b3b39f15625dacd6aeac4 Mon Sep 17 00:00:00 2001 From: Badlop Date: Wed, 22 Apr 2009 10:20:13 +0000 Subject: [PATCH] * doc/guide.tex: Add section to document how to setup CAPTCHA support (EJAB-895) * doc/guide.html: Likewise SVN Revision: 2027 --- ChangeLog | 6 + doc/guide.html | 310 +++++++++++++++++++++++++++---------------------- doc/guide.tex | 52 ++++++++- 3 files changed, 229 insertions(+), 139 deletions(-) diff --git a/ChangeLog b/ChangeLog index d5e16c2d2..4a8f3b10d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-04-22 Badlop + + * doc/guide.tex: Add section to document how to setup CAPTCHA + support (EJAB-895) + * doc/guide.html: Likewise + 2009-04-17 Badlop * doc/guide.tex: Document new ejabberdctl option. New section that diff --git a/doc/guide.html b/doc/guide.html index 7b8d5dd00..8cf7310ec 100644 --- a/doc/guide.html +++ b/doc/guide.html @@ -123,95 +123,96 @@ BLOCKQUOTE.figure DIV.center DIV.center HR{display:none;}
  • 3.1.5  Access Rules
  • 3.1.6  Shapers
  • 3.1.7  Default Language -
  • 3.1.8  Include Additional Configuration Files -
  • 3.1.9  Option Macros in Configuration File +
  • 3.1.8  CAPTCHA +
  • 3.1.9  Include Additional Configuration Files +
  • 3.1.10  Option Macros in Configuration File
  • -
  • 3.2  Database and LDAP Configuration +
  • 3.2  Database and LDAP Configuration -
  • 3.3  Modules Configuration +
  • 3.3  Modules Configuration
  • -
  • Chapter 4  Managing an ejabberd Server +
  • Chapter 4  Managing an ejabberd Server -
  • Chapter 5  Securing ejabberd +
  • Chapter 5  Securing ejabberd -
  • Chapter 6  Clustering +
  • Chapter 6  Clustering -
  • Chapter 7  Debugging +
  • Chapter 7  Debugging -
  • Appendix A  Internationalization and Localization -
  • Appendix B  Release Notes -
  • Appendix C  Acknowledgements -
  • Appendix D  Copyright Information +
  • Appendix A  Internationalization and Localization +
  • Appendix B  Release Notes +
  • Appendix C  Acknowledgements +
  • Appendix D  Copyright Information
  • Chapter 1  Introduction

    ejabberd is a free and open source instant messaging server written in Erlang.

    ejabberd is cross-platform, distributed, fault-tolerant, and based on open standards to achieve real-time communication.

    ejabberd is designed to be a rock-solid and feature rich XMPP server.

    ejabberd is suitable for small deployments, whether they need to be scalable or not, as well as extremely big deployments.

    @@ -342,6 +343,7 @@ GNU Make
  • Erlang pgsql library. Optional. For PostgreSQL authentication or storage. See section 3.2.3.
  • PAM library. Optional. For Pluggable Authentication Modules (PAM). See section 3.1.4.
  • GNU Iconv 1.8 or higher, for the IRC Transport (mod_irc). Optional. Not needed on systems with GNU Libc. See section 3.3.6. +
  • ImageMagick’s Convert program. Optional. For CAPTCHA challenges. See section 3.1.8.
  • 2.4.2  Download Source Code

    Released versions of ejabberd are available in the ProcessOne ejabberd downloads page: @@ -396,7 +398,7 @@ to install ejabberd.

    The files and directories created are, by de

    include/
    Erlang header files (*.hrl)
    priv/
    Additional files required at runtime
    - bin/
    Binary C programs + bin/
    Executable programs
    lib/
    Binary system libraries (*.so)
    msgs/
    Translation files (*.msgs)
    @@ -676,7 +678,7 @@ Interacts with an external shaper, service_check_from
    ejabberd_http
    Handles incoming HTTP connections.
    - Options: certfile, http_bind, http_poll, + Options: captcha, certfile, http_bind, http_poll, request_handlers, tls, web_admin

    Options

    This is a detailed description of each option allowed by the listening modules: @@ -699,6 +701,8 @@ when attempt to connect to ejabberd: {password, Secret}. Note that you cannot define in a single ejabberd_service components of different services: add an ejabberd_service for each service, as seen in an example below. +

    captcha
    +Simple web page that allows a user to fill a CAPTCHA challenge (see section 3.1.8).
    http_bind
    This option enables HTTP Binding (XEP-0124 and XEP-0206) support. HTTP Bind enables access via HTTP requests to ejabberd from behind firewalls which @@ -1203,8 +1207,40 @@ can be seen by Jabber clients. If a Jabber client does not support en. In order to take effect there must be a translation file <language>.msg in ejabberd’s msgs directory.

    For example, to set Russian as default language:

    {language, "ru"}.
    -

    Appendix A provides more details about internationalization and localization.

    -

    3.1.8  Include Additional Configuration Files

    +

    Appendix A provides more details about internationalization and localization.

    +

    3.1.8  CAPTCHA

    +

    Some ejabberd modules can be configured to require a CAPTCHA challenge on certain actions. +If the client does not support CAPTCHA Forms (XEP-0158), +a web link is provided so the user can fill the challenge in a web browser.

    An example script is provided that generates the image +using ImageMagick’s Convert program.

    The configurable options are: +

    +{captcha_cmd, Path}
    +Full path to a script that generates the image. +The default value is an empty string: "" +
    {captcha_host, Host}
    +Host part of the URL sent to the user. +You can include the port number. +The URL sent to the user is formed by: http://Host/captcha/ +The default value is the first hostname configured. +

    Additionally, an ejabberd_http listener must be enabled with the captcha option. +See section 3.1.3.

    Example configuration: +

    {hosts, ["example.org"]}.
    +
    +{captcha_cmd, "/lib/ejabberd/priv/bin/captcha.sh"}.
    +{captcha_host, "example.org:5280"}.
    +
    +{listen,
    + [
    +  ...
    +  {5280, ejabberd_http, [
    +                         captcha,
    +                         ...
    +                        ]
    +  }
    +
    +]}.
    +

    +

    3.1.9  Include Additional Configuration Files

    The option include_config_file in a configuration file instructs ejabberd to include other configuration files immediately.

    The basic usage is:

    {include_config_file, <filename>}.
     

    It is also possible to specify suboptions: @@ -1235,7 +1271,7 @@ and later includes another file with additional rules:

    {acl, admin, {user, "bob", "localhost"}}.
     {acl, admin, {user, "jan", "localhost"}}.
     

    -

    3.1.9  Option Macros in Configuration File

    +

    3.1.10  Option Macros in Configuration File

    In the ejabberd configuration file, it is possible to define a macro for a value and later use this macro when defining an option.

    A macro is defined with this syntax: @@ -1284,7 +1320,7 @@ This usage behaves as if it were defined and used this way: ] }.

    -

    3.2  Database and LDAP Configuration

    +

    3.2  Database and LDAP Configuration

    ejabberd uses its internal Mnesia database by default. However, it is possible to use a relational database or an LDAP server to store persistent, @@ -1317,7 +1353,7 @@ For example: {auth_method, [odbc]} ]}.

    -

    3.2.1  MySQL

    +

    3.2.1  MySQL

    Although this section will describe ejabberd’s configuration when you want to use the native MySQL driver, it does not describe MySQL’s installation and database creation. Check the MySQL documentation and the tutorial Using ejabberd with MySQL native driver for information regarding these topics. @@ -1378,7 +1414,7 @@ relational databases like MySQL. To enable storage to your database, just make sure that your database is running well (see previous sections), and replace the suffix-less or ldap module variant with the odbc module variant. Keep in mind that you cannot have several variants of the same module loaded!

    -

    3.2.2  Microsoft SQL Server

    +

    3.2.2  Microsoft SQL Server

    Although this section will describe ejabberd’s configuration when you want to use Microsoft SQL Server, it does not describe Microsoft SQL Server’s installation and database creation. Check the MySQL documentation and the @@ -1416,7 +1452,7 @@ database, just make sure that your database is running well (see previous sections), and replace the suffix-less or ldap module variant with the odbc module variant. Keep in mind that you cannot have several variants of the same module loaded!

    -

    3.2.3  PostgreSQL

    +

    3.2.3  PostgreSQL

    Although this section will describe ejabberd’s configuration when you want to use the native PostgreSQL driver, it does not describe PostgreSQL’s installation and database creation. Check the PostgreSQL documentation and the tutorial Using ejabberd with MySQL native driver for information regarding these topics. @@ -1477,7 +1513,7 @@ relational databases like PostgreSQL. To enable storage to your database, just make sure that your database is running well (see previous sections), and replace the suffix-less or ldap module variant with the odbc module variant. Keep in mind that you cannot have several variants of the same module loaded!

    -

    3.2.4  ODBC Compatible

    +

    3.2.4  ODBC Compatible

    Although this section will describe ejabberd’s configuration when you want to use the ODBC driver, it does not describe the installation and database creation of your database. Check the documentation of your database. The tutorial Using ejabberd with MySQL native driver also can help you. Note that the tutorial @@ -1522,7 +1558,7 @@ database, just make sure that your database is running well (see previous sections), and replace the suffix-less or ldap module variant with the odbc module variant. Keep in mind that you cannot have several variants of the same module loaded!

    -

    3.2.5  LDAP

    +

    3.2.5  LDAP

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

    Note that ejabberd treats LDAP as a read-only storage: @@ -1701,7 +1737,7 @@ configuration is shown below:

    {auth_method, ldap}.
       ...
      ]}.
     

    -

    3.3  Modules Configuration

    +

    3.3  Modules Configuration

    The option modules defines the list of modules that will be loaded after ejabberd’s startup. Each entry in the list is a tuple in which the first element is the name of a module and the second is a list of options for that @@ -1723,7 +1759,7 @@ all entries end with a comma: {mod_version, []} ]}.

    -

    3.3.1  Modules Overview

    +

    3.3.1  Modules Overview

    The following table lists all modules included in ejabberd.


    @@ -1785,7 +1821,7 @@ Last connection date and time: Use mod_last_odbc instead of ejabberd website. Please remember that these contributions might not work or that they can contain severe bugs and security leaks. Therefore, use them at your own risk!

    -

    3.3.2  Common Options

    The following options are used by many modules. Therefore, they are described in +

    3.3.2  Common Options

    The following options are used by many modules. Therefore, they are described in this separate section.

    iqdisc

    Many modules define handlers for processing IQ queries of different namespaces @@ -1837,7 +1873,7 @@ the "@HOST@" keyword must be used: ... ]}.

    -

    3.3.3  mod_announce

    +

    3.3.3  mod_announce

    This module enables configured users to broadcast announcements and to set the message of the day (MOTD). Configured users can perform these actions with a @@ -1901,7 +1937,7 @@ Only administrators can send announcements:

    Note that mod_announce can be resource intensive on large deployments as it can broadcast lot of messages. This module should be disabled for instances of ejabberd with hundreds of thousands users.

    -

    3.3.4  mod_disco

    +

    3.3.4  mod_disco

    @@ -1944,7 +1980,7 @@ To serve a link to the Jabber User Directory on jabber.org: ... ]}.

    -

    3.3.5  mod_echo

    +

    3.3.5  mod_echo

    This module simply echoes any Jabber packet back to the sender. This mirror can be of interest for ejabberd and Jabber client debugging.

    Options: @@ -1964,7 +2000,7 @@ of them all? ... ]}.

    -

    3.3.6  mod_irc

    +

    3.3.6  mod_irc

    This module is an IRC transport that can be used to join channels on IRC servers.

    End user information: @@ -2022,7 +2058,7 @@ of example.org, and any user of example.com: ... ]}.

    -

    3.3.7  mod_last

    +

    3.3.7  mod_last

    This module adds support for Last Activity (XEP-0012). It can be used to 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 @@ -2031,7 +2067,7 @@ connected user was last active on the server, or to query the uptime of the iqdisc

    This specifies the processing discipline for Last activity (jabber:iq:last) IQ queries (see section 3.3.2).

    -

    3.3.8  mod_muc

    +

    3.3.8  mod_muc

    This module provides a Multi-User Chat (XEP-0045) service. Users can discover existing rooms, join or create them. Occupants of a room can chat in public or have private chats.

    Some of the features of Multi-User Chat: @@ -2237,7 +2273,7 @@ the newly created rooms have by default those options. ... ]}.

    -

    3.3.9  mod_muc_log

    +

    3.3.9  mod_muc_log

    This module enables optional logging of Multi-User Chat (MUC) public conversations to HTML. Once you enable this module, users can join a room using a MUC capable Jabber client, and if they have enough privileges, they can request the @@ -2357,7 +2393,7 @@ top link will be the default <a href="/">Home</a>. ... ]}.

    -

    3.3.10  mod_offline

    +

    3.3.10  mod_offline

    This module implements offline message storage. This means that all messages sent to an offline user will be stored on the server until that user comes online again. Thus it is very similar to how email works. Note that @@ -2368,7 +2404,7 @@ is use to set a max number of offline messages per user (quota). Its value can be either infinity or a strictly positive integer. The default value is infinity.

    -

    3.3.11  mod_privacy

    +

    3.3.11  mod_privacy

    This module implements Blocking Communication (also known as Privacy Rules) as defined in section 10 from XMPP IM. If end users have support for it in their Jabber client, they will be able to: @@ -2396,7 +2432,7 @@ subscription type (or globally). iqdisc

    This specifies the processing discipline for Blocking Communication (jabber:iq:privacy) IQ queries (see section 3.3.2).

    -

    3.3.12  mod_private

    +

    3.3.12  mod_private

    This module adds support for Private XML Storage (XEP-0049):

    Using this method, Jabber entities can store private data on the server and @@ -2408,7 +2444,7 @@ of client-specific preferences; another is Bookmark Storage ( This specifies the processing discipline for Private XML Storage (jabber:iq:private) IQ queries (see section 3.3.2).

    -

    3.3.13  mod_proxy65

    +

    3.3.13  mod_proxy65

    This module implements SOCKS5 Bytestreams (XEP-0065). It allows ejabberd to act as a file transfer proxy between two XMPP clients.

    Options: @@ -2463,7 +2499,7 @@ The simpliest configuration of the module: ... ]}.

    -

    3.3.14  mod_pubsub

    +

    3.3.14  mod_pubsub

    This module offers a Publish-Subscribe Service (XEP-0060). The functionality in mod_pubsub can be extended using plugins. The plugin that implements PEP (Personal Eventing via Pubsub) (XEP-0163) @@ -2494,7 +2530,7 @@ and is shared by all node plugins. ... ]}.

    -

    3.3.15  mod_register

    +

    3.3.15  mod_register

    This module adds support for In-Band Registration (XEP-0077). This protocol enables end users to use a Jabber client to:

    • @@ -2567,13 +2603,13 @@ Also define a registration timeout of one hour: ... ]}.

    -

    3.3.16  mod_roster

    +

    3.3.16  mod_roster

    This module implements roster management as defined in RFC 3921: XMPP IM.

    Options:

    iqdisc
    This specifies the processing discipline for Roster Management (jabber:iq:roster) IQ queries (see section 3.3.2).

    -

    3.3.17  mod_service_log

    +

    3.3.17  mod_service_log

    This module adds support for logging end user packets via a Jabber message auditing service such as Bandersnatch. All user @@ -2603,7 +2639,7 @@ To log all end user packets to the Bandersnatch service running on ... ]}.

    -

    3.3.18  mod_shared_roster

    +

    3.3.18  mod_shared_roster

    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 @@ -2678,7 +2714,7 @@ roster groups as shown in the following table:

    ModuleFeatureDependencies
    mod_adhocAd-Hoc Commands (XEP-0050) 

    -

    3.3.19  mod_stats

    +

    3.3.19  mod_stats

    This module adds support for Statistics Gathering (XEP-0039). This protocol allows you to retrieve next statistics from your ejabberd deployment:

    • @@ -2710,14 +2746,14 @@ by sending: </query> </iq>

    -

    3.3.20  mod_time

    +

    3.3.20  mod_time

    This module features support for Entity Time (XEP-0090). By using this XEP, you are able to discover the time at another entity’s location.

    Options:

    iqdisc
    This specifies the processing discipline for Entity Time (jabber:iq:time) IQ queries (see section 3.3.2).

    -

    3.3.21  mod_vcard

    +

    3.3.21  mod_vcard

    This module allows end users to store and retrieve their vCard, and to retrieve other users vCards, as defined in vcard-temp (XEP-0054). The module also implements an uncomplicated Jabber User Directory based on the vCards of @@ -2772,7 +2808,7 @@ and that all virtual hosts will be searched instead of only the current one: ... ]}.

    -

    3.3.22  mod_vcard_ldap

    +

    3.3.22  mod_vcard_ldap

    ejabberd can map LDAP attributes to vCard fields. This behaviour is implemented in the mod_vcard_ldap module. This module does not depend on the authentication method (see 3.2.5).

    Note that ejabberd treats LDAP as a read-only storage: @@ -2948,7 +2984,7 @@ searching his info in LDAP.

  • ldap_vcard_map
  • -

    3.3.23  mod_version

    +

    3.3.23  mod_version

    This module implements Software Version (XEP-0092). Consequently, it answers ejabberd’s version when queried.

    Options:

    @@ -2957,8 +2993,8 @@ The default value is true.
    iqdisc
    This specifies the processing discipline for Software Version (jabber:iq:version) IQ queries (see section 3.3.2).

    -

    Chapter 4  Managing an ejabberd Server

    -

    4.1  ejabberdctl

    With the ejabberdctl command line administration script +

    Chapter 4  Managing an ejabberd Server

    +

    4.1  ejabberdctl

    With the ejabberdctl command line administration script you can execute ejabberdctl commands (described in the next section, 4.1.1) and also many general ejabberd commands (described in section 4.2). This means you can start, stop and perform many other administrative tasks @@ -2970,7 +3006,7 @@ and other codes may be used for specific results. This can be used by other scripts to determine automatically if a command succeeded or failed, for example using: echo $?

    -

    4.1.1  ejabberdctl Commands

    When ejabberdctl is executed without any parameter, +

    4.1.1  ejabberdctl Commands

    When ejabberdctl is executed without any parameter, it displays the available options. If there isn’t an ejabberd server running, the available parameters are:

    @@ -3006,7 +3042,7 @@ robot1 testuser1 testuser2

    -

    4.1.2  Erlang Runtime System

    ejabberd is an Erlang/OTP application that runs inside an Erlang runtime system. +

    4.1.2  Erlang Runtime System

    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 ejabberdctl administration script uses many of those possibilities. You can configure some of them with the file ejabberdctl.cfg, @@ -3075,7 +3111,7 @@ Starts the Erlang system detached from the system console.

    Note that some characters need to be escaped when used in shell scripts, for instance " and {}. You can find other options in the Erlang manual page (erl -man erl).

    -

    4.2  ejabberd Commands

    An ejabberd command is an abstract function identified by a name, +

    4.2  ejabberd Commands

    An ejabberd command is an abstract function identified by a name, with a defined number and type of calling arguments and type of result that is registered in the ejabberd_commands service. Those commands can be defined in any Erlang module and executed using any valid frontend.

    ejabberd includes a frontend to execute ejabberd commands: the script ejabberdctl. @@ -3083,7 +3119,7 @@ Other known frontends that can be installed to execute ejabberd commands in diff ejabberd_xmlrpc (XML-RPC service), mod_rest (HTTP POST service), mod_shcommands (ejabberd WebAdmin page).

    -

    4.2.1  List of ejabberd Commands

    ejabberd includes a few ejabberd Commands by default. +

    4.2.1  List of ejabberd Commands

    ejabberd includes a few ejabberd Commands by default. When more modules are installed, new commands may be available in the frontends.

    The easiest way to get a list of the available commands, and get help for them is to use the ejabberdctl script:

    $ ejabberdctl help
    @@ -3123,7 +3159,7 @@ exist tutorials to migrate
     in offline storage. This might be useful when the number of offline messages
     is very high.
     

    -

    4.2.2  Restrict Execution with AccessCommands

    The frontends can be configured to restrict access to certain commands. +

    4.2.2  Restrict Execution with AccessCommands

    The frontends can be configured to restrict access to certain commands. In that case, authentication information must be provided. In each frontend the AccessCommands option is defined in a different place. But in all cases the option syntax is the same: @@ -3169,7 +3205,7 @@ and the provided arguments do not contradict Arguments.

    As an example to u {_bot_reg_test, [register, unregister], [{host, "test.org"}]} ]

    -

    4.3  Web Admin

    +

    4.3  Web Admin

    The ejabberd Web Admin allows to administer most of ejabberd using a web browser.

    This feature is enabled by default: a ejabberd_http listener with the option web_admin (see section 3.1.3) is included in the listening ports. Then you can open @@ -3241,13 +3277,13 @@ The file is searched by default in The directory of the documentation can be specified in the environment variable EJABBERD_DOC_PATH. See section 4.1.2.

    -

    4.4  Ad-hoc Commands

    If you enable mod_configure and mod_adhoc, +

    4.4  Ad-hoc Commands

    If you enable mod_configure and mod_adhoc, you can perform several administrative tasks in ejabberd with a Jabber client. The client must support Ad-Hoc Commands (XEP-0050), and you must login in the Jabber server with an account with proper privileges.

    -

    4.5  Change Computer Hostname

    ejabberd uses the distributed Mnesia database. +

    4.5  Change Computer Hostname

    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 5.4). The name of an Erlang node includes the hostname of the computer. @@ -3263,8 +3299,8 @@ you must follow these instructions: For example:

    ejabberdctl restore /tmp/ejabberd-oldhost.backup
     

    -

    Chapter 5  Securing ejabberd

    -

    5.1  Firewall Settings

    +

    Chapter 5  Securing ejabberd

    +

    5.1  Firewall Settings

    You need to take the following TCP ports in mind when configuring your firewall:


    @@ -3275,7 +3311,7 @@ you must follow these instructions:
    PortDescription
    port rangeUsed for connections between Erlang nodes. This range is configurable (see section 5.2).

    -

    5.2  epmd

    epmd (Erlang Port Mapper Daemon) +

    5.2  epmd

    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 epmd to use ejabberdctl and also when clustering ejabberd nodes. @@ -3300,7 +3336,7 @@ but can be configured in the file ejabberdctl.cfg. The Erlang command-line parameter used internally is, for example:

    erl ... -kernel inet_dist_listen_min 4370 inet_dist_listen_max 4375
     

    -

    5.3  Erlang Cookie

    The Erlang cookie is a string with numbers and letters. +

    5.3  Erlang Cookie

    The Erlang cookie is a string with numbers and letters. An Erlang node reads the cookie at startup from the command-line parameter -setcookie. If not indicated, the cookie is read from the cookie file $HOME/.erlang.cookie. If this file does not exist, it is created immediately with a random cookie. @@ -3314,7 +3350,7 @@ 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.

    -

    5.4  Erlang Node Name

    An Erlang node may have a node name. +

    5.4  Erlang Node Name

    An Erlang node may have a node name. The name can be short (if indicated with the command-line parameter -sname) or long (if indicated with the parameter -name). Starting an Erlang node with -sname limits the communication between Erlang nodes to the LAN.

    Using the option -sname instead of -name is a simple method @@ -3323,7 +3359,7 @@ 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 using a modified version of Erlang epmd. The recommended way to secure the Erlang node is to block the port 4369.

    -

    5.5  Securing Sensible Files

    ejabberd stores sensible data in the file system either in plain text or binary files. +

    5.5  Securing Sensible Files

    ejabberd stores sensible data in the file system either in plain text or binary files. The file system permissions should be set to only allow the proper user to read, write and execute those files and directories.

    ejabberd configuration file: /etc/ejabberd/ejabberd.cfg
    @@ -3343,9 +3379,9 @@ so it is preferable to secure the whole /var/lib/ejabberd/ directory.
    Erlang cookie file: /var/lib/ejabberd/.erlang.cookie
    See section 5.3.

    -

    Chapter 6  Clustering

    +

    Chapter 6  Clustering

    -

    6.1  How it Works

    +

    6.1  How it Works

    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 @@ -3359,29 +3395,29 @@ router,

  • session manager,
  • s2s manager.
  • -

    6.1.1  Router

    +

    6.1.1  Router

    This module is the main router of Jabber packets on each node. It routes them based on their destination’s domains. It uses a global routing table. The domain of the packet’s destination is searched in the routing table, and if it is found, the packet is routed to the appropriate process. If not, it is sent to the s2s manager.

    -

    6.1.2  Local Router

    +

    6.1.2  Local Router

    This module routes packets which have a destination domain equal to one of this server’s host names. If the destination JID has a non-empty user part, it is routed to the session manager, otherwise it is processed depending on its content.

    -

    6.1.3  Session Manager

    +

    6.1.3  Session Manager

    This module routes packets to local users. It looks up to which user resource a packet must be sent via a presence table. Then the packet is either routed to the appropriate c2s process, or stored in offline storage, or bounced back.

    -

    6.1.4  s2s Manager

    +

    6.1.4  s2s Manager

    This module routes packets to other Jabber servers. First, it checks if an opened s2s connection from the domain of the packet’s source to the domain of the packet’s destination exists. If that is the case, the s2s manager routes the packet to the process serving this connection, otherwise a new connection is opened.

    -

    6.2  Clustering Setup

    +

    6.2  Clustering Setup

    Suppose you already configured ejabberd on one machine named (first), and you need to setup another one to make an ejabberd cluster. Then do following steps:

    1. @@ -3419,10 +3455,10 @@ and ‘access’ options because they will be taken from enabled only on one machine in the cluster.

    You can repeat these steps for other machines supposed to serve this domain.

    -

    6.3  Service Load-Balancing

    +

    6.3  Service Load-Balancing

    -

    6.3.1  Components Load-Balancing

    -

    6.3.2  Domain Load-Balancing Algorithm

    +

    6.3.1  Components Load-Balancing

    +

    6.3.2  Domain Load-Balancing Algorithm

    ejabberd includes an algorithm to load balance the components that are plugged on an ejabberd cluster. It means that you can plug one or several instances of the same component on each ejabberd cluster and that the traffic will be automatically distributed.

    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.

    If you need a different behaviour, you can change the load balancing behaviour with the option domain_balancing. The syntax of the option is the following:

    {domain_balancing, "component.example.com", <balancing_criterium>}.
     

    Several balancing criteria are available:

    • @@ -3431,13 +3467,13 @@ domain.

      -

      6.3.3  Load-Balancing Buckets

      +

      6.3.3  Load-Balancing Buckets

      When there is a risk of failure for a given component, domain balancing can cause service trouble. If one component is failing the service will not work correctly unless the sessions are rebalanced.

      In this case, it is best to limit the problem to the sessions handled by the failing component. This is what the domain_balancing_component_number option does, making the load balancing algorithm not dynamic, but sticky on a fix number of component instances.

      The syntax is the following:

      {domain_balancing_component_number, "component.example.com", N}
       

      -

      Chapter 7  Debugging

      +

      Chapter 7  Debugging

      -

      7.1  Log Files

      An ejabberd node writes two log files: +

      7.1  Log Files

      An ejabberd node writes two log files:

      ejabberd.log
      is the ejabberd service log, with the messages reported by ejabberd code
      sasl.log
      is the Erlang/OTP system log, with the messages reported by Erlang/OTP using SASL (System Architecture Support Libraries) @@ -3459,12 +3495,12 @@ The ejabberdctl command reopen-log (please refer to section 4.1.1) reopens the log files, and also renames the old ones if you didn’t rename them.

      -

      7.2  Debug Console

      The Debug Console is an Erlang shell attached to an already running ejabberd server. +

      7.2  Debug Console

      The Debug Console is an Erlang shell attached to an already running ejabberd server. 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 Interconnecting Erlang Nodes

      To exit the shell, close the window or press the keys: control+c control+c.

      -

      7.3  Watchdog Alerts

      +

      7.3  Watchdog Alerts

      ejabberd includes a watchdog mechanism that may be useful to developers when troubleshooting a problem related to memory usage. If a process in the ejabberd server consumes more memory than the configured threshold, @@ -3482,7 +3518,7 @@ or in a conversation with the watchdog alert bot.

      Example configuration: To remove all watchdog admins, set the option with an empty list:

      {watchdog_admins, []}.
       

      -

      Appendix A  Internationalization and Localization

      +

      Appendix A  Internationalization and Localization

      The source code of ejabberd supports localization. The translators can edit the gettext .po files @@ -3517,9 +3553,9 @@ HTTP header ‘Accept-Language: ru’


      -

      Appendix B  Release Notes

      +

      Appendix B  Release Notes

      Release notes are available from ejabberd Home Page

      -

      Appendix C  Acknowledgements

      Thanks to all people who contributed to this guide: +

      Appendix C  Acknowledgements

      Thanks to all people who contributed to this guide:

      -

      Appendix D  Copyright Information

      Ejabberd Installation and Operation Guide.
      +

      Appendix D  Copyright Information

      Ejabberd Installation and Operation Guide.
      Copyright © 2003 — 2009 ProcessOne

      This document is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 diff --git a/doc/guide.tex b/doc/guide.tex index 8db54c665..ab9d11324 100644 --- a/doc/guide.tex +++ b/doc/guide.tex @@ -305,6 +305,7 @@ To compile \ejabberd{} on a `Unix-like' operating system, you need: \item Erlang pgsql library. Optional. For PostgreSQL authentication or storage. See section \ref{compilepgsql}. \item PAM library. Optional. For Pluggable Authentication Modules (PAM). See section \ref{pam}. \item GNU Iconv 1.8 or higher, for the IRC Transport (mod\_irc). Optional. Not needed on systems with GNU Libc. See section \ref{modirc}. +\item ImageMagick's Convert program. Optional. For CAPTCHA challenges. See section \ref{captcha}. \end{itemize} \makesubsection{download}{Download Source Code} @@ -393,7 +394,7 @@ The files and directories created are, by default: \titem{include/} Erlang header files (*.hrl) \titem{priv/} Additional files required at runtime \begin{description} - \titem{bin/} Binary C programs + \titem{bin/} Executable programs \titem{lib/} Binary system libraries (*.so) \titem{msgs/} Translation files (*.msgs) \end{description} @@ -799,7 +800,7 @@ The available modules, their purpose and the options allowed by each one are: \texttt{shaper}, \texttt{service\_check\_from} \titem{\texttt{ejabberd\_http}} Handles incoming HTTP connections.\\ - Options: \texttt{certfile}, \texttt{http\_bind}, \texttt{http\_poll}, + Options: \texttt{captcha}, \texttt{certfile}, \texttt{http\_bind}, \texttt{http\_poll}, \texttt{request\_handlers}, \texttt{tls}, \texttt{web\_admin}\\ \end{description} @@ -826,6 +827,8 @@ This is a detailed description of each option allowed by the listening modules: Note that you cannot define in a single \term{ejabberd\_service} components of different services: add an \term{ejabberd\_service} for each service, as seen in an example below. + \titem{captcha} \ind{options!http-captcha} + Simple web page that allows a user to fill a CAPTCHA challenge (see section \ref{captcha}). \titem{http\_bind} \ind{options!http\_bind}\ind{protocols!XEP-0206: HTTP Binding}\ind{JWChat}\ind{web-based Jabber client} This option enables HTTP Binding (\xepref{0124} and \xepref{0206}) support. HTTP Bind enables access via HTTP requests to \ejabberd{} from behind firewalls which @@ -1498,6 +1501,51 @@ For example, to set Russian as default language: Appendix \ref{i18ni10n} provides more details about internationalization and localization. +\makesubsection{captcha}{CAPTCHA} +\ind{options!captcha}\ind{captcha} + +Some \ejabberd{} modules can be configured to require a CAPTCHA challenge on certain actions. +If the client does not support CAPTCHA Forms (\xepref{0158}), +a web link is provided so the user can fill the challenge in a web browser. + +An example script is provided that generates the image +using ImageMagick's Convert program. + +The configurable options are: +\begin{description} + \titem{\{captcha\_cmd, Path\}} + Full path to a script that generates the image. + The default value is an empty string: \term{""} + \titem{\{captcha\_host, Host\}} + Host part of the URL sent to the user. + You can include the port number. + The URL sent to the user is formed by: \term{http://Host/captcha/} + The default value is the first hostname configured. +\end{description} + +Additionally, an \term{ejabberd\_http} listener must be enabled with the \term{captcha} option. +See section \ref{listened-module}. + +Example configuration: +\begin{verbatim} +{hosts, ["example.org"]}. + +{captcha_cmd, "/lib/ejabberd/priv/bin/captcha.sh"}. +{captcha_host, "example.org:5280"}. + +{listen, + [ + ... + {5280, ejabberd_http, [ + captcha, + ... + ] + } + +]}. +\end{verbatim} + + \makesubsection{includeconfigfile}{Include Additional Configuration Files} \ind{options!includeconfigfile}\ind{includeconfigfile}