Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/processone/ejabberd.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.in12
-rw-r--r--README1
-rw-r--r--doc/guide.html2969
-rw-r--r--doc/guide.tex2723
-rw-r--r--ejabberd.cfg.example609
-rw-r--r--ejabberd.yml.example615
-rwxr-xr-xejabberdctl.template2
-rw-r--r--rebar.config.script1
-rw-r--r--rel/reltool.config.script6
-rw-r--r--src/acl.erl469
-rw-r--r--src/cyrsasl_digest.erl4
-rw-r--r--src/ejabberd_admin.erl6
-rw-r--r--src/ejabberd_app.erl18
-rw-r--r--src/ejabberd_auth.erl2
-rw-r--r--src/ejabberd_auth_anonymous.erl4
-rw-r--r--src/ejabberd_auth_external.erl4
-rw-r--r--src/ejabberd_auth_internal.erl2
-rw-r--r--src/ejabberd_auth_ldap.erl4
-rw-r--r--src/ejabberd_auth_pam.erl4
-rw-r--r--src/ejabberd_c2s.erl21
-rw-r--r--src/ejabberd_c2s_config.erl2
-rw-r--r--src/ejabberd_captcha.erl8
-rw-r--r--src/ejabberd_config.erl499
-rw-r--r--src/ejabberd_ctl.erl2
-rw-r--r--src/ejabberd_frontend_socket.erl3
-rw-r--r--src/ejabberd_http.erl42
-rw-r--r--src/ejabberd_http_poll.erl2
-rw-r--r--src/ejabberd_listener.erl99
-rw-r--r--src/ejabberd_node_groups.erl7
-rw-r--r--src/ejabberd_odbc.erl68
-rw-r--r--src/ejabberd_odbc_sup.erl27
-rw-r--r--src/ejabberd_rdbms.erl22
-rw-r--r--src/ejabberd_router.erl12
-rw-r--r--src/ejabberd_s2s.erl68
-rw-r--r--src/ejabberd_s2s_in.erl10
-rw-r--r--src/ejabberd_s2s_out.erl79
-rw-r--r--src/ejabberd_service.erl57
-rw-r--r--src/ejabberd_system_monitor.erl4
-rw-r--r--src/ejabberd_web_admin.erl6
-rw-r--r--src/eldap_utils.erl2
-rw-r--r--src/extauth.erl2
-rw-r--r--src/gen_iq_handler.erl18
-rw-r--r--src/gen_mod.erl23
-rw-r--r--src/mod_carboncopy.erl2
-rw-r--r--src/mod_configure2.erl4
-rw-r--r--src/mod_disco.erl33
-rw-r--r--src/mod_last.erl26
-rw-r--r--src/mod_muc_log.erl14
-rw-r--r--src/mod_proxy65.erl5
-rw-r--r--src/mod_proxy65_service.erl25
-rw-r--r--src/mod_proxy65_stream.erl12
-rw-r--r--src/mod_register.erl137
-rw-r--r--src/mod_vcard_ldap.erl18
-rw-r--r--src/node_pep.erl8
-rw-r--r--src/node_pep_odbc.erl2
-rw-r--r--src/odbc_queries.erl12
-rw-r--r--src/shaper.erl75
-rw-r--r--test/ejabberd_SUITE_data/ejabberd.yml267
-rw-r--r--test/suite.erl2
59 files changed, 5078 insertions, 4102 deletions
diff --git a/Makefile.in b/Makefile.in
index 06788a176..75bbcac19 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -109,9 +109,9 @@ install: all
#
# Configuration files
$(INSTALL) -d -m 750 $(G_USER) $(ETCDIR)
- [ -f $(ETCDIR)/ejabberd.cfg ] \
- && $(INSTALL) -b -m 640 $(G_USER) ejabberd.cfg.example $(ETCDIR)/ejabberd.cfg-new \
- || $(INSTALL) -b -m 640 $(G_USER) ejabberd.cfg.example $(ETCDIR)/ejabberd.cfg
+ [ -f $(ETCDIR)/ejabberd.yml ] \
+ && $(INSTALL) -b -m 640 $(G_USER) ejabberd.yml.example $(ETCDIR)/ejabberd.yml-new \
+ || $(INSTALL) -b -m 640 $(G_USER) ejabberd.yml.example $(ETCDIR)/ejabberd.yml
$(SED) -e "s*{{rootdir}}*@prefix@*" \
-e "s*{{installuser}}*@INSTALLUSER@*" \
-e "s*{{libdir}}*@libdir@*" \
@@ -120,9 +120,9 @@ install: all
-e "s*{{docdir}}*@docdir@*" \
-e "s*{{erl}}*@ERL@*" ejabberdctl.template \
> ejabberdctl.example
- [ -f $(ETCDIR)/ejabberdctl.cfg ] \
- && $(INSTALL) -b -m 640 $(G_USER) ejabberdctl.cfg.example $(ETCDIR)/ejabberdctl.cfg-new \
- || $(INSTALL) -b -m 640 $(G_USER) ejabberdctl.cfg.example $(ETCDIR)/ejabberdctl.cfg
+ [ -f $(ETCDIR)/ejabberdctl.yml ] \
+ && $(INSTALL) -b -m 640 $(G_USER) ejabberdctl.yml.example $(ETCDIR)/ejabberdctl.yml-new \
+ || $(INSTALL) -b -m 640 $(G_USER) ejabberdctl.yml.example $(ETCDIR)/ejabberdctl.yml
$(INSTALL) -b -m 644 $(G_USER) inetrc $(ETCDIR)/inetrc
#
# Administration script
diff --git a/README b/README
index 2d084603e..d6b95bcda 100644
--- a/README
+++ b/README
@@ -9,6 +9,7 @@ To compile ejabberd you need:
- GNU Make
- GCC
- Libexpat 1.95 or higher
+ - Libyaml 1.4 or higher
- Erlang/OTP R15B or higher.
- OpenSSL 0.9.8 or higher, for STARTTLS, SASL and SSL encryption.
- Zlib 1.2.3 or higher, for Stream Compression support
diff --git a/doc/guide.html b/doc/guide.html
index c9827def0..9e956f18f 100644
--- a/doc/guide.html
+++ b/doc/guide.html
@@ -6,7 +6,7 @@
- ejabberd 2.1.12
+ ejabberd
Installation and Operation Guide
@@ -76,7 +76,7 @@ BLOCKQUOTE.figure DIV.center DIV.center HR{display:none;}
<HR SIZE=2><BR>
<BR>
-<TABLE CELLSPACING=6 CELLPADDING=0><TR><TD ALIGN=right NOWRAP> <FONT SIZE=6><B>ejabberd 2.1.12 </B></FONT></TD></TR>
+<TABLE CELLSPACING=6 CELLPADDING=0><TR><TD ALIGN=right NOWRAP> <FONT SIZE=6><B>ejabberd </B></FONT></TD></TR>
<TR><TD ALIGN=right NOWRAP>&nbsp;</TD></TR>
<TR><TD ALIGN=right NOWRAP> <FONT SIZE=6>Installation and Operation Guide</FONT></TD></TR>
</TABLE><BR>
@@ -116,111 +116,109 @@ BLOCKQUOTE.figure DIV.center DIV.center HR{display:none;}
<UL CLASS="toc"><LI CLASS="li-toc">
<A HREF="#htoc20">3.1&#XA0;&#XA0;Basic Configuration</A>
<UL CLASS="toc"><LI CLASS="li-toc">
-<A HREF="#htoc21">3.1.1&#XA0;&#XA0;Host Names</A>
-</LI><LI CLASS="li-toc"><A HREF="#htoc22">3.1.2&#XA0;&#XA0;Virtual Hosting</A>
-</LI><LI CLASS="li-toc"><A HREF="#htoc23">3.1.3&#XA0;&#XA0;Listening Ports</A>
-</LI><LI CLASS="li-toc"><A HREF="#htoc24">3.1.4&#XA0;&#XA0;Authentication</A>
-</LI><LI CLASS="li-toc"><A HREF="#htoc25">3.1.5&#XA0;&#XA0;Access Rules</A>
-</LI><LI CLASS="li-toc"><A HREF="#htoc26">3.1.6&#XA0;&#XA0;Shapers</A>
-</LI><LI CLASS="li-toc"><A HREF="#htoc27">3.1.7&#XA0;&#XA0;Default Language</A>
-</LI><LI CLASS="li-toc"><A HREF="#htoc28">3.1.8&#XA0;&#XA0;CAPTCHA</A>
-</LI><LI CLASS="li-toc"><A HREF="#htoc29">3.1.9&#XA0;&#XA0;STUN</A>
-</LI><LI CLASS="li-toc"><A HREF="#htoc30">3.1.10&#XA0;&#XA0;Include Additional Configuration Files</A>
-</LI><LI CLASS="li-toc"><A HREF="#htoc31">3.1.11&#XA0;&#XA0;Option Macros in Configuration File</A>
+<A HREF="#htoc21">3.1.1&#XA0;&#XA0;Legacy Configuration File</A>
+</LI><LI CLASS="li-toc"><A HREF="#htoc22">3.1.2&#XA0;&#XA0;Host Names</A>
+</LI><LI CLASS="li-toc"><A HREF="#htoc23">3.1.3&#XA0;&#XA0;Virtual Hosting</A>
+</LI><LI CLASS="li-toc"><A HREF="#htoc24">3.1.4&#XA0;&#XA0;Listening Ports</A>
+</LI><LI CLASS="li-toc"><A HREF="#htoc25">3.1.5&#XA0;&#XA0;Authentication</A>
+</LI><LI CLASS="li-toc"><A HREF="#htoc26">3.1.6&#XA0;&#XA0;Access Rules</A>
+</LI><LI CLASS="li-toc"><A HREF="#htoc27">3.1.7&#XA0;&#XA0;Shapers</A>
+</LI><LI CLASS="li-toc"><A HREF="#htoc28">3.1.8&#XA0;&#XA0;Default Language</A>
+</LI><LI CLASS="li-toc"><A HREF="#htoc29">3.1.9&#XA0;&#XA0;CAPTCHA</A>
+</LI><LI CLASS="li-toc"><A HREF="#htoc30">3.1.10&#XA0;&#XA0;STUN</A>
+</LI><LI CLASS="li-toc"><A HREF="#htoc31">3.1.11&#XA0;&#XA0;Include Additional Configuration Files</A>
+</LI><LI CLASS="li-toc"><A HREF="#htoc32">3.1.12&#XA0;&#XA0;Option Macros in Configuration File</A>
</LI></UL>
-</LI><LI CLASS="li-toc"><A HREF="#htoc32">3.2&#XA0;&#XA0;Database and LDAP Configuration</A>
+</LI><LI CLASS="li-toc"><A HREF="#htoc33">3.2&#XA0;&#XA0;Database and LDAP Configuration</A>
<UL CLASS="toc"><LI CLASS="li-toc">
-<A HREF="#htoc33">3.2.1&#XA0;&#XA0;MySQL</A>
-</LI><LI CLASS="li-toc"><A HREF="#htoc34">3.2.2&#XA0;&#XA0;Microsoft SQL Server</A>
-</LI><LI CLASS="li-toc"><A HREF="#htoc35">3.2.3&#XA0;&#XA0;PostgreSQL</A>
-</LI><LI CLASS="li-toc"><A HREF="#htoc36">3.2.4&#XA0;&#XA0;ODBC Compatible</A>
-</LI><LI CLASS="li-toc"><A HREF="#htoc37">3.2.5&#XA0;&#XA0;LDAP</A>
+<A HREF="#htoc34">3.2.1&#XA0;&#XA0;ODBC</A>
+</LI><LI CLASS="li-toc"><A HREF="#htoc35">3.2.2&#XA0;&#XA0;LDAP</A>
</LI></UL>
-</LI><LI CLASS="li-toc"><A HREF="#htoc38">3.3&#XA0;&#XA0;Modules Configuration</A>
+</LI><LI CLASS="li-toc"><A HREF="#htoc36">3.3&#XA0;&#XA0;Modules Configuration</A>
<UL CLASS="toc"><LI CLASS="li-toc">
-<A HREF="#htoc39">3.3.1&#XA0;&#XA0;Modules Overview</A>
-</LI><LI CLASS="li-toc"><A HREF="#htoc40">3.3.2&#XA0;&#XA0;Common Options</A>
-</LI><LI CLASS="li-toc"><A HREF="#htoc41">3.3.3&#XA0;&#XA0;<TT>mod_announce</TT></A>
-</LI><LI CLASS="li-toc"><A HREF="#htoc42">3.3.4&#XA0;&#XA0;<TT>mod_disco</TT></A>
-</LI><LI CLASS="li-toc"><A HREF="#htoc43">3.3.5&#XA0;&#XA0;<TT>mod_echo</TT></A>
-</LI><LI CLASS="li-toc"><A HREF="#htoc44">3.3.6&#XA0;&#XA0;<TT>mod_http_bind</TT></A>
-</LI><LI CLASS="li-toc"><A HREF="#htoc45">3.3.7&#XA0;&#XA0;<TT>mod_http_fileserver</TT></A>
-</LI><LI CLASS="li-toc"><A HREF="#htoc46">3.3.8&#XA0;&#XA0;<TT>mod_irc</TT></A>
-</LI><LI CLASS="li-toc"><A HREF="#htoc47">3.3.9&#XA0;&#XA0;<TT>mod_last</TT></A>
-</LI><LI CLASS="li-toc"><A HREF="#htoc48">3.3.10&#XA0;&#XA0;<TT>mod_muc</TT></A>
-</LI><LI CLASS="li-toc"><A HREF="#htoc49">3.3.11&#XA0;&#XA0;<TT>mod_muc_log</TT></A>
-</LI><LI CLASS="li-toc"><A HREF="#htoc50">3.3.12&#XA0;&#XA0;<TT>mod_offline</TT></A>
-</LI><LI CLASS="li-toc"><A HREF="#htoc51">3.3.13&#XA0;&#XA0;<TT>mod_ping</TT></A>
-</LI><LI CLASS="li-toc"><A HREF="#htoc52">3.3.14&#XA0;&#XA0;<TT>mod_pres_counter</TT></A>
-</LI><LI CLASS="li-toc"><A HREF="#htoc53">3.3.15&#XA0;&#XA0;<TT>mod_privacy</TT></A>
-</LI><LI CLASS="li-toc"><A HREF="#htoc54">3.3.16&#XA0;&#XA0;<TT>mod_private</TT></A>
-</LI><LI CLASS="li-toc"><A HREF="#htoc55">3.3.17&#XA0;&#XA0;<TT>mod_proxy65</TT></A>
-</LI><LI CLASS="li-toc"><A HREF="#htoc56">3.3.18&#XA0;&#XA0;<TT>mod_pubsub</TT></A>
-</LI><LI CLASS="li-toc"><A HREF="#htoc57">3.3.19&#XA0;&#XA0;<TT>mod_register</TT></A>
-</LI><LI CLASS="li-toc"><A HREF="#htoc58">3.3.20&#XA0;&#XA0;<TT>mod_register_web</TT></A>
-</LI><LI CLASS="li-toc"><A HREF="#htoc59">3.3.21&#XA0;&#XA0;<TT>mod_roster</TT></A>
-</LI><LI CLASS="li-toc"><A HREF="#htoc60">3.3.22&#XA0;&#XA0;<TT>mod_service_log</TT></A>
-</LI><LI CLASS="li-toc"><A HREF="#htoc61">3.3.23&#XA0;&#XA0;<TT>mod_shared_roster</TT></A>
-</LI><LI CLASS="li-toc"><A HREF="#htoc62">3.3.24&#XA0;&#XA0;<TT>mod_shared_roster_ldap</TT></A>
-</LI><LI CLASS="li-toc"><A HREF="#htoc63">3.3.25&#XA0;&#XA0;<TT>mod_sic</TT></A>
-</LI><LI CLASS="li-toc"><A HREF="#htoc64">3.3.26&#XA0;&#XA0;<TT>mod_stats</TT></A>
-</LI><LI CLASS="li-toc"><A HREF="#htoc65">3.3.27&#XA0;&#XA0;<TT>mod_time</TT></A>
-</LI><LI CLASS="li-toc"><A HREF="#htoc66">3.3.28&#XA0;&#XA0;<TT>mod_vcard</TT></A>
-</LI><LI CLASS="li-toc"><A HREF="#htoc67">3.3.29&#XA0;&#XA0;<TT>mod_vcard_ldap</TT></A>
-</LI><LI CLASS="li-toc"><A HREF="#htoc68">3.3.30&#XA0;&#XA0;<TT>mod_vcard_xupdate</TT></A>
-</LI><LI CLASS="li-toc"><A HREF="#htoc69">3.3.31&#XA0;&#XA0;<TT>mod_version</TT></A>
+<A HREF="#htoc37">3.3.1&#XA0;&#XA0;Modules Overview</A>
+</LI><LI CLASS="li-toc"><A HREF="#htoc38">3.3.2&#XA0;&#XA0;Common Options</A>
+</LI><LI CLASS="li-toc"><A HREF="#htoc39">3.3.3&#XA0;&#XA0;<TT>mod_announce</TT></A>
+</LI><LI CLASS="li-toc"><A HREF="#htoc40">3.3.4&#XA0;&#XA0;<TT>mod_disco</TT></A>
+</LI><LI CLASS="li-toc"><A HREF="#htoc41">3.3.5&#XA0;&#XA0;<TT>mod_echo</TT></A>
+</LI><LI CLASS="li-toc"><A HREF="#htoc42">3.3.6&#XA0;&#XA0;<TT>mod_http_bind</TT></A>
+</LI><LI CLASS="li-toc"><A HREF="#htoc43">3.3.7&#XA0;&#XA0;<TT>mod_http_fileserver</TT></A>
+</LI><LI CLASS="li-toc"><A HREF="#htoc44">3.3.8&#XA0;&#XA0;<TT>mod_irc</TT></A>
+</LI><LI CLASS="li-toc"><A HREF="#htoc45">3.3.9&#XA0;&#XA0;<TT>mod_last</TT></A>
+</LI><LI CLASS="li-toc"><A HREF="#htoc46">3.3.10&#XA0;&#XA0;<TT>mod_muc</TT></A>
+</LI><LI CLASS="li-toc"><A HREF="#htoc47">3.3.11&#XA0;&#XA0;<TT>mod_muc_log</TT></A>
+</LI><LI CLASS="li-toc"><A HREF="#htoc48">3.3.12&#XA0;&#XA0;<TT>mod_offline</TT></A>
+</LI><LI CLASS="li-toc"><A HREF="#htoc49">3.3.13&#XA0;&#XA0;<TT>mod_ping</TT></A>
+</LI><LI CLASS="li-toc"><A HREF="#htoc50">3.3.14&#XA0;&#XA0;<TT>mod_pres_counter</TT></A>
+</LI><LI CLASS="li-toc"><A HREF="#htoc51">3.3.15&#XA0;&#XA0;<TT>mod_privacy</TT></A>
+</LI><LI CLASS="li-toc"><A HREF="#htoc52">3.3.16&#XA0;&#XA0;<TT>mod_private</TT></A>
+</LI><LI CLASS="li-toc"><A HREF="#htoc53">3.3.17&#XA0;&#XA0;<TT>mod_proxy65</TT></A>
+</LI><LI CLASS="li-toc"><A HREF="#htoc54">3.3.18&#XA0;&#XA0;<TT>mod_pubsub</TT></A>
+</LI><LI CLASS="li-toc"><A HREF="#htoc55">3.3.19&#XA0;&#XA0;<TT>mod_register</TT></A>
+</LI><LI CLASS="li-toc"><A HREF="#htoc56">3.3.20&#XA0;&#XA0;<TT>mod_register_web</TT></A>
+</LI><LI CLASS="li-toc"><A HREF="#htoc57">3.3.21&#XA0;&#XA0;<TT>mod_roster</TT></A>
+</LI><LI CLASS="li-toc"><A HREF="#htoc58">3.3.22&#XA0;&#XA0;<TT>mod_service_log</TT></A>
+</LI><LI CLASS="li-toc"><A HREF="#htoc59">3.3.23&#XA0;&#XA0;<TT>mod_shared_roster</TT></A>
+</LI><LI CLASS="li-toc"><A HREF="#htoc60">3.3.24&#XA0;&#XA0;<TT>mod_shared_roster_ldap</TT></A>
+</LI><LI CLASS="li-toc"><A HREF="#htoc61">3.3.25&#XA0;&#XA0;<TT>mod_sic</TT></A>
+</LI><LI CLASS="li-toc"><A HREF="#htoc62">3.3.26&#XA0;&#XA0;<TT>mod_stats</TT></A>
+</LI><LI CLASS="li-toc"><A HREF="#htoc63">3.3.27&#XA0;&#XA0;<TT>mod_time</TT></A>
+</LI><LI CLASS="li-toc"><A HREF="#htoc64">3.3.28&#XA0;&#XA0;<TT>mod_vcard</TT></A>
+</LI><LI CLASS="li-toc"><A HREF="#htoc65">3.3.29&#XA0;&#XA0;<TT>mod_vcard_ldap</TT></A>
+</LI><LI CLASS="li-toc"><A HREF="#htoc66">3.3.30&#XA0;&#XA0;<TT>mod_vcard_xupdate</TT></A>
+</LI><LI CLASS="li-toc"><A HREF="#htoc67">3.3.31&#XA0;&#XA0;<TT>mod_version</TT></A>
</LI></UL>
</LI></UL>
-</LI><LI CLASS="li-toc"><A HREF="#htoc70">Chapter&#XA0;4&#XA0;&#XA0;Managing an <TT>ejabberd</TT> Server</A>
+</LI><LI CLASS="li-toc"><A HREF="#htoc68">Chapter&#XA0;4&#XA0;&#XA0;Managing an <TT>ejabberd</TT> Server</A>
<UL CLASS="toc"><LI CLASS="li-toc">
-<A HREF="#htoc71">4.1&#XA0;&#XA0;<TT>ejabberdctl</TT></A>
+<A HREF="#htoc69">4.1&#XA0;&#XA0;<TT>ejabberdctl</TT></A>
<UL CLASS="toc"><LI CLASS="li-toc">
-<A HREF="#htoc72">4.1.1&#XA0;&#XA0;ejabberdctl Commands</A>
-</LI><LI CLASS="li-toc"><A HREF="#htoc73">4.1.2&#XA0;&#XA0;Erlang Runtime System</A>
+<A HREF="#htoc70">4.1.1&#XA0;&#XA0;ejabberdctl Commands</A>
+</LI><LI CLASS="li-toc"><A HREF="#htoc71">4.1.2&#XA0;&#XA0;Erlang Runtime System</A>
</LI></UL>
-</LI><LI CLASS="li-toc"><A HREF="#htoc74">4.2&#XA0;&#XA0;<TT>ejabberd</TT> Commands</A>
+</LI><LI CLASS="li-toc"><A HREF="#htoc72">4.2&#XA0;&#XA0;<TT>ejabberd</TT> Commands</A>
<UL CLASS="toc"><LI CLASS="li-toc">
-<A HREF="#htoc75">4.2.1&#XA0;&#XA0;List of ejabberd Commands</A>
-</LI><LI CLASS="li-toc"><A HREF="#htoc76">4.2.2&#XA0;&#XA0;Restrict Execution with AccessCommands</A>
+<A HREF="#htoc73">4.2.1&#XA0;&#XA0;List of ejabberd Commands</A>
+</LI><LI CLASS="li-toc"><A HREF="#htoc74">4.2.2&#XA0;&#XA0;Restrict Execution with AccessCommands</A>
</LI></UL>
-</LI><LI CLASS="li-toc"><A HREF="#htoc77">4.3&#XA0;&#XA0;Web Admin</A>
-</LI><LI CLASS="li-toc"><A HREF="#htoc78">4.4&#XA0;&#XA0;Ad-hoc Commands</A>
-</LI><LI CLASS="li-toc"><A HREF="#htoc79">4.5&#XA0;&#XA0;Change Computer Hostname</A>
+</LI><LI CLASS="li-toc"><A HREF="#htoc75">4.3&#XA0;&#XA0;Web Admin</A>
+</LI><LI CLASS="li-toc"><A HREF="#htoc76">4.4&#XA0;&#XA0;Ad-hoc Commands</A>
+</LI><LI CLASS="li-toc"><A HREF="#htoc77">4.5&#XA0;&#XA0;Change Computer Hostname</A>
</LI></UL>
-</LI><LI CLASS="li-toc"><A HREF="#htoc80">Chapter&#XA0;5&#XA0;&#XA0;Securing <TT>ejabberd</TT></A>
+</LI><LI CLASS="li-toc"><A HREF="#htoc78">Chapter&#XA0;5&#XA0;&#XA0;Securing <TT>ejabberd</TT></A>
<UL CLASS="toc"><LI CLASS="li-toc">
-<A HREF="#htoc81">5.1&#XA0;&#XA0;Firewall Settings</A>
-</LI><LI CLASS="li-toc"><A HREF="#htoc82">5.2&#XA0;&#XA0;epmd</A>
-</LI><LI CLASS="li-toc"><A HREF="#htoc83">5.3&#XA0;&#XA0;Erlang Cookie</A>
-</LI><LI CLASS="li-toc"><A HREF="#htoc84">5.4&#XA0;&#XA0;Erlang Node Name</A>
-</LI><LI CLASS="li-toc"><A HREF="#htoc85">5.5&#XA0;&#XA0;Securing Sensitive Files</A>
+<A HREF="#htoc79">5.1&#XA0;&#XA0;Firewall Settings</A>
+</LI><LI CLASS="li-toc"><A HREF="#htoc80">5.2&#XA0;&#XA0;epmd</A>
+</LI><LI CLASS="li-toc"><A HREF="#htoc81">5.3&#XA0;&#XA0;Erlang Cookie</A>
+</LI><LI CLASS="li-toc"><A HREF="#htoc82">5.4&#XA0;&#XA0;Erlang Node Name</A>
+</LI><LI CLASS="li-toc"><A HREF="#htoc83">5.5&#XA0;&#XA0;Securing Sensitive Files</A>
</LI></UL>
-</LI><LI CLASS="li-toc"><A HREF="#htoc86">Chapter&#XA0;6&#XA0;&#XA0;Clustering</A>
+</LI><LI CLASS="li-toc"><A HREF="#htoc84">Chapter&#XA0;6&#XA0;&#XA0;Clustering</A>
<UL CLASS="toc"><LI CLASS="li-toc">
-<A HREF="#htoc87">6.1&#XA0;&#XA0;How it Works</A>
+<A HREF="#htoc85">6.1&#XA0;&#XA0;How it Works</A>
<UL CLASS="toc"><LI CLASS="li-toc">
-<A HREF="#htoc88">6.1.1&#XA0;&#XA0;Router</A>
-</LI><LI CLASS="li-toc"><A HREF="#htoc89">6.1.2&#XA0;&#XA0;Local Router</A>
-</LI><LI CLASS="li-toc"><A HREF="#htoc90">6.1.3&#XA0;&#XA0;Session Manager</A>
-</LI><LI CLASS="li-toc"><A HREF="#htoc91">6.1.4&#XA0;&#XA0;s2s Manager</A>
+<A HREF="#htoc86">6.1.1&#XA0;&#XA0;Router</A>
+</LI><LI CLASS="li-toc"><A HREF="#htoc87">6.1.2&#XA0;&#XA0;Local Router</A>
+</LI><LI CLASS="li-toc"><A HREF="#htoc88">6.1.3&#XA0;&#XA0;Session Manager</A>
+</LI><LI CLASS="li-toc"><A HREF="#htoc89">6.1.4&#XA0;&#XA0;s2s Manager</A>
</LI></UL>
-</LI><LI CLASS="li-toc"><A HREF="#htoc92">6.2&#XA0;&#XA0;Clustering Setup</A>
-</LI><LI CLASS="li-toc"><A HREF="#htoc93">6.3&#XA0;&#XA0;Service Load-Balancing</A>
+</LI><LI CLASS="li-toc"><A HREF="#htoc90">6.2&#XA0;&#XA0;Clustering Setup</A>
+</LI><LI CLASS="li-toc"><A HREF="#htoc91">6.3&#XA0;&#XA0;Service Load-Balancing</A>
<UL CLASS="toc"><LI CLASS="li-toc">
-<A HREF="#htoc94">6.3.1&#XA0;&#XA0;Domain Load-Balancing Algorithm</A>
-</LI><LI CLASS="li-toc"><A HREF="#htoc95">6.3.2&#XA0;&#XA0;Load-Balancing Buckets</A>
+<A HREF="#htoc92">6.3.1&#XA0;&#XA0;Domain Load-Balancing Algorithm</A>
+</LI><LI CLASS="li-toc"><A HREF="#htoc93">6.3.2&#XA0;&#XA0;Load-Balancing Buckets</A>
</LI></UL>
</LI></UL>
-</LI><LI CLASS="li-toc"><A HREF="#htoc96">Chapter&#XA0;7&#XA0;&#XA0;Debugging</A>
+</LI><LI CLASS="li-toc"><A HREF="#htoc94">Chapter&#XA0;7&#XA0;&#XA0;Debugging</A>
<UL CLASS="toc"><LI CLASS="li-toc">
-<A HREF="#htoc97">7.1&#XA0;&#XA0;Log Files</A>
-</LI><LI CLASS="li-toc"><A HREF="#htoc98">7.2&#XA0;&#XA0;Debug Console</A>
-</LI><LI CLASS="li-toc"><A HREF="#htoc99">7.3&#XA0;&#XA0;Watchdog Alerts</A>
+<A HREF="#htoc95">7.1&#XA0;&#XA0;Log Files</A>
+</LI><LI CLASS="li-toc"><A HREF="#htoc96">7.2&#XA0;&#XA0;Debug Console</A>
+</LI><LI CLASS="li-toc"><A HREF="#htoc97">7.3&#XA0;&#XA0;Watchdog Alerts</A>
</LI></UL>
-</LI><LI CLASS="li-toc"><A HREF="#htoc100">Appendix&#XA0;A&#XA0;&#XA0;Internationalization and Localization</A>
-</LI><LI CLASS="li-toc"><A HREF="#htoc101">Appendix&#XA0;B&#XA0;&#XA0;Release Notes</A>
-</LI><LI CLASS="li-toc"><A HREF="#htoc102">Appendix&#XA0;C&#XA0;&#XA0;Acknowledgements</A>
-</LI><LI CLASS="li-toc"><A HREF="#htoc103">Appendix&#XA0;D&#XA0;&#XA0;Copyright Information</A>
+</LI><LI CLASS="li-toc"><A HREF="#htoc98">Appendix&#XA0;A&#XA0;&#XA0;Internationalization and Localization</A>
+</LI><LI CLASS="li-toc"><A HREF="#htoc99">Appendix&#XA0;B&#XA0;&#XA0;Release Notes</A>
+</LI><LI CLASS="li-toc"><A HREF="#htoc100">Appendix&#XA0;C&#XA0;&#XA0;Acknowledgements</A>
+</LI><LI CLASS="li-toc"><A HREF="#htoc101">Appendix&#XA0;D&#XA0;&#XA0;Copyright Information</A>
</LI></UL><!--TOC chapter Introduction-->
<H1 CLASS="chapter"><!--SEC ANCHOR --><A NAME="htoc1">Chapter&#XA0;1</A>&#XA0;&#XA0;Introduction</H1><!--SEC END --><P>
<A NAME="intro"></A></P><P><TT>ejabberd</TT> is a free and open source instant messaging server written in <A HREF="http://www.erlang.org/">Erlang/OTP</A>.</P><P><TT>ejabberd</TT> is cross-platform, distributed, fault-tolerant, and based on open standards to achieve real-time communication.</P><P><TT>ejabberd</TT> is designed to be a rock-solid and feature rich XMPP server.</P><P><TT>ejabberd</TT> is suitable for small deployments, whether they need to be scalable or not, as well as extremely big deployments.</P><!--TOC section Key Features-->
@@ -308,7 +306,10 @@ copy <TT>ejabberd.init</TT> from the &#X2019;bin&#X2019; directory to something
Create a system user called <TT>ejabberd</TT>,
give it write access to the directories <TT>database/</TT> and <TT>logs/</TT>, and set that as home;
the script will start the server with that user.
-Then you can call <TT>/etc/inid.d/ejabberd start</TT> as root to start the server.</P><P>If <TT>ejabberd</TT> doesn&#X2019;t start correctly in Windows,
+Then you can call <TT>/etc/inid.d/ejabberd start</TT> as root to start the server.</P><P>When ejabberd is started, the processes that are started in the system
+are <TT>beam</TT> or <TT>beam.smp</TT>, and also <TT>epmd</TT>.
+In Microsoft Windows, the processes are <TT>erl.exe</TT> and <TT>epmd.exe</TT>.
+For more information regarding <TT>epmd</TT> consult the section <A HREF="#epmd">5.2</A>.</P><P>If <TT>ejabberd</TT> doesn&#X2019;t start correctly in Windows,
try to start it using the shortcut in desktop or start menu.
If the window shows error 14001, the solution is to install:
"Microsoft Visual C++ 2005 SP1 Redistributable Package".
@@ -348,22 +349,20 @@ as long as your system have all the dependencies.</P><P> <A NAME="installreq"></
GNU Make
</LI><LI CLASS="li-itemize">GCC
</LI><LI CLASS="li-itemize">Libexpat 1.95 or higher
-</LI><LI CLASS="li-itemize">Erlang/OTP R10B-9 or higher. The recommended versions are R13B04 and R14B04.
-Don&#X2019;t use R14A or R14B because <A HREF="http://www.erlang.org/cgi-bin/ezmlm-cgi/4/54598">they have a bug</A>.
+</LI><LI CLASS="li-itemize">Erlang/OTP R15B or higher.
+</LI><LI CLASS="li-itemize">Libyaml 1.4 or higher
</LI><LI CLASS="li-itemize">OpenSSL 0.9.8 or higher, for STARTTLS, SASL and SSL encryption.
</LI><LI CLASS="li-itemize">Zlib 1.2.3 or higher, for Stream Compression support (<A HREF="http://xmpp.org/extensions/xep-0138.html">XEP-0138</A>). Optional.
-</LI><LI CLASS="li-itemize">Erlang mysql library. Optional. For MySQL authentication or storage. See section <A HREF="#compilemysql">3.2.1</A>.
-</LI><LI CLASS="li-itemize">Erlang pgsql library. Optional. For PostgreSQL authentication or storage. See section <A HREF="#compilepgsql">3.2.3</A>.
-</LI><LI CLASS="li-itemize">PAM library. Optional. For Pluggable Authentication Modules (PAM). See section <A HREF="#pam">3.1.4</A>.
+</LI><LI CLASS="li-itemize">PAM library. Optional. For Pluggable Authentication Modules (PAM). See section <A HREF="#pam">3.1.5</A>.
</LI><LI CLASS="li-itemize">GNU Iconv 1.8 or higher, for the IRC Transport (mod_irc). Optional. Not needed on systems with GNU Libc. See section <A HREF="#modirc">3.3.8</A>.
-</LI><LI CLASS="li-itemize">ImageMagick&#X2019;s Convert program. Optional. For CAPTCHA challenges. See section <A HREF="#captcha">3.1.8</A>.
+</LI><LI CLASS="li-itemize">ImageMagick&#X2019;s Convert program. Optional. For CAPTCHA challenges. See section <A HREF="#captcha">3.1.9</A>.
</LI><LI CLASS="li-itemize">exmpp 0.9.6 or higher. Optional. For import/export user data with <A HREF="http://xmpp.org/extensions/xep-0227.html">XEP-0227</A> XML files.
</LI></UL><P> <A NAME="download"></A> </P><!--TOC subsection Download Source Code-->
<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc10">2.4.2</A>&#XA0;&#XA0;<A HREF="#download">Download Source Code</A></H3><!--SEC END --><P> <A NAME="download"></A>
</P><P>Released versions of <TT>ejabberd</TT> are available in the ProcessOne <TT>ejabberd</TT> downloads page:
<A HREF="http://www.process-one.net/en/ejabberd/downloads"><TT>http://www.process-one.net/en/ejabberd/downloads</TT></A></P><P>
Alternatively, the latest development source code can be retrieved from the Git repository using the commands:
-</P><PRE CLASS="verbatim">git clone git://git.process-one.net/ejabberd/mainline.git ejabberd
+</P><PRE CLASS="verbatim">git clone git://github.com/processone/ejabberd.git ejabberd
cd ejabberd
git checkout -b 2.1.x origin/2.1.x
</PRE><P> <A NAME="compile"></A> </P><!--TOC subsection Compile-->
@@ -388,15 +387,21 @@ To get the full list run the command:
before running <TT>make install</TT>.
This account doesn&#X2019;t need an explicit HOME directory, because
<TT>/var/lib/ejabberd/</TT> will be used by default.<P> </P></DD><DT CLASS="dt-description"><B><TT>--enable-pam</TT></B></DT><DD CLASS="dd-description">
- Enable the PAM authentication method (see section <A HREF="#pam">3.1.4</A>).<P> </P></DD><DT CLASS="dt-description"><B><TT>--enable-odbc or --enable-mssql</TT></B></DT><DD CLASS="dd-description">
+ Enable the PAM authentication method (see section <A HREF="#pam">3.1.5</A>).<P> </P></DD><DT CLASS="dt-description"><B><TT>--enable-mssql</TT></B></DT><DD CLASS="dd-description">
Required if you want to use an external database.
- See section&#XA0;<A HREF="#database">3.2</A> for more information.<P> </P></DD><DT CLASS="dt-description"><B><TT>--enable-full-xml</TT></B></DT><DD CLASS="dd-description">
+ See section&#XA0;<A HREF="#database">3.2</A> for more information.</DD><DT CLASS="dt-description"><B><TT>--enable-tools</TT></B></DT><DD CLASS="dd-description">
+Enable the use of development tools.</DD><DT CLASS="dt-description"><B><TT>--enable-mysql</TT></B></DT><DD CLASS="dd-description">
+Enable MySQL support (see section <A HREF="#odbc">3.2.1</A>).</DD><DT CLASS="dt-description"><B><TT>--enable-pgsql</TT></B></DT><DD CLASS="dd-description">
+Enable PostgreSQL support (see section <A HREF="#odbc">3.2.1</A>).</DD><DT CLASS="dt-description"><B><TT>--enable-zlib</TT></B></DT><DD CLASS="dd-description">
+Enable Stream Compression (XEP-0138) using zlib.</DD><DT CLASS="dt-description"><B><TT>--enable-stun</TT></B></DT><DD CLASS="dd-description">
+Enable STUN support (see section <A HREF="#stun">3.1.10</A>).</DD><DT CLASS="dt-description"><B><TT>--enable-iconv</TT></B></DT><DD CLASS="dd-description">
+Enable iconv support. This is needed for <TT>mod_irc</TT> (see seciont <A HREF="#modirc">3.3.8</A>).</DD><DT CLASS="dt-description"><B><TT>--enable-debug</TT></B></DT><DD CLASS="dd-description">
+Compile with <TT>+debug_info</TT> enabled.<P> </P></DD><DT CLASS="dt-description"><B><TT>--enable-full-xml</TT></B></DT><DD CLASS="dd-description">
Enable the use of XML based optimisations.
It will for example use CDATA to escape characters in the XMPP stream.
Use this option only if you are sure your XMPP clients include a fully compliant XML parser.<P> </P></DD><DT CLASS="dt-description"><B><TT>--disable-transient-supervisors</TT></B></DT><DD CLASS="dd-description">
Disable the use of Erlang/OTP supervision for transient processes.<P> </P></DD><DT CLASS="dt-description"><B><TT>--enable-nif</TT></B></DT><DD CLASS="dd-description">
Replaces some critical Erlang functions with equivalents written in C to improve performance.
-This feature requires Erlang/OTP R13B04 or higher.
</DD></DL><P> <A NAME="install"></A> </P><!--TOC subsection Install-->
<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc12">2.4.4</A>&#XA0;&#XA0;<A HREF="#install">Install</A></H3><!--SEC END --><P> <A NAME="install"></A>
</P><P>To install <TT>ejabberd</TT> in the destination directories, run the command:
@@ -406,7 +411,7 @@ to install <TT>ejabberd</TT>.</P><P>The files and directories created are, by de
</P><DL CLASS="description"><DT CLASS="dt-description">
<B><TT>/etc/ejabberd/</TT></B></DT><DD CLASS="dd-description"> Configuration directory:
<DL CLASS="description"><DT CLASS="dt-description">
- <B><TT>ejabberd.cfg</TT></B></DT><DD CLASS="dd-description"> ejabberd configuration file
+ <B><TT>ejabberd.yml</TT></B></DT><DD CLASS="dd-description"> ejabberd configuration file
</DD><DT CLASS="dt-description"><B><TT>ejabberdctl.cfg</TT></B></DT><DD CLASS="dd-description"> Configuration file of the administration script
</DD><DT CLASS="dt-description"><B><TT>inetrc</TT></B></DT><DD CLASS="dd-description"> Network DNS configuration file
</DD></DL>
@@ -511,7 +516,7 @@ variable.
</LI><LI CLASS="li-enumerate">While in the directory <CODE>ejabberd\src</CODE> run:
<PRE CLASS="verbatim">configure.bat
nmake -f Makefile.win32
-</PRE></LI><LI CLASS="li-enumerate">Edit the file <CODE>ejabberd\src\ejabberd.cfg</CODE> and run
+</PRE></LI><LI CLASS="li-enumerate">Edit the file <CODE>ejabberd\src\ejabberd.yml</CODE> and run
<PRE CLASS="verbatim">werl -s ejabberd -name ejabberd
</PRE></LI></OL><P> <A NAME="initialadmin"></A> </P><!--TOC section Create an XMPP Account for Administration-->
<H2 CLASS="section"><!--SEC ANCHOR --><A NAME="htoc17">2.5</A>&#XA0;&#XA0;<A HREF="#initialadmin">Create an XMPP Account for Administration</A></H2><!--SEC END --><P> <A NAME="initialadmin"></A> </P><P>You need an XMPP account and grant him administrative privileges
@@ -525,8 +530,13 @@ Using <TT>ejabberdctl</TT> (see section&#XA0;<A HREF="#ejabberdctl">4.1</A>):
</PRE></LI><LI CLASS="li-enumerate">Using an XMPP client and In-Band Registration (see section&#XA0;<A HREF="#modregister">3.3.19</A>).
</LI></OL>
</LI><LI CLASS="li-enumerate">Edit the <TT>ejabberd</TT> configuration file to give administration rights to the XMPP account you created:
-<PRE CLASS="verbatim">{acl, admin, {user, "admin1", "example.org"}}.
-{access, configure, [{allow, admin}]}.
+<PRE CLASS="verbatim">acl:
+ admin:
+ user:
+ - "admin1": "example.org"
+access:
+ configure:
+ admin: allow
</PRE>You can grant administrative privileges to many XMPP accounts,
and also to accounts in other XMPP servers.
</LI><LI CLASS="li-enumerate">Restart <TT>ejabberd</TT> to load the new configuration.
@@ -544,119 +554,157 @@ check if the release notes of the new ejabberd version
indicates you need to also update those tables.</P><P> <A NAME="configure"></A> </P><!--TOC chapter Configuring <TT>ejabberd</TT>-->
<H1 CLASS="chapter"><!--SEC ANCHOR --><A NAME="htoc19">Chapter&#XA0;3</A>&#XA0;&#XA0;<A HREF="#configure">Configuring <TT>ejabberd</TT></A></H1><!--SEC END --><P> <A NAME="configure"></A>
</P><P> <A NAME="basicconfig"></A> </P><!--TOC section Basic Configuration-->
-<H2 CLASS="section"><!--SEC ANCHOR --><A NAME="htoc20">3.1</A>&#XA0;&#XA0;<A HREF="#basicconfig">Basic Configuration</A></H2><!--SEC END --><P> <A NAME="basicconfig"></A> </P><P>The configuration file will be loaded the first time you start <TT>ejabberd</TT>. The
-content from this file will be parsed and stored in the internal <TT>ejabberd</TT> database. Subsequently the
-configuration will be loaded from the database and any commands in the
-configuration file are appended to the entries in the database.</P><P>Note that <TT>ejabberd</TT> never edits the configuration file.
-So, the configuration changes done using the Web Admin
-are stored in the database, but are not reflected in the configuration file.
-If you want those changes to be use after <TT>ejabberd</TT> restart, you can either
-edit the configuration file, or remove all its content.</P><P>The configuration file contains a sequence of Erlang terms. Lines beginning with a
-<TT>&#X2018;%&#X2019;</TT> sign are ignored. Each term is a tuple of which the first element is
-the name of an option, and any further elements are that option&#X2019;s values. If the
-configuration file do not contain for instance the &#X2018;hosts&#X2019; option, the old
-host name(s) stored in the database will be used.</P><P>You can override the old values stored in the database by adding next lines to
-the beginning of the configuration file:
-</P><PRE CLASS="verbatim">override_global.
-override_local.
-override_acls.
-</PRE><P>With these lines the old global options (shared between all <TT>ejabberd</TT> nodes in a
-cluster), local options (which are specific for this particular <TT>ejabberd</TT> node)
-and ACLs will be removed before new ones are added.</P><P> <A NAME="hostnames"></A> </P><!--TOC subsection Host Names-->
-<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc21">3.1.1</A>&#XA0;&#XA0;<A HREF="#hostnames">Host Names</A></H3><!--SEC END --><P> <A NAME="hostnames"></A>
+<H2 CLASS="section"><!--SEC ANCHOR --><A NAME="htoc20">3.1</A>&#XA0;&#XA0;<A HREF="#basicconfig">Basic Configuration</A></H2><!--SEC END --><P> <A NAME="basicconfig"></A> </P><P>The configuration file will be loaded the first time you start <TT>ejabberd</TT>.
+The configuration file name MUST have &#X201C;.yml&#X201D; extension. This helps ejabberd
+to differentiate between the new and legacy file formats (see section&#XA0;<A HREF="#oldconfig">3.1.1</A>).</P><P>Note that <TT>ejabberd</TT> never edits the configuration file.</P><P>The configuration file is written in
+<A HREF="http://en.wikipedia.org/wiki/YAML">YAML</A>.
+However, different scalars are treated as different types:
+</P><UL CLASS="itemize"><LI CLASS="li-itemize">
+unquoted or single-quoted strings. The type is called <CODE>atom()</CODE>
+in this document.
+Examples: <CODE>dog</CODE>, <CODE>'Jupiter'</CODE>, <CODE>'3.14159'</CODE>, <CODE>YELLOW</CODE>.
+</LI><LI CLASS="li-itemize">numeric literals. The type is called <CODE>integer()</CODE>, <CODE>float()</CODE> or,
+if both are allowed, <CODE>number()</CODE>.
+Examples: <CODE>3</CODE>, <CODE>-45.0</CODE>, <CODE>.0</CODE>
+</LI><LI CLASS="li-itemize">double-quoted or folded strings. The type is called <CODE>string()</CODE>.
+Examples of a double-quoted string:
+<CODE>"Lizzard"</CODE>, <CODE>"orange"</CODE>, <CODE>"3.14159"</CODE>.
+Examples of a folded string:
+<PRE CLASS="verbatim">&gt; Art thou not Romeo,
+ and a Montague?
+</PRE><PRE CLASS="verbatim">| Neither, fair saint,
+ if either thee dislike.
+</PRE>For associative arrays ("mappings") and lists you can use both outline
+indentation and compact syntax (aka &#X201C;JSON style&#X201D;). For example, the following is equivalent:
+<PRE CLASS="verbatim">{param1: ["val1", "val2"], param2: ["val3", "val4"]}
+</PRE>and
+<PRE CLASS="verbatim">param1:
+ - "val1"
+ - "val2"
+param2:
+ - "val3"
+ - "val4"
+</PRE>Note that both styles are used in this document.
+</LI></UL><P> <A NAME="oldconfig"></A> </P><!--TOC subsection Legacy Configuration File-->
+<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc21">3.1.1</A>&#XA0;&#XA0;<A HREF="#oldconfig">Legacy Configuration File</A></H3><!--SEC END --><P> <A NAME="oldconfig"></A>
+In previous <TT>ejabberd</TT> version the configuration file should be written
+in Erlang terms. The format is still supported, but it is highly recommended
+to convert it to the new YAML format using <TT>convert_to_yaml</TT> command
+from <TT>ejabberdctl</TT> (see&#XA0;<A HREF="#ejabberdctl">4.1</A> for details).</P><P> <A NAME="hostnames"></A> </P><!--TOC subsection Host Names-->
+<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc22">3.1.2</A>&#XA0;&#XA0;<A HREF="#hostnames">Host Names</A></H3><!--SEC END --><P> <A NAME="hostnames"></A>
</P><P>The option <TT>hosts</TT> defines a list containing one or more domains that
<TT>ejabberd</TT> will serve.</P><P>The syntax is:
-</P><DL CLASS="description"><DT CLASS="dt-description"><B><TT>{hosts, [HostName, ...]}.</TT></B></DT></DL><P>Examples:
+</P><DL CLASS="description"><DT CLASS="dt-description"><B><TT>[HostName]</TT></B></DT></DL><P>Examples:
</P><UL CLASS="itemize"><LI CLASS="li-itemize">
Serving one domain:
-<PRE CLASS="verbatim">{hosts, ["example.org"]}.
+<PRE CLASS="verbatim">hosts: ["example.org"]
</PRE></LI><LI CLASS="li-itemize">Serving three domains:
-<PRE CLASS="verbatim">{hosts, ["example.net", "example.com", "jabber.somesite.org"]}.
+<PRE CLASS="verbatim">hosts:
+ - "example.net"
+ - "example.com"
+ - "jabber.somesite.org"
</PRE></LI></UL><P> <A NAME="virtualhost"></A> </P><!--TOC subsection Virtual Hosting-->
-<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc22">3.1.2</A>&#XA0;&#XA0;<A HREF="#virtualhost">Virtual Hosting</A></H3><!--SEC END --><P> <A NAME="virtualhost"></A>
+<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc23">3.1.3</A>&#XA0;&#XA0;<A HREF="#virtualhost">Virtual Hosting</A></H3><!--SEC END --><P> <A NAME="virtualhost"></A>
</P><P>Options can be defined separately for every virtual host using the
<TT>host_config</TT> option.</P><P>The syntax is:
-</P><DL CLASS="description"><DT CLASS="dt-description"><B><TT>{host_config, HostName, [Option, ...]}</TT></B></DT></DL><P>Examples:
+</P><DL CLASS="description"><DT CLASS="dt-description"><B><TT>{HostName: [Option, ...]}</TT></B></DT></DL><P>Examples:
</P><UL CLASS="itemize"><LI CLASS="li-itemize">
Domain <TT>example.net</TT> is using the internal authentication method while
domain <TT>example.com</TT> is using the LDAP server running on the
domain <TT>localhost</TT> to perform authentication:
-<PRE CLASS="verbatim">{host_config, "example.net", [{auth_method, internal}]}.
-
-{host_config, "example.com", [{auth_method, ldap},
- {ldap_servers, ["localhost"]},
- {ldap_uids, [{"uid"}]},
- {ldap_rootdn, "dc=localdomain"},
- {ldap_rootdn, "dc=example,dc=com"},
- {ldap_password, ""}]}.
+<PRE CLASS="verbatim">host_config:
+ "example.net"
+ auth_method: internal
+ "example.com":
+ auth_method: ldap
+ ldap_servers:
+ - "localhost"
+ ldap_uids:
+ - "uid"
+ ldap_rootdn: "dc=localdomain"
+ ldap_rootdn: "dc=example,dc=com"
+ ldap_password: ""
</PRE></LI><LI CLASS="li-itemize">Domain <TT>example.net</TT> is using ODBC to perform authentication
while domain <TT>example.com</TT> is using the LDAP servers running on the domains
<TT>localhost</TT> and <TT>otherhost</TT>:
-<PRE CLASS="verbatim">{host_config, "example.net", [{auth_method, odbc},
- {odbc_server, "DSN=ejabberd;UID=ejabberd;PWD=ejabberd"}]}.
-
-{host_config, "example.com", [{auth_method, ldap},
- {ldap_servers, ["localhost", "otherhost"]},
- {ldap_uids, [{"uid"}]},
- {ldap_rootdn, "dc=localdomain"},
- {ldap_rootdn, "dc=example,dc=com"},
- {ldap_password, ""}]}.
+<PRE CLASS="verbatim">host_config:
+ "example.net":
+ auth_method: odbc
+ odbc_type: odbc
+ odbc_server: "DSN=ejabberd;UID=ejabberd;PWD=ejabberd"
+ "example.com":
+ auth_method: ldap
+ ldap_servers:
+ - "localhost"
+ - "otherhost"
+ ldap_uids:
+ - "uid"
+ ldap_rootdn: "dc=localdomain"
+ ldap_rootdn: "dc=example,dc=com"
+ ldap_password: ""
</PRE></LI></UL><P>To define specific ejabberd modules in a virtual host,
you can define the global <TT>modules</TT> option with the common modules,
and later add specific modules to certain virtual hosts.
-To accomplish that, instead of defining each option in <TT>host_config</TT> with the general syntax
-</P><DL CLASS="description"><DT CLASS="dt-description"><B><TT>{OptionName, OptionValue}</TT></B></DT></DL><P>
-use this syntax:
-</P><DL CLASS="description"><DT CLASS="dt-description"><B><TT>{{add, OptionName}, OptionValue}</TT></B></DT></DL><P>In this example three virtual hosts have some similar modules, but there are also
+To accomplish that, instead of defining each option in <TT>host_config</TT>
+use <TT>append_host_config</TT> with the same syntax.</P><P>In this example three virtual hosts have some similar modules, but there are also
other different modules for some specific virtual hosts:
-</P><PRE CLASS="verbatim">%% This ejabberd server has three vhosts:
-{hosts, ["one.example.org", "two.example.org", "three.example.org"]}.
+</P><PRE CLASS="verbatim">## This ejabberd server has three vhosts:
+hosts:
+ - "one.example.org"
+ - "two.example.org"
+ - "three.example.org"
-%% Configuration of modules that are common to all vhosts
-{modules,
- [
- {mod_roster, []},
- {mod_configure, []},
- {mod_disco, []},
- {mod_private, []},
- {mod_time, []},
- {mod_last, []},
- {mod_version, []}
- ]}.
+## Configuration of modules that are common to all vhosts
+modules:
+ mod_roster: {}
+ mod_configure: {}
+ mod_disco: {}
+ mod_private: {}
+ mod_time: {}
+ mod_last: {}
+ mod_version: {}
-%% Add some modules to vhost one:
-{host_config, "one.example.org",
- [{{add, modules}, [
- {mod_echo, [{host, "echo-service.one.example.org"}]}
- {mod_http_bind, []},
- {mod_logxml, []}
- ]
- }
- ]}.
+## Add some modules to vhost one:
+append_host_config:
+ "one.example.org":
+ modules:
+ mod_echo:
+ host: "echo-service.one.example.org"
+ mod_http_bind: {}
+ mod_logxml: {}
-%% Add a module just to vhost two:
-{host_config, "two.example.org",
- [{{add, modules}, [
- {mod_echo, [{host, "mirror.two.example.org"}]}
- ]
- }
- ]}.
+## Add a module just to vhost two:
+append_host_config:
+ "two.example.org":
+ modules:
+ mod_echo:
+ host: "mirror.two.example.org"
</PRE><P> <A NAME="listened"></A> </P><!--TOC subsection Listening Ports-->
-<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc23">3.1.3</A>&#XA0;&#XA0;<A HREF="#listened">Listening Ports</A></H3><!--SEC END --><P> <A NAME="listened"></A>
+<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc24">3.1.4</A>&#XA0;&#XA0;<A HREF="#listened">Listening Ports</A></H3><!--SEC END --><P> <A NAME="listened"></A>
</P><P>The option <TT>listen</TT> defines for which ports, addresses and network protocols <TT>ejabberd</TT>
-will listen and what services will be run on them. Each element of the list is a
-tuple with the following elements:
+will listen and what services will be run on them. Each element of the list is an
+associative array with the following elements:
</P><UL CLASS="itemize"><LI CLASS="li-itemize">
Port number. Optionally also the IP address and/or a transport protocol.
</LI><LI CLASS="li-itemize">Listening module that serves this port.
</LI><LI CLASS="li-itemize">Options for the TCP socket and for the listening module.
</LI></UL><P>The option syntax is:
-</P><DL CLASS="description"><DT CLASS="dt-description"><B><TT>{listen, [Listener, ...]}.</TT></B></DT></DL><P>To define a listener there are several syntax.
-</P><DL CLASS="description"><DT CLASS="dt-description"><B><TT>{PortNumber, Module, [Option, ...]}</TT></B></DT></DL><DL CLASS="description"><DT CLASS="dt-description"><B><TT>{{PortNumber, IPaddress}, Module, [Option, ...]}</TT></B></DT></DL><DL CLASS="description"><DT CLASS="dt-description"><B><TT>{{PortNumber, TransportProtocol}, Module, [Option, ...]}</TT></B></DT></DL><DL CLASS="description"><DT CLASS="dt-description"><B><TT>{{PortNumber, IPaddress, TransportProtocol}, Module, [Option, ...]}</TT></B></DT></DL><P> <A NAME="listened-port"></A> </P><!--TOC subsubsection Port Number, IP Address and Transport Protocol-->
+</P><DL CLASS="description"><DT CLASS="dt-description"><B><TT>[Listener, ...]</TT></B></DT></DL><P>
+Example:
+</P><PRE CLASS="verbatim">listen:
+ -
+ port: 5222
+ module: ejabberd_c2s
+ starttls: true
+ certfile: "/path/to/certfile.pem"
+ -
+ port: 5269
+ module: ejabberd_s2s_in
+ transport: tcp
+</PRE><P> <A NAME="listened-port"></A> </P><!--TOC subsubsection Port Number, IP Address and Transport Protocol-->
<H4 CLASS="subsubsection"><!--SEC ANCHOR --><A HREF="#listened-port">Port Number, IP Address and Transport Protocol</A></H4><!--SEC END --><P> <A NAME="listened-port"></A> </P><P>The port number defines which port to listen for incoming connections.
It can be a Jabber/XMPP standard port
-(see section <A HREF="#firewall">5.1</A>) or any other valid port number.</P><P>The IP address can be represented with a string
-or an Erlang tuple with decimal or hexadecimal numbers.
+(see section <A HREF="#firewall">5.1</A>) or any other valid port number.</P><P>The IP address can be represented as a string.
The socket will listen only in that network interface.
It is possible to specify a generic address,
so <TT>ejabberd</TT> will listen in all addresses.
@@ -667,9 +715,6 @@ When not specified the IP address, it will listen on all IPv4 network addresses.
</LI><LI CLASS="li-itemize"><CODE>"::"</CODE> to listen in all IPv6 network interfaces
</LI><LI CLASS="li-itemize"><CODE>"10.11.12.13"</CODE> is the IPv4 address <CODE>10.11.12.13</CODE>
</LI><LI CLASS="li-itemize"><CODE>"::FFFF:127.0.0.1"</CODE> is the IPv6 address <CODE>::FFFF:127.0.0.1/128</CODE>
-</LI><LI CLASS="li-itemize"><CODE>{10, 11, 12, 13}</CODE> is the IPv4 address <CODE>10.11.12.13</CODE>
-</LI><LI CLASS="li-itemize"><CODE>{0, 0, 0, 0, 0, 65535, 32512, 1}</CODE> is the IPv6 address <CODE>::FFFF:127.0.0.1/128</CODE>
-</LI><LI CLASS="li-itemize"><CODE>{16#fdca, 16#8ab6, 16#a243, 16#75ef, 0, 0, 0, 1}</CODE> is the IPv6 address <CODE>FDCA:8AB6:A243:75EF::1/128</CODE>
</LI></UL><P>The transport protocol can be <TT>tcp</TT> or <TT>udp</TT>.
Default is <TT>tcp</TT>.</P><P> <A NAME="listened-module"></A> </P><!--TOC subsubsection Listening Module-->
<H4 CLASS="subsubsection"><!--SEC ANCHOR --><A HREF="#listened-module">Listening Module</A></H4><!--SEC END --><P> <A NAME="listened-module"></A> </P><P>
@@ -680,15 +725,15 @@ Handles c2s connections.<BR>
Options: <TT>access</TT>, <TT>certfile</TT>, <TT>max_fsm_queue</TT>,
<TT>max_stanza_size</TT>, <TT>shaper</TT>,
<TT>starttls</TT>, <TT>starttls_required</TT>, <TT>tls</TT>,
-<TT>zlib</TT>
+<TT>zlib</TT>, <TT>tls_compression</TT>
</DD><DT CLASS="dt-description"><B><TT>ejabberd_s2s_in</TT></B></DT><DD CLASS="dd-description">
Handles incoming s2s connections.<BR>
- Options: <TT>max_stanza_size</TT>, <TT>shaper</TT>
+ Options: <TT>max_stanza_size</TT>, <TT>shaper</TT>, <TT>tls_compression</TT>
</DD><DT CLASS="dt-description"><B><TT>ejabberd_service</TT></B></DT><DD CLASS="dd-description">
Interacts with an <A HREF="http://www.ejabberd.im/tutorials-transports">external component</A>
(as defined in the Jabber Component Protocol (<A HREF="http://xmpp.org/extensions/xep-0114.html">XEP-0114</A>).<BR>
Options: <TT>access</TT>, <TT>hosts</TT>, <TT>max_fsm_queue</TT>,
-<TT>service_check_from</TT>, <TT>shaper</TT>
+<TT>service_check_from</TT>, <TT>shaper_rule</TT>
</DD><DT CLASS="dt-description"><B><TT>ejabberd_stun</TT></B></DT><DD CLASS="dd-description">
Handles STUN Binding requests as defined in
<A HREF="http://tools.ietf.org/html/rfc5389">RFC 5389</A>.<BR>
@@ -696,37 +741,37 @@ Handles STUN Binding requests as defined in
</DD><DT CLASS="dt-description"><B><TT>ejabberd_http</TT></B></DT><DD CLASS="dd-description">
Handles incoming HTTP connections.<BR>
Options: <TT>captcha</TT>, <TT>certfile</TT>, <TT>default_host</TT>, <TT>http_bind</TT>, <TT>http_poll</TT>,
-<TT>request_handlers</TT>, <TT>tls</TT>, <TT>trusted_proxies</TT>, <TT>web_admin</TT><BR>
+<TT>request_handlers</TT>, <TT>tls</TT>, <TT>tls_compression</TT>, <TT>trusted_proxies</TT>, <TT>web_admin</TT><BR>
</DD></DL><P> <A NAME="listened-options"></A> </P><!--TOC subsubsection Options-->
<H4 CLASS="subsubsection"><!--SEC ANCHOR --><A HREF="#listened-options">Options</A></H4><!--SEC END --><P> <A NAME="listened-options"></A> </P><P>This is a detailed description of each option allowed by the listening modules:
</P><DL CLASS="description"><DT CLASS="dt-description">
-<B><TT>{access, AccessName}</TT></B></DT><DD CLASS="dd-description"> This option defines
+<B><TT>access: AccessName</TT></B></DT><DD CLASS="dd-description"> This option defines
access to the port. The default value is <TT>all</TT>.
-</DD><DT CLASS="dt-description"><B><TT>{backlog, Value}</TT></B></DT><DD CLASS="dd-description"> The backlog value
+</DD><DT CLASS="dt-description"><B><TT>backlog: Value</TT></B></DT><DD CLASS="dd-description"> The backlog value
defines the maximum length that the queue of pending connections may
grow to. This should be increased if the server is going to handle
lots of new incoming connections as they may be dropped if there is
no space in the queue (and ejabberd was not able to accept them
immediately). Default value is 5.
-</DD><DT CLASS="dt-description"><B><TT>captcha</TT></B></DT><DD CLASS="dd-description">
-Simple web page that allows a user to fill a CAPTCHA challenge (see section <A HREF="#captcha">3.1.8</A>).
-</DD><DT CLASS="dt-description"><B><TT>{certfile, Path}</TT></B></DT><DD CLASS="dd-description"> Full path to a file containing the default SSL certificate.
+</DD><DT CLASS="dt-description"><B><TT>captcha: true|false</TT></B></DT><DD CLASS="dd-description">
+Simple web page that allows a user to fill a CAPTCHA challenge (see section <A HREF="#captcha">3.1.9</A>).
+</DD><DT CLASS="dt-description"><B><TT>certfile: Path</TT></B></DT><DD CLASS="dd-description"> Full path to a file containing the default SSL certificate.
To define a certificate file specific for a given domain, use the global option <TT>domain_certfile</TT>.
-</DD><DT CLASS="dt-description"><B><TT>{default_host, undefined|HostName}</TT></B></DT><DD CLASS="dd-description">
+</DD><DT CLASS="dt-description"><B><TT>default_host: undefined|HostName}</TT></B></DT><DD CLASS="dd-description">
If the HTTP request received by ejabberd contains the HTTP header <TT>Host</TT>
-with an ambiguous virtual host that doesn&#X2019;t match any one defined in ejabberd (see <A HREF="#hostnames">3.1.1</A>),
+with an ambiguous virtual host that doesn&#X2019;t match any one defined in ejabberd (see <A HREF="#hostnames">3.1.2</A>),
then this configured HostName is set as the request Host.
The default value of this option is: <TT>undefined</TT>.
-</DD><DT CLASS="dt-description"><B><TT>{hosts, [Hostname, ...], [HostOption, ...]}</TT></B></DT><DD CLASS="dd-description">
+</DD><DT CLASS="dt-description"><B><TT>hosts: {Hostname: [HostOption, ...]}</TT></B></DT><DD CLASS="dd-description">
The external Jabber component that connects to this <TT>ejabberd_service</TT>
can serve one or more hostnames.
As <TT>HostOption</TT> you can define options for the component;
currently the only allowed option is the password required to the component
-when attempt to connect to ejabberd: <TT>{password, Secret}</TT>.
+when attempt to connect to ejabberd: <TT>password: Secret</TT>.
Note that you cannot define in a single <TT>ejabberd_service</TT> components of
different services: add an <TT>ejabberd_service</TT> for each service,
as seen in an example below.
-</DD><DT CLASS="dt-description"><B><TT>http_bind</TT></B></DT><DD CLASS="dd-description">
+</DD><DT CLASS="dt-description"><B><TT>http_bind: true|false</TT></B></DT><DD CLASS="dd-description">
This option enables HTTP Binding (<A HREF="http://xmpp.org/extensions/xep-0124.html">XEP-0124</A> and <A HREF="http://xmpp.org/extensions/xep-0206.html">XEP-0206</A>) support. HTTP Bind
enables access via HTTP requests to <TT>ejabberd</TT> from behind firewalls which
do not allow outgoing sockets on port 5222.<P>Remember that you must also install and enable the module mod_http_bind.</P><P>If HTTP Bind is enabled, it will be available at
@@ -737,7 +782,7 @@ interesting to host a web-based XMPP client such as
(check the tutorials to install JWChat with ejabberd and an
<A HREF="http://www.ejabberd.im/jwchat-localserver">embedded local web server</A>
or <A HREF="http://www.ejabberd.im/jwchat-apache">Apache</A>).
-</P></DD><DT CLASS="dt-description"><B><TT>http_poll</TT></B></DT><DD CLASS="dd-description">
+</P></DD><DT CLASS="dt-description"><B><TT>http_poll: true|false</TT></B></DT><DD CLASS="dd-description">
This option enables HTTP Polling (<A HREF="http://xmpp.org/extensions/xep-0025.html">XEP-0025</A>) support. HTTP Polling
enables access via HTTP requests to <TT>ejabberd</TT> from behind firewalls which
do not allow outgoing sockets on port 5222.<P>If HTTP Polling is enabled, it will be available at
@@ -747,9 +792,9 @@ interesting to host a web-based XMPP client such as
<A HREF="http://jwchat.sourceforge.net/">JWChat</A>.</P><P>The maximum period of time to keep a client session active without
an incoming POST request can be configured with the global option
<TT>http_poll_timeout</TT>. The default value is five minutes.
-The option can be defined in <TT>ejabberd.cfg</TT>, expressing the time
+The option can be defined in <TT>ejabberd.yml</TT>, expressing the time
in seconds: <CODE>{http_poll_timeout, 300}.</CODE>
-</P></DD><DT CLASS="dt-description"><B><TT>{max_fsm_queue, Size}</TT></B></DT><DD CLASS="dd-description">
+</P></DD><DT CLASS="dt-description"><B><TT>max_fsm_queue: Size</TT></B></DT><DD CLASS="dd-description">
This option specifies the maximum number of elements in the queue of the FSM
(Finite State Machine).
Roughly speaking, each message in such queues represents one XML
@@ -767,7 +812,7 @@ If the option is not specified for <TT>ejabberd_service</TT> or
the globally configured value is used.
The allowed values are integers and &#X2019;undefined&#X2019;.
Default value: &#X2019;undefined&#X2019;.
-</DD><DT CLASS="dt-description"><B><TT>{max_stanza_size, Size}</TT></B></DT><DD CLASS="dd-description">
+</DD><DT CLASS="dt-description"><B><TT>max_stanza_size: Size</TT></B></DT><DD CLASS="dd-description">
This option specifies an
approximate maximum size in bytes of XML stanzas. Approximate,
because it is calculated with the precision of one block of read
@@ -776,12 +821,15 @@ value is <TT>infinity</TT>. Recommended values are 65536 for c2s
connections and 131072 for s2s connections. s2s max stanza size
must always much higher than c2s limit. Change this value with
extreme care as it can cause unwanted disconnect if set too low.
-</DD><DT CLASS="dt-description"><B><TT>{request_handlers, [ {Path, Module}, ...]}</TT></B></DT><DD CLASS="dd-description"> To define one or several handlers that will serve HTTP requests.
-The Path is a list of strings; so the URIs that start with that Path will be served by Module.
+</DD><DT CLASS="dt-description"><B><TT>request_handlers: {Path: Module}</TT></B></DT><DD CLASS="dd-description"> To define one or several handlers that will serve HTTP requests.
+The Path is a string; so the URIs that start with that Path will be served by Module.
For example, if you want <TT>mod_foo</TT> to serve the URIs that start with <TT>/a/b/</TT>,
and you also want <TT>mod_http_bind</TT> to serve the URIs <TT>/http-bind/</TT>,
-use this option: <TT>{request_handlers, [{["a", "b"], mod_foo}, {["http-bind"], mod_http_bind}]}</TT>
-</DD><DT CLASS="dt-description"><B><TT>{service_check_from, true|false}</TT></B></DT><DD CLASS="dd-description">
+use this option:
+<PRE CLASS="verbatim">request_handlers:
+ /"a"/"b": mod_foo
+ /"http-bind": mod_http_bind
+</PRE></DD><DT CLASS="dt-description"><B><TT>service_check_from: true|false</TT></B></DT><DD CLASS="dd-description">
This option can be used with <TT>ejabberd_service</TT> only.
<A HREF="http://xmpp.org/extensions/xep-0114.html">XEP-0114</A> requires that the domain must match the hostname of the component.
@@ -789,19 +837,25 @@ If this option is set to <TT>false</TT>, <TT>ejabberd</TT> will allow the compon
to send stanzas with any arbitrary domain in the &#X2019;from&#X2019; attribute.
Only use this option if you are completely sure about it.
The default value is <TT>true</TT>, to be compliant with <A HREF="http://xmpp.org/extensions/xep-0114.html">XEP-0114</A>.
-</DD><DT CLASS="dt-description"><B><TT>{shaper, none|ShaperName}</TT></B></DT><DD CLASS="dd-description"> This option defines a
-shaper for the port (see section&#XA0;<A HREF="#shapers">3.1.6</A>). The default value
+</DD><DT CLASS="dt-description"><B><TT>shaper: none|ShaperName</TT></B></DT><DD CLASS="dd-description"> This option defines a
+shaper for the port (see section&#XA0;<A HREF="#shapers">3.1.7</A>). The default value
is <TT>none</TT>.
-</DD><DT CLASS="dt-description"><B><TT>starttls</TT></B></DT><DD CLASS="dd-description"> This option
+</DD><DT CLASS="dt-description"><B><TT>shaper_rule: none|ShaperRule</TT></B></DT><DD CLASS="dd-description"> This option defines a
+shaper rule for the <TT>ejabberd_service</TT> (see section&#XA0;<A HREF="#shapers">3.1.7</A>). The recommended value
+is <TT>fast</TT>.
+</DD><DT CLASS="dt-description"><B><TT>starttls: true|false</TT></B></DT><DD CLASS="dd-description"> This option
specifies that STARTTLS encryption is available on connections to the port.
You should also set the <TT>certfile</TT> option.
You can define a certificate file for a specific domain using the global option <TT>domain_certfile</TT>.
-</DD><DT CLASS="dt-description"><B><TT>starttls_required</TT></B></DT><DD CLASS="dd-description"> This option
+</DD><DT CLASS="dt-description"><B><TT>starttls_required: true|false</TT></B></DT><DD CLASS="dd-description"> This option
specifies that STARTTLS encryption is required on connections to the port.
No unencrypted connections will be allowed.
You should also set the <TT>certfile</TT> option.
You can define a certificate file for a specific domain using the global option <TT>domain_certfile</TT>.
-</DD><DT CLASS="dt-description"><B><TT>tls</TT></B></DT><DD CLASS="dd-description"> This option specifies that traffic on
+</DD><DT CLASS="dt-description"><B><TT>timeout: Integer</TT></B></DT><DD CLASS="dd-description">
+Timeout of the connections, expressed in milliseconds.
+Default: 5000
+</DD><DT CLASS="dt-description"><B><TT>tls: true|false</TT></B></DT><DD CLASS="dd-description"> This option specifies that traffic on
the port will be encrypted using SSL immediately after connecting.
This was the traditional encryption method in the early Jabber software,
commonly on port 5223 for client-to-server communications.
@@ -811,49 +865,51 @@ The preferable encryption method is STARTTLS on port 5222, as defined
which can be enabled in <TT>ejabberd</TT> with the option <TT>starttls</TT>.
If this option is set, you should also set the <TT>certfile</TT> option.
The option <TT>tls</TT> can also be used in <TT>ejabberd_http</TT> to support HTTPS.
-</DD><DT CLASS="dt-description"><B><TT>{trusted_proxies, all | [IpString]}</TT></B></DT><DD CLASS="dd-description">
+</DD><DT CLASS="dt-description"><B><TT>tls_compression: true|false</TT></B></DT><DD CLASS="dd-description">
+Whether to enable or disable TLS compression. The default value is <TT>true</TT>.
+</DD><DT CLASS="dt-description"><B><TT>trusted_proxies: all | [IpString]</TT></B></DT><DD CLASS="dd-description">
Specify what proxies are trusted when an HTTP request contains the header <TT>X-Forwarded-For</TT>
You can specify <TT>all</TT> to allow all proxies, or specify a list of IPs in string format.
The default value is: <TT>["127.0.0.1"]</TT>
-</DD><DT CLASS="dt-description"><B><TT>web_admin</TT></B></DT><DD CLASS="dd-description"> This option
+</DD><DT CLASS="dt-description"><B><TT>web_admin: true|false</TT></B></DT><DD CLASS="dd-description"> This option
enables the Web Admin for <TT>ejabberd</TT> administration which is available
at <CODE>http://server:port/admin/</CODE>. Login and password are the username and
password of one of the registered users who are granted access by the
&#X2018;configure&#X2019; access rule.
-</DD><DT CLASS="dt-description"><B><TT>zlib</TT></B></DT><DD CLASS="dd-description"> This
+</DD><DT CLASS="dt-description"><B><TT>zlib: true|false</TT></B></DT><DD CLASS="dd-description"> This
option specifies that Zlib stream compression (as defined in <A HREF="http://xmpp.org/extensions/xep-0138.html">XEP-0138</A>)
is available on connections to the port.
</DD></DL><P>There are some additional global options that can be specified in the ejabberd configuration file (outside <TT>listen</TT>):
</P><DL CLASS="description"><DT CLASS="dt-description">
-<B><TT>{s2s_use_starttls, false|optional|required|required_trusted}</TT></B></DT><DD CLASS="dd-description">
+<B><TT>s2s_use_starttls: false|optional|required|required_trusted</TT></B></DT><DD CLASS="dd-description">
This option defines if
s2s connections don&#X2019;t use STARTTLS encryption; if STARTTLS can be used optionally;
if STARTTLS is required to establish the connection;
or if STARTTLS is required and the remote certificate must be valid and trusted.
The default value is to not use STARTTLS: <TT>false</TT>.
-</DD><DT CLASS="dt-description"><B><TT>{s2s_certfile, Path}</TT></B></DT><DD CLASS="dd-description"> Full path to a
+</DD><DT CLASS="dt-description"><B><TT>s2s_certfile: Path</TT></B></DT><DD CLASS="dd-description"> Full path to a
file containing a SSL certificate.
-</DD><DT CLASS="dt-description"><B><TT>{domain_certfile, Domain, Path}</TT></B></DT><DD CLASS="dd-description">
+</DD><DT CLASS="dt-description"><B><TT>domain_certfile: Path</TT></B></DT><DD CLASS="dd-description">
Full path to the file containing the SSL certificate for a specific domain.
-</DD><DT CLASS="dt-description"><B><TT>{outgoing_s2s_options, [Family, ...], Timeout}</TT></B></DT><DD CLASS="dd-description">
-Specify which address families to try, in what order, and connect timeout in milliseconds.
-By default it first tries connecting with IPv4, if that fails it tries using IPv6,
-with a timeout of 10000 milliseconds.
-</DD><DT CLASS="dt-description"><B><TT>{s2s_dns_options, [ {Property, Value}, ...]}</TT></B></DT><DD CLASS="dd-description">
-Define properties to use for DNS resolving.
-Allowed Properties are: <TT>timeout</TT> in seconds which default value is <TT>10</TT>
-and <TT>retries</TT> which default value is <TT>2</TT>.
-</DD><DT CLASS="dt-description"><B><TT>{s2s_default_policy, allow|deny}</TT></B></DT><DD CLASS="dd-description">
-The default policy for incoming and outgoing s2s connections to other XMPP servers.
-The default value is <TT>allow</TT>.
-</DD><DT CLASS="dt-description"><B><TT>{{s2s_host, Host}, allow|deny}</TT></B></DT><DD CLASS="dd-description">
-Defines if incoming and outgoing s2s connections with a specific remote host are allowed or denied.
-This allows to restrict ejabberd to only establish s2s connections
-with a small list of trusted servers, or to block some specific servers.
-</DD><DT CLASS="dt-description"><B><TT>{s2s_max_retry_delay, Seconds}</TT></B></DT><DD CLASS="dd-description">
+</DD><DT CLASS="dt-description"><B><TT>outgoing_s2s_families: [Family, ...]</TT></B></DT><DD CLASS="dd-description">
+Specify which address families to try, in what order.
+By default it first tries connecting with IPv4, if that fails it tries using IPv6.
+</DD><DT CLASS="dt-description"><B><TT>outgoing_s2s_timeout: Timeout</TT></B></DT><DD CLASS="dd-description">
+The timeout in milliseconds for outgoing S2S connection attempts.
+</DD><DT CLASS="dt-description"><B><TT>s2s_dns_timeout: Timeout</TT></B></DT><DD CLASS="dd-description">
+The timeout in seconds for DNS resolving. The default value is <TT>10</TT>.
+</DD><DT CLASS="dt-description"><B><TT>s2s_dns_retries: Number</TT></B></DT><DD CLASS="dd-description">
+DNS resolving retries in seconds. The default value is <TT>2</TT>.
+</DD><DT CLASS="dt-description"><B><TT>s2s_policy: Access</TT></B></DT><DD CLASS="dd-description">
+The policy for incoming and outgoing s2s connections to other XMPP servers.
+The default value is <TT>all</TT>.
+</DD><DT CLASS="dt-description"><B><TT>s2s_max_retry_delay: Seconds</TT></B></DT><DD CLASS="dd-description">
The maximum allowed delay for retry to connect after a failed connection attempt.
Specified in seconds. The default value is 300 seconds (5 minutes).
-</DD><DT CLASS="dt-description"><B><TT>{max_fsm_queue, Size}</TT></B></DT><DD CLASS="dd-description">
+</DD><DT CLASS="dt-description"><B><TT>s2s_tls_compression: true|false</TT></B></DT><DD CLASS="dd-description">
+Whether to enable or disable TLS compression for s2s connections.
+The default value is <TT>true</TT>.
+</DD><DT CLASS="dt-description"><B><TT>max_fsm_queue: Size</TT></B></DT><DD CLASS="dd-description">
This option specifies the maximum number of elements in the queue of the FSM
(Finite State Machine).
Roughly speaking, each message in such queues represents one XML
@@ -871,7 +927,7 @@ If the option is not specified for <TT>ejabberd_service</TT> or
the globally configured value is used.
The allowed values are integers and &#X2019;undefined&#X2019;.
Default value: &#X2019;undefined&#X2019;.
-</DD><DT CLASS="dt-description"><B><TT>{route_subdomains, local|s2s}</TT></B></DT><DD CLASS="dd-description">
+</DD><DT CLASS="dt-description"><B><TT>route_subdomains: local|s2s</TT></B></DT><DD CLASS="dd-description">
Defines if ejabberd must route stanzas directed to subdomains locally (compliant with
<A HREF="http://xmpp.org/rfcs/rfc3920.html#rules.subdomain">RFC 3920: XMPP Core</A>),
or to foreign server using S2S (compliant with
@@ -889,40 +945,60 @@ and also allows plain connections for old clients.
</LI><LI CLASS="li-itemize">Port 5280 listens for HTTP requests, and serves the HTTP Poll service.
</LI><LI CLASS="li-itemize">Port 5281 listens for HTTP requests, using HTTPS to serve HTTP-Bind (BOSH) and the Web Admin as explained in
section&#XA0;<A HREF="#webadmin">4.3</A>. The socket only listens connections to the IP address 127.0.0.1.
-</LI></UL><PRE CLASS="verbatim">{hosts, ["example.com", "example.org", "example.net"]}.
-{listen,
- [
- {5222, ejabberd_c2s, [
- {access, c2s},
- {shaper, c2s_shaper},
- starttls, {certfile, "/etc/ejabberd/server.pem"},
- {max_stanza_size, 65536}
- ]},
- {5223, ejabberd_c2s, [
- {access, c2s},
- {shaper, c2s_shaper},
- tls, {certfile, "/etc/ejabberd/server.pem"},
- {max_stanza_size, 65536}
- ]},
- {{5269, "::"}, ejabberd_s2s_in, [
- {shaper, s2s_shaper},
- {max_stanza_size, 131072}
- ]},
- {{3478, udp}, ejabberd_stun, []},
- {5280, ejabberd_http, [
- http_poll
- ]},
- {{5281, "127.0.0.1"}, ejabberd_http, [
- web_admin,
- http_bind,
- tls, {certfile, "/etc/ejabberd/server.pem"},
- ]}
- ]
-}.
-{s2s_use_starttls, optional}.
-{s2s_certfile, "/etc/ejabberd/server.pem"}.
-{domain_certfile, "example.com", "/etc/ejabberd/example_com.pem"}.
-{outgoing_s2s_options, [ipv4, ipv6], 10000}.
+</LI></UL><PRE CLASS="verbatim">hosts:
+ - "example.com"
+ - "example.org"
+ - "example.net"
+
+listen:
+ -
+ port: 5222
+ module: ejabberd_c2s
+ access: c2s
+ shaper: c2s_shaper
+ starttls: true
+ certfile: "/etc/ejabberd/server.pem"
+ max_stanza_size: 65536
+ -
+ port: 5223
+ module: ejabberd_c2s
+ access: c2s
+ shaper: c2s_shaper
+ tls: true
+ certfile: "/etc/ejabberd/server.pem"
+ max_stanza_size: 65536
+ -
+ port: 5269
+ ip: "::"
+ module: ejabberd_s2s_in
+ shaper: s2s_shaper
+ max_stanza_size: 131072
+ -
+ port: 3478
+ transport: udp
+ module: ejabberd_stun
+ -
+ port: 5280
+ module: ejabberd_http
+ http_poll: true
+ -
+ port: 5281
+ ip: "127.0.0.1"
+ module: ejabberd_http
+ web_admin: true
+ http_bind: true
+ tls: true
+ certfile: "/etc/ejabberd/server.pem"
+
+s2s_use_starttls: optional
+s2s_certfile: "/etc/ejabberd/server.pem"
+host_config:
+ "example.com":
+ domain_certfile: "/etc/ejabberd/example_com.pem"
+outgoing_s2s_families:
+ - ipv4
+ - ipv6
+outgoing_s2s_timeout: 10000
</PRE><P>In this example, the following configuration defines that:
</P><UL CLASS="itemize"><LI CLASS="li-itemize">
c2s connections are listened for on port 5222 (all IPv4 addresses) and
@@ -960,59 +1036,117 @@ connected to port 5237 with password &#X2018;<TT>ggsecret</TT>&#X2019;.
<TT>jmc.example.org</TT> is connected to port 5238 with password
&#X2018;<TT>jmcsecret</TT>&#X2019;.
</LI><LI CLASS="li-itemize">The service custom has enabled the special option to avoiding checking the <TT>from</TT> attribute in the packets send by this component. The component can send packets in behalf of any users from the server, or even on behalf of any server.
-</LI></UL><PRE CLASS="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, {192, 168, 0, 1}}, ejabberd_c2s, [
- {access, c2s},
- ssl, {certfile, "/path/to/ssl.pem"}
- ]},
- {{5223, {16#fdca, 16#8ab6, 16#a243, 16#75ef, 0, 0, 0, 1}},
- ejabberd_c2s, [
- {access, c2s},
- ssl, {certfile, "/path/to/ssl.pem"}
- ]},
- {5269, ejabberd_s2s_in, []},
- {{5280, {0, 0, 0, 0}}, ejabberd_http, [
- http_poll,
- web_admin
- ]},
- {{5233, {127, 0, 0, 1}}, ejabberd_service, [
- {hosts, ["aim.example.org"],
- [{password, "aimsecret"}]}
- ]},
- {{5233, "::1"}, ejabberd_service, [
- {hosts, ["aim.example.org"],
- [{password, "aimsecret"}]}
- ]},
- {5234, ejabberd_service, [{hosts, ["icq.example.org", "sms.example.org"],
- [{password, "jitsecret"}]}]},
- {5235, ejabberd_service, [{hosts, ["msn.example.org"],
- [{password, "msnsecret"}]}]},
- {5236, ejabberd_service, [{hosts, ["yahoo.example.org"],
- [{password, "yahoosecret"}]}]},
- {5237, ejabberd_service, [{hosts, ["gg.example.org"],
- [{password, "ggsecret"}]}]},
- {5238, ejabberd_service, [{hosts, ["jmc.example.org"],
- [{password, "jmcsecret"}]}]},
- {5239, ejabberd_service, [{hosts, ["custom.example.org"],
- [{password, "customsecret"}]},
- {service_check_from, false}]}
- ]
-}.
-{s2s_use_starttls, required_trusted}.
-{s2s_certfile, "/path/to/ssl.pem"}.
-{s2s_default_policy, deny}.
-{{s2s_host,"jabber.example.org"}, allow}.
-{{s2s_host,"example.com"}, allow}.
+</LI></UL><PRE CLASS="verbatim">acl:
+ blocked:
+ user: "bad"
+ trusted_servers:
+ server:
+ - "example.com"
+ - "jabber.example.org"
+ xmlrpc_bot:
+ user:
+ - "xmlrpc-robot": "example.org"
+shaper:
+ normal: 1000
+access:
+ c2s:
+ blocked: deny
+ all: allow
+ c2s_shaper:
+ admin: none
+ all: normal
+ xmlrpc_access:
+ xmlrpc_bot: allow
+ s2s_access:
+ trusted_servers: allow
+ all: deny
+s2s_certfile: "/path/to/ssl.pem"
+s2s_policy: s2s_access
+s2s_use_starttls: required_trusted
+listen:
+ -
+ port: 5222
+ module: ejabberd_c2s
+ shaper: c2s_shaper
+ access: c2s
+ -
+ ip: "192.168.0.1"
+ port: 5223
+ module: ejabberd_c2s
+ certfile: "/path/to/ssl.pem"
+ tls: true
+ access: c2s
+ -
+ ip: "FDCA:8AB6:A243:75EF::1"
+ port: 5223
+ module: ejabberd_c2s
+ certfile: "/path/to/ssl.pem"
+ tls: true
+ access: c2s
+ -
+ port: 5269
+ module: ejabberd_s2s_in
+ -
+ port: 5280
+ module: ejabberd_http
+ web_admin: true
+ http_poll: true
+ -
+ port: 4560
+ module: ejabberd_xmlrpc
+ -
+ ip: "127.0.0.1"
+ port: 5233
+ module: ejabberd_service
+ hosts:
+ "aim.example.org":
+ password: "aimsecret"
+ -
+ ip: "::1"
+ port: 5233
+ module: ejabberd_service
+ hosts:
+ "aim.example.org":
+ password: "aimsecret"
+ -
+ port: 5234
+ module: ejabberd_service
+ hosts:
+ "icq.example.org":
+ password: "jitsecret"
+ "sms.example.org":
+ password: "jitsecret"
+ -
+ port: 5235
+ module: ejabberd_service
+ hosts:
+ "msn.example.org":
+ password: "msnsecret"
+ -
+ port: 5236
+ module: ejabberd_service
+ hosts:
+ "yahoo.example.org":
+ password: "yahoosecret"
+ -
+ port: 5237
+ module: ejabberd_service
+ hosts:
+ "gg.example.org":
+ password: "ggsecret"
+ -
+ port: 5238
+ module: ejabberd_service
+ hosts:
+ "jmc.example.org":
+ password: "jmcsecret"
+ -
+ port: 5239
+ module: ejabberd_service
+ service_check_from: false
+ hosts:
+ "custom.example.org":
+ password: "customsecret"
</PRE><P>Note, that for services based in jabberd14 or WPJabber
you have to make the transports log and do XDB by themselves:
</P><PRE CLASS="verbatim"> &lt;!--
@@ -1044,22 +1178,21 @@ you have to make the transports log and do XDB by themselves:
&lt;/xdb_file&gt;
&lt;/xdb&gt;
</PRE><P> <A NAME="auth"></A> </P><!--TOC subsection Authentication-->
-<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc24">3.1.4</A>&#XA0;&#XA0;<A HREF="#auth">Authentication</A></H3><!--SEC END --><P> <A NAME="auth"></A>
+<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc25">3.1.5</A>&#XA0;&#XA0;<A HREF="#auth">Authentication</A></H3><!--SEC END --><P> <A NAME="auth"></A>
</P><P>The option <TT>auth_method</TT> defines the authentication methods that are used
for user authentication. The syntax is:
-</P><DL CLASS="description"><DT CLASS="dt-description"><B><TT>{auth_method, [Method, ...]}.</TT></B></DT></DL><P>The following authentication methods are supported by <TT>ejabberd</TT>:
+</P><DL CLASS="description"><DT CLASS="dt-description"><B><TT>[Method, ...]</TT></B></DT></DL><P>The following authentication methods are supported by <TT>ejabberd</TT>:
</P><UL CLASS="itemize"><LI CLASS="li-itemize">
-internal (default) &#X2014; See section&#XA0;<A HREF="#internalauth">3.1.4</A>.
-</LI><LI CLASS="li-itemize">external &#X2014; See section&#XA0;<A HREF="#extauth">3.1.4</A>.
-</LI><LI CLASS="li-itemize">ldap &#X2014; See section&#XA0;<A HREF="#ldap">3.2.5</A>.
-</LI><LI CLASS="li-itemize">odbc &#X2014; See section&#XA0;<A HREF="#mysql">3.2.1</A>, <A HREF="#pgsql">3.2.3</A>,
-<A HREF="#mssql">3.2.2</A> and <A HREF="#odbc">3.2.4</A>.
-</LI><LI CLASS="li-itemize">anonymous &#X2014; See section&#XA0;<A HREF="#saslanonymous">3.1.4</A>.
-</LI><LI CLASS="li-itemize">pam &#X2014; See section&#XA0;<A HREF="#pam">3.1.4</A>.
+internal (default) &#X2014; See section&#XA0;<A HREF="#internalauth">3.1.5</A>.
+</LI><LI CLASS="li-itemize">external &#X2014; See section&#XA0;<A HREF="#extauth">3.1.5</A>.
+</LI><LI CLASS="li-itemize">ldap &#X2014; See section&#XA0;<A HREF="#ldap">3.2.2</A>.
+</LI><LI CLASS="li-itemize">odbc &#X2014; See section&#XA0;<A HREF="#odbc">3.2.1</A>.
+</LI><LI CLASS="li-itemize">anonymous &#X2014; See section&#XA0;<A HREF="#saslanonymous">3.1.5</A>.
+</LI><LI CLASS="li-itemize">pam &#X2014; See section&#XA0;<A HREF="#pam">3.1.5</A>.
</LI></UL><P>Account creation is only supported by internal, external and odbc methods.</P><P>The option <TT>resource_conflict</TT> defines the action when a client attempts to
login to an account with a resource that is already connected.
The option syntax is:
-</P><DL CLASS="description"><DT CLASS="dt-description"><B><TT>{resource_conflict, setresource|closenew|closeold}.</TT></B></DT></DL><P>
+</P><DL CLASS="description"><DT CLASS="dt-description"><B><TT>resource_conflict: setresource|closenew|closeold</TT></B></DT></DL><P>
The possible values match exactly the three possibilities described in
<A HREF="http://tools.ietf.org/html/rfc6120#section-7.7.2.2">XMPP Core: section 7.7.2.2</A>.
The default value is <TT>closeold</TT>.
@@ -1068,10 +1201,10 @@ then this option is not respected, and the action performed is <TT>closeold</TT>
of the machine, in case it isn&#X2019;t detected automatically.
The FQDN is used to authenticate some clients that use the DIGEST-MD5 SASL mechanism.
The option syntax is:
-</P><DL CLASS="description"><DT CLASS="dt-description"><B><TT>{fqdn, undefined|FqdnString|[FqdnString]}.</TT></B></DT></DL><P> <A NAME="internalauth"></A> </P><!--TOC subsubsection Internal-->
+</P><DL CLASS="description"><DT CLASS="dt-description"><B><TT>fqdn: undefined|FqdnString|[FqdnString]</TT></B></DT></DL><P> <A NAME="internalauth"></A> </P><!--TOC subsubsection Internal-->
<H4 CLASS="subsubsection"><!--SEC ANCHOR --><A HREF="#internalauth">Internal</A></H4><!--SEC END --><P> <A NAME="internalauth"></A>
</P><P><TT>ejabberd</TT> uses its internal Mnesia database as the default authentication method.
-The value <TT>internal</TT> will enable the internal authentication method.</P><P>The option <TT>{auth_password_format, plain|scram}</TT>
+The value <TT>internal</TT> will enable the internal authentication method.</P><P>The option <TT>auth_password_format: plain|scram</TT>
defines in what format the users passwords are stored:
</P><DL CLASS="description"><DT CLASS="dt-description">
<B><TT>plain</TT></B></DT><DD CLASS="dd-description">
@@ -1089,11 +1222,14 @@ This format allows clients to authenticate using: <TT>SASL PLAIN</TT> and <TT>SA
</P><UL CLASS="itemize"><LI CLASS="li-itemize">
To use internal authentication on <TT>example.org</TT> and LDAP
authentication on <TT>example.net</TT>:
-<PRE CLASS="verbatim">{host_config, "example.org", [{auth_method, [internal]}]}.
-{host_config, "example.net", [{auth_method, [ldap]}]}.
+<PRE CLASS="verbatim">host_config:
+ "example.org":
+ auth_method: [internal]
+ "example.net":
+ auth_method: [ldap]
</PRE></LI><LI CLASS="li-itemize">To use internal authentication with hashed passwords on all virtual hosts:
-<PRE CLASS="verbatim">{auth_method, internal}.
-{auth_password_format, scram}.
+<PRE CLASS="verbatim">auth_method: internal
+auth_password_format: scram
</PRE></LI></UL><P> <A NAME="extauth"></A> </P><!--TOC subsubsection External Script-->
<H4 CLASS="subsubsection"><!--SEC ANCHOR --><A HREF="#extauth">External Script</A></H4><!--SEC END --><P> <A NAME="extauth"></A>
</P><P>In this authentication method, when <TT>ejabberd</TT> starts,
@@ -1103,11 +1239,11 @@ The details on the interface between ejabberd and the script are described
in the <TT>ejabberd Developers Guide</TT>.
There are also <A HREF="http://www.ejabberd.im/extauth">several example authentication scripts</A>.</P><P>These are the specific options:
</P><DL CLASS="description"><DT CLASS="dt-description">
-<B><TT>{extauth_program, PathToScript}</TT></B></DT><DD CLASS="dd-description">
+<B><TT>extauth_program: PathToScript</TT></B></DT><DD CLASS="dd-description">
Indicate in this option the full path to the external authentication script.
-The script must be executable by ejabberd.</DD><DT CLASS="dt-description"><B><TT>{extauth_instances, Integer}</TT></B></DT><DD CLASS="dd-description">
+The script must be executable by ejabberd.</DD><DT CLASS="dt-description"><B><TT>extauth_instances: Integer</TT></B></DT><DD CLASS="dd-description">
Indicate how many instances of the script to run simultaneously to serve authentication in the virtual host.
-The default value is the minimum number: 1.</DD><DT CLASS="dt-description"><B><TT>{extauth_cache, false|CacheTimeInteger}</TT></B></DT><DD CLASS="dd-description">
+The default value is the minimum number: 1.</DD><DT CLASS="dt-description"><B><TT>extauth_cache: false|CacheTimeInteger</TT></B></DT><DD CLASS="dd-description">
The value <TT>false</TT> disables the caching feature, this is the default.
The integer <TT>0</TT> (zero) enables caching for statistics, but doesn&#X2019;t use that cached information to authenticate users.
If another integer value is set, caching is enabled both for statistics and for authentication:
@@ -1118,51 +1254,78 @@ Note: caching should not be enabled in a host if internal auth is also enabled.
If caching is enabled, <TT>mod_last</TT> must be enabled also in that vhost.
</DD></DL><P>This example sets external authentication, the extauth script, enables caching for 10 minutes,
and starts three instances of the script for each virtual host defined in ejabberd:
-</P><PRE CLASS="verbatim">{auth_method, [external]}.
-{extauth_program, "/etc/ejabberd/JabberAuth.class.php"}.
-{extauth_cache, 600}.
-{extauth_instances, 3}.
-</PRE><P> <A NAME="saslanonymous"></A> </P><!--TOC subsubsection SASL Anonymous and Anonymous Login-->
-<H4 CLASS="subsubsection"><!--SEC ANCHOR --><A HREF="#saslanonymous">SASL Anonymous and Anonymous Login</A></H4><!--SEC END --><P> <A NAME="saslanonymous"></A>
-</P><P>The value <TT>anonymous</TT> will enable the internal authentication method.</P><P>The anonymous authentication method can be configured with the following
+</P><PRE CLASS="verbatim">auth_method: [external]
+extauth_program: "/etc/ejabberd/JabberAuth.class.php"
+extauth_cache: 600
+extauth_instances: 3
+</PRE><P> <A NAME="saslanonymous"></A> </P><!--TOC subsubsection Anonymous Login and SASL Anonymous-->
+<H4 CLASS="subsubsection"><!--SEC ANCHOR --><A HREF="#saslanonymous">Anonymous Login and SASL Anonymous</A></H4><!--SEC END --><P> <A NAME="saslanonymous"></A>
+</P><P>The <TT>anonymous</TT> authentication method enables two modes for anonymous authentication:
+</P><DL CLASS="description"><DT CLASS="dt-description">
+<B><TT>Anonymous login:</TT></B></DT><DD CLASS="dd-description"> This is a standard login, that use the
+classical login and password mechanisms, but where password is
+accepted or preconfigured for all anonymous users. This login is
+compliant with SASL authentication, password and digest non-SASL
+authentication, so this option will work with almost all XMPP
+clients</DD><DT CLASS="dt-description"><B><TT>SASL Anonymous:</TT></B></DT><DD CLASS="dd-description"> This is a special SASL authentication
+mechanism that allows to login without providing username or
+password (see <A HREF="http://xmpp.org/extensions/xep-0175.html">XEP-0175</A>). The main advantage of SASL Anonymous
+is that the protocol was designed to give the user a login. This is
+useful to avoid in some case, where the server has many users
+already logged or registered and when it is hard to find a free
+username. The main disavantage is that you need a client that
+specifically supports the SASL Anonymous protocol.
+</DD></DL><P>The anonymous authentication method can be configured with the following
options. Remember that you can use the <TT>host_config</TT> option to set virtual
-host specific options (see section&#XA0;<A HREF="#virtualhost">3.1.2</A>). Note that there also
-is a detailed tutorial regarding <A HREF="http://support.process-one.net/doc/display/MESSENGER/Anonymous+users+support">SASL
-Anonymous and anonymous login configuration</A>.</P><DL CLASS="description"><DT CLASS="dt-description">
-<B><TT>{allow_multiple_connections, false|true}</TT></B></DT><DD CLASS="dd-description"> This option is only used
+host specific options (see section&#XA0;<A HREF="#virtualhost">3.1.3</A>).</P><DL CLASS="description"><DT CLASS="dt-description">
+<B><TT>allow_multiple_connections: false|true</TT></B></DT><DD CLASS="dd-description"> This option is only used
when the anonymous mode is
enabled. Setting it to <TT>true</TT> means that the same username can be taken
multiple times in anonymous login mode if different resource are used to
connect. This option is only useful in very special occasions. The default
value is <TT>false</TT>.
-</DD><DT CLASS="dt-description"><B><TT>{anonymous_protocol, sasl_anon | login_anon | both}</TT></B></DT><DD CLASS="dd-description">
-<TT>sasl_anon</TT> means
-that the SASL Anonymous method will be used. <TT>login_anon</TT> means that the
-anonymous login method will be used. <TT>both</TT> means that SASL Anonymous and
-login anonymous are both enabled.
+</DD><DT CLASS="dt-description"><B><TT>anonymous_protocol: login_anon | sasl_anon | both</TT></B></DT><DD CLASS="dd-description">
+<TT>login_anon</TT> means that the anonymous login method will be used.
+<TT>sasl_anon</TT> means that the SASL Anonymous method will be used.
+<TT>both</TT> means that SASL Anonymous and login anonymous are both enabled.
</DD></DL><P>Those options are defined for each virtual host with the <TT>host_config</TT>
-parameter (see section&#XA0;<A HREF="#virtualhost">3.1.2</A>).</P><P>Examples:
+parameter (see section&#XA0;<A HREF="#virtualhost">3.1.3</A>).</P><P>Examples:
</P><UL CLASS="itemize"><LI CLASS="li-itemize">
To enable anonymous login on all virtual hosts:
-<PRE CLASS="verbatim">{auth_method, [anonymous]}.
-{anonymous_protocol, login_anon}.
+<PRE CLASS="verbatim">auth_method: [anonymous]
+anonymous_protocol: login_anon
</PRE></LI><LI CLASS="li-itemize">Similar as previous example, but limited to <TT>public.example.org</TT>:
-<PRE CLASS="verbatim">{host_config, "public.example.org", [{auth_method, [anonymous]},
- {anonymous_protocol, login_anon}]}.
+<PRE CLASS="verbatim">host_config:
+ "public.example.org":
+ auth_method: [anonymous]
+ anonymous_protoco: login_anon
</PRE></LI><LI CLASS="li-itemize">To enable anonymous login and internal authentication on a virtual host:
-<PRE CLASS="verbatim">{host_config, "public.example.org", [{auth_method, [internal,anonymous]},
- {anonymous_protocol, login_anon}]}.
+<PRE CLASS="verbatim">host_config:
+ "public.example.org":
+ auth_method:
+ - internal
+ - anonymous
+ anonymous_protocol: login_anon
</PRE></LI><LI CLASS="li-itemize">To enable SASL Anonymous on a virtual host:
-<PRE CLASS="verbatim">{host_config, "public.example.org", [{auth_method, [anonymous]},
- {anonymous_protocol, sasl_anon}]}.
+<PRE CLASS="verbatim">host_config:
+ "public.example.org":
+ auth_method: [anonymous]
+ anonymous_protocol: sasl_anon
</PRE></LI><LI CLASS="li-itemize">To enable SASL Anonymous and anonymous login on a virtual host:
-<PRE CLASS="verbatim">{host_config, "public.example.org", [{auth_method, [anonymous]},
- {anonymous_protocol, both}]}.
+<PRE CLASS="verbatim">host_config:
+ "public.example.org":
+ auth_method: [anonymous]
+ anonymous_protocol: both
</PRE></LI><LI CLASS="li-itemize">To enable SASL Anonymous, anonymous login, and internal authentication on
a virtual host:
-<PRE CLASS="verbatim">{host_config, "public.example.org", [{auth_method, [internal,anonymous]},
- {anonymous_protocol, both}]}.
-</PRE></LI></UL><P> <A NAME="pam"></A> </P><!--TOC subsubsection PAM Authentication-->
+<PRE CLASS="verbatim">host_config:
+ "public.example.org":
+ auth_method:
+ - internal
+ - anonymous
+ anonymous_protocol: both
+</PRE></LI></UL><P>There are more configuration examples and XMPP client example stanzas in
+<A HREF="http://www.ejabberd.im/Anonymous-users-support">Anonymous users support</A>.</P><P> <A NAME="pam"></A> </P><!--TOC subsubsection PAM Authentication-->
<H4 CLASS="subsubsection"><!--SEC ANCHOR --><A HREF="#pam">PAM Authentication</A></H4><!--SEC END --><P> <A NAME="pam"></A>
</P><P><TT>ejabberd</TT> supports authentication via Pluggable Authentication Modules (PAM).
PAM is currently supported in AIX, FreeBSD, HP-UX, Linux, Mac OS X, NetBSD and Solaris.
@@ -1171,16 +1334,16 @@ PAM authentication is disabled by default, so you have to configure and compile
</P><PRE CLASS="verbatim">./configure --enable-pam &amp;&amp; make install
</PRE><P>Options:
</P><DL CLASS="description"><DT CLASS="dt-description">
-<B><TT>{pam_service, Name}</TT></B></DT><DD CLASS="dd-description">This option defines the PAM service name.
+<B><TT>pam_service: Name</TT></B></DT><DD CLASS="dd-description">This option defines the PAM service name.
Default is <TT>"ejabberd"</TT>. Refer to the PAM documentation of your operation system
for more information.
-</DD><DT CLASS="dt-description"><B><TT>{pam_userinfotype, username|jid}</TT></B></DT><DD CLASS="dd-description">
+</DD><DT CLASS="dt-description"><B><TT>pam_userinfotype: username|jid</TT></B></DT><DD CLASS="dd-description">
This option defines what type of information about the user ejabberd
provides to the PAM service: only the username, or the user JID.
Default is <TT>username</TT>.
</DD></DL><P>Example:
-</P><PRE CLASS="verbatim">{auth_method, [pam]}.
-{pam_service, "ejabberd"}.
+</P><PRE CLASS="verbatim">auth_method: [pam]
+pam_service: "ejabberd"
</PRE><P>Though it is quite easy to set up PAM support in <TT>ejabberd</TT>, PAM itself introduces some
security issues:</P><UL CLASS="itemize"><LI CLASS="li-itemize">
To perform PAM authentication <TT>ejabberd</TT> uses external C-program called
@@ -1212,52 +1375,85 @@ module provides such functionality.
</LI><LI CLASS="li-itemize">If you use <TT>pam_winbind</TT> to authorise against a Windows Active Directory,
then <TT>/etc/nsswitch.conf</TT> must be configured to use <TT>winbind</TT> as well.
</LI></UL><P> <A NAME="accessrules"></A> </P><!--TOC subsection Access Rules-->
-<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc25">3.1.5</A>&#XA0;&#XA0;<A HREF="#accessrules">Access Rules</A></H3><!--SEC END --><P> <A NAME="accessrules"></A>
+<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc26">3.1.6</A>&#XA0;&#XA0;<A HREF="#accessrules">Access Rules</A></H3><!--SEC END --><P> <A NAME="accessrules"></A>
</P><P> <A NAME="ACLDefinition"></A> </P><!--TOC subsubsection ACL Definition-->
<H4 CLASS="subsubsection"><!--SEC ANCHOR --><A HREF="#ACLDefinition">ACL Definition</A></H4><!--SEC END --><P> <A NAME="ACLDefinition"></A>
</P><P>Access control in <TT>ejabberd</TT> is performed via Access Control Lists (ACLs). The
declarations of ACLs in the configuration file have the following syntax:
-</P><DL CLASS="description"><DT CLASS="dt-description"><B><TT>{acl, ACLName, ACLValue}.</TT></B></DT></DL><P><TT>ACLValue</TT> can be one of the following:
+</P><DL CLASS="description"><DT CLASS="dt-description"><B><TT>acl: { ACLName: { ACLType: ACLValue } }</TT></B></DT></DL><P><TT>ACLType: ACLValue</TT> can be one of the following:
</P><DL CLASS="description"><DT CLASS="dt-description">
<B><TT>all</TT></B></DT><DD CLASS="dd-description"> Matches all JIDs. Example:
-<PRE CLASS="verbatim">{acl, all, all}.
-</PRE></DD><DT CLASS="dt-description"><B><TT>{user, Username}</TT></B></DT><DD CLASS="dd-description"> Matches the user with the name
+<PRE CLASS="verbatim">acl:
+ world: all
+</PRE></DD><DT CLASS="dt-description"><B><TT>user: Username</TT></B></DT><DD CLASS="dd-description"> Matches the user with the name
<TT>Username</TT> at the first virtual host. Example:
-<PRE CLASS="verbatim">{acl, admin, {user, "yozhik"}}.
-</PRE></DD><DT CLASS="dt-description"><B><TT>{user, Username, Server}</TT></B></DT><DD CLASS="dd-description"> Matches the user with the JID
+<PRE CLASS="verbatim">acl:
+ admin:
+ user: "yozhik"
+</PRE></DD><DT CLASS="dt-description"><B><TT>user: {Username: Server}</TT></B></DT><DD CLASS="dd-description"> Matches the user with the JID
<TT>Username@Server</TT> and any resource. Example:
-<PRE CLASS="verbatim">{acl, admin, {user, "yozhik", "example.org"}}.
-</PRE></DD><DT CLASS="dt-description"><B><TT>{server, Server}</TT></B></DT><DD CLASS="dd-description"> Matches any JID from server
+<PRE CLASS="verbatim">acl:
+ admin:
+ user:
+ "yozhik": "example.org"
+</PRE></DD><DT CLASS="dt-description"><B><TT>server: Server</TT></B></DT><DD CLASS="dd-description"> Matches any JID from server
<TT>Server</TT>. Example:
-<PRE CLASS="verbatim">{acl, exampleorg, {server, "example.org"}}.
-</PRE></DD><DT CLASS="dt-description"><B><TT>{resource, Resource}</TT></B></DT><DD CLASS="dd-description"> Matches any JID with a resource
+<PRE CLASS="verbatim">acl:
+ exampleorg:
+ server: "example.org"
+</PRE></DD><DT CLASS="dt-description"><B><TT>resource: Resource</TT></B></DT><DD CLASS="dd-description"> Matches any JID with a resource
<TT>Resource</TT>. Example:
-<PRE CLASS="verbatim">{acl, mucklres, {resource, "muckl"}}.
-</PRE></DD><DT CLASS="dt-description"><B><TT>{shared_group, Groupname}</TT></B></DT><DD CLASS="dd-description"> Matches any member of a Shared Roster Group with name <TT>Groupname</TT> in the virtual host. Example:
-<PRE CLASS="verbatim">{acl, techgroupmembers, {shared_group, "techteam"}}.
-</PRE></DD><DT CLASS="dt-description"><B><TT>{shared_group, Groupname, Server}</TT></B></DT><DD CLASS="dd-description"> Matches any member of a Shared Roster Group with name <TT>Groupname</TT> in the virtual host <TT>Server</TT>. Example:
-<PRE CLASS="verbatim">{acl, techgroupmembers, {shared_group, "techteam", "example.org"}}.
-</PRE></DD><DT CLASS="dt-description"><B><TT>{user_regexp, Regexp}</TT></B></DT><DD CLASS="dd-description"> Matches any local user with a name that
+<PRE CLASS="verbatim">acl:
+ mucklres:
+ resource: "muckl"
+</PRE></DD><DT CLASS="dt-description"><B><TT>shared_group: Groupname</TT></B></DT><DD CLASS="dd-description"> Matches any member of a Shared Roster Group with name <TT>Groupname</TT> in the virtual host. Example:
+<PRE CLASS="verbatim">acl:
+ techgroupmembers:
+ shared_group: "techteam"
+</PRE></DD><DT CLASS="dt-description"><B><TT>shared_group: {Groupname: Server}</TT></B></DT><DD CLASS="dd-description"> Matches any member of a Shared Roster Group with name <TT>Groupname</TT> in the virtual host <TT>Server</TT>. Example:
+<PRE CLASS="verbatim">acl:
+ techgroupmembers:
+ shared_group:
+ "techteam": "example.org"
+</PRE></DD><DT CLASS="dt-description"><B><TT>ip: Network</TT></B></DT><DD CLASS="dd-description"> Matches any IP address from the <TT>Network</TT>. Example:
+<PRE CLASS="verbatim">acl:
+ loopback:
+ ip:
+ - "127.0.0.0/8"
+ - "::"
+</PRE></DD><DT CLASS="dt-description"><B><TT>user_regexp: Regexp</TT></B></DT><DD CLASS="dd-description"> Matches any local user with a name that
matches <TT>Regexp</TT> on local virtual hosts. Example:
-<PRE CLASS="verbatim">{acl, tests, {user_regexp, "^test[0-9]*$"}}.
-</PRE></DD><DT CLASS="dt-description"><B><TT>{user_regexp, Regexp, Server}</TT></B></DT><DD CLASS="dd-description"> Matches any user with a name
+<PRE CLASS="verbatim">acl:
+ tests:
+ user_regexp: "^test[0-9]*$"
+</PRE></DD><DT CLASS="dt-description"><B><TT>user_regexp: {Regexp: Server}</TT></B></DT><DD CLASS="dd-description"> Matches any user with a name
that matches <TT>Regexp</TT> at server <TT>Server</TT>. Example:
-<PRE CLASS="verbatim">{acl, tests, {user_regexp, "^test", "example.org"}}.
-</PRE></DD><DT CLASS="dt-description"><B><TT>{server_regexp, Regexp}</TT></B></DT><DD CLASS="dd-description"> Matches any JID from the server that
+<PRE CLASS="verbatim">acl:
+ tests:
+ user_regexp:
+ "^test": "example.org"
+</PRE></DD><DT CLASS="dt-description"><B><TT>server_regexp: Regexp</TT></B></DT><DD CLASS="dd-description"> Matches any JID from the server that
matches <TT>Regexp</TT>. Example:
-<PRE CLASS="verbatim">{acl, icq, {server_regexp, "^icq\\."}}.
-</PRE></DD><DT CLASS="dt-description"><B><TT>{resource_regexp, Regexp}</TT></B></DT><DD CLASS="dd-description"> Matches any JID with a resource that
+<PRE CLASS="verbatim">acl:
+ icq:
+ server_regexp: "^icq\\."
+</PRE></DD><DT CLASS="dt-description"><B><TT>resource_regexp: Regexp</TT></B></DT><DD CLASS="dd-description"> Matches any JID with a resource that
matches <TT>Regexp</TT>. Example:
-<PRE CLASS="verbatim">{acl, icq, {resource_regexp, "^laptop\\."}}.
-</PRE></DD><DT CLASS="dt-description"><B><TT>{node_regexp, UserRegexp, ServerRegexp}</TT></B></DT><DD CLASS="dd-description"> Matches any user
+<PRE CLASS="verbatim">acl:
+ icq:
+ resource_regexp: "^laptop\\."
+</PRE></DD><DT CLASS="dt-description"><B><TT>node_regexp: {UserRegexp: ServerRegexp}</TT></B></DT><DD CLASS="dd-description"> Matches any user
with a name that matches <TT>UserRegexp</TT> at any server that matches
<TT>ServerRegexp</TT>. Example:
-<PRE CLASS="verbatim">{acl, yozhik, {node_regexp, "^yozhik$", "^example.(com|org)$"}}.
-</PRE></DD><DT CLASS="dt-description"><B><TT>{user_glob, Glob}</TT></B></DT><DD CLASS="dd-description">
-</DD><DT CLASS="dt-description"><B><TT>{user_glob, Glob, Server}</TT></B></DT><DD CLASS="dd-description">
-</DD><DT CLASS="dt-description"><B><TT>{server_glob, Glob}</TT></B></DT><DD CLASS="dd-description">
-</DD><DT CLASS="dt-description"><B><TT>{resource_glob, Glob}</TT></B></DT><DD CLASS="dd-description">
-</DD><DT CLASS="dt-description"><B><TT>{node_glob, UserGlob, ServerGlob}</TT></B></DT><DD CLASS="dd-description"> This is the same as
+<PRE CLASS="verbatim">acl:
+ yozhik:
+ node_regexp:
+ "^yozhik$": "^example.(com|org)$"
+</PRE></DD><DT CLASS="dt-description"><B><TT>user_glob: Glob}</TT></B></DT><DD CLASS="dd-description">
+</DD><DT CLASS="dt-description"><B><TT>user_glob: {Glob: Server}</TT></B></DT><DD CLASS="dd-description">
+</DD><DT CLASS="dt-description"><B><TT>server_glob: Glob</TT></B></DT><DD CLASS="dd-description">
+</DD><DT CLASS="dt-description"><B><TT>resource_glob: Glob</TT></B></DT><DD CLASS="dd-description">
+</DD><DT CLASS="dt-description"><B><TT>node_glob: {UserGlob: ServerGlob}</TT></B></DT><DD CLASS="dd-description"> This is the same as
above. However, it uses shell glob patterns instead of regexp. These patterns
can have the following special characters:
<DL CLASS="description"><DT CLASS="dt-description">
@@ -1276,7 +1472,7 @@ character not enclosed is matched.
<H4 CLASS="subsubsection"><!--SEC ANCHOR --><A HREF="#AccessRights">Access Rights</A></H4><!--SEC END --><P> <A NAME="AccessRights"></A>
</P><P>An entry allowing or denying access to different services.
The syntax is:
-</P><DL CLASS="description"><DT CLASS="dt-description"><B><TT>{access, AccessName, [ {allow|deny, ACLName}, ...]}.</TT></B></DT></DL><P>When a JID is checked to have access to <TT>Accessname</TT>, the server
+</P><DL CLASS="description"><DT CLASS="dt-description"><B><TT>access: { AccessName: { ACLName: allow|deny } }</TT></B></DT></DL><P>When a JID is checked to have access to <TT>Accessname</TT>, the server
sequentially checks if that JID matches any of the ACLs that are named in the
second elements of the tuples in the list. If it matches, the first element of
the first matched tuple is returned, otherwise the value &#X2018;<TT>deny</TT>&#X2019; is
@@ -1284,9 +1480,12 @@ returned.</P><P>If you define specific Access rights in a virtual host,
remember that the globally defined Access rights have precedence over those.
This means that, in case of conflict, the Access granted or denied in the global server is used
and the Access of a virtual host doesn&#X2019;t have effect.</P><P>Example:
-</P><PRE CLASS="verbatim">{access, configure, [{allow, admin}]}.
-{access, something, [{deny, badmans},
- {allow, all}]}.
+</P><PRE CLASS="verbatim">access:
+ configure:
+ admin: allow
+ something
+ badmans: deny
+ all: allow
</PRE><P>The following <TT>AccessName</TT> are pre-defined:
</P><DL CLASS="description"><DT CLASS="dt-description">
<B><TT>all</TT></B></DT><DD CLASS="dd-description"> Always returns the value &#X2018;<TT>allow</TT>&#X2019;.
@@ -1300,26 +1499,28 @@ opened session will be disconnected. The error <TT>session replaced</TT>
will be sent to the disconnected session. The value for this option
can be either a number, or <TT>infinity</TT>. The default value is
<TT>infinity</TT>.</P><P>The syntax is:
-</P><DL CLASS="description"><DT CLASS="dt-description"><B><TT>{access, max_user_sessions, [ {MaxNumber, ACLName}, ...]}.</TT></B></DT></DL><P>This example limits the number of sessions per user to 5 for all users, and to 10 for admins:
-</P><PRE CLASS="verbatim">{access, max_user_sessions, [{10, admin}, {5, all}]}.
+</P><DL CLASS="description"><DT CLASS="dt-description"><B><TT>{ max_user_sessions: { ACLName: MaxNumber } }</TT></B></DT></DL><P>This example limits the number of sessions per user to 5 for all users, and to 10 for admins:
+</P><PRE CLASS="verbatim">access:
+ max_user_sessions:
+ admin: 10
+ all: 5
</PRE><P> <A NAME="configmaxs2sconns"></A> </P><!--TOC subsubsection Several connections to a remote XMPP server with ACL-->
<H4 CLASS="subsubsection"><!--SEC ANCHOR --><A HREF="#configmaxs2sconns">Several connections to a remote XMPP server with ACL</A></H4><!--SEC END --><P> <A NAME="configmaxs2sconns"></A>
</P><P>The special access <TT>max_s2s_connections</TT> specifies how many
simultaneous S2S connections can be established to a specific remote XMPP server.
The default value is <TT>1</TT>.
There&#X2019;s also available the access <TT>max_s2s_connections_per_node</TT>.</P><P>The syntax is:
-</P><DL CLASS="description"><DT CLASS="dt-description"><B><TT>{access, max_s2s_connections, [ {MaxNumber, ACLName}, ...]}.</TT></B></DT></DL><P>Examples:
+</P><DL CLASS="description"><DT CLASS="dt-description"><B><TT>{ max_s2s_connections: { ACLName: MaxNumber } }</TT></B></DT></DL><P>Examples:
</P><UL CLASS="itemize"><LI CLASS="li-itemize">
Allow up to 3 connections with each remote server:
-<PRE CLASS="verbatim">{access, max_s2s_connections, [{3, all}]}.
+<PRE CLASS="verbatim">access:
+ max_s2s_connections:
+ all: 3
</PRE></LI></UL><P> <A NAME="shapers"></A> </P><!--TOC subsection Shapers-->
-<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc26">3.1.6</A>&#XA0;&#XA0;<A HREF="#shapers">Shapers</A></H3><!--SEC END --><P> <A NAME="shapers"></A>
+<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc27">3.1.7</A>&#XA0;&#XA0;<A HREF="#shapers">Shapers</A></H3><!--SEC END --><P> <A NAME="shapers"></A>
</P><P>Shapers enable you to limit connection traffic.
The syntax is:
-</P><DL CLASS="description"><DT CLASS="dt-description"><B><TT>{shaper, ShaperName, Kind}.</TT></B></DT></DL><P>
-Currently only one kind of shaper called <TT>maxrate</TT> is available. It has the
-following syntax:
-</P><DL CLASS="description"><DT CLASS="dt-description"><B><TT>{maxrate, Rate}</TT></B></DT></DL><P>
+</P><DL CLASS="description"><DT CLASS="dt-description"><B><TT>shaper: { ShaperName: Rate }</TT></B></DT></DL><P>
where <TT>Rate</TT> stands for the maximum allowed incoming rate in bytes per
second.
When a connection exceeds this limit, <TT>ejabberd</TT> stops reading from the socket
@@ -1327,30 +1528,32 @@ until the average rate is again below the allowed maximum.</P><P>Examples:
</P><UL CLASS="itemize"><LI CLASS="li-itemize">
To define a shaper named &#X2018;<TT>normal</TT>&#X2019; with traffic speed limited to
1,000&#XA0;bytes/second:
-<PRE CLASS="verbatim">{shaper, normal, {maxrate, 1000}}.
+<PRE CLASS="verbatim">shaper:
+ normal: 1000
</PRE></LI><LI CLASS="li-itemize">To define a shaper named &#X2018;<TT>fast</TT>&#X2019; with traffic speed limited to
50,000&#XA0;bytes/second:
-<PRE CLASS="verbatim">{shaper, fast, {maxrate, 50000}}.
+<PRE CLASS="verbatim">shaper:
+ fast: 50000
</PRE></LI></UL><P> <A NAME="language"></A> </P><!--TOC subsection Default Language-->
-<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc27">3.1.7</A>&#XA0;&#XA0;<A HREF="#language">Default Language</A></H3><!--SEC END --><P> <A NAME="language"></A>
+<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc28">3.1.8</A>&#XA0;&#XA0;<A HREF="#language">Default Language</A></H3><!--SEC END --><P> <A NAME="language"></A>
</P><P>The option <TT>language</TT> defines the default language of server strings that
can be seen by XMPP clients. If a XMPP client does not support
<TT>xml:lang</TT>, the specified language is used.</P><P>The option syntax is:
-</P><DL CLASS="description"><DT CLASS="dt-description"><B><TT>{language, Language}.</TT></B></DT></DL><P>The default value is <TT>en</TT>.
+</P><DL CLASS="description"><DT CLASS="dt-description"><B><TT>language: Language</TT></B></DT></DL><P>The default value is <TT>en</TT>.
In order to take effect there must be a translation file
<TT>Language.msg</TT> in <TT>ejabberd</TT>&#X2019;s <TT>msgs</TT> directory.</P><P>For example, to set Russian as default language:
-</P><PRE CLASS="verbatim">{language, "ru"}.
+</P><PRE CLASS="verbatim">language: "ru"
</PRE><P>Appendix <A HREF="#i18ni10n">A</A> provides more details about internationalization and localization.</P><P> <A NAME="captcha"></A> </P><!--TOC subsection CAPTCHA-->
-<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc28">3.1.8</A>&#XA0;&#XA0;<A HREF="#captcha">CAPTCHA</A></H3><!--SEC END --><P> <A NAME="captcha"></A>
+<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc29">3.1.9</A>&#XA0;&#XA0;<A HREF="#captcha">CAPTCHA</A></H3><!--SEC END --><P> <A NAME="captcha"></A>
</P><P>Some <TT>ejabberd</TT> modules can be configured to require a CAPTCHA challenge on certain actions.
If the client does not support CAPTCHA Forms (<A HREF="http://xmpp.org/extensions/xep-0158.html">XEP-0158</A>),
a web link is provided so the user can fill the challenge in a web browser.</P><P>An example script is provided that generates the image
using ImageMagick&#X2019;s Convert program.</P><P>The configurable options are:
</P><DL CLASS="description"><DT CLASS="dt-description">
-<B><TT>{captcha_cmd, Path}</TT></B></DT><DD CLASS="dd-description">
+<B><TT>captcha_cmd: Path</TT></B></DT><DD CLASS="dd-description">
Full path to a script that generates the image.
The default value disables the feature: <TT>undefined</TT>
-</DD><DT CLASS="dt-description"><B><TT>{captcha_host, ProtocolHostPort}</TT></B></DT><DD CLASS="dd-description">
+</DD><DT CLASS="dt-description"><B><TT>captcha_host: ProtocolHostPort</TT></B></DT><DD CLASS="dd-description">
ProtocolHostPort is a string with the host, and optionally the Protocol and Port number.
It must identify where ejabberd listens for CAPTCHA requests.
The URL sent to the user is formed by: <TT>Protocol://Host:Port/captcha/</TT>
@@ -1359,44 +1562,46 @@ If you specify a port number that does not match exactly an ejabberd listener
(because you are using a reverse proxy or other port-forwarding tool),
then you must specify the transfer protocol, as seen in the example below.
</DD></DL><P>Additionally, an <TT>ejabberd_http</TT> listener must be enabled with the <TT>captcha</TT> option.
-See section <A HREF="#listened-module">3.1.3</A>.</P><P>Example configuration:
-</P><PRE CLASS="verbatim">{hosts, ["example.org"]}.
+See section <A HREF="#listened-module">3.1.4</A>.</P><P>Example configuration:
+</P><PRE CLASS="verbatim">hosts: ["example.org"]
-{captcha_cmd, "/lib/ejabberd/priv/bin/captcha.sh"}.
-{captcha_host, "example.org:5280"}.
-%% {captcha_host, "https://example.org:443"}.
-%% {captcha_host, "http://example.com"}.
+captcha_cmd: "/lib/ejabberd/priv/bin/captcha.sh"
+captcha_host: "example.org:5280"
+## captcha_host: "https://example.org:443"
+## captcha_host: "http://example.com"
-{listen,
- [
+listen:
+ ...
+ -
+ port: 5280
+ module: ejabberd_http
+ captcha: true
...
- {5280, ejabberd_http, [
- captcha,
- ...
- ]
- }
-
-]}.
</PRE><P> <A NAME="stun"></A> </P><!--TOC subsection STUN-->
-<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc29">3.1.9</A>&#XA0;&#XA0;<A HREF="#stun">STUN</A></H3><!--SEC END --><P> <A NAME="stun"></A>
+<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc30">3.1.10</A>&#XA0;&#XA0;<A HREF="#stun">STUN</A></H3><!--SEC END --><P> <A NAME="stun"></A>
</P><P><TT>ejabberd</TT> is able to act as a stand-alone STUN server
(<A HREF="http://tools.ietf.org/html/rfc5389">RFC 5389</A>). Currently only Binding usage
-is supported. In that role <TT>ejabberd</TT> helps clients with Jingle ICE (<A HREF="http://xmpp.org/extensions/xep-0176.html">XEP-0176</A>) support to discover their external addresses and ports.</P><P>You should configure <TT>ejabberd_stun</TT> listening module as described in <A HREF="#listened">3.1.3</A> section.
+is supported. In that role <TT>ejabberd</TT> helps clients with Jingle ICE (<A HREF="http://xmpp.org/extensions/xep-0176.html">XEP-0176</A>) support to discover their external addresses and ports.</P><P>You should configure <TT>ejabberd_stun</TT> listening module as described in <A HREF="#listened">3.1.4</A> section.
If <TT>certfile</TT> option is defined, <TT>ejabberd</TT> multiplexes TCP and
TLS over TCP connections on the same port. Obviously, <TT>certfile</TT> option
is defined for <TT>tcp</TT> only. Note however that TCP or TLS over TCP
support is not required for Binding usage and is reserved for
<A HREF="http://tools.ietf.org/html/draft-ietf-behave-turn-16">TURN</A>
functionality. Feel free to configure <TT>udp</TT> transport only.</P><P>Example configuration:
-</P><PRE CLASS="verbatim">{listen,
- [
+</P><PRE CLASS="verbatim">listen:
...
- {{3478, udp}, ejabberd_stun, []},
- {3478, ejabberd_stun, []},
- {5349, ejabberd_stun, [{certfile, "/etc/ejabberd/server.pem"}]},
+ -
+ port: 3478
+ transport: udp
+ module: ejabberd_stun
+ -
+ port: 3478
+ module: ejabberd_stun
+ -
+ port: 5349
+ module: ejabberd_stun
+ certfile: "/etc/ejabberd/server.pem"
...
- ]
-}.
</PRE><P>You also need to configure DNS SRV records properly so clients can easily discover a
STUN server serving your XMPP domain. Refer to section
<A HREF="http://tools.ietf.org/html/rfc5389#section-9">DNS Discovery of a Server</A>
@@ -1405,41 +1610,55 @@ of <A HREF="http://tools.ietf.org/html/rfc5389">RFC 5389</A> for details.</P><P>
_stun._tcp IN SRV 0 0 3478 stun.example.com.
_stuns._tcp IN SRV 0 0 5349 stun.example.com.
</PRE><P> <A NAME="includeconfigfile"></A> </P><!--TOC subsection Include Additional Configuration Files-->
-<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc30">3.1.10</A>&#XA0;&#XA0;<A HREF="#includeconfigfile">Include Additional Configuration Files</A></H3><!--SEC END --><P> <A NAME="includeconfigfile"></A>
+<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc31">3.1.11</A>&#XA0;&#XA0;<A HREF="#includeconfigfile">Include Additional Configuration Files</A></H3><!--SEC END --><P> <A NAME="includeconfigfile"></A>
</P><P>The option <TT>include_config_file</TT> in a configuration file instructs <TT>ejabberd</TT> to include other configuration files immediately.</P><P>The basic syntax is:
-</P><DL CLASS="description"><DT CLASS="dt-description"><B><TT>{include_config_file, Filename}.</TT></B></DT></DL><P>
+</P><DL CLASS="description"><DT CLASS="dt-description"><B><TT>include_config_file: [Filename]</TT></B></DT></DL><P>
It is possible to specify suboptions using the full syntax:
-</P><DL CLASS="description"><DT CLASS="dt-description"><B><TT>{include_config_file, Filename, [Suboption, ...]}.</TT></B></DT></DL><P>The filename can be indicated either as an absolute path,
+</P><DL CLASS="description"><DT CLASS="dt-description"><B><TT>include_config_file: { Filename: [Suboption, ...] }</TT></B></DT></DL><P>The filename can be indicated either as an absolute path,
or relative to the main <TT>ejabberd</TT> configuration file.
It isn&#X2019;t possible to use wildcards.
The file must exist and be readable.</P><P>The allowed suboptions are:
</P><DL CLASS="description"><DT CLASS="dt-description">
-<B><TT>{disallow, [Optionname, ...]}</TT></B></DT><DD CLASS="dd-description"> Disallows the usage of those options in the included configuration file.
+<B><TT>disallow: [Optionname, ...]</TT></B></DT><DD CLASS="dd-description"> Disallows the usage of those options in the included configuration file.
The options that match this criteria are not accepted.
The default value is an empty list: <TT>[]</TT>
-</DD><DT CLASS="dt-description"><B><TT>{allow_only, [Optionname, ...]}</TT></B></DT><DD CLASS="dd-description"> Allows only the usage of those options in the included configuration file.
+</DD><DT CLASS="dt-description"><B><TT>allow_only: [Optionname, ...]</TT></B></DT><DD CLASS="dd-description"> Allows only the usage of those options in the included configuration file.
The options that do not match this criteria are not accepted.
The default value is: <TT>all</TT>
</DD></DL><P>This is a basic example:
-</P><PRE CLASS="verbatim">{include_config_file, "/etc/ejabberd/additional.cfg"}.
+</P><PRE CLASS="verbatim">include_config_file: "/etc/ejabberd/additional.yml"
</PRE><P>In this example, the included file is not allowed to contain a <TT>listen</TT> option.
If such an option is present, the option will not be accepted.
The file is in a subdirectory from where the main configuration file is.
-</P><PRE CLASS="verbatim">{include_config_file, "./example.org/additional_not_listen.cfg", [{disallow, [listen]}]}.
-</PRE><P>In this example, <TT>ejabberd.cfg</TT> defines some ACL and Access rules,
+</P><PRE CLASS="verbatim">include_config_file:
+ "./example.org/additional_not_listen.yml":
+ disallow: [listen]
+</PRE><P>In this example, <TT>ejabberd.yml</TT> defines some ACL and Access rules,
and later includes another file with additional rules:
-</P><PRE CLASS="verbatim">{acl, admin, {user, "admin", "localhost"}}.
-{access, announce, [{allow, admin}]}.
-{include_config_file, "/etc/ejabberd/acl_and_access.cfg", [{allow_only, [acl, access]}]}.
-</PRE><P>and content of the file <TT>acl_and_access.cfg</TT> can be, for example:
-</P><PRE CLASS="verbatim">{acl, admin, {user, "bob", "localhost"}}.
-{acl, admin, {user, "jan", "localhost"}}.
+</P><PRE CLASS="verbatim">acl:
+ admin:
+ user:
+ - "admin": "localhost"
+access:
+ announce:
+ admin: allow
+include_config_file:
+ "/etc/ejabberd/acl_and_access.yml":
+ allow_only:
+ - acl
+ - access
+</PRE><P>and content of the file <TT>acl_and_access.yml</TT> can be, for example:
+</P><PRE CLASS="verbatim">acl:
+ admin:
+ user:
+ - "bob": "localhost"
+ - "jan": "localhost"
</PRE><P> <A NAME="optionmacros"></A> </P><!--TOC subsection Option Macros in Configuration File-->
-<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc31">3.1.11</A>&#XA0;&#XA0;<A HREF="#optionmacros">Option Macros in Configuration File</A></H3><!--SEC END --><P> <A NAME="optionmacros"></A>
+<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc32">3.1.12</A>&#XA0;&#XA0;<A HREF="#optionmacros">Option Macros in Configuration File</A></H3><!--SEC END --><P> <A NAME="optionmacros"></A>
</P><P>In the <TT>ejabberd</TT> configuration file,
it is possible to define a macro for a value
and later use this macro when defining an option.</P><P>A macro is defined with this syntax:
-</P><DL CLASS="description"><DT CLASS="dt-description"><B><TT>{define_macro, &#X2019;MACRO&#X2019;, Value}.</TT></B></DT></DL><P>
+</P><DL CLASS="description"><DT CLASS="dt-description"><B><TT>define_macro: { &#X2019;MACRO&#X2019;: Value }</TT></B></DT></DL><P>
The <TT>MACRO</TT> must be surrounded by single quotation marks,
and all letters in uppercase; check the examples bellow.
The <TT>value</TT> can be any valid arbitrary Erlang term.</P><P>The first definition of a macro is preserved,
@@ -1447,44 +1666,43 @@ and additional definitions of the same macro are forgotten.</P><P>Macros are pro
additional configuration files have been included,
so it is possible to use macros that
are defined in configuration files included before the usage.</P><P>It isn&#X2019;t possible to use a macro in the definition
-of another macro.</P><P>There are two ways to use a macro:
-</P><DL CLASS="description"><DT CLASS="dt-description"><B><TT>&#X2019;MACRO&#X2019;</TT></B></DT><DD CLASS="dd-description">
-You can put this instead of a value in an <TT>ejabberd</TT> option,
-and will be replaced with the <TT>value</TT> previously defined.
-If the macro is not defined previously,
-the program will crash and report an error.</DD><DT CLASS="dt-description"><B><TT>{use_macro, &#X2019;MACRO&#X2019;, Defaultvalue}</TT></B></DT><DD CLASS="dd-description">
-Use a macro even if it may not be defined.
-If the macro is not defined previously,
-the provided <TT>defaultvalue</TT> is used.
-This usage behaves as if it were defined and used this way:
-<PRE CLASS="verbatim">{define_macro, 'MACRO', Defaultvalue}.
-'MACRO'
-</PRE></DD></DL><P>This example shows the basic usage of a macro:
-</P><PRE CLASS="verbatim">{define_macro, 'LOG_LEVEL_NUMBER', 5}.
-{loglevel, 'LOG_LEVEL_NUMBER'}.
-</PRE><P>The resulting option interpreted by <TT>ejabberd</TT> is: <TT>{loglevel, 5}</TT>.</P><P>This example shows that values can be any arbitrary Erlang term:
-</P><PRE CLASS="verbatim">{define_macro, 'USERBOB', {user, "bob", "localhost"}}.
-{acl, admin, 'USERBOB'}.
-</PRE><P>The resulting option interpreted by <TT>ejabberd</TT> is: <TT>{acl, admin, {user, "bob", "localhost"}}</TT>.</P><P>This complex example:
-</P><PRE CLASS="verbatim">{define_macro, 'NUMBER_PORT_C2S', 5222}.
-{define_macro, 'PORT_S2S_IN', {5269, ejabberd_s2s_in, []}}.
-{listen,
- [
- {'NUMBER_PORT_C2S', ejabberd_c2s, []},
- 'PORT_S2S_IN',
- {{use_macro, 'NUMBER_PORT_HTTP', 5280}, ejabberd_http, []}
- ]
-}.
+of another macro.</P><P>This example shows the basic usage of a macro:
+</P><PRE CLASS="verbatim">define_macro:
+ 'LOG_LEVEL_NUMBER': 5
+loglevel: 'LOG_LEVEL_NUMBER'
+</PRE><P>The resulting option interpreted by <TT>ejabberd</TT> is: <TT>loglevel: 5</TT>.</P><P>This example shows that values can be any arbitrary Erlang term:
+</P><PRE CLASS="verbatim">define_macro:
+ 'USERBOB':
+ user:
+ - "bob": "localhost"
+acl:
+ admin: 'USERBOB'
+</PRE><P>The resulting option interpreted by <TT>ejabberd</TT> is:
+</P><PRE CLASS="verbatim">acl:
+ admin:
+ user:
+ - "bob": "localhost"
+</PRE><P>This complex example:
+</P><PRE CLASS="verbatim">define_macro:
+ 'NUMBER_PORT_C2S': 5222
+ 'NUMBER_PORT_HTTP': 5280
+listen:
+ -
+ port: 'NUMBER_PORT_C2S'
+ module: ejabberd_c2s
+ -
+ port: 'NUMBER_PORT_HTTP'
+ module: ejabberd_http
</PRE><P>produces this result after being interpreted:
-</P><PRE CLASS="verbatim">{listen,
- [
- {5222, ejabberd_c2s, []},
- {5269, ejabberd_s2s_in, []},
- {5280, ejabberd_http, []}
- ]
-}.
+</P><PRE CLASS="verbatim">listen:
+ -
+ port: 5222
+ module: ejabberd_c2s
+ -
+ port: 5280
+ module: ejabberd_http
</PRE><P> <A NAME="database"></A> </P><!--TOC section Database and LDAP Configuration-->
-<H2 CLASS="section"><!--SEC ANCHOR --><A NAME="htoc32">3.2</A>&#XA0;&#XA0;<A HREF="#database">Database and LDAP Configuration</A></H2><!--SEC END --><P> <A NAME="database"></A>
+<H2 CLASS="section"><!--SEC ANCHOR --><A NAME="htoc33">3.2</A>&#XA0;&#XA0;<A HREF="#database">Database and LDAP Configuration</A></H2><!--SEC END --><P> <A NAME="database"></A>
</P><P><TT>ejabberd</TT> uses its internal Mnesia database by default. However, it is
possible to use a relational database or an LDAP server to store persistent,
@@ -1493,206 +1711,70 @@ authentication methods for different virtual hosts, you can configure different
authentication mechanisms for the same virtual host (fallback), you can set
different storage systems for modules, and so forth.</P><P>The following databases are supported by <TT>ejabberd</TT>:
</P><UL CLASS="itemize"><LI CLASS="li-itemize">
-<A HREF="http://www.microsoft.com/sql/">Microsoft SQL Server</A>
-</LI><LI CLASS="li-itemize"><A HREF="http://www.erlang.org/doc/apps/mnesia/index.html">Mnesia</A>
+<A HREF="http://www.erlang.org/doc/apps/mnesia/index.html">Mnesia</A>
</LI><LI CLASS="li-itemize"><A HREF="http://www.mysql.com/">MySQL</A>
</LI><LI CLASS="li-itemize"><A HREF="http://en.wikipedia.org/wiki/Open_Database_Connectivity">Any ODBC compatible database</A>
</LI><LI CLASS="li-itemize"><A HREF="http://www.postgresql.org/">PostgreSQL</A>
</LI></UL><P>The following LDAP servers are tested with <TT>ejabberd</TT>:
</P><UL CLASS="itemize"><LI CLASS="li-itemize">
<A HREF="http://www.microsoft.com/activedirectory/">Active Directory</A>
-(see section&#XA0;<A HREF="#ad">3.2.5</A>)
+(see section&#XA0;<A HREF="#ad">3.2.2</A>)
</LI><LI CLASS="li-itemize"><A HREF="http://www.openldap.org/">OpenLDAP</A>
</LI><LI CLASS="li-itemize"><A HREF="http://www.communigate.com/">CommuniGate Pro</A>
</LI><LI CLASS="li-itemize">Normally any LDAP compatible server should work; inform us about your
success with a not-listed server so that we can list it here.
</LI></UL><P>Important note about virtual hosting:
-if you define several domains in ejabberd.cfg (see section <A HREF="#hostnames">3.1.1</A>),
+if you define several domains in ejabberd.yml (see section <A HREF="#hostnames">3.1.2</A>),
you probably want that each virtual host uses a different configuration of database, authentication and storage,
so that usernames do not conflict and mix between different virtual hosts.
For that purpose, the options described in the next sections
-must be set inside a <TT>host_config</TT> for each vhost (see section <A HREF="#virtualhost">3.1.2</A>).
+must be set inside a <TT>host_config</TT> for each vhost (see section <A HREF="#virtualhost">3.1.3</A>).
For example:
-</P><PRE CLASS="verbatim">{host_config, "public.example.org", [
- {odbc_server, {pgsql, "localhost", "database-public-example-org", "ejabberd", "password"}},
- {auth_method, [odbc]}
-]}.
-</PRE><P> <A NAME="mysql"></A> </P><!--TOC subsection MySQL-->
-<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc33">3.2.1</A>&#XA0;&#XA0;<A HREF="#mysql">MySQL</A></H3><!--SEC END --><P> <A NAME="mysql"></A>
-</P><P>Although this section will describe <TT>ejabberd</TT>&#X2019;s configuration when you want to
-use the native MySQL driver, it does not describe MySQL&#X2019;s installation and
-database creation. Check the MySQL documentation and the tutorial <A HREF="http://support.process-one.net/doc/display/MESSENGER/Using+ejabberd+with+MySQL+native+driver">Using ejabberd with MySQL native driver</A> for information regarding these topics.
-Note that the tutorial contains information about <TT>ejabberd</TT>&#X2019;s configuration
-which is duplicate to this section.</P><P>Moreover, the file mysql.sql in the directory src/odbc might be interesting for
-you. This file contains the <TT>ejabberd</TT> schema for MySQL. At the end of the file
-you can find information to update your database schema.</P><P> <A NAME="compilemysql"></A> </P><!--TOC subsubsection Driver Compilation-->
-<H4 CLASS="subsubsection"><!--SEC ANCHOR --><A HREF="#compilemysql">Driver Compilation</A></H4><!--SEC END --><P> <A NAME="compilemysql"></A>
-</P><P>You can skip this step if you installed <TT>ejabberd</TT> using a binary installer or
-if the binary packages of <TT>ejabberd</TT> you are using include support for MySQL.</P><OL CLASS="enumerate" type=1><LI CLASS="li-enumerate">
-First, install the <A HREF="http://support.process-one.net/doc/display/CONTRIBS/Yxa">Erlang
-MySQL library</A>. Make sure the compiled files are in your Erlang path; you can
-put them for example in the same directory as your <TT>ejabberd</TT> .beam files.
-</LI><LI CLASS="li-enumerate">Then, configure and install <TT>ejabberd</TT> with ODBC support enabled (this is
-also needed for native MySQL support!). This can be done, by using next
-commands:
-<PRE CLASS="verbatim">./configure --enable-odbc &amp;&amp; make install
-</PRE></LI></OL><P> <A NAME="configuremysql"></A> </P><!--TOC subsubsection Database Connection-->
-<H4 CLASS="subsubsection"><!--SEC ANCHOR --><A HREF="#configuremysql">Database Connection</A></H4><!--SEC END --><P> <A NAME="configuremysql"></A>
-</P><P>The actual database access is defined in the option <TT>odbc_server</TT>. Its
-value is used to define if we want to use ODBC, or one of the two native
-interface available, PostgreSQL or MySQL.</P><P>To use the native MySQL interface, you can pass a tuple of the following form as
-parameter:
-</P><DL CLASS="description"><DT CLASS="dt-description"><B><TT>{mysql, "Server", "Database", "Username", "Password"}</TT></B></DT></DL><P><TT>mysql</TT> is a keyword that should be kept as is. For example:
-</P><DL CLASS="description"><DT CLASS="dt-description"><B><TT>{odbc_server, {mysql, "localhost", "test", "root", "password"}}.</TT></B></DT></DL><P>Optionally, it is possible to define the MySQL port to use. This
-option is only useful, in very rare cases, when you are not running
-MySQL with the default port setting. The <TT>mysql</TT> parameter
-can thus take the following form:
-</P><DL CLASS="description"><DT CLASS="dt-description"><B><TT>{mysql, "Server", Port, "Database", "Username", "Password"}</TT></B></DT></DL><P>The <TT>Port</TT> value should be an integer, without quotes. For example:
-</P><DL CLASS="description"><DT CLASS="dt-description"><B><TT>{odbc_server, {mysql, "localhost", Port, "test", "root", "password"}}.</TT></B></DT></DL><P>By default <TT>ejabberd</TT> opens 10 connections to the database for each virtual host.
-Use this option to modify the value:
-</P><PRE CLASS="verbatim">{odbc_pool_size, 10}.
-</PRE><P>You can configure an interval to make a dummy SQL request
-to keep alive the connections to the database.
-The default value is &#X2019;undefined&#X2019;, so no keepalive requests are made.
-Specify in seconds: for example 28800 means 8 hours.
-</P><PRE CLASS="verbatim">{odbc_keepalive_interval, undefined}.
-</PRE><P>If the connection to the database fails, <TT>ejabberd</TT> waits 30 seconds before retrying.
-You can modify this interval with this option:
-</P><PRE CLASS="verbatim">{odbc_start_interval, 30}.
-</PRE><P> <A NAME="mysqlauth"></A> </P><!--TOC subsubsection Authentication-->
-<H4 CLASS="subsubsection"><!--SEC ANCHOR --><A HREF="#mysqlauth">Authentication</A></H4><!--SEC END --><P> <A NAME="mysqlauth"></A>
-</P><P>The option value name may be misleading, as the <TT>auth_method</TT> name is used
-for access to a relational database through ODBC, as well as through the native
-MySQL interface. Anyway, the first configuration step is to define the odbc
-<TT>auth_method</TT>. For example:
-</P><PRE CLASS="verbatim">{auth_method, [odbc]}.
-</PRE><P> <A NAME="mysqlstorage"></A> </P><!--TOC subsubsection Storage-->
-<H4 CLASS="subsubsection"><!--SEC ANCHOR --><A HREF="#mysqlstorage">Storage</A></H4><!--SEC END --><P> <A NAME="mysqlstorage"></A>
-</P><P>MySQL also can be used to store information into from several <TT>ejabberd</TT>
-modules. See section&#XA0;<A HREF="#modoverview">3.3.1</A> to see which modules can be used with
-relational databases like MySQL. To enable storage to your database, just make
-sure that your database is running well (see previous sections), and add the
-module option <TT>{db_type, odbc}</TT>.</P><P> <A NAME="mssql"></A> </P><!--TOC subsection Microsoft SQL Server-->
-<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc34">3.2.2</A>&#XA0;&#XA0;<A HREF="#mssql">Microsoft SQL Server</A></H3><!--SEC END --><P> <A NAME="mssql"></A>
-</P><P>Although this section will describe <TT>ejabberd</TT>&#X2019;s configuration when you want to
-use Microsoft SQL Server, it does not describe Microsoft SQL Server&#X2019;s
-installation and database creation. Check the MySQL documentation and the
-tutorial <A HREF="http://support.process-one.net/doc/display/MESSENGER/Using+ejabberd+with+MySQL+native+driver">Using ejabberd with MySQL native driver</A> for information regarding these topics.
-Note that the tutorial contains information about <TT>ejabberd</TT>&#X2019;s configuration
-which is duplicate to this section.</P><P>Moreover, the file mssql.sql in the directory src/odbc might be interesting for
-you. This file contains the <TT>ejabberd</TT> schema for Microsoft SQL Server. At the end
-of the file you can find information to update your database schema.</P><P> <A NAME="compilemssql"></A> </P><!--TOC subsubsection Driver Compilation-->
-<H4 CLASS="subsubsection"><!--SEC ANCHOR --><A HREF="#compilemssql">Driver Compilation</A></H4><!--SEC END --><P> <A NAME="compilemssql"></A>
-</P><P>You can skip this step if you installed <TT>ejabberd</TT> using a binary installer or
-if the binary packages of <TT>ejabberd</TT> you are using include support for ODBC.</P><P>If you want to use Microsoft SQL Server with ODBC, you need to configure,
-compile and install <TT>ejabberd</TT> with support for ODBC and Microsoft SQL Server
-enabled. This can be done, by using next commands:
-</P><PRE CLASS="verbatim">./configure --enable-odbc --enable-mssql &amp;&amp; make install
-</PRE><P> <A NAME="configuremssql"></A> </P><!--TOC subsubsection Database Connection-->
-<H4 CLASS="subsubsection"><!--SEC ANCHOR --><A HREF="#configuremssql">Database Connection</A></H4><!--SEC END --><P> <A NAME="configuremssql"></A>
-</P><P>The configuration of Database Connection for a Microsoft SQL Server
-is the same as the configuration for
-ODBC compatible servers (see section&#XA0;<A HREF="#configureodbc">3.2.4</A>).</P><P> <A NAME="mssqlauth"></A> </P><!--TOC subsubsection Authentication-->
-<H4 CLASS="subsubsection"><!--SEC ANCHOR --><A HREF="#mssqlauth">Authentication</A></H4><!--SEC END --><P> <A NAME="mssqlauth"></A>
-</P><P>The configuration of Authentication for a Microsoft SQL Server
-is the same as the configuration for
-ODBC compatible servers (see section&#XA0;<A HREF="#odbcauth">3.2.4</A>).</P><P> <A NAME="mssqlstorage"></A> </P><!--TOC subsubsection Storage-->
-<H4 CLASS="subsubsection"><!--SEC ANCHOR --><A HREF="#mssqlstorage">Storage</A></H4><!--SEC END --><P> <A NAME="mssqlstorage"></A>
-</P><P>Microsoft SQL Server also can be used to store information into from several
-modules. See section&#XA0;<A HREF="#modoverview">3.3.1</A> to see which modules can be used with
-relational databases like MySQL. To enable storage to your database, just make
-sure that your database is running well (see previous sections), and add the
-module option <TT>{db_type, odbc}</TT>.</P><P> <A NAME="pgsql"></A> </P><!--TOC subsection PostgreSQL-->
-<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc35">3.2.3</A>&#XA0;&#XA0;<A HREF="#pgsql">PostgreSQL</A></H3><!--SEC END --><P> <A NAME="pgsql"></A>
-</P><P>Although this section will describe <TT>ejabberd</TT>&#X2019;s configuration when you want to
-use the native PostgreSQL driver, it does not describe PostgreSQL&#X2019;s installation
-and database creation. Check the PostgreSQL documentation and the tutorial <A HREF="http://support.process-one.net/doc/display/MESSENGER/Using+ejabberd+with+MySQL+native+driver">Using ejabberd with MySQL native driver</A> for information regarding these topics.
-Note that the tutorial contains information about <TT>ejabberd</TT>&#X2019;s configuration
-which is duplicate to this section.</P><P>Also the file pg.sql in the directory src/odbc might be interesting for you.
-This file contains the <TT>ejabberd</TT> schema for PostgreSQL. At the end of the file
-you can find information to update your database schema.</P><P> <A NAME="compilepgsql"></A> </P><!--TOC subsubsection Driver Compilation-->
-<H4 CLASS="subsubsection"><!--SEC ANCHOR --><A HREF="#compilepgsql">Driver Compilation</A></H4><!--SEC END --><P> <A NAME="compilepgsql"></A>
-</P><P>You can skip this step if you installed <TT>ejabberd</TT> using a binary installer or
-if the binary packages of <TT>ejabberd</TT> you are using include support for
-PostgreSQL.</P><OL CLASS="enumerate" type=1><LI CLASS="li-enumerate">
-First, install the Erlang pgsql library from
-<A HREF="http://www.ejabberd.im/ejabberd-modules/">ejabberd-modules SVN repository</A>.
-Make sure the compiled
-files are in your Erlang path; you can put them for example in the same
-directory as your <TT>ejabberd</TT> .beam files.
-</LI><LI CLASS="li-enumerate">Then, configure, compile and install <TT>ejabberd</TT> with ODBC support enabled
-(this is also needed for native PostgreSQL support!). This can be done, by
-using next commands:
-<PRE CLASS="verbatim">./configure --enable-odbc &amp;&amp; make install
-</PRE></LI></OL><P> <A NAME="configurepgsql"></A> </P><!--TOC subsubsection Database Connection-->
-<H4 CLASS="subsubsection"><!--SEC ANCHOR --><A HREF="#configurepgsql">Database Connection</A></H4><!--SEC END --><P> <A NAME="configurepgsql"></A>
-</P><P>The actual database access is defined in the option <TT>odbc_server</TT>. Its
-value is used to define if we want to use ODBC, or one of the two native
-interface available, PostgreSQL or MySQL.</P><P>To use the native PostgreSQL interface, you can pass a tuple of the following
-form as parameter:
-</P><DL CLASS="description"><DT CLASS="dt-description"><B><TT>{pgsql, "Server", "Database", "Username", "Password"}</TT></B></DT></DL><P><TT>pgsql</TT> is a keyword that should be kept as is. For example:
-</P><DL CLASS="description"><DT CLASS="dt-description"><B><TT>{odbc_server, {pgsql, "localhost", "database", "ejabberd", "password"}}.</TT></B></DT></DL><P>Optionally, it is possible to define the PostgreSQL port to use. This
-option is only useful, in very rare cases, when you are not running
-PostgreSQL with the default port setting. The <TT>pgsql</TT> parameter
-can thus take the following form:
-</P><DL CLASS="description"><DT CLASS="dt-description"><B><TT>{pgsql, "Server", Port, "Database", "Username", "Password"}</TT></B></DT></DL><P>The <TT>Port</TT> value should be an integer, without quotes. For example:
-</P><DL CLASS="description"><DT CLASS="dt-description"><B><TT>{odbc_server, {pgsql, "localhost", 5432, "database", "ejabberd", "password"}}.</TT></B></DT></DL><P>By default <TT>ejabberd</TT> opens 10 connections to the database for each virtual host.
-Use this option to modify the value:
-</P><PRE CLASS="verbatim">{odbc_pool_size, 10}.
-</PRE><P>You can configure an interval to make a dummy SQL request
-to keep alive the connections to the database.
-The default value is &#X2019;undefined&#X2019;, so no keepalive requests are made.
-Specify in seconds: for example 28800 means 8 hours.
-</P><PRE CLASS="verbatim">{odbc_keepalive_interval, undefined}.
-</PRE><P> <A NAME="pgsqlauth"></A> </P><!--TOC subsubsection Authentication-->
-<H4 CLASS="subsubsection"><!--SEC ANCHOR --><A HREF="#pgsqlauth">Authentication</A></H4><!--SEC END --><P> <A NAME="pgsqlauth"></A>
-</P><P>The option value name may be misleading, as the <TT>auth_method</TT> name is used
-for access to a relational database through ODBC, as well as through the native
-PostgreSQL interface. Anyway, the first configuration step is to define the odbc
-<TT>auth_method</TT>. For example:
-</P><PRE CLASS="verbatim">{auth_method, [odbc]}.
-</PRE><P> <A NAME="pgsqlstorage"></A> </P><!--TOC subsubsection Storage-->
-<H4 CLASS="subsubsection"><!--SEC ANCHOR --><A HREF="#pgsqlstorage">Storage</A></H4><!--SEC END --><P> <A NAME="pgsqlstorage"></A>
-</P><P>PostgreSQL also can be used to store information into from several <TT>ejabberd</TT>
-modules. See section&#XA0;<A HREF="#modoverview">3.3.1</A> to see which modules can be used with
-relational databases like MySQL. To enable storage to your database, just make
-sure that your database is running well (see previous sections), and add the
-module option <TT>{db_type, odbc}</TT>.</P><P> <A NAME="odbc"></A> </P><!--TOC subsection ODBC Compatible-->
-<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc36">3.2.4</A>&#XA0;&#XA0;<A HREF="#odbc">ODBC Compatible</A></H3><!--SEC END --><P> <A NAME="odbc"></A>
-</P><P>Although this section will describe <TT>ejabberd</TT>&#X2019;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 <A HREF="http://support.process-one.net/doc/display/MESSENGER/Using+ejabberd+with+MySQL+native+driver">Using ejabberd with MySQL native driver</A> also can help you. Note that the tutorial
-contains information about <TT>ejabberd</TT>&#X2019;s configuration which is duplicate to
-this section.</P><P> <A NAME="compileodbc"></A> </P><!--TOC subsubsection Driver Compilation-->
-<H4 CLASS="subsubsection"><!--SEC ANCHOR --><A HREF="#compileodbc">Driver Compilation</A></H4><!--SEC END --><P> <A NAME="compileodbc"></A> </P><P>You can skip this step if you installed <TT>ejabberd</TT> using a binary installer or
-if the binary packages of <TT>ejabberd</TT> you are using include support for
-ODBC.</P><OL CLASS="enumerate" type=1><LI CLASS="li-enumerate">
-First, install the <A HREF="http://support.process-one.net/doc/display/CONTRIBS/Yxa">Erlang
-MySQL library</A>. Make sure the compiled files are in your Erlang path; you can
-put them for example in the same directory as your <TT>ejabberd</TT> .beam files.
-</LI><LI CLASS="li-enumerate">Then, configure, compile and install <TT>ejabberd</TT> with ODBC support
-enabled. This can be done, by using next commands:
-<PRE CLASS="verbatim">./configure --enable-odbc &amp;&amp; make install
-</PRE></LI></OL><P> <A NAME="configureodbc"></A> </P><!--TOC subsubsection Database Connection-->
-<H4 CLASS="subsubsection"><!--SEC ANCHOR --><A HREF="#configureodbc">Database Connection</A></H4><!--SEC END --><P> <A NAME="configureodbc"></A>
-</P><P>The actual database access is defined in the option <TT>odbc_server</TT>. Its
-value is used to defined if we want to use ODBC, or one of the two native
-interface available, PostgreSQL or MySQL.</P><P>To use a relational database through ODBC, you can pass the ODBC connection
-string as <TT>odbc_server</TT> parameter. For example:
-</P><PRE CLASS="verbatim">{odbc_server, "DSN=database;UID=ejabberd;PWD=password"}.
-</PRE><P>By default <TT>ejabberd</TT> opens 10 connections to the database for each virtual host.
-Use this option to modify the value:
-</P><PRE CLASS="verbatim">{odbc_pool_size, 10}.
-</PRE><P>You can configure an interval to make a dummy SQL request
-to keep alive the connections to the database.
+</P><PRE CLASS="verbatim">host_config:
+ "public.example.org":
+ odbc_type: pgsql
+ odbc_server: "localhost"
+ odbc_database: "database-public-example-org"
+ odbc_username: "ejabberd"
+ odbc_password: "password"
+ auth_method: [odbc]
+</PRE><P> <A NAME="odbc"></A> </P><!--TOC subsection ODBC-->
+<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc34">3.2.1</A>&#XA0;&#XA0;<A HREF="#odbc">ODBC</A></H3><!--SEC END --><P> <A NAME="odbc"></A> </P><P>The actual database access is defined in the options with <TT>odbc_</TT> prefix. The
+values are used to define if we want to use ODBC, or one of the two native
+interface available, PostgreSQL or MySQL.</P><P>The following paramaters are available:
+</P><DL CLASS="description"><DT CLASS="dt-description">
+<B><TT>odbc_type: mysql | pgsql | odbc</TT></B></DT><DD CLASS="dd-description"> The type of an ODBC connection.
+The default is <TT>odbc</TT>.
+</DD><DT CLASS="dt-description"><B><TT>odbc_server: String</TT></B></DT><DD CLASS="dd-description"> A hostname of the ODBC server. The default is
+<TT>&#X2018;&#X2018;localhost&#X2019;&#X2019;</TT>.
+</DD><DT CLASS="dt-description"><B><TT>odbc_port: Port</TT></B></DT><DD CLASS="dd-description"> The port where the ODBC server is accepting connections.
+The option is only valid for <TT>mysql</TT> and <TT>pgsql</TT>. The default is
+<TT>3306</TT> and <TT>5432</TT> respectively.
+</DD><DT CLASS="dt-description"><B><TT>odbc_database: String</TT></B></DT><DD CLASS="dd-description"> The database name. The default is <TT>&#X2018;&#X2018;ejabberd&#X2019;&#X2019;</TT>.
+The option is only valid for <TT>mysql</TT> and <TT>pgsql</TT>.
+</DD><DT CLASS="dt-description"><B><TT>odbc_username: String</TT></B></DT><DD CLASS="dd-description"> The username. The default is <TT>&#X2018;&#X2018;ejabberd&#X2019;&#X2019;</TT>.
+The option is only valid for <TT>mysql</TT> and <TT>pgsql</TT>.
+</DD><DT CLASS="dt-description"><B><TT>odbc_password: String</TT></B></DT><DD CLASS="dd-description"> The password. The default is empty string.
+The option is only valid for <TT>mysql</TT> and <TT>pgsql</TT>.
+</DD><DT CLASS="dt-description"><B><TT>odbc_pool_size: N</TT></B></DT><DD CLASS="dd-description"> By default <TT>ejabberd</TT> opens 10 connections to
+the database for each virtual host. You can change this number by using this option.
+</DD><DT CLASS="dt-description"><B><TT>odbc_keepalive_interval: N</TT></B></DT><DD CLASS="dd-description"> You can configure an interval to
+make a dummy SQL request to keep alive the connections to the database.
The default value is &#X2019;undefined&#X2019;, so no keepalive requests are made.
Specify in seconds: for example 28800 means 8 hours.
-</P><PRE CLASS="verbatim">{odbc_keepalive_interval, undefined}.
-</PRE><P> <A NAME="odbcauth"></A> </P><!--TOC subsubsection Authentication-->
-<H4 CLASS="subsubsection"><!--SEC ANCHOR --><A HREF="#odbcauth">Authentication</A></H4><!--SEC END --><P> <A NAME="odbcauth"></A>
-</P><P>The first configuration step is to define the odbc <TT>auth_method</TT>. For
-example:
-</P><PRE CLASS="verbatim">{auth_method, [odbc]}.
+</DD><DT CLASS="dt-description"><B><TT>odbc_start_interval: N</TT></B></DT><DD CLASS="dd-description"> If the connection to the database fails,
+<TT>ejabberd</TT> waits 30 seconds before retrying.
+You can modify this interval with this option.
+</DD></DL><P>Example of plain ODBC connection:
+</P><PRE CLASS="verbatim">odbc_server: "DSN=database;UID=ejabberd;PWD=password"
+</PRE><P>Example of MySQL connection:
+</P><PRE CLASS="verbatim">odbc_type: mysql
+odbc_server: "server.company.com"
+odbc_port: 3306 # the default
+odbc_database: "mydb"
+odbc_username: "user1"
+odbc_password: "**********"
+odbc_pool_size: 5
</PRE><P> <A NAME="odbcstorage"></A> </P><!--TOC subsubsection Storage-->
<H4 CLASS="subsubsection"><!--SEC ANCHOR --><A HREF="#odbcstorage">Storage</A></H4><!--SEC END --><P> <A NAME="odbcstorage"></A>
</P><P>An ODBC compatible database also can be used to store information into from
@@ -1700,8 +1782,8 @@ several <TT>ejabberd</TT>
modules. See section&#XA0;<A HREF="#modoverview">3.3.1</A> to see which modules can be used with
relational databases like MySQL. To enable storage to your database, just make
sure that your database is running well (see previous sections), and add the
-module option <TT>{db_type, odbc}</TT>.</P><P> <A NAME="ldap"></A> </P><!--TOC subsection LDAP-->
-<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc37">3.2.5</A>&#XA0;&#XA0;<A HREF="#ldap">LDAP</A></H3><!--SEC END --><P> <A NAME="ldap"></A>
+module option <TT>db_type: odbc</TT>.</P><P> <A NAME="ldap"></A> </P><!--TOC subsection LDAP-->
+<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc35">3.2.2</A>&#XA0;&#XA0;<A HREF="#ldap">LDAP</A></H3><!--SEC END --><P> <A NAME="ldap"></A>
</P><P><TT>ejabberd</TT> has built-in LDAP support. You can authenticate users against LDAP
server and use LDAP directory as vCard storage.</P><P>Usually <TT>ejabberd</TT> treats LDAP as a read-only storage:
it is possible to consult data, but not possible to
@@ -1712,50 +1794,51 @@ and LDAP server supports
<H4 CLASS="subsubsection"><!--SEC ANCHOR --><A HREF="#ldapconnection">Connection</A></H4><!--SEC END --><P> <A NAME="ldapconnection"></A> </P><P>Two connections are established to the LDAP server per vhost,
one for authentication and other for regular calls.</P><P>Parameters:
</P><DL CLASS="description"><DT CLASS="dt-description">
-<B><TT>{ldap_servers, [Servers, ...]}</TT></B></DT><DD CLASS="dd-description"> List of IP addresses or DNS names of your
+<B><TT>ldap_servers: [Servers, ...]</TT></B></DT><DD CLASS="dd-description"> List of IP addresses or DNS names of your
LDAP servers. This option is required.
-</DD><DT CLASS="dt-description"><B><TT>{ldap_encrypt, none|tls}</TT></B></DT><DD CLASS="dd-description"> Type of connection encryption to the LDAP server.
+</DD><DT CLASS="dt-description"><B><TT>ldap_encrypt: none|tls</TT></B></DT><DD CLASS="dd-description"> Type of connection encryption to the LDAP server.
Allowed values are: <TT>none</TT>, <TT>tls</TT>.
The value <TT>tls</TT> enables encryption by using LDAP over SSL.
Note that STARTTLS encryption is not supported.
The default value is: <TT>none</TT>.
-</DD><DT CLASS="dt-description"><B><TT>{ldap_tls_verify, false|soft|hard}</TT></B></DT><DD CLASS="dd-description">
+</DD><DT CLASS="dt-description"><B><TT>ldap_tls_verify: false|soft|hard</TT></B></DT><DD CLASS="dd-description">
This option specifies whether to verify LDAP server certificate or not when TLS is enabled.
When <TT>hard</TT> is enabled <TT>ejabberd</TT> doesn&#X2019;t proceed if a certificate is invalid.
When <TT>soft</TT> is enabled <TT>ejabberd</TT> proceeds even if check fails.
The default is <TT>false</TT> which means no checks are performed.
-</DD><DT CLASS="dt-description"><B><TT>{ldap_tls_cacertfile, Path}</TT></B></DT><DD CLASS="dd-description">
+</DD><DT CLASS="dt-description"><B><TT>ldap_tls_cacertfile: Path</TT></B></DT><DD CLASS="dd-description">
Path to file containing PEM encoded CA certificates. This option is needed
(and required) when TLS verification is enabled.
-</DD><DT CLASS="dt-description"><B><TT>{ldap_tls_depth, Number}</TT></B></DT><DD CLASS="dd-description">
+</DD><DT CLASS="dt-description"><B><TT>ldap_tls_depth: Number</TT></B></DT><DD CLASS="dd-description">
Specifies the maximum verification depth when TLS verification is enabled,
i.e. how far in a chain of certificates the verification process can proceed
before the verification is considered to fail.
Peer certificate = 0, CA certificate = 1, higher level CA certificate = 2, etc.
The value 2 thus means that a chain can at most contain peer cert,
CA cert, next CA cert, and an additional CA cert. The default value is 1.
-</DD><DT CLASS="dt-description"><B><TT>{ldap_port, Number}</TT></B></DT><DD CLASS="dd-description"> Port to connect to your LDAP server.
+</DD><DT CLASS="dt-description"><B><TT>ldap_port: Number</TT></B></DT><DD CLASS="dd-description"> Port to connect to your LDAP server.
The default port is&#XA0;389 if encryption is disabled; and 636 if encryption is enabled.
If you configure a value, it is stored in <TT>ejabberd</TT>&#X2019;s database.
Then, if you remove that value from the configuration file,
the value previously stored in the database will be used instead of the default port.
-</DD><DT CLASS="dt-description"><B><TT>{ldap_rootdn, RootDN}</TT></B></DT><DD CLASS="dd-description"> Bind DN. The default value
+</DD><DT CLASS="dt-description"><B><TT>ldap_rootdn: RootDN</TT></B></DT><DD CLASS="dd-description"> Bind DN. The default value
is&#XA0;<TT>""</TT> which means &#X2018;anonymous connection&#X2019;.
-</DD><DT CLASS="dt-description"><B><TT>{ldap_password, Password}</TT></B></DT><DD CLASS="dd-description"> Bind password. The default
+</DD><DT CLASS="dt-description"><B><TT>ldap_password: Password</TT></B></DT><DD CLASS="dd-description"> Bind password. The default
value is <TT>""</TT>.
-</DD><DT CLASS="dt-description"><B><TT>{ldap_deref_aliases, never|always|finding|searching}</TT></B></DT><DD CLASS="dd-description"> Whether or not to dereference aliases. The default is <TT>never</TT>.
+</DD><DT CLASS="dt-description"><B><TT>ldap_deref_aliases: never|always|finding|searching</TT></B></DT><DD CLASS="dd-description"> Whether or not to dereference aliases. The default is <TT>never</TT>.
</DD></DL><P>Example:
-</P><PRE CLASS="verbatim">{auth_method, ldap}.
-{ldap_servers, ["ldap.example.org"]}.
-{ldap_port, 389}.
-{ldap_rootdn, "cn=Manager,dc=domain,dc=org"}.
-{ldap_password, "secret"}.
+</P><PRE CLASS="verbatim">auth_method: [ldap]
+ldap_servers:
+ - "ldap1.example.org"
+ldap_port: 389
+ldap_rootdn: "cn=Manager,dc=domain,dc=org"
+ldap_password: "**********"
</PRE><P> <A NAME="ldapauth"></A> </P><!--TOC subsubsection Authentication-->
<H4 CLASS="subsubsection"><!--SEC ANCHOR --><A HREF="#ldapauth">Authentication</A></H4><!--SEC END --><P> <A NAME="ldapauth"></A> </P><P>You can authenticate users against an LDAP directory.
Note that current LDAP implementation does not support SASL authentication.</P><P>Available options are:</P><DL CLASS="description"><DT CLASS="dt-description">
-<B><TT>{ldap_base, Base}</TT></B></DT><DD CLASS="dd-description">LDAP base directory which stores
+<B><TT>ldap_base: Base</TT></B></DT><DD CLASS="dd-description">LDAP base directory which stores
users accounts. This option is required.
-</DD><DT CLASS="dt-description"><B><TT>{ldap_uids, [ {ldap_uidattr} | {ldap_uidattr, ldap_uidattr_format}, ...]}</TT></B></DT><DD CLASS="dd-description">
+</DD><DT CLASS="dt-description"><B><TT>ldap_uids: [ ldap_uidattr | {ldap_uidattr: ldap_uidattr_format} ]</TT></B></DT><DD CLASS="dd-description">
LDAP attribute which holds a list of attributes to use as alternatives for getting the JID.
The default attributes are <TT>[{"uid", "%u"}]</TT>.
The attributes are of the form:
@@ -1772,14 +1855,14 @@ only one pattern variable <TT>"%u"</TT> which will be replaced by the
user&#X2019;s part of a JID. For example, <TT>"%u@example.org"</TT>. The default
value is <TT>"%u"</TT>.
</DD></DL>
-</DD><DT CLASS="dt-description"><B><TT>{ldap_filter, Filter}</TT></B></DT><DD CLASS="dd-description">
+</DD><DT CLASS="dt-description"><B><TT>ldap_filter: Filter</TT></B></DT><DD CLASS="dd-description">
<A HREF="http://tools.ietf.org/html/rfc4515">RFC 4515</A> LDAP filter. The
default Filter value is: <TT>undefined</TT>. Example:
<TT>"(&amp;(objectClass=shadowAccount)(memberOf=Jabber Users))"</TT>. Please, do
not forget to close brackets and do not use superfluous whitespaces. Also you
<EM>must not</EM> use <TT>ldap_uidattr</TT> attribute in filter because this
attribute will be substituted in LDAP filter automatically.
-</DD><DT CLASS="dt-description"><B><TT>{ldap_dn_filter, { Filter, FilterAttrs }}</TT></B></DT><DD CLASS="dd-description">
+</DD><DT CLASS="dt-description"><B><TT>ldap_dn_filter: { Filter: FilterAttrs }</TT></B></DT><DD CLASS="dd-description">
This filter is applied on the results returned by the main filter. This filter
performs additional LDAP lookup to make the complete result. This is useful
when you are unable to define all filter rules in <TT>ldap_filter</TT>. You
@@ -1790,7 +1873,8 @@ all <TT>"%s"</TT> variables are consecutively replaced by values of FilterAttrs
attributes and <TT>"%D"</TT> is replaced by Distinguished Name. By default
<TT>ldap_dn_filter</TT> is undefined.
Example:
-<PRE CLASS="verbatim">{ldap_dn_filter, {"(&amp;(name=%s)(owner=%D)(user=%u@%d))", ["sn"]}}.
+<PRE CLASS="verbatim">ldap_dn_filter:
+ "(&amp;(name=%s)(owner=%D)(user=%u@%d))": ["sn"]
</PRE>Since this filter makes additional LDAP lookups, use it only in the
last resort: try to define all filter rules in <TT>ldap_filter</TT> if possible.
</DD><DT CLASS="dt-description"><B><TT>{ldap_local_filter, Filter}</TT></B></DT><DD CLASS="dd-description">
@@ -1812,140 +1896,130 @@ Also we have addressbook, which contains users emails and their additional
infos in <TT>"ou=AddressBook,dc=example,dc=org"</TT> directory.
The connection to the LDAP server is encrypted using TLS,
and using the custom port 6123.
-Corresponding authentication section should looks like this:</P><PRE CLASS="verbatim">%% Authentication method
-{auth_method, ldap}.
-%% DNS name of our LDAP server
-{ldap_servers, ["ldap.example.org"]}.
-%% Bind to LDAP server as "cn=Manager,dc=example,dc=org" with password "secret"
-{ldap_rootdn, "cn=Manager,dc=example,dc=org"}.
-{ldap_password, "secret"}.
-{ldap_encrypt, tls}.
-{ldap_port, 6123}.
-%% Define the user's base
-{ldap_base, "ou=Users,dc=example,dc=org"}.
-%% We want to authorize users from 'shadowAccount' object class only
-{ldap_filter, "(objectClass=shadowAccount)"}.
+Corresponding authentication section should looks like this:</P><PRE CLASS="verbatim">## Authentication method
+auth_method: [ldap]
+## DNS name of our LDAP server
+ldap_servers: ["ldap.example.org"]
+## Bind to LDAP server as "cn=Manager,dc=example,dc=org" with password "secret"
+ldap_rootdn: "cn=Manager,dc=example,dc=org"
+ldap_password: "secret"
+ldap_encrypt: tls
+ldap_port: 6123
+## Define the user's base
+ldap_base: "ou=Users,dc=example,dc=org"
+## We want to authorize users from 'shadowAccount' object class only
+ldap_filter: "(objectClass=shadowAccount)"
</PRE><P>Now we want to use users LDAP-info as their vCards. We have four attributes
defined in our LDAP schema: <TT>"mail"</TT> &#X2014; email address, <TT>"givenName"</TT>
&#X2014; first name, <TT>"sn"</TT> &#X2014; second name, <TT>"birthDay"</TT> &#X2014; birthday.
-Also we want users to search each other. Let&#X2019;s see how we can set it up:</P><PRE CLASS="verbatim">{modules,
- [
+Also we want users to search each other. Let&#X2019;s see how we can set it up:</P><PRE CLASS="verbatim">modules:
...
- {mod_vcard_ldap,
- [
- %% We use the same server and port, but want to bind anonymously because
- %% our LDAP server accepts anonymous requests to
- %% "ou=AddressBook,dc=example,dc=org" subtree.
- {ldap_rootdn, ""},
- {ldap_password, ""},
- %% define the addressbook's base
- {ldap_base, "ou=AddressBook,dc=example,dc=org"},
- %% uidattr: user's part of JID is located in the "mail" attribute
- %% uidattr_format: common format for our emails
- {ldap_uids, [{"mail", "%u@mail.example.org"}]},
- %% We have to define empty filter here, because entries in addressbook does not
- %% belong to shadowAccount object class
- {ldap_filter, ""},
- %% Now we want to define vCard pattern
- {ldap_vcard_map,
- [{"NICKNAME", "%u", []}, % just use user's part of JID as his nickname
- {"GIVEN", "%s", ["givenName"]},
- {"FAMILY", "%s", ["sn"]},
- {"FN", "%s, %s", ["sn", "givenName"]}, % example: "Smith, John"
- {"EMAIL", "%s", ["mail"]},
- {"BDAY", "%s", ["birthDay"]}]},
- %% Search form
- {ldap_search_fields,
- [{"User", "%u"},
- {"Name", "givenName"},
- {"Family Name", "sn"},
- {"Email", "mail"},
- {"Birthday", "birthDay"}]},
- %% vCard fields to be reported
- %% Note that JID is always returned with search results
- {ldap_search_reported,
- [{"Full Name", "FN"},
- {"Nickname", "NICKNAME"},
- {"Birthday", "BDAY"}]}
- ]},
+ mod_vcard_ldap:
+ ## We use the same server and port, but want to bind anonymously because
+ ## our LDAP server accepts anonymous requests to
+ ## "ou=AddressBook,dc=example,dc=org" subtree.
+ ldap_rootdn: ""
+ ldap_password: ""
+ ## define the addressbook's base
+ ldap_base: "ou=AddressBook,dc=example,dc=org"
+ ## uidattr: user's part of JID is located in the "mail" attribute
+ ## uidattr_format: common format for our emails
+ ldap_uids:
+ "mail": "%u@mail.example.org"
+ ## We have to define empty filter here, because entries in addressbook does not
+ ## belong to shadowAccount object class
+ ldap_filter: ""
+ ## Now we want to define vCard pattern
+ ldap_vcard_map:
+ "NICKNAME": {"%u": []} # just use user's part of JID as his nickname
+ "GIVEN": {"%s": ["givenName"]}
+ "FAMILY": {"%s": ["sn"]}
+ "FN": {"%s, %s": ["sn", "givenName"]}, # example: "Smith, John"
+ "EMAIL": {"%s": ["mail"]}
+ "BDAY": {"%s": ["birthDay"]}]}
+ ## Search form
+ ldap_search_fields:
+ "User": "%u"
+ "Name": "givenName"
+ "Family Name": "sn"
+ "Email": "mail"
+ "Birthday": "birthDay"
+ ## vCard fields to be reported
+ ## Note that JID is always returned with search results
+ ldap_search_reported:
+ "Full Name": "FN"
+ "Nickname": "NICKNAME"
+ "Birthday": "BDAY"
...
- ]}.
</PRE><P>Note that <TT>mod_vcard_ldap</TT> module checks for the existence of the user before
searching in his information in LDAP.</P><P> <A NAME="ad"></A> </P><!--TOC paragraph Active Directory-->
<H5 CLASS="paragraph"><!--SEC ANCHOR --><A HREF="#ad">Active Directory</A></H5><!--SEC END --><P> <A NAME="ad"></A>
</P><P>Active Directory is just an LDAP-server with predefined attributes. A sample
-configuration is shown below:</P><PRE CLASS="verbatim">{auth_method, ldap}.
-{ldap_servers, ["office.org"]}. % List of LDAP servers
-{ldap_base, "DC=office,DC=org"}. % Search base of LDAP directory
-{ldap_rootdn, "CN=Administrator,CN=Users,DC=office,DC=org"}. % LDAP manager
-{ldap_password, "*******"}. % Password to LDAP manager
-{ldap_uids, [{"sAMAccountName"}]}.
-{ldap_filter, "(memberOf=*)"}.
+configuration is shown below:</P><PRE CLASS="verbatim">auth_method: [ldap]
+ldap_servers: ["office.org"] # List of LDAP servers
+ldap_base: "DC=office,DC=org" # Search base of LDAP directory
+ldap_rootdn: "CN=Administrator,CN=Users,DC=office,DC=org" # LDAP manager
+ldap_password: "*******" # Password to LDAP manager
+ldap_uids: ["sAMAccountName"]
+ldap_filter: "(memberOf=*)"
-{modules,
- [
+modules:
...
- {mod_vcard_ldap,
- [{ldap_vcard_map,
- [{"NICKNAME", "%u", []},
- {"GIVEN", "%s", ["givenName"]},
- {"MIDDLE", "%s", ["initials"]},
- {"FAMILY", "%s", ["sn"]},
- {"FN", "%s", ["displayName"]},
- {"EMAIL", "%s", ["mail"]},
- {"ORGNAME", "%s", ["company"]},
- {"ORGUNIT", "%s", ["department"]},
- {"CTRY", "%s", ["c"]},
- {"LOCALITY", "%s", ["l"]},
- {"STREET", "%s", ["streetAddress"]},
- {"REGION", "%s", ["st"]},
- {"PCODE", "%s", ["postalCode"]},
- {"TITLE", "%s", ["title"]},
- {"URL", "%s", ["wWWHomePage"]},
- {"DESC", "%s", ["description"]},
- {"TEL", "%s", ["telephoneNumber"]}]},
- {ldap_search_fields,
- [{"User", "%u"},
- {"Name", "givenName"},
- {"Family Name", "sn"},
- {"Email", "mail"},
- {"Company", "company"},
- {"Department", "department"},
- {"Role", "title"},
- {"Description", "description"},
- {"Phone", "telephoneNumber"}]},
- {ldap_search_reported,
- [{"Full Name", "FN"},
- {"Nickname", "NICKNAME"},
- {"Email", "EMAIL"}]}
- ]},
+ mod_vcard_ldap:
+ ldap_vcard_map:
+ "NICKNAME": {"%u", []}
+ "GIVEN": {"%s", ["givenName"]}
+ "MIDDLE": {"%s", ["initials"]}
+ "FAMILY": {"%s", ["sn"]}
+ "FN": {"%s", ["displayName"]}
+ "EMAIL": {"%s", ["mail"]}
+ "ORGNAME": {"%s", ["company"]}
+ "ORGUNIT": {"%s", ["department"]}
+ "CTRY": {"%s", ["c"]}
+ "LOCALITY": {"%s", ["l"]}
+ "STREET": {"%s", ["streetAddress"]}
+ "REGION": {"%s", ["st"]}
+ "PCODE": {"%s", ["postalCode"]}
+ "TITLE": {"%s", ["title"]}
+ "URL": {"%s", ["wWWHomePage"]}
+ "DESC": {"%s", ["description"]}
+ "TEL": {"%s", ["telephoneNumber"]}]}
+ ldap_search_fields:
+ "User": "%u"
+ "Name": "givenName"
+ "Family Name": "sn"
+ "Email": "mail"
+ "Company": "company"
+ "Department": "department"
+ "Role": "title"
+ "Description": "description"
+ "Phone": "telephoneNumber"
+ ldap_search_reported:
+ "Full Name": "FN"
+ "Nickname": "NICKNAME"
+ "Email": "EMAIL"
...
- ]}.
</PRE><P> <A NAME="modules"></A> </P><!--TOC section Modules Configuration-->
-<H2 CLASS="section"><!--SEC ANCHOR --><A NAME="htoc38">3.3</A>&#XA0;&#XA0;<A HREF="#modules">Modules Configuration</A></H2><!--SEC END --><P> <A NAME="modules"></A>
+<H2 CLASS="section"><!--SEC ANCHOR --><A NAME="htoc36">3.3</A>&#XA0;&#XA0;<A HREF="#modules">Modules Configuration</A></H2><!--SEC END --><P> <A NAME="modules"></A>
</P><P>The option <TT>modules</TT> defines the list of modules that will be loaded after
<TT>ejabberd</TT>&#X2019;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
module.</P><P>The syntax is:
-</P><DL CLASS="description"><DT CLASS="dt-description"><B><TT>{modules, [ {ModuleName, ModuleOptions}, ...]}.</TT></B></DT></DL><P>Examples:
+</P><DL CLASS="description"><DT CLASS="dt-description"><B><TT>modules: { ModuleName: ModuleOptions }</TT></B></DT></DL><P>Examples:
</P><UL CLASS="itemize"><LI CLASS="li-itemize">
In this example only the module <TT>mod_echo</TT> is loaded and no module
options are specified between the square brackets:
-<PRE CLASS="verbatim">{modules,
- [
- {mod_echo, []}
- ]}.
+<PRE CLASS="verbatim">modules:
+ mod_echo: {}
</PRE></LI><LI CLASS="li-itemize">In the second example the modules <TT>mod_echo</TT>, <TT>mod_time</TT>, and
<TT>mod_version</TT> are loaded without options. Remark that, besides the last entry,
all entries end with a comma:
-<PRE CLASS="verbatim">{modules,
- [
- {mod_echo, []},
- {mod_time, []},
- {mod_version, []}
- ]}.
+<PRE CLASS="verbatim">modules:
+ mod_echo: {}
+ mod_time: {}
+ mod_version: {}
</PRE></LI></UL><P> <A NAME="modoverview"></A> </P><!--TOC subsection Modules Overview-->
-<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc39">3.3.1</A>&#XA0;&#XA0;<A HREF="#modoverview">Modules Overview</A></H3><!--SEC END --><P> <A NAME="modoverview"></A>
+<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc37">3.3.1</A>&#XA0;&#XA0;<A HREF="#modoverview">Modules Overview</A></H3><!--SEC END --><P> <A NAME="modoverview"></A>
</P><P>The following table lists all modules included in <TT>ejabberd</TT>.</P><BLOCKQUOTE CLASS="table"><DIV CLASS="center"><DIV CLASS="center"><HR WIDTH="80%" SIZE=2></DIV>
<TABLE BORDER=1 CELLSPACING=0 CELLPADDING=1><TR><TD ALIGN=left NOWRAP><B>Module</B></TD><TD ALIGN=left NOWRAP><B>Feature</B></TD><TD ALIGN=left NOWRAP><B>Dependencies</B></TD></TR>
<TR><TD ALIGN=left NOWRAP><TT>mod_adhoc</TT></TD><TD ALIGN=left NOWRAP>Ad-Hoc Commands (<A HREF="http://xmpp.org/extensions/xep-0050.html">XEP-0050</A>)</TD><TD ALIGN=left NOWRAP>&nbsp;</TD></TR>
@@ -1995,14 +2069,14 @@ Mnesia as backend, or a ODBC database in some cases (see&#XA0;<A HREF="#database
<TT>ejabberd</TT> 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!</P><P> <A NAME="modcommonoptions"></A> </P><!--TOC subsection Common Options-->
-<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc40">3.3.2</A>&#XA0;&#XA0;<A HREF="#modcommonoptions">Common Options</A></H3><!--SEC END --><P> <A NAME="modcommonoptions"></A> </P><P>The following options are used by many modules. Therefore, they are described in
+<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc38">3.3.2</A>&#XA0;&#XA0;<A HREF="#modcommonoptions">Common Options</A></H3><!--SEC END --><P> <A NAME="modcommonoptions"></A> </P><P>The following options are used by many modules. Therefore, they are described in
this separate section.</P><P> <A NAME="modiqdiscoption"></A> </P><!--TOC subsubsection <TT>iqdisc</TT>-->
<H4 CLASS="subsubsection"><!--SEC ANCHOR --><A HREF="#modiqdiscoption"><TT>iqdisc</TT></A></H4><!--SEC END --><P> <A NAME="modiqdiscoption"></A>
</P><P>Many modules define handlers for processing IQ queries of different namespaces
to this server or to a user (e.&#XA0;g. to <TT>example.org</TT> or to
<TT>user@example.org</TT>). This option defines processing discipline for
these queries.</P><P>The syntax is:
-</P><DL CLASS="description"><DT CLASS="dt-description"><B><TT>{iqdisc, Value}</TT></B></DT></DL><P>Possible <TT>Value</TT> are:
+</P><DL CLASS="description"><DT CLASS="dt-description"><B><TT>iqdisc: Value</TT></B></DT></DL><P>Possible <TT>Value</TT> are:
</P><DL CLASS="description"><DT CLASS="dt-description">
<B><TT>no_queue</TT></B></DT><DD CLASS="dd-description"> All queries of a namespace with this processing discipline are
processed directly. This means that the XMPP connection that sends this IQ query gets blocked:
@@ -2013,7 +2087,7 @@ recommended if the processing of a query can take a relatively long time.
of IQ queries of a namespace with this discipline. In addition, the processing
of this queue is done in parallel with that of other packets. This discipline
is most recommended.
-</DD><DT CLASS="dt-description"><B><TT>{queues, N}</TT></B></DT><DD CLASS="dd-description"> N separate queues are created to process the
+</DD><DT CLASS="dt-description"><B><TT>N</TT></B></DT><DD CLASS="dd-description"> N separate queues are created to process the
queries. The queries are thus processed in parallel, but in a
controlled way.
</DD><DT CLASS="dt-description"><B><TT>parallel</TT></B></DT><DD CLASS="dd-description"> For every packet with this discipline a separate Erlang process
@@ -2022,35 +2096,32 @@ Although spawning of Erlang process has a relatively low cost, this can break
the server&#X2019;s normal work, because the Erlang emulator has a limit on the
number of processes (32000 by default).
</DD></DL><P>Example:
-</P><PRE CLASS="verbatim">{modules,
- [
+</P><PRE CLASS="verbatim">modules:
...
- {mod_time, [{iqdisc, no_queue}]},
+ mod_time:
+ iqdisc: no_queue
...
- ]}.
</PRE><P> <A NAME="modhostoption"></A> </P><!--TOC subsubsection <TT>host</TT>-->
<H4 CLASS="subsubsection"><!--SEC ANCHOR --><A HREF="#modhostoption"><TT>host</TT></A></H4><!--SEC END --><P> <A NAME="modhostoption"></A>
</P><P>This option defines the Jabber ID of a service provided by an <TT>ejabberd</TT> module.</P><P>The syntax is:
-</P><DL CLASS="description"><DT CLASS="dt-description"><B><TT>{host, HostName}</TT></B></DT></DL><P>If you include the keyword "@HOST@" in the HostName,
+</P><DL CLASS="description"><DT CLASS="dt-description"><B><TT>host: HostName</TT></B></DT></DL><P>If you include the keyword "@HOST@" in the HostName,
it is replaced at start time with the real virtual host string.</P><P>This example configures
the echo module to provide its echoing service
in the Jabber ID <TT>mirror.example.org</TT>:
-</P><PRE CLASS="verbatim">{modules,
- [
+</P><PRE CLASS="verbatim">modules:
...
- {mod_echo, [{host, "mirror.example.org"}]},
+ mod_echo:
+ host: "mirror.example.org"
...
- ]}.
</PRE><P>However, if there are several virtual hosts and this module is enabled in all of them,
the "@HOST@" keyword must be used:
-</P><PRE CLASS="verbatim">{modules,
- [
+</P><PRE CLASS="verbatim">modules:
...
- {mod_echo, [{host, "mirror.@HOST@"}]},
+ mod_echo:
+ host: "mirror.@HOST@"
...
- ]}.
</PRE><P> <A NAME="modannounce"></A> </P><!--TOC subsection <TT>mod_announce</TT>-->
-<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc41">3.3.3</A>&#XA0;&#XA0;<A HREF="#modannounce"><TT>mod_announce</TT></A></H3><!--SEC END --><P> <A NAME="modannounce"></A>
+<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc39">3.3.3</A>&#XA0;&#XA0;<A HREF="#modannounce"><TT>mod_announce</TT></A></H3><!--SEC END --><P> <A NAME="modannounce"></A>
</P><P>This module enables configured users to broadcast announcements and to set
the message of the day (MOTD).
Configured users can perform these actions with a
@@ -2081,44 +2152,50 @@ login. The message is <EM>not sent</EM> to any currently connected user.
Any message sent to this JID removes the existing message of the day (MOTD).
</DD></DL><P>Options:
</P><DL CLASS="description"><DT CLASS="dt-description">
-<B><TT>{db_type, mnesia|odbc}</TT></B></DT><DD CLASS="dd-description">
+<B><TT>db_type: internal|odbc</TT></B></DT><DD CLASS="dd-description">
Define the type of storage where the module will create the tables and store user information.
The default is to store in the internal Mnesia database.
If <TT>odbc</TT> value is defined, make sure you have defined the database, see&#XA0;<A HREF="#database">3.2</A>.
-</DD><DT CLASS="dt-description"><B><TT>{access, AccessName}</TT></B></DT><DD CLASS="dd-description"> This option specifies who is allowed to
+</DD><DT CLASS="dt-description"><B><TT>access: AccessName</TT></B></DT><DD CLASS="dd-description"> This option specifies who is allowed to
send announcements and to set the message of the day (by default, nobody is
able to send such messages).
</DD></DL><P>Examples:
</P><UL CLASS="itemize"><LI CLASS="li-itemize">
Only administrators can send announcements:
-<PRE CLASS="verbatim">{access, announce, [{allow, admin}]}.
+<PRE CLASS="verbatim">access:
+ announce:
+ admin: allow
-{modules,
- [
+modules:
...
- {mod_adhoc, []},
- {mod_announce, [{access, announce}]},
+ mod_adhoc: {}
+ mod_announce:
+ access: announce
...
- ]}.
</PRE></LI><LI CLASS="li-itemize">Administrators as well as the direction can send announcements:
-<PRE CLASS="verbatim">{acl, direction, {user, "big_boss", "example.org"}}.
-{acl, direction, {user, "assistant", "example.org"}}.
-{acl, admin, {user, "admin", "example.org"}}.
+<PRE CLASS="verbatim">acl:
+ direction:
+ user:
+ "big_boss": "example.org"
+ "assistant": "example.org"
+ admin:
+ user:
+ "admin": "example.org"
+access:
+ announce:
+ admin: allow
+ direction: allow
-{access, announce, [{allow, admin},
- {allow, direction}]}.
-
-{modules,
- [
+modules:
...
- {mod_adhoc, []},
- {mod_announce, [{access, announce}]},
+ mod_adhoc: {}
+ mod_announce:
+ access: announce
...
- ]}.
</PRE></LI></UL><P>Note that <TT>mod_announce</TT> can be resource intensive on large
deployments as it can broadcast lot of messages. This module should be
disabled for instances of <TT>ejabberd</TT> with hundreds of thousands users.</P><P> <A NAME="moddisco"></A> </P><!--TOC subsection <TT>mod_disco</TT>-->
-<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc42">3.3.4</A>&#XA0;&#XA0;<A HREF="#moddisco"><TT>mod_disco</TT></A></H3><!--SEC END --><P> <A NAME="moddisco"></A>
+<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc40">3.3.4</A>&#XA0;&#XA0;<A HREF="#moddisco"><TT>mod_disco</TT></A></H3><!--SEC END --><P> <A NAME="moddisco"></A>
@@ -2131,162 +2208,163 @@ for the superseded Jabber Browsing (<A HREF="http://xmpp.org/extensions/xep-0011
the newer Service Discovery protocol if you want them be able to discover
the services you offer.</P><P>Options:
</P><DL CLASS="description"><DT CLASS="dt-description">
-<B><TT>{iqdisc, Discipline}</TT></B></DT><DD CLASS="dd-description"> This specifies
+<B><TT>iqdisc: Discipline</TT></B></DT><DD CLASS="dd-description"> This specifies
the processing discipline for Service Discovery (<TT>http://jabber.org/protocol/disco#items</TT> and
<TT>http://jabber.org/protocol/disco#info</TT>) IQ queries (see section&#XA0;<A HREF="#modiqdiscoption">3.3.2</A>).
-</DD><DT CLASS="dt-description"><B><TT>{extra_domains, [Domain, ...]}</TT></B></DT><DD CLASS="dd-description"> With this option,
+</DD><DT CLASS="dt-description"><B><TT>extra_domains: [Domain, ...]</TT></B></DT><DD CLASS="dd-description"> With this option,
you can specify a list of extra domains that are added to the Service Discovery item list.
-</DD><DT CLASS="dt-description"><B><TT>{server_info, [ {Modules, Field, [Value, ...]}, ... ]}</TT></B></DT><DD CLASS="dd-description">
+</DD><DT CLASS="dt-description"><B><TT>server_info: [ { modules: Modules, name: Name, urls: [URL, ...] } ]</TT></B></DT><DD CLASS="dd-description">
Specify additional information about the server,
as described in Contact Addresses for XMPP Services (<A HREF="http://xmpp.org/extensions/xep-0157.html">XEP-0157</A>).
<TT>Modules</TT> can be the keyword &#X2018;all&#X2019;,
in which case the information is reported in all the services;
or a list of <TT>ejabberd</TT> modules,
in which case the information is only specified for the services provided by those modules.
-Any arbitrary <TT>Field</TT> and <TT>Value</TT> can be specified, not only contact addresses.
+Any arbitrary <TT>Name</TT> and <TT>URL</TT> can be specified, not only contact addresses.
</DD></DL><P>Examples:
</P><UL CLASS="itemize"><LI CLASS="li-itemize">
To serve a link to the Jabber User Directory on <TT>jabber.org</TT>:
-<PRE CLASS="verbatim">{modules,
- [
+<PRE CLASS="verbatim">modules:
...
- {mod_disco, [{extra_domains, ["users.jabber.org"]}]},
+ mod_disco:
+ extra_domains: ["users.jabber.org"]
...
- ]}.
</PRE></LI><LI CLASS="li-itemize">To serve a link to the transports on another server:
-<PRE CLASS="verbatim">{modules,
- [
+<PRE CLASS="verbatim">modules:
...
- {mod_disco, [{extra_domains, ["icq.example.com",
- "msn.example.com"]}]},
+ mod_disco:
+ extra_domains:
+ - "icq.example.com"
+ - "msn.example.com"
...
- ]}.
</PRE></LI><LI CLASS="li-itemize">To serve a link to a few friendly servers:
-<PRE CLASS="verbatim">{modules,
- [
+<PRE CLASS="verbatim">modules:
...
- {mod_disco, [{extra_domains, ["example.org",
- "example.com"]}]},
+ mod_disco:
+ extra_domains:
+ - "example.org"
+ - "example.com"
...
- ]}.
</PRE></LI><LI CLASS="li-itemize">With this configuration, all services show abuse addresses,
feedback address on the main server,
and admin addresses for both the main server and the vJUD service:
-<PRE CLASS="verbatim">{modules,
- [
+<PRE CLASS="verbatim">modules:
...
- {mod_disco, [{server_info, [
- {all,
- "abuse-addresses",
- ["mailto:abuse@shakespeare.lit"]},
- {[mod_muc],
- "Web chatroom logs",
- ["http://www.example.org/muc-logs"]},
- {[mod_disco],
- "feedback-addresses",
- ["http://shakespeare.lit/feedback.php", "mailto:feedback@shakespeare.lit", "xmpp:feedback@shakespeare.lit"]},
- {[mod_disco, mod_vcard],
- "admin-addresses",
- ["mailto:xmpp@shakespeare.lit", "xmpp:admins@shakespeare.lit"]}
- ]}]},
+ mod_disco:
+ server_info:
+ -
+ modules: all
+ name: "abuse-addresses"
+ urls: ["mailto:abuse@shakespeare.lit"]
+ -
+ modules: [mod_muc]
+ name: "Web chatroom logs"
+ urls: ["http://www.example.org/muc-logs"]
+ -
+ modules: [mod_disco]
+ name: "feedback-addresses"
+ urls:
+ - "http://shakespeare.lit/feedback.php"
+ - "mailto:feedback@shakespeare.lit"
+ - "xmpp:feedback@shakespeare.lit"
+ -
+ modules:
+ - mod_disco
+ - mod_vcard
+ name: "admin-addresses"
+ urls:
+ - "mailto:xmpp@shakespeare.lit"
+ - "xmpp:admins@shakespeare.lit"
...
- ]}.
</PRE></LI></UL><P> <A NAME="modecho"></A> </P><!--TOC subsection <TT>mod_echo</TT>-->
-<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc43">3.3.5</A>&#XA0;&#XA0;<A HREF="#modecho"><TT>mod_echo</TT></A></H3><!--SEC END --><P> <A NAME="modecho"></A>
+<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc41">3.3.5</A>&#XA0;&#XA0;<A HREF="#modecho"><TT>mod_echo</TT></A></H3><!--SEC END --><P> <A NAME="modecho"></A>
</P><P>This module simply echoes any XMPP
packet back to the sender. This mirror can be of interest for
<TT>ejabberd</TT> and XMPP client debugging.</P><P>Options:
</P><DL CLASS="description"><DT CLASS="dt-description">
-<B><TT>{host, HostName}</TT></B></DT><DD CLASS="dd-description"> This option defines the Jabber ID of the
+<B><TT>host: HostName</TT></B></DT><DD CLASS="dd-description"> This option defines the Jabber ID of the
service. If the <TT>host</TT> option is not specified, the Jabber ID will be the
hostname of the virtual host with the prefix &#X2018;<TT>echo.</TT>&#X2019;. The keyword "@HOST@"
is replaced at start time with the real virtual host name.
</DD></DL><P>Example: Mirror, mirror, on the wall, who is the most beautiful
of them all?
-</P><PRE CLASS="verbatim">{modules,
- [
+</P><PRE CLASS="verbatim">modules:
...
- {mod_echo, [{host, "mirror.example.org"}]},
+ mod_echo:
+ host: "mirror.example.org"
...
- ]}.
</PRE><P> <A NAME="modhttpbind"></A> </P><!--TOC subsection <TT>mod_http_bind</TT>-->
-<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc44">3.3.6</A>&#XA0;&#XA0;<A HREF="#modhttpbind"><TT>mod_http_bind</TT></A></H3><!--SEC END --><P> <A NAME="modhttpbind"></A>
+<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc42">3.3.6</A>&#XA0;&#XA0;<A HREF="#modhttpbind"><TT>mod_http_bind</TT></A></H3><!--SEC END --><P> <A NAME="modhttpbind"></A>
</P><P>This module implements XMPP over Bosh (formerly known as HTTP Binding)
as defined in <A HREF="http://xmpp.org/extensions/xep-0124.html">XEP-0124</A> and <A HREF="http://xmpp.org/extensions/xep-0206.html">XEP-0206</A>.
It extends ejabberd&#X2019;s built in HTTP service with a configurable
resource at which this service will be hosted.</P><P>To use HTTP-Binding, enable the module:
-</P><PRE CLASS="verbatim">{modules,
- [
+</P><PRE CLASS="verbatim">modules:
...
- {mod_http_bind, []},
+ mod_http_bind: {}
...
-]}.
</PRE><P>and add <CODE>http_bind</CODE> in the HTTP service. For example:
-</P><PRE CLASS="verbatim">{listen,
- [
+</P><PRE CLASS="verbatim">listen:
...
- {5280, ejabberd_http, [
- http_bind,
- http_poll,
- web_admin
- ]
- },
+ -
+ port: 5280
+ module: ejabberd_http
+ http_bind: true
+ http_poll: true
+ web_admin: true
...
-]}.
</PRE><P>With this configuration, the module will serve the requests sent to
<CODE>http://example.org:5280/http-bind/</CODE>
Remember that this page is not designed to be used by web browsers,
it is used by XMPP clients that support XMPP over Bosh.</P><P>If you want to set the service in a different URI path or use a different module,
you can configure it manually using the option <CODE>request_handlers</CODE>.
For example:
-</P><PRE CLASS="verbatim">{listen,
- [
+</P><PRE CLASS="verbatim">listen:
...
- {5280, ejabberd_http, [
- {request_handlers, [{["http-bind"], mod_http_bind}]},
- http_poll,
- web_admin
- ]
- },
+ -
+ port: 5280
+ module: ejabberd_http
+ request_handlers:
+ "/http-bind": mod_http_bind
+ http_poll: true
+ web_admin: true
...
-]}.
</PRE><P>Options:
</P><DL CLASS="description"><DT CLASS="dt-description">
<B><TT>{max_inactivity, Seconds}</TT></B></DT><DD CLASS="dd-description">
Define the maximum inactivity period in seconds.
Default value is 30 seconds.
For example, to set 50 seconds:
-<PRE CLASS="verbatim">{modules,
- [
+<PRE CLASS="verbatim">modules:
...
- {mod_http_bind, [ {max_inactivity, 50} ]},
+ mod_http_bind:
+ max_inactivity: 50
...
-]}.
</PRE></DD></DL><P> <A NAME="modhttpfileserver"></A> </P><!--TOC subsection <TT>mod_http_fileserver</TT>-->
-<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc45">3.3.7</A>&#XA0;&#XA0;<A HREF="#modhttpfileserver"><TT>mod_http_fileserver</TT></A></H3><!--SEC END --><P> <A NAME="modhttpfileserver"></A>
+<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc43">3.3.7</A>&#XA0;&#XA0;<A HREF="#modhttpfileserver"><TT>mod_http_fileserver</TT></A></H3><!--SEC END --><P> <A NAME="modhttpfileserver"></A>
</P><P>This simple module serves files from the local disk over HTTP.</P><P>Options:
</P><DL CLASS="description"><DT CLASS="dt-description">
-<B><TT>{docroot, Path}</TT></B></DT><DD CLASS="dd-description">
+<B><TT>docroot: Path</TT></B></DT><DD CLASS="dd-description">
Directory to serve the files.
-</DD><DT CLASS="dt-description"><B><TT>{accesslog, Path}</TT></B></DT><DD CLASS="dd-description">
+</DD><DT CLASS="dt-description"><B><TT>accesslog: Path</TT></B></DT><DD CLASS="dd-description">
File to log accesses using an Apache-like format.
No log will be recorded if this option is not specified.
-</DD><DT CLASS="dt-description"><B><TT>{directory_indices, [Index, ...]}</TT></B></DT><DD CLASS="dd-description">
+</DD><DT CLASS="dt-description"><B><TT>directory_indices: [Index, ...]</TT></B></DT><DD CLASS="dd-description">
Indicate one or more directory index files, similarly to Apache&#X2019;s
DirectoryIndex variable. When a web request hits a directory
instead of a regular file, those directory indices are looked in
order, and the first one found is returned.
-</DD><DT CLASS="dt-description"><B><TT>{custom_headers, [ {Name, Value}, ...]}</TT></B></DT><DD CLASS="dd-description">
+</DD><DT CLASS="dt-description"><B><TT>custom_headers: {Name: Value}</TT></B></DT><DD CLASS="dd-description">
Indicate custom HTTP headers to be included in all responses.
Default value is: <TT>[]</TT>
-</DD><DT CLASS="dt-description"><B><TT>{content_types, [ {Name, Type}, ...]}</TT></B></DT><DD CLASS="dd-description">
+</DD><DT CLASS="dt-description"><B><TT>content_types: {Name: Type}</TT></B></DT><DD CLASS="dd-description">
Specify mappings of extension to content type.
There are several content types already defined,
with this option you can add new definitions, modify or delete existing ones.
To delete an existing definition, simply define it with a value: &#X2018;undefined&#X2019;.
-</DD><DT CLASS="dt-description"><B><TT>{default_content_type, Type}</TT></B></DT><DD CLASS="dd-description">
+</DD><DT CLASS="dt-description"><B><TT>default_content_type: Type</TT></B></DT><DD CLASS="dd-description">
Specify the content type to use for unknown extensions.
Default value is &#X2018;application/octet-stream&#X2019;.
</DD></DL><P>This example configuration will serve the files from
@@ -2295,44 +2373,36 @@ in the address <CODE>http://example.org:5280/pub/archive/</CODE>.
In this example a new content type <TT>ogg</TT> is defined,
<TT>png</TT> is redefined, and <TT>jpg</TT> definition is deleted.
To use this module you must enable it:
-</P><PRE CLASS="verbatim">{modules,
- [
+</P><PRE CLASS="verbatim">modules:
...
- {mod_http_fileserver, [
- {docroot, "/var/www"},
- {accesslog, "/var/log/ejabberd/access.log"},
- {directory_indices, ["index.html", "main.htm"]},
- {custom_headers, [{"X-Powered-By", "Erlang/OTP"},
- {"X-Fry", "It's a widely-believed fact!"}
- ]},
- {content_types, [{".ogg", "audio/ogg"},
- {".png", "image/png"},
- {".jpg", undefined}
- ]},
- {default_content_type, "text/html"}
- ]
- },
+ mod_http_fileserver:
+ docroot: "/var/www"
+ accesslog: "/var/log/ejabberd/access.log"
+ directory_indices:
+ - "index.html"
+ - "main.htm"
+ custom_headers:
+ "X-Powered-By": "Erlang/OTP"
+ "X-Fry": "It's a widely-believed fact!"
+ content_types:
+ ".ogg": "audio/ogg"
+ ".png": "image/png"
+ ".jpg": undefined
+ default_content_type: "text/html"
...
-]}.
</PRE><P>And define it as a handler in the HTTP service:
-</P><PRE CLASS="verbatim">{listen,
- [
+</P><PRE CLASS="verbatim">listen:
...
- {5280, ejabberd_http, [
- ...
- {request_handlers, [
- ...
- {["pub", "archive"], mod_http_fileserver},
- ...
- ]
- },
- ...
- ]
- },
+ -
+ port: 5280
+ module: ejabberd_http
+ request_handlers:
+ ...
+ "/pub/archive": mod_http_fileserver
+ ...
...
-]}.
</PRE><P> <A NAME="modirc"></A> </P><!--TOC subsection <TT>mod_irc</TT>-->
-<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc46">3.3.8</A>&#XA0;&#XA0;<A HREF="#modirc"><TT>mod_irc</TT></A></H3><!--SEC END --><P> <A NAME="modirc"></A>
+<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc44">3.3.8</A>&#XA0;&#XA0;<A HREF="#modirc"><TT>mod_irc</TT></A></H3><!--SEC END --><P> <A NAME="modirc"></A>
</P><P>This module is an IRC transport that can be used to join channels on IRC
servers.</P><P>End user information:
@@ -2356,61 +2426,66 @@ number of connections from one IP.
</LI></UL><P>Options:
</P><DL CLASS="description"><DT CLASS="dt-description">
-<B><TT>{host, HostName}</TT></B></DT><DD CLASS="dd-description"> This option defines the Jabber ID of the
+<B><TT>host: HostName</TT></B></DT><DD CLASS="dd-description"> This option defines the Jabber ID of the
service. If the <TT>host</TT> option is not specified, the Jabber ID will be the
hostname of the virtual host with the prefix &#X2018;<TT>irc.</TT>&#X2019;. The keyword "@HOST@"
is replaced at start time with the real virtual host name.
-</DD><DT CLASS="dt-description"><B><TT>{db_type, mnesia|odbc}</TT></B></DT><DD CLASS="dd-description">
+</DD><DT CLASS="dt-description"><B><TT>db_type: internal|odbc</TT></B></DT><DD CLASS="dd-description">
Define the type of storage where the module will create the tables and store user information.
The default is to store in the internal Mnesia database.
If <TT>odbc</TT> value is defined, make sure you have defined the database, see&#XA0;<A HREF="#database">3.2</A>.
-</DD><DT CLASS="dt-description"><B><TT>{access, AccessName}</TT></B></DT><DD CLASS="dd-description"> This option can be used to specify who
+</DD><DT CLASS="dt-description"><B><TT>access: AccessName</TT></B></DT><DD CLASS="dd-description"> This option can be used to specify who
may use the IRC transport (default value: <TT>all</TT>).
-</DD><DT CLASS="dt-description"><B><TT>{default_encoding, Encoding}</TT></B></DT><DD CLASS="dd-description"> Set the default IRC encoding.
+</DD><DT CLASS="dt-description"><B><TT>default_encoding: Encoding</TT></B></DT><DD CLASS="dd-description"> Set the default IRC encoding.
Default value: <TT>"iso8859-1"</TT>
</DD></DL><P>Examples:
</P><UL CLASS="itemize"><LI CLASS="li-itemize">
In the first example, the IRC transport is available on (all) your
virtual host(s) with the prefix &#X2018;<TT>irc.</TT>&#X2019;. Furthermore, anyone is
able to use the transport. The default encoding is set to "iso8859-15".
-<PRE CLASS="verbatim">{modules,
- [
+<PRE CLASS="verbatim">modules:
...
- {mod_irc, [{access, all}, {default_encoding, "iso8859-15"}]},
+ mod_irc:
+ access: all
+ default_encoding: "iso8859-15"
...
- ]}.
</PRE></LI><LI CLASS="li-itemize">In next example the IRC transport is available with JIDs with prefix <TT>irc-t.net</TT>.
Moreover, the transport is only accessible to two users
of <TT>example.org</TT>, and any user of <TT>example.com</TT>:
-<PRE CLASS="verbatim">{acl, paying_customers, {user, "customer1", "example.org"}}.
-{acl, paying_customers, {user, "customer2", "example.org"}}.
-{acl, paying_customers, {server, "example.com"}}.
+<PRE CLASS="verbatim">acl:
+ paying_customers:
+ user:
+ - "customer1": "example.org"
+ - "customer2": "example.org"
+ server: "example.com"
-{access, irc_users, [{allow, paying_customers}, {deny, all}]}.
+access:
+ irc_users:
+ paying_customers: allow
+ all: deny
-{modules,
- [
+modules:
...
- {mod_irc, [{access, irc_users},
- {host, "irc.example.net"}]},
+ mod_irc:
+ access: irc_users
+ host: "irc.example.net"
...
- ]}.
</PRE></LI></UL><P> <A NAME="modlast"></A> </P><!--TOC subsection <TT>mod_last</TT>-->
-<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc47">3.3.9</A>&#XA0;&#XA0;<A HREF="#modlast"><TT>mod_last</TT></A></H3><!--SEC END --><P> <A NAME="modlast"></A>
+<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc45">3.3.9</A>&#XA0;&#XA0;<A HREF="#modlast"><TT>mod_last</TT></A></H3><!--SEC END --><P> <A NAME="modlast"></A>
</P><P>This module adds support for Last Activity (<A HREF="http://xmpp.org/extensions/xep-0012.html">XEP-0012</A>). 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
<TT>ejabberd</TT> server.</P><P>Options:
</P><DL CLASS="description"><DT CLASS="dt-description">
-<B><TT>{iqdisc, Discipline}</TT></B></DT><DD CLASS="dd-description"> This specifies
+<B><TT>iqdisc: Discipline</TT></B></DT><DD CLASS="dd-description"> This specifies
the processing discipline for Last activity (<TT>jabber:iq:last</TT>) IQ queries (see section&#XA0;<A HREF="#modiqdiscoption">3.3.2</A>).
-</DD><DT CLASS="dt-description"><B><TT>{db_type, mnesia|odbc}</TT></B></DT><DD CLASS="dd-description">
+</DD><DT CLASS="dt-description"><B><TT>db_type: internal|odbc</TT></B></DT><DD CLASS="dd-description">
Define the type of storage where the module will create the tables and store user information.
The default is to store in the internal Mnesia database.
If <TT>odbc</TT> value is defined, make sure you have defined the database, see&#XA0;<A HREF="#database">3.2</A>.
</DD></DL><P> <A NAME="modmuc"></A> </P><!--TOC subsection <TT>mod_muc</TT>-->
-<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc48">3.3.10</A>&#XA0;&#XA0;<A HREF="#modmuc"><TT>mod_muc</TT></A></H3><!--SEC END --><P> <A NAME="modmuc"></A>
+<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc46">3.3.10</A>&#XA0;&#XA0;<A HREF="#modmuc"><TT>mod_muc</TT></A></H3><!--SEC END --><P> <A NAME="modmuc"></A>
</P><P>This module provides a Multi-User Chat (<A HREF="http://xmpp.org/extensions/xep-0045.html">XEP-0045</A>) service.
Users can discover existing rooms, join or create them.
Occupants of a room can chat in public or have private chats.</P><P>Some of the features of Multi-User Chat:
@@ -2432,24 +2507,24 @@ set of rooms goes down, the rooms disappear and they will be recreated
on an available node on first connection attempt.</P><P>Module options:
</P><DL CLASS="description"><DT CLASS="dt-description">
-<B><TT>{host, HostName}</TT></B></DT><DD CLASS="dd-description"> This option defines the Jabber ID of the
+<B><TT>host: HostName</TT></B></DT><DD CLASS="dd-description"> This option defines the Jabber ID of the
service. If the <TT>host</TT> option is not specified, the Jabber ID will be the
hostname of the virtual host with the prefix &#X2018;<TT>conference.</TT>&#X2019;. The keyword "@HOST@"
is replaced at start time with the real virtual host name.
-</DD><DT CLASS="dt-description"><B><TT>{db_type, mnesia|odbc}</TT></B></DT><DD CLASS="dd-description">
+</DD><DT CLASS="dt-description"><B><TT>db_type: internal|odbc</TT></B></DT><DD CLASS="dd-description">
Define the type of storage where the module will create the tables and store user information.
The default is to store in the internal Mnesia database.
If <TT>odbc</TT> value is defined, make sure you have defined the database, see&#XA0;<A HREF="#database">3.2</A>.
-</DD><DT CLASS="dt-description"><B><TT>{access, AccessName}</TT></B></DT><DD CLASS="dd-description"> You can specify who is allowed to use
+</DD><DT CLASS="dt-description"><B><TT>access: AccessName</TT></B></DT><DD CLASS="dd-description"> You can specify who is allowed to use
the Multi-User Chat service. By default everyone is allowed to use it.
-</DD><DT CLASS="dt-description"><B><TT>{access_create, AccessName}</TT></B></DT><DD CLASS="dd-description"> To configure who is
+</DD><DT CLASS="dt-description"><B><TT>access_create: AccessName</TT></B></DT><DD CLASS="dd-description"> To configure who is
allowed to create new rooms at the Multi-User Chat service, this option can be used.
By default any account in the local ejabberd server is allowed to create rooms.
-</DD><DT CLASS="dt-description"><B><TT>{access_persistent, AccessName}</TT></B></DT><DD CLASS="dd-description"> To configure who is
+</DD><DT CLASS="dt-description"><B><TT>access_persistent: AccessName</TT></B></DT><DD CLASS="dd-description"> To configure who is
allowed to modify the &#X2019;persistent&#X2019; room option.
By default any account in the local ejabberd server is allowed to modify that option.
-</DD><DT CLASS="dt-description"><B><TT>{access_admin, AccessName}</TT></B></DT><DD CLASS="dd-description"> This option specifies
+</DD><DT CLASS="dt-description"><B><TT>access_admin: AccessName</TT></B></DT><DD CLASS="dd-description"> This option specifies
who is allowed to administrate the Multi-User Chat service. The default
value is <TT>none</TT>, which means that only the room creator can
administer his room.
@@ -2457,7 +2532,7 @@ The administrators can send a normal message to the service JID,
and it will be shown in all active rooms as a service message.
The administrators can send a groupchat message to the JID of an active room,
and the message will be shown in the room as a service message.
-</DD><DT CLASS="dt-description"><B><TT>{history_size, Size}</TT></B></DT><DD CLASS="dd-description"> A small history of
+</DD><DT CLASS="dt-description"><B><TT>history_size: Size</TT></B></DT><DD CLASS="dd-description"> A small history of
the current discussion is sent to users when they enter the
room. With this option you can define the number of history messages
to keep and send to users joining the room. The value is an
@@ -2465,35 +2540,35 @@ integer. Setting the value to <TT>0</TT> disables the history feature
and, as a result, nothing is kept in memory. The default value is
<TT>20</TT>. This value is global and thus affects all rooms on the
service.
-</DD><DT CLASS="dt-description"><B><TT>{max_users, Number}</TT></B></DT><DD CLASS="dd-description"> This option defines at
+</DD><DT CLASS="dt-description"><B><TT>max_users: Number</TT></B></DT><DD CLASS="dd-description"> This option defines at
the service level, the maximum number of users allowed per
room. It can be lowered in each room configuration but cannot be
increased in individual room configuration. The default value is
200.
-</DD><DT CLASS="dt-description"><B><TT>{max_users_admin_threshold, Number}</TT></B></DT><DD CLASS="dd-description">
+</DD><DT CLASS="dt-description"><B><TT>max_users_admin_threshold: Number</TT></B></DT><DD CLASS="dd-description">
This option defines the
number of service admins or room owners allowed to enter the room when
the maximum number of allowed occupants was reached. The default limit
is 5.
-</DD><DT CLASS="dt-description"><B><TT>{max_user_conferences, Number}</TT></B></DT><DD CLASS="dd-description">
+</DD><DT CLASS="dt-description"><B><TT>max_user_conferences: Number</TT></B></DT><DD CLASS="dd-description">
This option defines the maximum
number of rooms that any given user can join. The default value
is 10. This option is used to prevent possible abuses. Note that
this is a soft limit: some users can sometimes join more conferences
in cluster configurations.
-</DD><DT CLASS="dt-description"><B><TT>{max_room_id, Number}</TT></B></DT><DD CLASS="dd-description">
+</DD><DT CLASS="dt-description"><B><TT>max_room_id: Number</TT></B></DT><DD CLASS="dd-description">
This option defines the maximum number of characters that Room ID
can have when creating a new room.
The default value is to not limit: infinite.
-</DD><DT CLASS="dt-description"><B><TT>{max_room_name, Number}</TT></B></DT><DD CLASS="dd-description">
+</DD><DT CLASS="dt-description"><B><TT>max_room_name: Number</TT></B></DT><DD CLASS="dd-description">
This option defines the maximum number of characters that Room Name
can have when configuring the room.
The default value is to not limit: infinite.
-</DD><DT CLASS="dt-description"><B><TT>{max_room_desc, Number}</TT></B></DT><DD CLASS="dd-description">
+</DD><DT CLASS="dt-description"><B><TT>max_room_desc: Number</TT></B></DT><DD CLASS="dd-description">
This option defines the maximum number of characters that Room Description
can have when configuring the room.
The default value is to not limit: infinite.
-</DD><DT CLASS="dt-description"><B><TT>{min_message_interval, Number}</TT></B></DT><DD CLASS="dd-description">
+</DD><DT CLASS="dt-description"><B><TT>min_message_interval: Number</TT></B></DT><DD CLASS="dd-description">
This option defines the minimum interval between two messages send
by an occupant in seconds. This option is global and valid for all
rooms. A decimal value can be used. When this option is not defined,
@@ -2503,7 +2578,7 @@ be broadcasted by the service. A good value for this minimum message
interval is 0.4 second. If an occupant tries to send messages faster, an
error is send back explaining that the message has been discarded
and describing the reason why the message is not acceptable.
-</DD><DT CLASS="dt-description"><B><TT>{min_presence_interval, Number}</TT></B></DT><DD CLASS="dd-description">
+</DD><DT CLASS="dt-description"><B><TT>min_presence_interval: Number</TT></B></DT><DD CLASS="dd-description">
This option defines the
minimum of time between presence changes coming from a given occupant in
seconds. This option is global and valid for all rooms. A
@@ -2515,41 +2590,41 @@ presence is cached by <TT>ejabberd</TT> and only the last presence is
broadcasted to all occupants in the room after expiration of the
interval delay. Intermediate presence packets are silently
discarded. A good value for this option is 4 seconds.
-</DD><DT CLASS="dt-description"><B><TT>{default_room_options, [ {OptionName, OptionValue}, ...]}</TT></B></DT><DD CLASS="dd-description">
+</DD><DT CLASS="dt-description"><B><TT>default_room_options: {OptionName: OptionValue}</TT></B></DT><DD CLASS="dd-description">
This module option allows to define the desired default room options.
Note that the creator of a room can modify the options of his room
at any time using an XMPP client with MUC capability.
The available room options and the default values are:
<DL CLASS="description"><DT CLASS="dt-description">
-<B><TT>{allow_change_subj, true|false}</TT></B></DT><DD CLASS="dd-description"> Allow occupants to change the subject.
-</DD><DT CLASS="dt-description"><B><TT>{allow_private_messages, true|false}</TT></B></DT><DD CLASS="dd-description"> Occupants can send private messages to other occupants.
-</DD><DT CLASS="dt-description"><B><TT>{allow_private_messages_from_visitors, anyone|moderators|nobody}</TT></B></DT><DD CLASS="dd-description"> Visitors can send private messages to other occupants.
-</DD><DT CLASS="dt-description"><B><TT>{allow_query_users, true|false}</TT></B></DT><DD CLASS="dd-description"> Occupants can send IQ queries to other occupants.
-</DD><DT CLASS="dt-description"><B><TT>{allow_user_invites, false|true}</TT></B></DT><DD CLASS="dd-description"> Allow occupants to send invitations.
-</DD><DT CLASS="dt-description"><B><TT>{allow_visitor_nickchange, true|false}</TT></B></DT><DD CLASS="dd-description"> Allow visitors to
+<B><TT>allow_change_subj: true|false</TT></B></DT><DD CLASS="dd-description"> Allow occupants to change the subject.
+</DD><DT CLASS="dt-description"><B><TT>allow_private_messages: true|false</TT></B></DT><DD CLASS="dd-description"> Occupants can send private messages to other occupants.
+</DD><DT CLASS="dt-description"><B><TT>allow_private_messages_from_visitors: anyone|moderators|nobody</TT></B></DT><DD CLASS="dd-description"> Visitors can send private messages to other occupants.
+</DD><DT CLASS="dt-description"><B><TT>allow_query_users: true|false</TT></B></DT><DD CLASS="dd-description"> Occupants can send IQ queries to other occupants.
+</DD><DT CLASS="dt-description"><B><TT>allow_user_invites: false|true</TT></B></DT><DD CLASS="dd-description"> Allow occupants to send invitations.
+</DD><DT CLASS="dt-description"><B><TT>allow_visitor_nickchange: true|false</TT></B></DT><DD CLASS="dd-description"> Allow visitors to
change nickname.
-</DD><DT CLASS="dt-description"><B><TT>{allow_visitor_status, true|false}</TT></B></DT><DD CLASS="dd-description"> Allow visitors to send
+</DD><DT CLASS="dt-description"><B><TT>allow_visitor_status: true|false</TT></B></DT><DD CLASS="dd-description"> Allow visitors to send
status text in presence updates. If disallowed, the <TT>status</TT>
text is stripped before broadcasting the presence update to all
the room occupants.
-</DD><DT CLASS="dt-description"><B><TT>{anonymous, true|false}</TT></B></DT><DD CLASS="dd-description"> The room is anonymous:
+</DD><DT CLASS="dt-description"><B><TT>anonymous: true|false</TT></B></DT><DD CLASS="dd-description"> The room is anonymous:
occupants don&#X2019;t see the real JIDs of other occupants.
Note that the room moderators can always see the real JIDs of the occupants.
-</DD><DT CLASS="dt-description"><B><TT>{captcha_protected, false}</TT></B></DT><DD CLASS="dd-description">
+</DD><DT CLASS="dt-description"><B><TT>captcha_protected: false</TT></B></DT><DD CLASS="dd-description">
When a user tries to join a room where he has no affiliation (not owner, admin or member),
-the room requires him to fill a CAPTCHA challenge (see section <A HREF="#captcha">3.1.8</A>)
+the room requires him to fill a CAPTCHA challenge (see section <A HREF="#captcha">3.1.9</A>)
in order to accept her join in the room.
-</DD><DT CLASS="dt-description"><B><TT>{logging, false|true}</TT></B></DT><DD CLASS="dd-description"> The public messages are logged using <TT>mod_muc_log</TT>.
-</DD><DT CLASS="dt-description"><B><TT>{max_users, 200}</TT></B></DT><DD CLASS="dd-description"> Maximum number of occupants in the room.
-</DD><DT CLASS="dt-description"><B><TT>{members_by_default, true|false}</TT></B></DT><DD CLASS="dd-description"> The occupants that enter the room are participants by default, so they have &#X2019;voice&#X2019;.
-</DD><DT CLASS="dt-description"><B><TT>{members_only, false|true}</TT></B></DT><DD CLASS="dd-description"> Only members of the room can enter.
-</DD><DT CLASS="dt-description"><B><TT>{moderated, true|false}</TT></B></DT><DD CLASS="dd-description"> Only occupants with &#X2019;voice&#X2019; can send public messages.
-</DD><DT CLASS="dt-description"><B><TT>{password, "roompass123"}</TT></B></DT><DD CLASS="dd-description"> Password of the room. You may want to enable the next option too.
-</DD><DT CLASS="dt-description"><B><TT>{password_protected, false|true}</TT></B></DT><DD CLASS="dd-description"> The password is required to enter the room.
-</DD><DT CLASS="dt-description"><B><TT>{persistent, false|true}</TT></B></DT><DD CLASS="dd-description"> The room persists even if the last participant leaves.
-</DD><DT CLASS="dt-description"><B><TT>{public, true|false}</TT></B></DT><DD CLASS="dd-description"> The room is public in the list of the MUC service, so it can be discovered.
-</DD><DT CLASS="dt-description"><B><TT>{public_list, true|false}</TT></B></DT><DD CLASS="dd-description"> The list of participants is public, without requiring to enter the room.
-</DD><DT CLASS="dt-description"><B><TT>{title, "Room Title"}</TT></B></DT><DD CLASS="dd-description"> A human-readable title of the room.
+</DD><DT CLASS="dt-description"><B><TT>logging: false|true</TT></B></DT><DD CLASS="dd-description"> The public messages are logged using <TT>mod_muc_log</TT>.
+</DD><DT CLASS="dt-description"><B><TT>max_users: 200</TT></B></DT><DD CLASS="dd-description"> Maximum number of occupants in the room.
+</DD><DT CLASS="dt-description"><B><TT>members_by_default: true|false</TT></B></DT><DD CLASS="dd-description"> The occupants that enter the room are participants by default, so they have &#X2019;voice&#X2019;.
+</DD><DT CLASS="dt-description"><B><TT>members_only: false|true</TT></B></DT><DD CLASS="dd-description"> Only members of the room can enter.
+</DD><DT CLASS="dt-description"><B><TT>moderated: true|false</TT></B></DT><DD CLASS="dd-description"> Only occupants with &#X2019;voice&#X2019; can send public messages.
+</DD><DT CLASS="dt-description"><B><TT>password: "roompass123"</TT></B></DT><DD CLASS="dd-description"> Password of the room. You may want to enable the next option too.
+</DD><DT CLASS="dt-description"><B><TT>password_protected: false|true</TT></B></DT><DD CLASS="dd-description"> The password is required to enter the room.
+</DD><DT CLASS="dt-description"><B><TT>persistent: false|true</TT></B></DT><DD CLASS="dd-description"> The room persists even if the last participant leaves.
+</DD><DT CLASS="dt-description"><B><TT>public: true|false</TT></B></DT><DD CLASS="dd-description"> The room is public in the list of the MUC service, so it can be discovered.
+</DD><DT CLASS="dt-description"><B><TT>public_list: true|false</TT></B></DT><DD CLASS="dd-description"> The list of participants is public, without requiring to enter the room.
+</DD><DT CLASS="dt-description"><B><TT>title: "Room Title"</TT></B></DT><DD CLASS="dd-description"> A human-readable title of the room.
</DD></DL>
All of those room options can be set to <TT>true</TT> or <TT>false</TT>,
except <TT>password</TT> and <TT>title</TT> which are strings,
@@ -2565,19 +2640,23 @@ to new hardware. This will involve service breakdowns around 23:00 UMT.
We apologise for this inconvenience.&#X2019; to <TT>conference.example.org</TT>,
it will be displayed in all active rooms. In this example the history
feature is disabled.
-<PRE CLASS="verbatim">{acl, admin, {user, "admin", "example.org"}}.
+<PRE CLASS="verbatim">acl:
+ admin:
+ user:
+ - "admin": "example.org"
-{access, muc_admin, [{allow, admin}]}.
+access:
+ muc_admin:
+ admin: allow
-{modules,
- [
+modules:
...
- {mod_muc, [{access, all},
- {access_create, all},
- {access_admin, muc_admin},
- {history_size, 0}]},
+ mod_muc:
+ access: all
+ access_create: all
+ access_admin: muc_admin
+ history_size: 0
...
- ]}.
</PRE></LI><LI CLASS="li-itemize">In the second example the Multi-User Chat service is only accessible by
paying customers registered on our domains and on other servers. Of course
the administrator is also allowed to access rooms. In addition, he is the
@@ -2588,61 +2667,64 @@ around 23:00 UMT. We apologise for this inconvenience.&#X2019; to
<TT>conference.example.org</TT>, it will be displayed in all active rooms. No
<TT>history_size</TT> option is used, this means that the feature is enabled
and the default value of 20 history messages will be send to the users.
-<PRE CLASS="verbatim">{acl, paying_customers, {user, "customer1", "example.net"}}.
-{acl, paying_customers, {user, "customer2", "example.com"}}.
-{acl, paying_customers, {user, "customer3", "example.org"}}.
-{acl, admin, {user, "admin", "example.org"}}.
+<PRE CLASS="verbatim">acl:
+ paying_customers:
+ user:
+ - "customer1": "example.net"
+ - "customer2": "example.com"
+ - "customer3": "example.org"
+ admin:
+ user:
+ - "admin": "example.org"
-{access, muc_admin, [{allow, admin},
- {deny, all}]}.
-{access, muc_access, [{allow, paying_customers},
- {allow, admin},
- {deny, all}]}.
+access:
+ muc_admin
+ admin: allow
+ all: deny
+ muc_access:
+ paying_customers: allow
+ admin: allow
+ all: deny
-{modules,
- [
+modules:
...
- {mod_muc, [{access, muc_access},
- {access_create, muc_admin},
- {access_admin, muc_admin}]},
+ mod_muc:
+ access: muc_access
+ access_create: muc_admin
+ access_admin: muc_admin
...
- ]}.
</PRE></LI><LI CLASS="li-itemize">In the following example, MUC anti abuse options are used. An
occupant cannot send more than one message every 0.4 seconds and cannot
change its presence more than once every 4 seconds.
The length of Room IDs and Room Names are limited to 20 characters,
and Room Description to 300 characters. No ACLs are
-defined, but some user restriction could be added as well:<PRE CLASS="verbatim">{modules,
- [
+defined, but some user restriction could be added as well:<PRE CLASS="verbatim">modules:
...
- {mod_muc, [{min_message_interval, 0.4},
- {min_presence_interval, 4},
- {max_room_id, 20},
- {max_room_name, 20},
- {max_room_desc, 300}]},
+ mod_muc:
+ min_message_interval: 0.4
+ min_presence_interval: 4
+ max_room_id: 20
+ max_room_name: 20
+ max_room_desc: 300
...
- ]}.
</PRE></LI><LI CLASS="li-itemize">This example shows how to use <TT>default_room_options</TT> to make sure
the newly created rooms have by default those options.
-<PRE CLASS="verbatim">{modules,
- [
+<PRE CLASS="verbatim">modules:
...
- {mod_muc, [{access, muc_access},
- {access_create, muc_admin},
- {default_room_options,
- [
- {allow_change_subj, false},
- {allow_query_users, true},
- {allow_private_messages, true},
- {members_by_default, false},
- {title, "New chatroom"},
- {anonymous, false}
- ]},
- {access_admin, muc_admin}]},
+ mod_muc:
+ access: muc_access
+ access_create: muc_admin
+ default_room_options:
+ allow_change_subj: false
+ allow_query_users: true
+ allow_private_messages: true
+ members_by_default: false
+ title: "New chatroom"
+ anonymous: false
+ access_admin: muc_admin
...
- ]}.
</PRE></LI></UL><P> <A NAME="modmuclog"></A> </P><!--TOC subsection <TT>mod_muc_log</TT>-->
-<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc49">3.3.11</A>&#XA0;&#XA0;<A HREF="#modmuclog"><TT>mod_muc_log</TT></A></H3><!--SEC END --><P> <A NAME="modmuclog"></A>
+<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc47">3.3.11</A>&#XA0;&#XA0;<A HREF="#modmuclog"><TT>mod_muc_log</TT></A></H3><!--SEC END --><P> <A NAME="modmuclog"></A>
</P><P>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
XMPP client, and if they have enough privileges, they can request the
@@ -2665,54 +2747,54 @@ displayed, including the reason if available.
</LI><LI CLASS="li-itemize">A custom link can be added on top of each page.
</LI></UL><P>Options:
</P><DL CLASS="description"><DT CLASS="dt-description">
-<B><TT>{access_log, AccessName}</TT></B></DT><DD CLASS="dd-description">
+<B><TT>access_log: AccessName</TT></B></DT><DD CLASS="dd-description">
This option restricts which occupants are allowed to enable or disable room
logging. The default value is <TT>muc_admin</TT>. Note for this default setting
you need to have an access rule for <TT>muc_admin</TT> in order to take effect.
-</DD><DT CLASS="dt-description"><B><TT>{cssfile, false|URL}</TT></B></DT><DD CLASS="dd-description">
+</DD><DT CLASS="dt-description"><B><TT>cssfile: false|URL</TT></B></DT><DD CLASS="dd-description">
With this option you can set whether the HTML files should have a custom CSS
file or if they need to use the embedded CSS file. Allowed values are
<TT>false</TT> and an URL to a CSS file. With the first value, HTML files will
include the embedded CSS code. With the latter, you can specify the URL of the
custom CSS file (for example: <TT>"http://example.com/my.css"</TT>). The default value
is <TT>false</TT>.
-</DD><DT CLASS="dt-description"><B><TT>{dirname, room_jid|room_name}</TT></B></DT><DD CLASS="dd-description">
+</DD><DT CLASS="dt-description"><B><TT>dirname: room_jid|room_name</TT></B></DT><DD CLASS="dd-description">
Allows to configure the name of the room directory.
Allowed values are <TT>room_jid</TT> and <TT>room_name</TT>.
With the first value, the room directory name will be the full room JID.
With the latter, the room directory name will be only the room name,
not including the MUC service name.
The default value is <TT>room_jid</TT>.
-</DD><DT CLASS="dt-description"><B><TT>{dirtype, subdirs|plain}</TT></B></DT><DD CLASS="dd-description">
+</DD><DT CLASS="dt-description"><B><TT>dirtype: subdirs|plain</TT></B></DT><DD CLASS="dd-description">
The type of the created directories can be specified with this option. Allowed
values are <TT>subdirs</TT> and <TT>plain</TT>. With the first value,
subdirectories are created for each year and month. With the latter, the
names of the log files contain the full date, and there are no subdirectories.
The default value is <TT>subdirs</TT>.
-</DD><DT CLASS="dt-description"><B><TT>{file_format, html|plaintext}</TT></B></DT><DD CLASS="dd-description">
+</DD><DT CLASS="dt-description"><B><TT>file_format: html|plaintext</TT></B></DT><DD CLASS="dd-description">
Define the format of the log files:
<TT>html</TT> stores in HTML format,
<TT>plaintext</TT> stores in plain text.
The default value is <TT>html</TT>.
-</DD><DT CLASS="dt-description"><B><TT>{file_permissions, {Mode, Group}}</TT></B></DT><DD CLASS="dd-description">
+</DD><DT CLASS="dt-description"><B><TT>file_permissions: {mode: Mode, group: Group}</TT></B></DT><DD CLASS="dd-description">
Define the permissions that must be used when creating the log files:
the number of the mode, and the numeric id of the group that will own the files.
The default value is <TT>{644, 33}</TT>.
-</DD><DT CLASS="dt-description"><B><TT>{outdir, Path}</TT></B></DT><DD CLASS="dd-description">
+</DD><DT CLASS="dt-description"><B><TT>outdir: Path</TT></B></DT><DD CLASS="dd-description">
This option sets the full path to the directory in which the HTML files should
be stored. Make sure the <TT>ejabberd</TT> daemon user has write access on that
directory. The default value is <TT>"www/muc"</TT>.
-</DD><DT CLASS="dt-description"><B><TT>{spam_prevention true|false}</TT></B></DT><DD CLASS="dd-description">
+</DD><DT CLASS="dt-description"><B><TT>spam_prevention: true|false</TT></B></DT><DD CLASS="dd-description">
To prevent spam, the <TT>spam_prevention</TT> option adds a special attribute
to links that prevent their indexation by search engines. The default value
is <TT>true</TT>, which mean that nofollow attributes will be added to user
submitted links.
-</DD><DT CLASS="dt-description"><B><TT>{timezone, local|universal}</TT></B></DT><DD CLASS="dd-description">
+</DD><DT CLASS="dt-description"><B><TT>timezone: local|universal</TT></B></DT><DD CLASS="dd-description">
The time zone for the logs is configurable with this option. Allowed values
are <TT>local</TT> and <TT>universal</TT>. With the first value, the local time,
as reported to Erlang by the operating system, will be used. With the latter,
GMT/UTC time will be used. The default value is <TT>local</TT>.
-</DD><DT CLASS="dt-description"><B><TT>{top_link, {URL, Text}}</TT></B></DT><DD CLASS="dd-description">
+</DD><DT CLASS="dt-description"><B><TT>top_link: {URL: Text}</TT></B></DT><DD CLASS="dd-description">
With this option you can customize the link on the top right corner of each
log file. The default value is <TT>{"/", "Home"}</TT>.
</DD></DL><P>Examples:
@@ -2723,120 +2805,131 @@ of the log files will contain the full date, and there will be no
subdirectories. The log files will be stored in /var/www/muclogs, and the
time zone will be GMT/UTC. Finally, the top link will be
<CODE>&lt;a href="http://www.jabber.ru/"&gt;Jabber.ru&lt;/a&gt;</CODE>.
-<PRE CLASS="verbatim">{access, muc, [{allow, all}]}.
+<PRE CLASS="verbatim">access:
+ muc:
+ all: allow
-{modules,
- [
+modules:
...
- {mod_muc_log, [
- {access_log, muc},
- {cssfile, "http://example.com/my.css"},
- {dirtype, plain},
- {dirname, room_jid},
- {outdir, "/var/www/muclogs"},
- {timezone, universal},
- {spam_prevention, true},
- {top_link, {"http://www.jabber.ru/", "Jabber.ru"}}
- ]},
+ mod_muc_log:
+ access_log: muc
+ cssfile: "http://example.com/my.css"
+ dirtype: plain
+ dirname: room_jid
+ outdir: "/var/www/muclogs"
+ timezone: universal
+ spam_prevention: true
+ top_link:
+ "http://www.jabber.ru/": "Jabber.ru"
...
- ]}.
</PRE></LI><LI CLASS="li-itemize">In the second example only <TT>admin1@example.org</TT> and
<TT>admin2@example.net</TT> can enable logging, and the embedded CSS file will be
used. The names of the log files will only contain the day (number),
and there will be subdirectories for each year and month. The log files will
be stored in /var/www/muclogs, and the local time will be used. Finally, the
top link will be the default <CODE>&lt;a href="/"&gt;Home&lt;/a&gt;</CODE>.
-<PRE CLASS="verbatim">{acl, admin, {user, "admin1", "example.org"}}.
-{acl, admin, {user, "admin2", "example.net"}}.
-
-{access, muc_log, [{allow, admin},
- {deny, all}]}.
+<PRE CLASS="verbatim">acl:
+ admin:
+ user:
+ - "admin1": "example.org"
+ - "admin2": "example.net"
+access:
+ muc_log:
+ admin: allow
+ all: deny
-{modules,
- [
+modules:
...
- {mod_muc_log, [
- {access_log, muc_log},
- {cssfile, false},
- {dirtype, subdirs},
- {dirtype, subdirs},
- {file_permissions, {644, 33}},
- {outdir, "/var/www/muclogs"},
- {timezone, local}
- ]},
+ mod_muc_log:
+ access_log: muc_log
+ cssfile: false
+ dirtype: subdirs
+ file_permissions:
+ mode: 644
+ group: 33
+ outdir: "/var/www/muclogs"
+ timezone: local
...
- ]}.
</PRE></LI></UL><P> <A NAME="modoffline"></A> </P><!--TOC subsection <TT>mod_offline</TT>-->
-<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc50">3.3.12</A>&#XA0;&#XA0;<A HREF="#modoffline"><TT>mod_offline</TT></A></H3><!--SEC END --><P> <A NAME="modoffline"></A>
+<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc48">3.3.12</A>&#XA0;&#XA0;<A HREF="#modoffline"><TT>mod_offline</TT></A></H3><!--SEC END --><P> <A NAME="modoffline"></A>
</P><P>This module implements offline message storage (<A HREF="http://xmpp.org/extensions/xep-0160.html">XEP-0160</A>).
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
<TT>ejabberdctl</TT> has a command to delete expired messages
(see section&#XA0;<A HREF="#ejabberdctl">4.1</A>).</P><DL CLASS="description"><DT CLASS="dt-description">
-<B><TT>{db_type, mnesia|odbc}</TT></B></DT><DD CLASS="dd-description">
+<B><TT>db_type: internal|odbc</TT></B></DT><DD CLASS="dd-description">
Define the type of storage where the module will create the tables and store user information.
The default is to store in the internal Mnesia database.
If <TT>odbc</TT> value is defined, make sure you have defined the database, see&#XA0;<A HREF="#database">3.2</A>.
-</DD><DT CLASS="dt-description"><B><TT>{access_max_user_messages, AccessName}</TT></B></DT><DD CLASS="dd-description">
+</DD><DT CLASS="dt-description"><B><TT>access_max_user_messages: AccessName</TT></B></DT><DD CLASS="dd-description">
This option defines which access rule will be enforced to limit
the maximum number of offline messages that a user can have (quota).
When a user has too many offline messages, any new messages that he receive are discarded,
and a resource-constraint error is returned to the sender.
The default value is <TT>max_user_offline_messages</TT>.
Then you can define an access rule with a syntax similar to
-<TT>max_user_sessions</TT> (see <A HREF="#configmaxsessions">3.1.5</A>).
+<TT>max_user_sessions</TT> (see <A HREF="#configmaxsessions">3.1.6</A>).
</DD></DL><P>This example allows power users to have as much as 5000 offline messages,
administrators up to 2000,
and all the other users up to 100.
-</P><PRE CLASS="verbatim">{acl, admin, {user, "admin1", "localhost"}}.
-{acl, admin, {user, "admin2", "example.org"}}.
-{acl, poweruser, {user, "bob", "example.org"}}.
-{acl, poweruser, {user, "jane", "example.org"}}.
+</P><PRE CLASS="verbatim">acl:
+ admin:
+ user:
+ - "admin1": "localhost"
+ - "admin2": "example.org"
+ poweruser:
+ user:
+ - "bob": "example.org"
+ - "jane": "example.org"
-{access, max_user_offline_messages, [ {5000, poweruser}, {2000, admin}, {100, all} ]}.
+access:
+ max_user_offline_messages:
+ poweruser: 5000
+ admin: 2000
+ all: 100
-{modules,
- [
+modules:
...
- {mod_offline, [ {access_max_user_messages, max_user_offline_messages} ]},
+ mod_offline:
+ access_max_user_messages: max_user_offline_messages
...
- ]}.
</PRE><P> <A NAME="modping"></A> </P><!--TOC subsection <TT>mod_ping</TT>-->
-<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc51">3.3.13</A>&#XA0;&#XA0;<A HREF="#modping"><TT>mod_ping</TT></A></H3><!--SEC END --><P> <A NAME="modping"></A>
+<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc49">3.3.13</A>&#XA0;&#XA0;<A HREF="#modping"><TT>mod_ping</TT></A></H3><!--SEC END --><P> <A NAME="modping"></A>
</P><P>This module implements support for XMPP Ping (<A HREF="http://xmpp.org/extensions/xep-0199.html">XEP-0199</A>) and periodic keepalives.
When this module is enabled ejabberd responds correctly to
ping requests, as defined in the protocol.</P><P>Configuration options:
</P><DL CLASS="description"><DT CLASS="dt-description">
-<B><TT>{send_pings, true|false}</TT></B></DT><DD CLASS="dd-description">
+<B><TT>send_pings: true|false</TT></B></DT><DD CLASS="dd-description">
If this option is set to <TT>true</TT>, the server sends pings to connected clients
that are not active in a given interval <TT>ping_interval</TT>.
This is useful to keep client connections alive or checking availability.
By default this option is disabled.
-</DD><DT CLASS="dt-description"><B><TT>{ping_interval, Seconds}</TT></B></DT><DD CLASS="dd-description">
+</DD><DT CLASS="dt-description"><B><TT>ping_interval: Seconds</TT></B></DT><DD CLASS="dd-description">
How often to send pings to connected clients, if the previous option is enabled.
If a client connection does not send or receive any stanza in this interval,
a ping request is sent to the client.
The default value is 60 seconds.
-</DD><DT CLASS="dt-description"><B><TT>{timeout_action, none|kill}</TT></B></DT><DD CLASS="dd-description">
+</DD><DT CLASS="dt-description"><B><TT>timeout_action: none|kill</TT></B></DT><DD CLASS="dd-description">
What to do when a client does not answer to a server ping request in less than 32 seconds.
The default is to do nothing.
</DD></DL><P>This example enables Ping responses, configures the module to send pings
to client connections that are inactive for 4 minutes,
and if a client does not answer to the ping in less than 32 seconds, its connection is closed:
-</P><PRE CLASS="verbatim">{modules,
- [
+</P><PRE CLASS="verbatim">modules:
...
- {mod_ping, [{send_pings, true}, {ping_interval, 240}, {timeout_action, kill}]},
+ mod_ping:
+ send_pings: true
+ ping_interval: 240
+ timeout_action: kill
...
- ]}.
</PRE><P> <A NAME="modprescounter"></A> </P><!--TOC subsection <TT>mod_pres_counter</TT>-->
-<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc52">3.3.14</A>&#XA0;&#XA0;<A HREF="#modprescounter"><TT>mod_pres_counter</TT></A></H3><!--SEC END --><P> <A NAME="modprescounter"></A>
+<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc50">3.3.14</A>&#XA0;&#XA0;<A HREF="#modprescounter"><TT>mod_pres_counter</TT></A></H3><!--SEC END --><P> <A NAME="modprescounter"></A>
</P><P>This module detects flood/spam in presence subscription stanza traffic.
If a user sends or receives more of those stanzas in a time interval,
the exceeding stanzas are silently dropped, and warning is logged.</P><P>Configuration options:
</P><DL CLASS="description"><DT CLASS="dt-description">
-<B><TT>{count, StanzaNumber}</TT></B></DT><DD CLASS="dd-description">
+<B><TT>count: StanzaNumber</TT></B></DT><DD CLASS="dd-description">
The number of subscription presence stanzas
(subscribe, unsubscribe, subscribed, unsubscribed)
allowed for any direction (input or output)
@@ -2844,19 +2937,19 @@ per time interval.
Please note that two users subscribing to each other usually generate
4 stanzas, so the recommended value is 4 or more.
The default value is: 5.
-</DD><DT CLASS="dt-description"><B><TT>{interval, Seconds}</TT></B></DT><DD CLASS="dd-description">
+</DD><DT CLASS="dt-description"><B><TT>interval: Seconds</TT></B></DT><DD CLASS="dd-description">
The time interval defined in seconds.
The default value is 60.
</DD></DL><P>This example enables the module, and allows up to 5 presence subscription stanzas
to be sent or received by the users in 60 seconds:
-</P><PRE CLASS="verbatim">{modules,
- [
+</P><PRE CLASS="verbatim">modules:
...
- {mod_pres_counter, [{count, 5}, {interval, 60}]},
+ mod_pres_counter:
+ count: 5
+ interval: 60
...
- ]}.
</PRE><P> <A NAME="modprivacy"></A> </P><!--TOC subsection <TT>mod_privacy</TT>-->
-<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc53">3.3.15</A>&#XA0;&#XA0;<A HREF="#modprivacy"><TT>mod_privacy</TT></A></H3><!--SEC END --><P> <A NAME="modprivacy"></A>
+<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc51">3.3.15</A>&#XA0;&#XA0;<A HREF="#modprivacy"><TT>mod_privacy</TT></A></H3><!--SEC END --><P> <A NAME="modprivacy"></A>
</P><P>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 XMPP client, they will be able to:
@@ -2881,14 +2974,14 @@ subscription type (or globally).
(from <A HREF="http://xmpp.org/rfcs/rfc3921.html#privacy"><TT>http://xmpp.org/rfcs/rfc3921.html#privacy</TT></A>)
</BLOCKQUOTE><P>Options:
</P><DL CLASS="description"><DT CLASS="dt-description">
-<B><TT>{iqdisc, Discipline}</TT></B></DT><DD CLASS="dd-description"> This specifies
+<B><TT>iqdisc: Discipline</TT></B></DT><DD CLASS="dd-description"> This specifies
the processing discipline for Blocking Communication (<TT>jabber:iq:privacy</TT>) IQ queries (see section&#XA0;<A HREF="#modiqdiscoption">3.3.2</A>).
-</DD><DT CLASS="dt-description"><B><TT>{db_type, mnesia|odbc}</TT></B></DT><DD CLASS="dd-description">
+</DD><DT CLASS="dt-description"><B><TT>db_type: internal|odbc</TT></B></DT><DD CLASS="dd-description">
Define the type of storage where the module will create the tables and store user information.
The default is to store in the internal Mnesia database.
If <TT>odbc</TT> value is defined, make sure you have defined the database, see&#XA0;<A HREF="#database">3.2</A>.
</DD></DL><P> <A NAME="modprivate"></A> </P><!--TOC subsection <TT>mod_private</TT>-->
-<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc54">3.3.16</A>&#XA0;&#XA0;<A HREF="#modprivate"><TT>mod_private</TT></A></H3><!--SEC END --><P> <A NAME="modprivate"></A>
+<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc52">3.3.16</A>&#XA0;&#XA0;<A HREF="#modprivate"><TT>mod_private</TT></A></H3><!--SEC END --><P> <A NAME="modprivate"></A>
</P><P>This module adds support for Private XML Storage (<A HREF="http://xmpp.org/extensions/xep-0049.html">XEP-0049</A>):
</P><BLOCKQUOTE CLASS="quote">
Using this method, XMPP entities can store private data on the server and
@@ -2897,78 +2990,87 @@ it is valid XML. One typical usage for this namespace is the server-side storage
of client-specific preferences; another is Bookmark Storage (<A HREF="http://xmpp.org/extensions/xep-0048.html">XEP-0048</A>).
</BLOCKQUOTE><P>Options:
</P><DL CLASS="description"><DT CLASS="dt-description">
-<B><TT>{iqdisc, Discipline}</TT></B></DT><DD CLASS="dd-description"> This specifies
+<B><TT>iqdisc: Discipline</TT></B></DT><DD CLASS="dd-description"> This specifies
the processing discipline for Private XML Storage (<TT>jabber:iq:private</TT>) IQ queries (see section&#XA0;<A HREF="#modiqdiscoption">3.3.2</A>).
-</DD><DT CLASS="dt-description"><B><TT>{db_type, mnesia|odbc}</TT></B></DT><DD CLASS="dd-description">
+</DD><DT CLASS="dt-description"><B><TT>db_type: internal|odbc</TT></B></DT><DD CLASS="dd-description">
Define the type of storage where the module will create the tables and store user information.
The default is to store in the internal Mnesia database.
If <TT>odbc</TT> value is defined, make sure you have defined the database, see&#XA0;<A HREF="#database">3.2</A>.
</DD></DL><P> <A NAME="modproxy"></A> </P><!--TOC subsection <TT>mod_proxy65</TT>-->
-<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc55">3.3.17</A>&#XA0;&#XA0;<A HREF="#modproxy"><TT>mod_proxy65</TT></A></H3><!--SEC END --><P> <A NAME="modproxy"></A>
+<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc53">3.3.17</A>&#XA0;&#XA0;<A HREF="#modproxy"><TT>mod_proxy65</TT></A></H3><!--SEC END --><P> <A NAME="modproxy"></A>
</P><P>This module implements SOCKS5 Bytestreams (<A HREF="http://xmpp.org/extensions/xep-0065.html">XEP-0065</A>).
It allows <TT>ejabberd</TT> to act as a file transfer proxy between two
XMPP clients.</P><P>Options:
</P><DL CLASS="description"><DT CLASS="dt-description">
-<B><TT>{host, HostName}</TT></B></DT><DD CLASS="dd-description"> This option defines the Jabber ID of the
+<B><TT>host: HostName</TT></B></DT><DD CLASS="dd-description"> This option defines the Jabber ID of the
service. If the <TT>host</TT> option is not specified, the Jabber ID will be the
hostname of the virtual host with the prefix &#X2018;<TT>proxy.</TT>&#X2019;. The keyword "@HOST@"
is replaced at start time with the real virtual host name.
-</DD><DT CLASS="dt-description"><B><TT>{name, Text}</TT></B></DT><DD CLASS="dd-description">Defines Service Discovery name of the service.
+</DD><DT CLASS="dt-description"><B><TT>name: Text</TT></B></DT><DD CLASS="dd-description">Defines Service Discovery name of the service.
Default is <TT>"SOCKS5 Bytestreams"</TT>.
-</DD><DT CLASS="dt-description"><B><TT>{ip, IPTuple}</TT></B></DT><DD CLASS="dd-description">This option specifies which network interface
+</DD><DT CLASS="dt-description"><B><TT>ip: IP</TT></B></DT><DD CLASS="dd-description">This option specifies which network interface
to listen for. Default is an IP address of the service&#X2019;s DNS name, or,
-if fails, <CODE>{127,0,0,1}</CODE>.
-</DD><DT CLASS="dt-description"><B><TT>{port, Number}</TT></B></DT><DD CLASS="dd-description">This option defines port to listen for
+if fails, <CODE>"127.0.0.1"</CODE>.
+</DD><DT CLASS="dt-description"><B><TT>port: Number</TT></B></DT><DD CLASS="dd-description">This option defines port to listen for
incoming connections. Default is&#XA0;7777.
-</DD><DT CLASS="dt-description"><B><TT>{hostname, HostName}</TT></B></DT><DD CLASS="dd-description">Defines a hostname advertised
+</DD><DT CLASS="dt-description"><B><TT>hostname: HostName</TT></B></DT><DD CLASS="dd-description">Defines a hostname advertised
by the service when establishing a session with clients. This is useful when
you run the service behind a NAT. The default is the value of <TT>ip</TT> option.
Examples: <TT>"proxy.mydomain.org"</TT>, <TT>"200.150.100.50"</TT>. Note that
not all clients understand domain names in stream negotiation,
so you should think twice before setting domain name in this option.
-</DD><DT CLASS="dt-description"><B><TT>{auth_type, anonymous|plain}</TT></B></DT><DD CLASS="dd-description">SOCKS5 authentication type.
+</DD><DT CLASS="dt-description"><B><TT>auth_type: anonymous|plain</TT></B></DT><DD CLASS="dd-description">SOCKS5 authentication type.
Possible values are <TT>anonymous</TT> and <TT>plain</TT>. Default is
<TT>anonymous</TT>.
-</DD><DT CLASS="dt-description"><B><TT>{access, AccessName}</TT></B></DT><DD CLASS="dd-description">Defines ACL for file transfer initiators.
+</DD><DT CLASS="dt-description"><B><TT>access: AccessName</TT></B></DT><DD CLASS="dd-description">Defines ACL for file transfer initiators.
Default is <TT>all</TT>.
-</DD><DT CLASS="dt-description"><B><TT>{max_connections, Number}</TT></B></DT><DD CLASS="dd-description">Maximum number of
+</DD><DT CLASS="dt-description"><B><TT>max_connections: Number</TT></B></DT><DD CLASS="dd-description">Maximum number of
active connections per file transfer initiator. No limit by default.
-</DD><DT CLASS="dt-description"><B><TT>{shaper, none|ShaperName}</TT></B></DT><DD CLASS="dd-description">This option defines shaper for
+</DD><DT CLASS="dt-description"><B><TT>shaper: none|ShaperName</TT></B></DT><DD CLASS="dd-description">This option defines shaper for
the file transfer peers. Shaper with the maximum bandwidth will be selected.
Default is <TT>none</TT>.
</DD></DL><P>Examples:
</P><UL CLASS="itemize"><LI CLASS="li-itemize">
The simpliest configuration of the module:
-<PRE CLASS="verbatim">{modules,
- [
+<PRE CLASS="verbatim">modules:
...
- {mod_proxy65, []},
+ mod_proxy65: {}
...
- ]}.
</PRE></LI><LI CLASS="li-itemize">More complicated configuration.
-<PRE CLASS="verbatim">{acl, proxy_users, {server, "example.org"}}.
-{access, proxy65_access, [{allow, proxy_users}, {deny, all}]}.
+<PRE CLASS="verbatim">acl:
+ admin:
+ user:
+ - "admin": "example.org"
+ proxy_users:
+ server:
+ - "example.org"
+
+access:
+ proxy65_access:
+ proxy_users: allow
+ all: deny
+ proxy65_shaper:
+ admin: none
+ proxy_users: proxyrate
-{acl, admin, {user, "admin", "example.org"}}.
-{shaper, proxyrate, {maxrate, 10240}}. %% 10 Kbytes/sec
-{access, proxy65_shaper, [{none, admin}, {proxyrate, proxy_users}]}.
+shaper:
+ proxyrate: 10240
-{modules,
- [
+modules:
...
- {mod_proxy65, [{host, "proxy1.example.org"},
- {name, "File Transfer Proxy"},
- {ip, {200,150,100,1}},
- {port, 7778},
- {max_connections, 5},
- {access, proxy65_access},
- {shaper, proxy65_shaper}]},
+ mod_proxy65:
+ host: "proxy1.example.org"
+ name: "File Transfer Proxy"
+ ip: "200.150.100.1"
+ port: 7778
+ max_connections: 5
+ access: proxy65_access
+ shaper: proxy65_shaper
...
- ]}.
</PRE></LI></UL><P> <A NAME="modpubsub"></A> </P><!--TOC subsection <TT>mod_pubsub</TT>-->
-<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc56">3.3.18</A>&#XA0;&#XA0;<A HREF="#modpubsub"><TT>mod_pubsub</TT></A></H3><!--SEC END --><P> <A NAME="modpubsub"></A>
+<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc54">3.3.18</A>&#XA0;&#XA0;<A HREF="#modpubsub"><TT>mod_pubsub</TT></A></H3><!--SEC END --><P> <A NAME="modpubsub"></A>
</P><P>This module offers a Publish-Subscribe Service (<A HREF="http://xmpp.org/extensions/xep-0060.html">XEP-0060</A>).
The functionality in <TT>mod_pubsub</TT> can be extended using plugins.
The plugin that implements PEP (Personal Eventing via Pubsub) (<A HREF="http://xmpp.org/extensions/xep-0163.html">XEP-0163</A>)
@@ -2976,27 +3078,27 @@ is enabled in the default ejabberd configuration file,
and it requires <TT>mod_caps</TT>.</P><P>Options:
</P><DL CLASS="description"><DT CLASS="dt-description">
-<B><TT>{host, HostName}</TT></B></DT><DD CLASS="dd-description"> This option defines the Jabber ID of the
+<B><TT>host: HostName</TT></B></DT><DD CLASS="dd-description"> This option defines the Jabber ID of the
service. If the <TT>host</TT> option is not specified, the Jabber ID will be the
hostname of the virtual host with the prefix &#X2018;<TT>pubsub.</TT>&#X2019;. The keyword "@HOST@"
is replaced at start time with the real virtual host name.
If you use <TT>mod_pubsub_odbc</TT>, please ensure the prefix contains only one dot,
for example &#X2018;<TT>pubsub.</TT>&#X2019;, or &#X2018;<TT>publish.</TT>&#X2019;,.
-</DD><DT CLASS="dt-description"><B><TT>{access_createnode, AccessName}</TT></B></DT><DD CLASS="dd-description">
+</DD><DT CLASS="dt-description"><B><TT>access_createnode: AccessName</TT></B></DT><DD CLASS="dd-description">
This option restricts which users are allowed to create pubsub nodes using
ACL and ACCESS.
By default any account in the local ejabberd server is allowed to create pubsub nodes.
-</DD><DT CLASS="dt-description"><B><TT>{max_items_node, MaxItems}</TT></B></DT><DD CLASS="dd-description">
+</DD><DT CLASS="dt-description"><B><TT>max_items_node: MaxItems</TT></B></DT><DD CLASS="dd-description">
Define the maximum number of items that can be stored in a node.
Default value is 10.
-</DD><DT CLASS="dt-description"><B><TT>{plugins, [ Plugin, ...]}</TT></B></DT><DD CLASS="dd-description">
+</DD><DT CLASS="dt-description"><B><TT>plugins: [ Plugin, ...]</TT></B></DT><DD CLASS="dd-description">
To specify which pubsub node plugins to use.
The first one in the list is used by default.
If this option is not defined, the default plugins list is: <TT>["flat"]</TT>.
PubSub clients can define which plugin to use when creating a node:
add <TT>type=&#X2019;plugin-name&#X2019;</TT> attribute to the <TT>create</TT> stanza element.
-</DD><DT CLASS="dt-description"><B><TT>{nodetree, Nodetree}</TT></B></DT><DD CLASS="dd-description">
+</DD><DT CLASS="dt-description"><B><TT>nodetree: Nodetree</TT></B></DT><DD CLASS="dd-description">
To specify which nodetree to use.
If not defined, the default pubsub nodetree is used: "tree".
Only one nodetree can be used per host, and is shared by all node plugins.<P>The "virtual" nodetree does not store nodes on database.
@@ -3010,43 +3112,48 @@ and this can not be changed.
Using "virtual" nodetree requires to start from a clean database,
it will not work if you used the default "tree" nodetree before.</P><P>The "dag" nodetree provides experimental support for PubSub Collection Nodes (<A HREF="http://xmpp.org/extensions/xep-0248.html">XEP-0248</A>).
In that case you should also add "dag" node plugin as default, for example:
-<TT>{plugins, ["dag","flat","hometree","pep"]}</TT>
-</P></DD><DT CLASS="dt-description"><B><TT>{ignore_pep_from_offline, false|true}</TT></B></DT><DD CLASS="dd-description">
+<TT>plugins: ["dag","flat","hometree","pep"]</TT>
+</P></DD><DT CLASS="dt-description"><B><TT>ignore_pep_from_offline: false|true</TT></B></DT><DD CLASS="dd-description">
To specify whether or not we should get last published PEP items
from users in our roster which are offline when we connect. Value is true or false.
If not defined, pubsub assumes true so we only get last items of online contacts.
-</DD><DT CLASS="dt-description"><B><TT>{last_item_cache, false|true}</TT></B></DT><DD CLASS="dd-description">
+</DD><DT CLASS="dt-description"><B><TT>last_item_cache: false|true</TT></B></DT><DD CLASS="dd-description">
To specify whether or not pubsub should cache last items. Value is true
or false. If not defined, pubsub do not cache last items. On systems with not so many nodes,
caching last items speeds up pubsub and allows to raise user connection rate. The cost is memory
usage, as every item is stored in memory.
-</DD><DT CLASS="dt-description"><B><TT>{pep_mapping, [ {Key, Value}, ...]}</TT></B></DT><DD CLASS="dd-description">
+</DD><DT CLASS="dt-description"><B><TT>pep_mapping: {Key, Value}</TT></B></DT><DD CLASS="dd-description">
This allow to define a Key-Value list to choose defined node plugins on given PEP namespace.
The following example will use node_tune instead of node_pep for every PEP node with tune namespace:
-<PRE CLASS="verbatim"> {mod_pubsub, [{pep_mapping, [{"http://jabber.org/protocol/tune", "tune"}]}]}
+<PRE CLASS="verbatim">modules:
+ ...
+ mod_pubsub:
+ pep_mapping:
+ "http://jabber.org/protocol/tune": "tune"
+ ...
</PRE></DD></DL><P>Example of configuration that uses flat nodes as default, and allows use of flat, nodetree and pep nodes:
-</P><PRE CLASS="verbatim">{modules,
- [
+</P><PRE CLASS="verbatim">modules:
...
- {mod_pubsub, [
- {access_createnode, pubsub_createnode},
- {plugins, ["flat", "hometree", "pep"]}
- ]},
+ mod_pubsub:
+ access_createnode: pubsub_createnode
+ plugins:
+ - "flat"
+ - "hometree"
+ - "pep"
...
- ]}.
</PRE><P>Using ODBC database requires using mod_pubsub_odbc without option changes. Only flat, hometree and pep plugins supports ODBC.
The following example shows previous configuration with ODBC usage:
-</P><PRE CLASS="verbatim">{modules,
- [
+</P><PRE CLASS="verbatim">modules:
...
- {mod_pubsub_odbc, [
- {access_createnode, pubsub_createnode},
- {plugins, ["flat", "hometree", "pep"]}
- ]},
+ mod_pubsub_odbc:
+ access_createnode: pubsub_createnode
+ plugins:
+ - "flat"
+ - "hometree"
+ - "pep"
...
- ]}.
</PRE><P> <A NAME="modregister"></A> </P><!--TOC subsection <TT>mod_register</TT>-->
-<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc57">3.3.19</A>&#XA0;&#XA0;<A HREF="#modregister"><TT>mod_register</TT></A></H3><!--SEC END --><P> <A NAME="modregister"></A>
+<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc55">3.3.19</A>&#XA0;&#XA0;<A HREF="#modregister"><TT>mod_register</TT></A></H3><!--SEC END --><P> <A NAME="modregister"></A>
</P><P>This module adds support for In-Band Registration (<A HREF="http://xmpp.org/extensions/xep-0077.html">XEP-0077</A>). This protocol
enables end users to use a XMPP client to:
</P><UL CLASS="itemize"><LI CLASS="li-itemize">
@@ -3055,37 +3162,35 @@ Register a new account on the server.
</LI><LI CLASS="li-itemize">Delete an existing account on the server.
</LI></UL><P>Options:
</P><DL CLASS="description"><DT CLASS="dt-description">
-<B><TT>{access, AccessName}</TT></B></DT><DD CLASS="dd-description">
+<B><TT>access: AccessName</TT></B></DT><DD CLASS="dd-description">
Specify rules to restrict what usernames can be registered and unregistered.
If a rule returns &#X2018;deny&#X2019; on the requested username,
registration and unregistration of that user name is denied.
There are no restrictions by default.
-</DD><DT CLASS="dt-description"><B><TT>{access_from, AccessName}</TT></B></DT><DD CLASS="dd-description"> By default, <TT>ejabberd</TT>
+</DD><DT CLASS="dt-description"><B><TT>access_from: AccessName</TT></B></DT><DD CLASS="dd-description"> By default, <TT>ejabberd</TT>
doesn&#X2019;t allow to register new accounts from s2s or existing c2s sessions. You can
change it by defining access rule in this option. Use with care: allowing registration
from s2s leads to uncontrolled massive accounts creation by rogue users.
-</DD><DT CLASS="dt-description"><B><TT>{captcha_protected, false|true}</TT></B></DT><DD CLASS="dd-description">
-Protect registrations with CAPTCHA (see section <A HREF="#captcha">3.1.8</A>). The default is <TT>false</TT>.
-</DD><DT CLASS="dt-description"><B><TT>{ip_access, [ {allow|deny, IPaddress}, ...]}</TT></B></DT><DD CLASS="dd-description">
+</DD><DT CLASS="dt-description"><B><TT>captcha_protected: false|true</TT></B></DT><DD CLASS="dd-description">
+Protect registrations with CAPTCHA (see section <A HREF="#captcha">3.1.9</A>). The default is <TT>false</TT>.
+</DD><DT CLASS="dt-description"><B><TT>ip_access: AccessName</TT></B></DT><DD CLASS="dd-description">
Define rules to allow or deny account registration depending
-in the IP address of the XMPP client.
-If there is no matching IP mask, the default rule is &#X201C;allow&#X201D;.
-IPv6 addresses are supported, but not tested.
-The default option value is an empty list: <TT>[]</TT>.
-</DD><DT CLASS="dt-description"><B><TT>{password_strength, Entropy}</TT></B></DT><DD CLASS="dd-description">
+on the IP address of the XMPP client. The <TT>AccessName</TT> should be
+of type <TT>ip</TT>. The default value is <TT>all</TT>.
+</DD><DT CLASS="dt-description"><B><TT>password_strength: Entropy</TT></B></DT><DD CLASS="dd-description">
This option sets the minimum informational entropy for passwords. The value <TT>Entropy</TT>
is a number of bits of entropy. The recommended minimum is 32 bits.
The default is 0, i.e. no checks are performed.
-</DD><DT CLASS="dt-description"><B><TT>{welcome_message, {Subject, Body}}</TT></B></DT><DD CLASS="dd-description"> Set a welcome message that
+</DD><DT CLASS="dt-description"><B><TT>welcome_message: {subject: Subject, body: Body}</TT></B></DT><DD CLASS="dd-description">
+ Set a welcome message that
is sent to each newly registered account. The first string is the subject, and
the second string is the message body.
-In the body you can set a newline with the characters: <CODE>\n</CODE>
-</DD><DT CLASS="dt-description"><B><TT>{registration_watchers, [ JID, ...]}</TT></B></DT><DD CLASS="dd-description"> This option defines a
+</DD><DT CLASS="dt-description"><B><TT>registration_watchers: [ JID, ...]</TT></B></DT><DD CLASS="dd-description"> This option defines a
list of JIDs which will be notified each time a new account is registered.
-</DD><DT CLASS="dt-description"><B><TT>{iqdisc, Discipline}</TT></B></DT><DD CLASS="dd-description"> This specifies
+</DD><DT CLASS="dt-description"><B><TT>iqdisc: Discipline</TT></B></DT><DD CLASS="dd-description"> This specifies
the processing discipline for In-Band Registration (<TT>jabber:iq:register</TT>) IQ queries (see section&#XA0;<A HREF="#modiqdiscoption">3.3.2</A>).
</DD></DL><P>This module reads also another option defined globally for the server:
-<TT>{registration_timeout, Timeout}</TT>.
+<TT>registration_timeout: Timeout</TT>.
This option limits the frequency of registration from a given IP or username.
So, a user that tries to register a new account from the same IP address or JID during
this number of seconds after his previous registration
@@ -3098,57 +3203,69 @@ Default value: 600 seconds.</P><P>Examples:
</P><UL CLASS="itemize"><LI CLASS="li-itemize">
Next example prohibits the registration of too short account names,
and allows to create accounts only to clients of the local network:
-<PRE CLASS="verbatim">{acl, shortname, {user_glob, "?"}}.
-{acl, shortname, {user_glob, "??"}}.
-%% The same using regexp:
-%%{acl, shortname, {user_regexp, "^..?$"}}.
+<PRE CLASS="verbatim">acl:
+ loopback:
+ ip:
+ - "127.0.0.0/8"
+ - "::"
+ shortname:
+ user_glob:
+ - "?"
+ - "??"
+ ## The same using regexp:
+ ##user_regexp: "^..?$"
-{access, register, [{deny, shortname},
- {allow, all}]}.
+access:
+ mynetworks:
+ loopback: allow
+ all: deny
+ register:
+ shortname: deny
+ all: allow
-{modules,
- [
- ...
- {mod_register, [{access, register},
- {ip_access, [{allow, "127.0.0.0/8"},
- {deny, "0.0.0.0/0"}]}
- ]},
- ...
- ]}.
+modules:
+ mod_register:
+ ip_access: mynetworks
+ access: register
</PRE></LI><LI CLASS="li-itemize">This configuration prohibits usage of In-Band Registration
to create or delete accounts,
but allows existing accounts to change the password:
-<PRE CLASS="verbatim">{access, register, [{deny, all}]}.
+<PRE CLASS="verbatim">access:
+ register:
+ all: deny
-{modules,
- [
+modules:
...
- {mod_register, [{access, register}]},
+ mod_register:
+ access: register
...
- ]}.
</PRE></LI><LI CLASS="li-itemize">This configuration disables all In-Band Registration
functionality: create, delete accounts and change password:
-<PRE CLASS="verbatim">{modules,
- [
+<PRE CLASS="verbatim">modules:
...
- %% {mod_register, [{access, register}]},
+ ## mod_register:
+ ## access: register
...
- ]}.
</PRE></LI><LI CLASS="li-itemize">Define the welcome message and two registration watchers.
Also define a registration timeout of one hour:
-<PRE CLASS="verbatim">{registration_timeout, 3600}.
-{modules,
- [
+<PRE CLASS="verbatim">registration_timeout: 3600
+modules:
...
- {mod_register,
- [
- {welcome_message, {"Welcome!", "Hi.\nWelcome to this Jabber server.\n Check http://www.jabber.org\n\nBye"}},
- {registration_watchers, ["admin1@example.org", "boss@example.net"]}
- ]},
+ mod_register:
+ welcome_message:
+ subject: "Welcome!"
+ body: |-
+ Hi.
+ Welcome to this Jabber server.
+ Check http://www.jabber.org
+
+ Bye
+ registration_watchers:
+ - "admin1@example.org"
+ - "boss@example.net"
...
- ]}.
</PRE></LI></UL><P> <A NAME="modregisterweb"></A> </P><!--TOC subsection <TT>mod_register_web</TT>-->
-<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc58">3.3.20</A>&#XA0;&#XA0;<A HREF="#modregisterweb"><TT>mod_register_web</TT></A></H3><!--SEC END --><P> <A NAME="modregisterweb"></A>
+<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc56">3.3.20</A>&#XA0;&#XA0;<A HREF="#modregisterweb"><TT>mod_register_web</TT></A></H3><!--SEC END --><P> <A NAME="modregisterweb"></A>
</P><P>This module provides a web page where people can:
</P><UL CLASS="itemize"><LI CLASS="li-itemize">
Register a new account on the server.
@@ -3157,46 +3274,46 @@ Register a new account on the server.
</LI></UL><P>This module supports CAPTCHA image to register a new account.
To enable this feature, configure the options captcha_cmd and captcha_host.</P><P>Options:
</P><DL CLASS="description"><DT CLASS="dt-description">
-<B><TT>{registration_watchers, [ JID, ...]}</TT></B></DT><DD CLASS="dd-description"> This option defines a
+<B><TT>registration_watchers: [ JID, ...]</TT></B></DT><DD CLASS="dd-description"> This option defines a
list of JIDs which will be notified each time a new account is registered.
</DD></DL><P>This example configuration shows how to enable the module and the web handler:
-</P><PRE CLASS="verbatim">{hosts, ["localhost", "example.org", "example.com"]}.
-
-{listen, [
+</P><PRE CLASS="verbatim">hosts:
+ - "localhost"
+ - "example.org"
+ - "example.com"
+listen:
...
- {5281, ejabberd_http, [
- tls,
- {certfile, "/etc/ejabberd/certificate.pem"},
- register
- ]},
+ -
+ port: 5281
+ module: ejabberd_http
+ register: true
+ certfile: "/etc/ejabberd/certificate.pem"
+ tls: true
...
-]}.
-{modules,
- [
+modules:
...
- {mod_register_web, []},
+ mod_register_web: {}
...
- ]}.
</PRE><P>For example, the users of the host <TT>example.org</TT> can visit the page:
<TT>https://example.org:5281/register/</TT>
It is important to include the last / character in the URL,
otherwise the subpages URL will be incorrect.</P><P> <A NAME="modroster"></A> </P><!--TOC subsection <TT>mod_roster</TT>-->
-<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc59">3.3.21</A>&#XA0;&#XA0;<A HREF="#modroster"><TT>mod_roster</TT></A></H3><!--SEC END --><P> <A NAME="modroster"></A>
+<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc57">3.3.21</A>&#XA0;&#XA0;<A HREF="#modroster"><TT>mod_roster</TT></A></H3><!--SEC END --><P> <A NAME="modroster"></A>
</P><P>This module implements roster management as defined in
<A HREF="http://xmpp.org/rfcs/rfc3921.html#roster">RFC 3921: XMPP IM</A>.
It also supports Roster Versioning (<A HREF="http://xmpp.org/extensions/xep-0237.html">XEP-0237</A>).</P><P>Options:
</P><DL CLASS="description"><DT CLASS="dt-description">
-<B><TT>{iqdisc, Discipline}</TT></B></DT><DD CLASS="dd-description"> This specifies
+<B><TT>iqdisc: Discipline</TT></B></DT><DD CLASS="dd-description"> This specifies
the processing discipline for Roster Management (<TT>jabber:iq:roster</TT>) IQ queries (see section&#XA0;<A HREF="#modiqdiscoption">3.3.2</A>).
-</DD><DT CLASS="dt-description"><B><TT>{db_type, mnesia|odbc}</TT></B></DT><DD CLASS="dd-description">
+</DD><DT CLASS="dt-description"><B><TT>db_type: internal|odbc</TT></B></DT><DD CLASS="dd-description">
Define the type of storage where the module will create the tables and store user information.
The default is to store in the internal Mnesia database.
If <TT>odbc</TT> value is defined, make sure you have defined the database, see&#XA0;<A HREF="#database">3.2</A>.
-</DD><DT CLASS="dt-description"><B><TT>{versioning, false|true}</TT></B></DT><DD CLASS="dd-description"> Enables
+</DD><DT CLASS="dt-description"><B><TT>versioning: false|true</TT></B></DT><DD CLASS="dd-description"> Enables
Roster Versioning.
This option is disabled by default.
-</DD><DT CLASS="dt-description"><B><TT>{store_current_id, false|true}</TT></B></DT><DD CLASS="dd-description">
+</DD><DT CLASS="dt-description"><B><TT>store_current_id: false|true</TT></B></DT><DD CLASS="dd-description">
If this option is enabled, the current version number is stored on the database.
If disabled, the version number is calculated on the fly each time.
Enabling this option reduces the load for both ejabberd and the database.
@@ -3206,44 +3323,43 @@ This option is disabled by default.
Important: if you use <TT>mod_shared_roster</TT> or <TT>mod_shared_roster_ldap</TT>,
you must disable this option.
</DD></DL><P>This example configuration enables Roster Versioning with storage of current id:
-</P><PRE CLASS="verbatim">{modules,
- [
+</P><PRE CLASS="verbatim">modules:
...
- {mod_roster, [{versioning, true}, {store_current_id, true}]},
+ mod_roster:
+ versioning: true
+ store_current_id: true
...
- ]}.
</PRE><P> <A NAME="modservicelog"></A> </P><!--TOC subsection <TT>mod_service_log</TT>-->
-<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc60">3.3.22</A>&#XA0;&#XA0;<A HREF="#modservicelog"><TT>mod_service_log</TT></A></H3><!--SEC END --><P> <A NAME="modservicelog"></A>
+<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc58">3.3.22</A>&#XA0;&#XA0;<A HREF="#modservicelog"><TT>mod_service_log</TT></A></H3><!--SEC END --><P> <A NAME="modservicelog"></A>
</P><P>This module adds support for logging end user packets via a XMPP message
auditing service such as
<A HREF="http://www.funkypenguin.info/project/bandersnatch/">Bandersnatch</A>. All user
packets are encapsulated in a <CODE>&lt;route/&gt;</CODE> element and sent to the specified
service(s).</P><P>Options:
</P><DL CLASS="description"><DT CLASS="dt-description">
-<B><TT>{loggers, [Names, ...]}</TT></B></DT><DD CLASS="dd-description"> With this option a (list of) service(s)
+<B><TT>loggers: [Names, ...]</TT></B></DT><DD CLASS="dd-description"> With this option a (list of) service(s)
that will receive the packets can be specified.
</DD></DL><P>Examples:
</P><UL CLASS="itemize"><LI CLASS="li-itemize">
To log all end user packets to the Bandersnatch service running on
<TT>bandersnatch.example.com</TT>:
-<PRE CLASS="verbatim">{modules,
- [
+<PRE CLASS="verbatim">modules:
...
- {mod_service_log, [{loggers, ["bandersnatch.example.com"]}]},
+ mod_service_log:
+ loggers: ["bandersnatch.example.com"]
...
- ]}.
</PRE></LI><LI CLASS="li-itemize">To log all end user packets to the Bandersnatch service running on
<TT>bandersnatch.example.com</TT> and the backup service on
<TT>bandersnatch.example.org</TT>:
-<PRE CLASS="verbatim">{modules,
- [
+<PRE CLASS="verbatim">modules:
...
- {mod_service_log, [{loggers, ["bandersnatch.example.com",
- "bandersnatch.example.org"]}]},
+ mod_service_log:
+ loggers:
+ - "bandersnatch.example.com"
+ - "bandersnatch.example.org"
...
- ]}.
</PRE></LI></UL><P> <A NAME="modsharedroster"></A> </P><!--TOC subsection <TT>mod_shared_roster</TT>-->
-<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc61">3.3.23</A>&#XA0;&#XA0;<A HREF="#modsharedroster"><TT>mod_shared_roster</TT></A></H3><!--SEC END --><P> <A NAME="modsharedroster"></A>
+<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc59">3.3.23</A>&#XA0;&#XA0;<A HREF="#modsharedroster"><TT>mod_shared_roster</TT></A></H3><!--SEC END --><P> <A NAME="modsharedroster"></A>
</P><P>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
@@ -3253,7 +3369,7 @@ A shared roster group can have members from any XMPP server,
but the presence will only be available from and to members
of the same virtual host where the group is created.</P><P>Options:
</P><DL CLASS="description"><DT CLASS="dt-description">
-<B><TT>{db_type, mnesia|odbc}</TT></B></DT><DD CLASS="dd-description">
+<B><TT>db_type: internal|odbc</TT></B></DT><DD CLASS="dd-description">
Define the type of storage where the module will create the tables and store user information.
The default is to store in the internal Mnesia database.
If <TT>odbc</TT> value is defined, make sure you have defined the database, see&#XA0;<A HREF="#database">3.2</A>.
@@ -3327,7 +3443,7 @@ roster groups as shown in the following table:
</TABLE>
<DIV CLASS="center"><HR WIDTH="80%" SIZE=2></DIV></DIV></BLOCKQUOTE>
</LI></UL><P> <A NAME="modsharedrosterldap"></A> </P><!--TOC subsection <TT>mod_shared_roster_ldap</TT>-->
-<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc62">3.3.24</A>&#XA0;&#XA0;<A HREF="#modsharedrosterldap"><TT>mod_shared_roster_ldap</TT></A></H3><!--SEC END --><P> <A NAME="modsharedrosterldap"></A>
+<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc60">3.3.24</A>&#XA0;&#XA0;<A HREF="#modsharedrosterldap"><TT>mod_shared_roster_ldap</TT></A></H3><!--SEC END --><P> <A NAME="modsharedrosterldap"></A>
</P><P>This module lets the server administrator
automatically populate users&#X2019; rosters (contact lists) with entries based on
users and groups defined in an LDAP-based directory.</P><P> <A NAME="msrlconfigparams"></A> </P><!--TOC subsubsection Configuration parameters-->
@@ -3438,7 +3554,7 @@ fresh after retrieval. 300 by default. See section&#XA0;<A HREF="#msrlconfigrost
how it is used during roster retrieval.
</DD></DL><P> <A NAME="msrlconnparams"></A> </P><!--TOC subsubsection Connection parameters-->
<H4 CLASS="subsubsection"><!--SEC ANCHOR --><A HREF="#msrlconnparams">Connection parameters</A></H4><!--SEC END --><P> <A NAME="msrlconnparams"></A> </P><P>The module also accepts the connection parameters, all of which default to the
-top-level parameter of the same name, if unspecified. See&#XA0;<A HREF="#ldapconnection">3.2.5</A>
+top-level parameter of the same name, if unspecified. See&#XA0;<A HREF="#ldapconnection">3.2.2</A>
for more information about them.</P><P> <A NAME="msrlconfigroster"></A> </P><!--TOC subsubsection Retrieving the roster-->
<H4 CLASS="subsubsection"><!--SEC ANCHOR --><A HREF="#msrlconfigroster">Retrieving the roster</A></H4><!--SEC END --><P> <A NAME="msrlconfigroster"></A> </P><P>When the module is called to retrieve the shared roster for a user, the
following algorithm is used:</P><OL CLASS="enumerate" type=1><LI CLASS="li-enumerate">
@@ -3496,14 +3612,16 @@ information duplication &#X2013; the group name is repeated in every member obje
centralized, but distributed between member objects
</LI><LI CLASS="li-itemize">inefficiency &#X2013; the list of unique group names has to be computed by iterating over all users
</LI></UL><P>This however seems to be a common DIT layout, so the module keeps supporting it.
-You can use the following configuration&#X2026;</P><PRE CLASS="verbatim"> {mod_shared_roster_ldap,[
- {ldap_base, "ou=flat,dc=nodomain"},
- {ldap_rfilter, "(objectClass=inetOrgPerson)"},
- {ldap_groupattr, "ou"},
- {ldap_memberattr, "cn"},
- {ldap_filter, "(objectClass=inetOrgPerson)"},
- {ldap_userdesc, "displayName"}
- ]},
+You can use the following configuration&#X2026;</P><PRE CLASS="verbatim">modules:
+ ...
+ mod_shared_roster_ldap:
+ ldap_base: "ou=flat,dc=nodomain"
+ ldap_rfilter: "(objectClass=inetOrgPerson)"
+ ldap_groupattr: "ou"
+ ldap_memberattr: "cn"
+ ldap_filter: "(objectClass=inetOrgPerson)"
+ ldap_userdesc: "displayName"
+ ...
</PRE><P>&#X2026;to be provided with a roster as shown in figure&#XA0;<A HREF="#fig:msrl-roster-flat">3.2</A> upon connecting as user <TT>czesio</TT>.</P><BLOCKQUOTE CLASS="figure"><DIV CLASS="center"><DIV CLASS="center"><HR WIDTH="80%" SIZE=2></DIV>
<IMG SRC="msrl-roster-flat.png" ALT="msrl-roster-flat.png">
@@ -3523,17 +3641,19 @@ They are shown separated into different subtrees, but it&#X2019;s not a requirem
</TABLE></DIV>
<A NAME="fig:msrl-dit-deep"></A>
<DIV CLASS="center"><HR WIDTH="80%" SIZE=2></DIV></DIV></BLOCKQUOTE><P>If you use the following example module configuration with it:
-</P><PRE CLASS="verbatim"> {mod_shared_roster_ldap,[
- {ldap_base, "ou=deep,dc=nodomain"},
- {ldap_rfilter, "(objectClass=groupOfUniqueNames)"},
- {ldap_filter, ""},
- {ldap_gfilter, "(&amp;(objectClass=groupOfUniqueNames)(cn=%g))"},
- {ldap_groupdesc, "description"},
- {ldap_memberattr, "uniqueMember"},
- {ldap_memberattr_format, "cn=%u,ou=people,ou=deep,dc=nodomain"},
- {ldap_ufilter, "(&amp;(objectClass=inetOrgPerson)(cn=%u))"},
- {ldap_userdesc, "displayName"}
- ]},
+</P><PRE CLASS="verbatim">modules:
+ ...
+ mod_shared_roster_ldap:
+ ldap_base: "ou=deep,dc=nodomain"
+ ldap_rfilter: "(objectClass=groupOfUniqueNames)"
+ ldap_filter: ""
+ ldap_gfilter: "(&amp;(objectClass=groupOfUniqueNames)(cn=%g))"
+ ldap_groupdesc: "description"
+ ldap_memberattr: "uniqueMember"
+ ldap_memberattr_format: "cn=%u,ou=people,ou=deep,dc=nodomain"
+ ldap_ufilter: "(&amp;(objectClass=inetOrgPerson)(cn=%u))"
+ ldap_userdesc: "displayName"
+ ...
</PRE><P>&#X2026;and connect as user <TT>czesio</TT>, then <TT>ejabberd</TT> will provide you with
the roster shown in figure&#XA0;<A HREF="#fig:msrl-roster-deep">3.4</A>.</P><BLOCKQUOTE CLASS="figure"><DIV CLASS="center"><DIV CLASS="center"><HR WIDTH="80%" SIZE=2></DIV>
@@ -3544,14 +3664,14 @@ the roster shown in figure&#XA0;<A HREF="#fig:msrl-roster-deep">3.4</A>.</P><BLO
</TABLE></DIV>
<A NAME="fig:msrl-roster-deep"></A>
<DIV CLASS="center"><HR WIDTH="80%" SIZE=2></DIV></DIV></BLOCKQUOTE><P> <A NAME="modsic"></A> </P><!--TOC subsection <TT>mod_sic</TT>-->
-<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc63">3.3.25</A>&#XA0;&#XA0;<A HREF="#modsic"><TT>mod_sic</TT></A></H3><!--SEC END --><P> <A NAME="modsic"></A>
+<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc61">3.3.25</A>&#XA0;&#XA0;<A HREF="#modsic"><TT>mod_sic</TT></A></H3><!--SEC END --><P> <A NAME="modsic"></A>
</P><P>This module adds support for Server IP Check (<A HREF="http://xmpp.org/extensions/xep-0279.html">XEP-0279</A>). This protocol
enables a client to discover its external IP address.</P><P>Options:
</P><DL CLASS="description"><DT CLASS="dt-description">
-<B><TT>{iqdisc, Discipline}</TT></B></DT><DD CLASS="dd-description"> This specifies
+<B><TT>iqdisc: Discipline</TT></B></DT><DD CLASS="dd-description"> This specifies
the processing discipline for <TT>urn:xmpp:sic:0</TT> IQ queries (see section&#XA0;<A HREF="#modiqdiscoption">3.3.2</A>).
</DD></DL><P> <A NAME="modstats"></A> </P><!--TOC subsection <TT>mod_stats</TT>-->
-<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc64">3.3.26</A>&#XA0;&#XA0;<A HREF="#modstats"><TT>mod_stats</TT></A></H3><!--SEC END --><P> <A NAME="modstats"></A>
+<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc62">3.3.26</A>&#XA0;&#XA0;<A HREF="#modstats"><TT>mod_stats</TT></A></H3><!--SEC END --><P> <A NAME="modstats"></A>
</P><P>This module adds support for Statistics Gathering (<A HREF="http://xmpp.org/extensions/xep-0039.html">XEP-0039</A>). This protocol
allows you to retrieve next statistics from your <TT>ejabberd</TT> deployment:
</P><UL CLASS="itemize"><LI CLASS="li-itemize">
@@ -3561,7 +3681,7 @@ Total number of registered users on the current virtual host (users/total).
</LI><LI CLASS="li-itemize">Total number of online users on all virtual hosts (users/all-hosts/online).
</LI></UL><P>Options:
</P><DL CLASS="description"><DT CLASS="dt-description">
-<B><TT>{iqdisc, Discipline}</TT></B></DT><DD CLASS="dd-description"> This specifies
+<B><TT>iqdisc: Discipline</TT></B></DT><DD CLASS="dd-description"> This specifies
the processing discipline for Statistics Gathering (<TT>http://jabber.org/protocol/stats</TT>) IQ queries (see section&#XA0;<A HREF="#modiqdiscoption">3.3.2</A>).
</DD></DL><P>As there are only a small amount of clients (for example
<A HREF="http://tkabber.jabber.ru/">Tkabber</A>) and software libraries with
@@ -3583,44 +3703,44 @@ by sending:
&lt;/query&gt;
&lt;/iq&gt;
</PRE></LI></UL><P> <A NAME="modtime"></A> </P><!--TOC subsection <TT>mod_time</TT>-->
-<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc65">3.3.27</A>&#XA0;&#XA0;<A HREF="#modtime"><TT>mod_time</TT></A></H3><!--SEC END --><P> <A NAME="modtime"></A>
+<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc63">3.3.27</A>&#XA0;&#XA0;<A HREF="#modtime"><TT>mod_time</TT></A></H3><!--SEC END --><P> <A NAME="modtime"></A>
</P><P>This module features support for Entity Time (<A HREF="http://xmpp.org/extensions/xep-0202.html">XEP-0202</A>). By using this XEP,
you are able to discover the time at another entity&#X2019;s location.</P><P>Options:
</P><DL CLASS="description"><DT CLASS="dt-description">
-<B><TT>{iqdisc, Discipline}</TT></B></DT><DD CLASS="dd-description"> This specifies
+<B><TT>iqdisc: Discipline</TT></B></DT><DD CLASS="dd-description"> This specifies
the processing discipline for Entity Time (<TT>jabber:iq:time</TT>) IQ queries (see section&#XA0;<A HREF="#modiqdiscoption">3.3.2</A>).
</DD></DL><P> <A NAME="modvcard"></A> </P><!--TOC subsection <TT>mod_vcard</TT>-->
-<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc66">3.3.28</A>&#XA0;&#XA0;<A HREF="#modvcard"><TT>mod_vcard</TT></A></H3><!--SEC END --><P> <A NAME="modvcard"></A>
+<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc64">3.3.28</A>&#XA0;&#XA0;<A HREF="#modvcard"><TT>mod_vcard</TT></A></H3><!--SEC END --><P> <A NAME="modvcard"></A>
</P><P>This module allows end users to store and retrieve their vCard, and to retrieve
other users vCards, as defined in vcard-temp (<A HREF="http://xmpp.org/extensions/xep-0054.html">XEP-0054</A>). The module also
implements an uncomplicated Jabber User Directory based on the vCards of
these users. Moreover, it enables the server to send its vCard when queried.</P><P>Options:
</P><DL CLASS="description"><DT CLASS="dt-description">
-<B><TT>{host, HostName}</TT></B></DT><DD CLASS="dd-description"> This option defines the Jabber ID of the
+<B><TT>host: HostName</TT></B></DT><DD CLASS="dd-description"> This option defines the Jabber ID of the
service. If the <TT>host</TT> option is not specified, the Jabber ID will be the
hostname of the virtual host with the prefix &#X2018;<TT>vjud.</TT>&#X2019;. The keyword "@HOST@"
is replaced at start time with the real virtual host name.
-</DD><DT CLASS="dt-description"><B><TT>{iqdisc, Discipline}</TT></B></DT><DD CLASS="dd-description"> This specifies
+</DD><DT CLASS="dt-description"><B><TT>iqdisc: Discipline</TT></B></DT><DD CLASS="dd-description"> This specifies
the processing discipline for <TT>vcard-temp</TT> IQ queries (see section&#XA0;<A HREF="#modiqdiscoption">3.3.2</A>).
-</DD><DT CLASS="dt-description"><B><TT>{db_type, mnesia|odbc}</TT></B></DT><DD CLASS="dd-description">
+</DD><DT CLASS="dt-description"><B><TT>db_type: internal|odbc</TT></B></DT><DD CLASS="dd-description">
Define the type of storage where the module will create the tables and store user information.
The default is to store in the internal Mnesia database.
If <TT>odbc</TT> value is defined, make sure you have defined the database, see&#XA0;<A HREF="#database">3.2</A>.
-</DD><DT CLASS="dt-description"><B><TT>{search, true|false}</TT></B></DT><DD CLASS="dd-description">This option specifies whether the search
+</DD><DT CLASS="dt-description"><B><TT>search: true|false</TT></B></DT><DD CLASS="dd-description">This option specifies whether the search
functionality is enabled or not
If disabled, the option <TT>host</TT> will be ignored and the
Jabber User Directory service will not appear in the Service Discovery item
list. The default value is <TT>true</TT>.
-</DD><DT CLASS="dt-description"><B><TT>{matches, infinity|Number}</TT></B></DT><DD CLASS="dd-description">With this option, the number of reported
+</DD><DT CLASS="dt-description"><B><TT>matches: infinity|Number</TT></B></DT><DD CLASS="dd-description">With this option, the number of reported
search results can be limited. If the option&#X2019;s value is set to <TT>infinity</TT>,
all search results are reported. The default value is <TT>30</TT>.
-</DD><DT CLASS="dt-description"><B><TT>{allow_return_all, false|true}</TT></B></DT><DD CLASS="dd-description">This option enables
+</DD><DT CLASS="dt-description"><B><TT>allow_return_all: false|true</TT></B></DT><DD CLASS="dd-description">This option enables
you to specify if search operations with empty input fields should return all
users who added some information to their vCard. The default value is
<TT>false</TT>.
-</DD><DT CLASS="dt-description"><B><TT>{search_all_hosts, true|false}</TT></B></DT><DD CLASS="dd-description">If this option is set
+</DD><DT CLASS="dt-description"><B><TT>search_all_hosts, true|false</TT></B></DT><DD CLASS="dd-description">If this option is set
to <TT>true</TT>, search operations will apply to all virtual hosts. Otherwise
only the current host will be searched. The default value is <TT>true</TT>.
This option is available in <TT>mod_vcard</TT>when using Mnesia, but not when using ODBC storage.
@@ -3629,30 +3749,28 @@ This option is available in <TT>mod_vcard</TT>when using Mnesia, but not when us
In this first situation, search results are limited to twenty items,
every user who added information to their vCard will be listed when people
do an empty search, and only users from the current host will be returned:
-<PRE CLASS="verbatim">{modules,
- [
+<PRE CLASS="verbatim">modules:
...
- {mod_vcard, [{search, true},
- {matches, 20},
- {allow_return_all, true},
- {search_all_hosts, false}]},
+ mod_vcard:
+ search: true
+ matches: 20
+ allow_return_all: true
+ search_all_hosts: false
...
- ]}.
</PRE></LI><LI CLASS="li-itemize">The second situation differs in a way that search results are not limited,
and that all virtual hosts will be searched instead of only the current one:
-<PRE CLASS="verbatim">{modules,
- [
+<PRE CLASS="verbatim">modules:
...
- {mod_vcard, [{search, true},
- {matches, infinity},
- {allow_return_all, true}]},
+ mod_vcard:
+ search: true
+ matches: infinity
+ allow_return_all: true
...
- ]}.
</PRE></LI></UL><P> <A NAME="modvcardldap"></A> </P><!--TOC subsection <TT>mod_vcard_ldap</TT>-->
-<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc67">3.3.29</A>&#XA0;&#XA0;<A HREF="#modvcardldap"><TT>mod_vcard_ldap</TT></A></H3><!--SEC END --><P> <A NAME="modvcardldap"></A>
+<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc65">3.3.29</A>&#XA0;&#XA0;<A HREF="#modvcardldap"><TT>mod_vcard_ldap</TT></A></H3><!--SEC END --><P> <A NAME="modvcardldap"></A>
</P><P><TT>ejabberd</TT> can map LDAP attributes to vCard fields. This behaviour is
implemented in the <TT>mod_vcard_ldap</TT> module. This module does not depend on the
-authentication method (see&#XA0;<A HREF="#ldapauth">3.2.5</A>).</P><P>Usually <TT>ejabberd</TT> treats LDAP as a read-only storage:
+authentication method (see&#XA0;<A HREF="#ldapauth">3.2.2</A>).</P><P>Usually <TT>ejabberd</TT> treats LDAP as a read-only storage:
it is possible to consult data, but not possible to
create accounts or edit vCard that is stored in LDAP.
However, it is possible to change passwords if <TT>mod_register</TT> module is enabled
@@ -3663,17 +3781,17 @@ meaning as the top-level LDAP parameters to set the authentication method:
<TT>ldap_servers</TT>, <TT>ldap_port</TT>, <TT>ldap_rootdn</TT>,
<TT>ldap_password</TT>, <TT>ldap_base</TT>, <TT>ldap_uids</TT>,
<TT>ldap_deref_aliases</TT> and <TT>ldap_filter</TT>.
-See section&#XA0;<A HREF="#ldapauth">3.2.5</A> for detailed information
+See section&#XA0;<A HREF="#ldapauth">3.2.2</A> for detailed information
about these options. If one of these options is not set, <TT>ejabberd</TT> will look
for the top-level option with the same name.</P><P>The second group of parameters
consists of the following <TT>mod_vcard_ldap</TT>-specific options:</P><DL CLASS="description"><DT CLASS="dt-description">
-<B><TT>{host, HostName}</TT></B></DT><DD CLASS="dd-description"> This option defines the Jabber ID of the
+<B><TT>host: HostName</TT></B></DT><DD CLASS="dd-description"> This option defines the Jabber ID of the
service. If the <TT>host</TT> option is not specified, the Jabber ID will be the
hostname of the virtual host with the prefix &#X2018;<TT>vjud.</TT>&#X2019;. The keyword "@HOST@"
is replaced at start time with the real virtual host name.
-</DD><DT CLASS="dt-description"><B><TT>{iqdisc, Discipline}</TT></B></DT><DD CLASS="dd-description"> This specifies
+</DD><DT CLASS="dt-description"><B><TT>iqdisc: Discipline</TT></B></DT><DD CLASS="dd-description"> This specifies
the processing discipline for <TT>vcard-temp</TT> IQ queries (see section&#XA0;<A HREF="#modiqdiscoption">3.3.2</A>).
</DD><DT CLASS="dt-description"><B><TT>{search, true|false}</TT></B></DT><DD CLASS="dd-description">This option specifies whether the search
functionality is enabled (value: <TT>true</TT>) or disabled (value:
@@ -3832,7 +3950,7 @@ searching his info in LDAP.</P></LI><LI CLASS="li-itemize"><TT>ldap_vcard_map</T
{"Nickname", "NICKNAME"}
]},
</PRE></LI></UL><P> <A NAME="modvcardxupdate"></A> </P><!--TOC subsection <TT>mod_vcard_xupdate</TT>-->
-<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc68">3.3.30</A>&#XA0;&#XA0;<A HREF="#modvcardxupdate"><TT>mod_vcard_xupdate</TT></A></H3><!--SEC END --><P> <A NAME="modvcardxupdate"></A>
+<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc66">3.3.30</A>&#XA0;&#XA0;<A HREF="#modvcardxupdate"><TT>mod_vcard_xupdate</TT></A></H3><!--SEC END --><P> <A NAME="modvcardxupdate"></A>
</P><P>The user&#X2019;s client can store an avatar in the user vCard.
The vCard-Based Avatars protocol (<A HREF="http://xmpp.org/extensions/xep-0153.html">XEP-0153</A>)
provides a method for clients to inform the contacts what is the avatar hash value.
@@ -3847,22 +3965,22 @@ presence stanza rewrite.
For this reason, enabling this module will introduce a computational overhead
in servers with clients that change frequently their presence.</P><P>Options:
</P><DL CLASS="description"><DT CLASS="dt-description">
-<B><TT>{db_type, mnesia|odbc}</TT></B></DT><DD CLASS="dd-description">
+<B><TT>db_type: internal|odbc</TT></B></DT><DD CLASS="dd-description">
Define the type of storage where the module will create the tables and store user information.
The default is to store in the internal Mnesia database.
If <TT>odbc</TT> value is defined, make sure you have defined the database, see&#XA0;<A HREF="#database">3.2</A>.
</DD></DL><P> <A NAME="modversion"></A> </P><!--TOC subsection <TT>mod_version</TT>-->
-<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc69">3.3.31</A>&#XA0;&#XA0;<A HREF="#modversion"><TT>mod_version</TT></A></H3><!--SEC END --><P> <A NAME="modversion"></A>
+<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc67">3.3.31</A>&#XA0;&#XA0;<A HREF="#modversion"><TT>mod_version</TT></A></H3><!--SEC END --><P> <A NAME="modversion"></A>
</P><P>This module implements Software Version (<A HREF="http://xmpp.org/extensions/xep-0092.html">XEP-0092</A>). Consequently, it
answers <TT>ejabberd</TT>&#X2019;s version when queried.</P><P>Options:
</P><DL CLASS="description"><DT CLASS="dt-description">
-<B><TT>{show_os, true|false}</TT></B></DT><DD CLASS="dd-description">Should the operating system be revealed or not.
+<B><TT>show_os: true|false</TT></B></DT><DD CLASS="dd-description">Should the operating system be revealed or not.
The default value is <TT>true</TT>.
-</DD><DT CLASS="dt-description"><B><TT>{iqdisc, Discipline}</TT></B></DT><DD CLASS="dd-description"> This specifies
+</DD><DT CLASS="dt-description"><B><TT>iqdisc: Discipline</TT></B></DT><DD CLASS="dd-description"> This specifies
the processing discipline for Software Version (<TT>jabber:iq:version</TT>) IQ queries (see section&#XA0;<A HREF="#modiqdiscoption">3.3.2</A>).
</DD></DL><P> <A NAME="manage"></A> </P><!--TOC chapter Managing an <TT>ejabberd</TT> Server-->
-<H1 CLASS="chapter"><!--SEC ANCHOR --><A NAME="htoc70">Chapter&#XA0;4</A>&#XA0;&#XA0;<A HREF="#manage">Managing an <TT>ejabberd</TT> Server</A></H1><!--SEC END --><P> <A NAME="manage"></A> </P><P> <A NAME="ejabberdctl"></A> </P><!--TOC section <TT>ejabberdctl</TT>-->
-<H2 CLASS="section"><!--SEC ANCHOR --><A NAME="htoc71">4.1</A>&#XA0;&#XA0;<A HREF="#ejabberdctl"><TT>ejabberdctl</TT></A></H2><!--SEC END --><P> <A NAME="ejabberdctl"></A> </P><P>With the <TT>ejabberdctl</TT> command line administration script
+<H1 CLASS="chapter"><!--SEC ANCHOR --><A NAME="htoc68">Chapter&#XA0;4</A>&#XA0;&#XA0;<A HREF="#manage">Managing an <TT>ejabberd</TT> Server</A></H1><!--SEC END --><P> <A NAME="manage"></A> </P><P> <A NAME="ejabberdctl"></A> </P><!--TOC section <TT>ejabberdctl</TT>-->
+<H2 CLASS="section"><!--SEC ANCHOR --><A NAME="htoc69">4.1</A>&#XA0;&#XA0;<A HREF="#ejabberdctl"><TT>ejabberdctl</TT></A></H2><!--SEC END --><P> <A NAME="ejabberdctl"></A> </P><P>With the <TT>ejabberdctl</TT> command line administration script
you can execute <TT>ejabberdctl commands</TT> (described in the next section, <A HREF="#ectl-commands">4.1.1</A>)
and also many general <TT>ejabberd commands</TT> (described in section <A HREF="#eja-commands">4.2</A>).
This means you can start, stop and perform many other administrative tasks
@@ -3874,7 +3992,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: <TT>echo $?</TT></P><P> <A NAME="ectl-commands"></A> </P><!--TOC subsection ejabberdctl Commands-->
-<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc72">4.1.1</A>&#XA0;&#XA0;<A HREF="#ectl-commands">ejabberdctl Commands</A></H3><!--SEC END --><P> <A NAME="ectl-commands"></A> </P><P>When <TT>ejabberdctl</TT> is executed without any parameter,
+<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc70">4.1.1</A>&#XA0;&#XA0;<A HREF="#ectl-commands">ejabberdctl Commands</A></H3><!--SEC END --><P> <A NAME="ectl-commands"></A> </P><P>When <TT>ejabberdctl</TT> is executed without any parameter,
it displays the available options. If there isn&#X2019;t an <TT>ejabberd</TT> server running,
the available parameters are:
</P><DL CLASS="description"><DT CLASS="dt-description">
@@ -3892,11 +4010,12 @@ and all the <TT>ejabberd commands</TT> available in that server (see <A HREF="#l
</DD><DT CLASS="dt-description"><B><TT>mnesia</TT></B></DT><DD CLASS="dd-description"> Get information about the Mnesia database.
</DD></DL><P>The <TT>ejabberdctl</TT> script can be restricted to require authentication
and execute some <TT>ejabberd commands</TT>; see <A HREF="#accesscommands">4.2.2</A>.
-Add the option to the file <TT>ejabberd.cfg</TT>.
+Add the option to the file <TT>ejabberd.yml</TT>.
In this example there is no restriction:
-</P><PRE CLASS="verbatim">{ejabberdctl_access_commands, []}.
+</P><PRE CLASS="verbatim">ejabberdctl_access_commands: []
</PRE><P>If account <TT>robot1@example.org</TT> is registered in <TT>ejabberd</TT> with password <TT>abcdef</TT>
-and <TT>ejabberd.cfg</TT> contains this setting:
+(which MD5 is E8B501798950FC58AAD83C8C14978E),
+and <TT>ejabberd.yml</TT> contains this setting:
</P><PRE CLASS="verbatim">{hosts, ["example.org"]}.
{acl, bots, {user, "robot1", "example.org"}}.
{access, ctlaccess, [{allow, bots}]}.
@@ -3909,7 +4028,7 @@ robot1
testuser1
testuser2
</PRE><P> <A NAME="erlangconfiguration"></A> </P><!--TOC subsection Erlang Runtime System-->
-<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc73">4.1.2</A>&#XA0;&#XA0;<A HREF="#erlangconfiguration">Erlang Runtime System</A></H3><!--SEC END --><P> <A NAME="erlangconfiguration"></A> </P><P><TT>ejabberd</TT> is an Erlang/OTP application that runs inside an Erlang runtime system.
+<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc71">4.1.2</A>&#XA0;&#XA0;<A HREF="#erlangconfiguration">Erlang Runtime System</A></H3><!--SEC END --><P> <A NAME="erlangconfiguration"></A> </P><P><TT>ejabberd</TT> is an Erlang/OTP application that runs inside an Erlang runtime system.
This system is configured using environment variables and command line parameters.
The <TT>ejabberdctl</TT> administration script uses many of those possibilities.
You can configure some of them with the file <TT>ejabberdctl.cfg</TT>,
@@ -3991,7 +4110,7 @@ not &#X201C;Simple Authentication and Security Layer&#X201D;.
</DD></DL><P>
Note that some characters need to be escaped when used in shell scripts, for instance <CODE>"</CODE> and <CODE>{}</CODE>.
You can find other options in the Erlang manual page (<TT>erl -man erl</TT>).</P><P> <A NAME="eja-commands"></A> </P><!--TOC section <TT>ejabberd</TT> Commands-->
-<H2 CLASS="section"><!--SEC ANCHOR --><A NAME="htoc74">4.2</A>&#XA0;&#XA0;<A HREF="#eja-commands"><TT>ejabberd</TT> Commands</A></H2><!--SEC END --><P> <A NAME="eja-commands"></A> </P><P>An <TT>ejabberd command</TT> is an abstract function identified by a name,
+<H2 CLASS="section"><!--SEC ANCHOR --><A NAME="htoc72">4.2</A>&#XA0;&#XA0;<A HREF="#eja-commands"><TT>ejabberd</TT> Commands</A></H2><!--SEC END --><P> <A NAME="eja-commands"></A> </P><P>An <TT>ejabberd command</TT> 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 <TT>ejabberd_commands</TT> service.
Those commands can be defined in any Erlang module and executed using any valid frontend.</P><P><TT>ejabberd</TT> includes a frontend to execute <TT>ejabberd commands</TT>: the script <TT>ejabberdctl</TT>.
@@ -3999,7 +4118,7 @@ Other known frontends that can be installed to execute ejabberd commands in diff
<TT>ejabberd_xmlrpc</TT> (XML-RPC service),
<TT>mod_rest</TT> (HTTP POST service),
<TT>mod_shcommands</TT> (ejabberd WebAdmin page).</P><P> <A NAME="list-eja-commands"></A> </P><!--TOC subsection List of ejabberd Commands-->
-<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc75">4.2.1</A>&#XA0;&#XA0;<A HREF="#list-eja-commands">List of ejabberd Commands</A></H3><!--SEC END --><P> <A NAME="list-eja-commands"></A> </P><P><TT>ejabberd</TT> includes a few ejabberd Commands by default.
+<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc73">4.2.1</A>&#XA0;&#XA0;<A HREF="#list-eja-commands">List of ejabberd Commands</A></H3><!--SEC END --><P> <A NAME="list-eja-commands"></A> </P><P><TT>ejabberd</TT> includes a few ejabberd Commands by default.
When more modules are installed, new commands may be available in the frontends.</P><P>The easiest way to get a list of the available commands, and get help for them is to use
the ejabberdctl script:
</P><PRE CLASS="verbatim">$ ejabberdctl help
@@ -4053,7 +4172,7 @@ is very high.
</DD><DT CLASS="dt-description"><B><TT>register user host password</TT></B></DT><DD CLASS="dd-description"> Register an account in that domain with the given password.
</DD><DT CLASS="dt-description"><B><TT>unregister user host</TT></B></DT><DD CLASS="dd-description"> Unregister the given account.
</DD></DL><P> <A NAME="accesscommands"></A> </P><!--TOC subsection Restrict Execution with AccessCommands-->
-<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc76">4.2.2</A>&#XA0;&#XA0;<A HREF="#accesscommands">Restrict Execution with AccessCommands</A></H3><!--SEC END --><P> <A NAME="accesscommands"></A> </P><P>The frontends can be configured to restrict access to certain commands.
+<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc74">4.2.2</A>&#XA0;&#XA0;<A HREF="#accesscommands">Restrict Execution with AccessCommands</A></H3><!--SEC END --><P> <A NAME="accesscommands"></A> </P><P>The frontends can be configured to restrict access to certain commands.
In that case, authentication information must be provided.
In each frontend the <TT>AccessCommands</TT> option is defined
in a different place. But in all cases the option syntax is the same:
@@ -4097,10 +4216,10 @@ and the provided arguments do not contradict Arguments.</P><P>As an example to u
{_bot_reg_test, [register, unregister], [{host, "test.org"}]}
]
</PRE><P> <A NAME="webadmin"></A> </P><!--TOC section Web Admin-->
-<H2 CLASS="section"><!--SEC ANCHOR --><A NAME="htoc77">4.3</A>&#XA0;&#XA0;<A HREF="#webadmin">Web Admin</A></H2><!--SEC END --><P> <A NAME="webadmin"></A>
+<H2 CLASS="section"><!--SEC ANCHOR --><A NAME="htoc75">4.3</A>&#XA0;&#XA0;<A HREF="#webadmin">Web Admin</A></H2><!--SEC END --><P> <A NAME="webadmin"></A>
</P><P>The <TT>ejabberd</TT> Web Admin allows to administer most of <TT>ejabberd</TT> using a web browser.</P><P>This feature is enabled by default:
a <TT>ejabberd_http</TT> listener with the option <TT>web_admin</TT> (see
-section&#XA0;<A HREF="#listened">3.1.3</A>) is included in the listening ports. Then you can open
+section&#XA0;<A HREF="#listened">3.1.4</A>) is included in the listening ports. Then you can open
<CODE>http://server:port/admin/</CODE> in your favourite web browser. You
will be asked to enter the username (the <EM>full</EM> Jabber ID) and password
of an <TT>ejabberd</TT> user with administrator rights. After authentication
@@ -4131,40 +4250,58 @@ URL). If you log in with &#X2018;<TT>admin@example.com</TT>&#X2019; on<BR>
<CODE>http://example.org:5280/admin/server/example.com/</CODE> you can only
administer the virtual host <TT>example.com</TT>.
The account &#X2018;<TT>reviewer@example.com</TT>&#X2019; can browse that vhost in read-only mode.
-<PRE CLASS="verbatim">{acl, admin, {user, "admin", "example.net"}}.
-{host_config, "example.com", [{acl, admin, {user, "admin", "example.com"}}]}.
-{host_config, "example.com", [{acl, viewers, {user, "reviewer", "example.com"}}]}.
+<PRE CLASS="verbatim">acl:
+ admin:
+ user:
+ - "admin": "example.net"
+
+host_config:
+ "example.com":
+ acl:
+ admin:
+ user:
+ - "admin": "example.com"
+ viewers:
+ user:
+ - "reviewer": "example.com"
-{access, configure, [{allow, admin}]}.
-{access, webadmin_view, [{allow, viewers}]}.
+access:
+ configure:
+ admin: allow
+ webadmin_view:
+ viewers: allow
-{hosts, ["example.org"]}.
+hosts:
+ - "example.org"
-{listen,
- [
+listen:
...
- {5280, ejabberd_http, [http_poll, web_admin]},
+ -
+ port: 5280
+ module: ejabberd_http
+ web_admin: true
+ http_poll: true
...
- ]}.
</PRE></LI><LI CLASS="li-itemize">For security reasons, you can serve the Web Admin on a secured
connection, on a port differing from the HTTP Polling interface, and bind it
to the internal LAN IP. The Web Admin will be accessible by pointing your
web browser to <CODE>https://192.168.1.1:5282/admin/</CODE>:
-<PRE CLASS="verbatim">
-{hosts, ["example.org"]}.
-
-{listen,
- [
+<PRE CLASS="verbatim">hosts:
+ - "example.org"
+listen:
...
- {5280, ejabberd_http, [
- http_poll
- ]},
- {{5282, "192.168.1.1"}, ejabberd_http, [
- web_admin,
- tls, {certfile, "/usr/local/etc/server.pem"}
- ]},
+ -
+ port: 5280
+ module: ejabberd_http
+ http_poll: true
+ -
+ ip: "192.168.1.1"
+ port: 5282
+ module: ejabberd_http
+ certfile: "/usr/local/etc/server.pem"
+ tls: true
+ web_admin: true
...
- ]}.
</PRE></LI></UL><P>Certain pages in the ejabberd Web Admin contain a link to a related
section in the ejabberd Installation and Operation Guide.
In order to view such links, a copy in HTML format of the Guide must
@@ -4174,13 +4311,13 @@ The file is searched by default in
The directory of the documentation can be specified in
the environment variable <TT>EJABBERD_DOC_PATH</TT>.
See section <A HREF="#erlangconfiguration">4.1.2</A>.</P><P> <A NAME="adhoccommands"></A> </P><!--TOC section Ad-hoc Commands-->
-<H2 CLASS="section"><!--SEC ANCHOR --><A NAME="htoc78">4.4</A>&#XA0;&#XA0;<A HREF="#adhoccommands">Ad-hoc Commands</A></H2><!--SEC END --><P> <A NAME="adhoccommands"></A> </P><P>If you enable <TT>mod_configure</TT> and <TT>mod_adhoc</TT>,
+<H2 CLASS="section"><!--SEC ANCHOR --><A NAME="htoc76">4.4</A>&#XA0;&#XA0;<A HREF="#adhoccommands">Ad-hoc Commands</A></H2><!--SEC END --><P> <A NAME="adhoccommands"></A> </P><P>If you enable <TT>mod_configure</TT> and <TT>mod_adhoc</TT>,
you can perform several administrative tasks in <TT>ejabberd</TT>
with an XMPP client.
The client must support Ad-Hoc Commands (<A HREF="http://xmpp.org/extensions/xep-0050.html">XEP-0050</A>),
and you must login in the XMPP server with
an account with proper privileges.</P><P> <A NAME="changeerlangnodename"></A> </P><!--TOC section Change Computer Hostname-->
-<H2 CLASS="section"><!--SEC ANCHOR --><A NAME="htoc79">4.5</A>&#XA0;&#XA0;<A HREF="#changeerlangnodename">Change Computer Hostname</A></H2><!--SEC END --><P> <A NAME="changeerlangnodename"></A> </P><P><TT>ejabberd</TT> uses the distributed Mnesia database.
+<H2 CLASS="section"><!--SEC ANCHOR --><A NAME="htoc77">4.5</A>&#XA0;&#XA0;<A HREF="#changeerlangnodename">Change Computer Hostname</A></H2><!--SEC END --><P> <A NAME="changeerlangnodename"></A> </P><P><TT>ejabberd</TT> uses the distributed Mnesia database.
Being distributed, Mnesia enforces consistency of its file,
so it stores the name of the Erlang node in it (see section <A HREF="#nodename">5.4</A>).
The name of an Erlang node includes the hostname of the computer.
@@ -4226,8 +4363,8 @@ mv /var/lib/ejabberd/*.* /var/lib/ejabberd/oldfiles/
</PRE></LI><LI CLASS="li-enumerate">Check that the information of the old database is available: accounts, rosters...
After you finish, remember to delete the temporary backup files from public directories.
</LI></OL><P> <A NAME="secure"></A> </P><!--TOC chapter Securing <TT>ejabberd</TT>-->
-<H1 CLASS="chapter"><!--SEC ANCHOR --><A NAME="htoc80">Chapter&#XA0;5</A>&#XA0;&#XA0;<A HREF="#secure">Securing <TT>ejabberd</TT></A></H1><!--SEC END --><P> <A NAME="secure"></A> </P><P> <A NAME="firewall"></A> </P><!--TOC section Firewall Settings-->
-<H2 CLASS="section"><!--SEC ANCHOR --><A NAME="htoc81">5.1</A>&#XA0;&#XA0;<A HREF="#firewall">Firewall Settings</A></H2><!--SEC END --><P> <A NAME="firewall"></A>
+<H1 CLASS="chapter"><!--SEC ANCHOR --><A NAME="htoc78">Chapter&#XA0;5</A>&#XA0;&#XA0;<A HREF="#secure">Securing <TT>ejabberd</TT></A></H1><!--SEC END --><P> <A NAME="secure"></A> </P><P> <A NAME="firewall"></A> </P><!--TOC section Firewall Settings-->
+<H2 CLASS="section"><!--SEC ANCHOR --><A NAME="htoc79">5.1</A>&#XA0;&#XA0;<A HREF="#firewall">Firewall Settings</A></H2><!--SEC END --><P> <A NAME="firewall"></A>
</P><P>You need to take the following TCP ports in mind when configuring your firewall:
</P><BLOCKQUOTE CLASS="table"><DIV CLASS="center"><DIV CLASS="center"><HR WIDTH="80%" SIZE=2></DIV>
<TABLE BORDER=1 CELLSPACING=0 CELLPADDING=1><TR><TD ALIGN=left NOWRAP><B>Port</B></TD><TD ALIGN=left NOWRAP><B>Description</B></TD></TR>
@@ -4238,7 +4375,7 @@ After you finish, remember to delete the temporary backup files from public dire
<TR><TD ALIGN=left NOWRAP>port range</TD><TD ALIGN=left NOWRAP>Used for connections between Erlang nodes. This range is configurable (see section <A HREF="#epmd">5.2</A>).</TD></TR>
</TABLE>
<DIV CLASS="center"><HR WIDTH="80%" SIZE=2></DIV></DIV></BLOCKQUOTE><P> <A NAME="epmd"></A> </P><!--TOC section epmd-->
-<H2 CLASS="section"><!--SEC ANCHOR --><A NAME="htoc82">5.2</A>&#XA0;&#XA0;<A HREF="#epmd">epmd</A></H2><!--SEC END --><P> <A NAME="epmd"></A> </P><P><A HREF="http://www.erlang.org/doc/man/epmd.html">epmd (Erlang Port Mapper Daemon)</A>
+<H2 CLASS="section"><!--SEC ANCHOR --><A NAME="htoc80">5.2</A>&#XA0;&#XA0;<A HREF="#epmd">epmd</A></H2><!--SEC END --><P> <A NAME="epmd"></A> </P><P><A HREF="http://www.erlang.org/doc/man/epmd.html">epmd (Erlang Port Mapper Daemon)</A>
is a small name server included in Erlang/OTP
and used by Erlang programs when establishing distributed Erlang communications.
<TT>ejabberd</TT> needs <TT>epmd</TT> to use <TT>ejabberdctl</TT> and also when clustering <TT>ejabberd</TT> nodes.
@@ -4251,8 +4388,7 @@ In order for this communication to work,
<TT>epmd</TT> must be running and listening for name requests in the port 4369.
You should block the port 4369 in the firewall in such a way that
only the programs in your machine can access it.
-or configure the option <TT>ERL_EPMD_ADDRESS</TT> in the file <TT>ejabberdctl.cfg</TT>
-(this option works only in Erlang/OTP R14B03 or higher).</P><P>If you build a cluster of several <TT>ejabberd</TT> instances,
+or configure the option <TT>ERL_EPMD_ADDRESS</TT> in the file <TT>ejabberdctl.cfg</TT>.</P><P>If you build a cluster of several <TT>ejabberd</TT> instances,
each <TT>ejabberd</TT> instance is called an <TT>ejabberd</TT> node.
Those <TT>ejabberd</TT> nodes use a special Erlang communication method to
build the cluster, and EPMD is again needed listening in the port 4369.
@@ -4269,7 +4405,7 @@ the network interface where the Erlang node will listen and accept connections.
The Erlang command-line parameter used internally is, for example:
</P><PRE CLASS="verbatim">erl ... -kernel inet_dist_use_interface "{127,0,0,1}"
</PRE><P> <A NAME="cookie"></A> </P><!--TOC section Erlang Cookie-->
-<H2 CLASS="section"><!--SEC ANCHOR --><A NAME="htoc83">5.3</A>&#XA0;&#XA0;<A HREF="#cookie">Erlang Cookie</A></H2><!--SEC END --><P> <A NAME="cookie"></A> </P><P>The Erlang cookie is a string with numbers and letters.
+<H2 CLASS="section"><!--SEC ANCHOR --><A NAME="htoc81">5.3</A>&#XA0;&#XA0;<A HREF="#cookie">Erlang Cookie</A></H2><!--SEC END --><P> <A NAME="cookie"></A> </P><P>The Erlang cookie is a string with numbers and letters.
An Erlang node reads the cookie at startup from the command-line parameter <TT>-setcookie</TT>.
If not indicated, the cookie is read from the cookie file <TT>$HOME/.erlang.cookie</TT>.
If this file does not exist, it is created immediately with a random cookie.
@@ -4283,7 +4419,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.</P><P> <A NAME="nodename"></A> </P><!--TOC section Erlang Node Name-->
-<H2 CLASS="section"><!--SEC ANCHOR --><A NAME="htoc84">5.4</A>&#XA0;&#XA0;<A HREF="#nodename">Erlang Node Name</A></H2><!--SEC END --><P> <A NAME="nodename"></A> </P><P>An Erlang node may have a node name.
+<H2 CLASS="section"><!--SEC ANCHOR --><A NAME="htoc82">5.4</A>&#XA0;&#XA0;<A HREF="#nodename">Erlang Node Name</A></H2><!--SEC END --><P> <A NAME="nodename"></A> </P><P>An Erlang node may have a node name.
The name can be short (if indicated with the command-line parameter <TT>-sname</TT>)
or long (if indicated with the parameter <TT>-name</TT>).
Starting an Erlang node with -sname limits the communication between Erlang nodes to the LAN.</P><P>Using the option <TT>-sname</TT> instead of <TT>-name</TT> is a simple method
@@ -4292,10 +4428,10 @@ 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 <TT>epmd</TT>.
The recommended way to secure the Erlang node is to block the port 4369.</P><P> <A NAME="secure-files"></A> </P><!--TOC section Securing Sensitive Files-->
-<H2 CLASS="section"><!--SEC ANCHOR --><A NAME="htoc85">5.5</A>&#XA0;&#XA0;<A HREF="#secure-files">Securing Sensitive Files</A></H2><!--SEC END --><P> <A NAME="secure-files"></A> </P><P><TT>ejabberd</TT> stores sensitive data in the file system either in plain text or binary files.
+<H2 CLASS="section"><!--SEC ANCHOR --><A NAME="htoc83">5.5</A>&#XA0;&#XA0;<A HREF="#secure-files">Securing Sensitive Files</A></H2><!--SEC END --><P> <A NAME="secure-files"></A> </P><P><TT>ejabberd</TT> stores sensitive 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.</P><DL CLASS="description"><DT CLASS="dt-description">
-<B><TT>ejabberd configuration file: /etc/ejabberd/ejabberd.cfg</TT></B></DT><DD CLASS="dd-description">
+<B><TT>ejabberd configuration file: /etc/ejabberd/ejabberd.yml</TT></B></DT><DD CLASS="dd-description">
Contains the JID of administrators
and passwords of external components.
The backup files probably contain also this information,
@@ -4312,9 +4448,9 @@ so it is preferable to secure the whole <TT>/var/lib/ejabberd/</TT> directory.
</DD><DT CLASS="dt-description"><B><TT>Erlang cookie file: /var/lib/ejabberd/.erlang.cookie</TT></B></DT><DD CLASS="dd-description">
See section <A HREF="#cookie">5.3</A>.
</DD></DL><P> <A NAME="clustering"></A> </P><!--TOC chapter Clustering-->
-<H1 CLASS="chapter"><!--SEC ANCHOR --><A NAME="htoc86">Chapter&#XA0;6</A>&#XA0;&#XA0;<A HREF="#clustering">Clustering</A></H1><!--SEC END --><P> <A NAME="clustering"></A>
+<H1 CLASS="chapter"><!--SEC ANCHOR --><A NAME="htoc84">Chapter&#XA0;6</A>&#XA0;&#XA0;<A HREF="#clustering">Clustering</A></H1><!--SEC END --><P> <A NAME="clustering"></A>
</P><P> <A NAME="howitworks"></A> </P><!--TOC section How it Works-->
-<H2 CLASS="section"><!--SEC ANCHOR --><A NAME="htoc87">6.1</A>&#XA0;&#XA0;<A HREF="#howitworks">How it Works</A></H2><!--SEC END --><P> <A NAME="howitworks"></A>
+<H2 CLASS="section"><!--SEC ANCHOR --><A NAME="htoc85">6.1</A>&#XA0;&#XA0;<A HREF="#howitworks">How it Works</A></H2><!--SEC END --><P> <A NAME="howitworks"></A>
</P><P>A XMPP domain is served by one or more <TT>ejabberd</TT> 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
@@ -4328,29 +4464,29 @@ router,
</LI><LI CLASS="li-itemize">session manager,
</LI><LI CLASS="li-itemize">s2s manager.
</LI></UL><P> <A NAME="router"></A> </P><!--TOC subsection Router-->
-<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc88">6.1.1</A>&#XA0;&#XA0;<A HREF="#router">Router</A></H3><!--SEC END --><P> <A NAME="router"></A>
+<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc86">6.1.1</A>&#XA0;&#XA0;<A HREF="#router">Router</A></H3><!--SEC END --><P> <A NAME="router"></A>
</P><P>This module is the main router of XMPP packets on each node. It
routes them based on their destination&#X2019;s domains. It uses a global
routing table. The domain of the packet&#X2019;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.</P><P> <A NAME="localrouter"></A> </P><!--TOC subsection Local Router-->
-<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc89">6.1.2</A>&#XA0;&#XA0;<A HREF="#localrouter">Local Router</A></H3><!--SEC END --><P> <A NAME="localrouter"></A>
+<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc87">6.1.2</A>&#XA0;&#XA0;<A HREF="#localrouter">Local Router</A></H3><!--SEC END --><P> <A NAME="localrouter"></A>
</P><P>This module routes packets which have a destination domain equal to
one of this server&#X2019;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.</P><P> <A NAME="sessionmanager"></A> </P><!--TOC subsection Session Manager-->
-<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc90">6.1.3</A>&#XA0;&#XA0;<A HREF="#sessionmanager">Session Manager</A></H3><!--SEC END --><P> <A NAME="sessionmanager"></A>
+<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc88">6.1.3</A>&#XA0;&#XA0;<A HREF="#sessionmanager">Session Manager</A></H3><!--SEC END --><P> <A NAME="sessionmanager"></A>
</P><P>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.</P><P> <A NAME="s2smanager"></A> </P><!--TOC subsection s2s Manager-->
-<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc91">6.1.4</A>&#XA0;&#XA0;<A HREF="#s2smanager">s2s Manager</A></H3><!--SEC END --><P> <A NAME="s2smanager"></A>
+<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc89">6.1.4</A>&#XA0;&#XA0;<A HREF="#s2smanager">s2s Manager</A></H3><!--SEC END --><P> <A NAME="s2smanager"></A>
</P><P>This module routes packets to other XMPP servers. First, it
checks if an opened s2s connection from the domain of the packet&#X2019;s
source to the domain of the packet&#X2019;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.</P><P> <A NAME="cluster"></A> </P><!--TOC section Clustering Setup-->
-<H2 CLASS="section"><!--SEC ANCHOR --><A NAME="htoc92">6.2</A>&#XA0;&#XA0;<A HREF="#cluster">Clustering Setup</A></H2><!--SEC END --><P> <A NAME="cluster"></A>
+<H2 CLASS="section"><!--SEC ANCHOR --><A NAME="htoc90">6.2</A>&#XA0;&#XA0;<A HREF="#cluster">Clustering Setup</A></H2><!--SEC END --><P> <A NAME="cluster"></A>
</P><P>Suppose you already configured <TT>ejabberd</TT> on one machine named (<TT>first</TT>),
and you need to setup another one to make an <TT>ejabberd</TT> cluster. Then do
following steps:</P><OL CLASS="enumerate" type=1><LI CLASS="li-enumerate">
@@ -4388,30 +4524,29 @@ and &#X2018;<CODE>access</CODE>&#X2019; options because they will be taken from
enabled only on one machine in the cluster.
</LI></OL><P>You can repeat these steps for other machines supposed to serve this
domain.</P><P> <A NAME="servicelb"></A> </P><!--TOC section Service Load-Balancing-->
-<H2 CLASS="section"><!--SEC ANCHOR --><A NAME="htoc93">6.3</A>&#XA0;&#XA0;<A HREF="#servicelb">Service Load-Balancing</A></H2><!--SEC END --><P> <A NAME="servicelb"></A>
+<H2 CLASS="section"><!--SEC ANCHOR --><A NAME="htoc91">6.3</A>&#XA0;&#XA0;<A HREF="#servicelb">Service Load-Balancing</A></H2><!--SEC END --><P> <A NAME="servicelb"></A>
</P><P> <A NAME="domainlb"></A> </P><!--TOC subsection Domain Load-Balancing Algorithm-->
-<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc94">6.3.1</A>&#XA0;&#XA0;<A HREF="#domainlb">Domain Load-Balancing Algorithm</A></H3><!--SEC END --><P> <A NAME="domainlb"></A>
+<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc92">6.3.1</A>&#XA0;&#XA0;<A HREF="#domainlb">Domain Load-Balancing Algorithm</A></H3><!--SEC END --><P> <A NAME="domainlb"></A>
</P><P><TT>ejabberd</TT> includes an algorithm to load balance the components that are plugged on an <TT>ejabberd</TT> cluster. It means that you can plug one or several instances of the same component on each <TT>ejabberd</TT> cluster and that the traffic will be automatically distributed.</P><P>The default distribution algorithm try to deliver to a local instance of a component. If several local instances are available, one instance is chosen randomly. If no instance is available locally, one instance is chosen randomly among the remote component instances.</P><P>If you need a different behaviour, you can change the load balancing behaviour with the option <TT>domain_balancing</TT>. The syntax of the option is the following:
-</P><DL CLASS="description"><DT CLASS="dt-description"><B><TT>{domain_balancing, "component.example.com", BalancingCriteria}.</TT></B></DT></DL><P>Several balancing criteria are available:
+</P><DL CLASS="description"><DT CLASS="dt-description"><B><TT>domain_balancing: BalancingCriteria</TT></B></DT></DL><P>Several balancing criteria are available:
</P><UL CLASS="itemize"><LI CLASS="li-itemize">
<TT>destination</TT>: the full JID of the packet <TT>to</TT> attribute is used.
</LI><LI CLASS="li-itemize"><TT>source</TT>: the full JID of the packet <TT>from</TT> attribute is used.
</LI><LI CLASS="li-itemize"><TT>bare_destination</TT>: the bare JID (without resource) of the packet <TT>to</TT> attribute is used.
</LI><LI CLASS="li-itemize"><TT>bare_source</TT>: the bare JID (without resource) of the packet <TT>from</TT> attribute is used.
</LI></UL><P>If the value corresponding to the criteria is the same, the same component instance in the cluster will be used.</P><P> <A NAME="lbbuckets"></A> </P><!--TOC subsection Load-Balancing Buckets-->
-<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc95">6.3.2</A>&#XA0;&#XA0;<A HREF="#lbbuckets">Load-Balancing Buckets</A></H3><!--SEC END --><P> <A NAME="lbbuckets"></A>
+<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc93">6.3.2</A>&#XA0;&#XA0;<A HREF="#lbbuckets">Load-Balancing Buckets</A></H3><!--SEC END --><P> <A NAME="lbbuckets"></A>
</P><P>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.</P><P>In this case, it is best to limit the problem to the sessions handled by the failing component. This is what the <TT>domain_balancing_component_number</TT> option does, making the load balancing algorithm not dynamic, but sticky on a fix number of component instances.</P><P>The syntax is:
-</P><DL CLASS="description"><DT CLASS="dt-description"><B><TT>{domain_balancing_component_number, "component.example.com", Number}.</TT></B></DT></DL><P> <A NAME="debugging"></A> </P><!--TOC chapter Debugging-->
-<H1 CLASS="chapter"><!--SEC ANCHOR --><A NAME="htoc96">Chapter&#XA0;7</A>&#XA0;&#XA0;<A HREF="#debugging">Debugging</A></H1><!--SEC END --><P> <A NAME="debugging"></A>
+</P><DL CLASS="description"><DT CLASS="dt-description"><B><TT>domain_balancing_component_number: Number</TT></B></DT></DL><P> <A NAME="debugging"></A> </P><!--TOC chapter Debugging-->
+<H1 CLASS="chapter"><!--SEC ANCHOR --><A NAME="htoc94">Chapter&#XA0;7</A>&#XA0;&#XA0;<A HREF="#debugging">Debugging</A></H1><!--SEC END --><P> <A NAME="debugging"></A>
</P><P> <A NAME="logfiles"></A> </P><!--TOC section Log Files-->
-<H2 CLASS="section"><!--SEC ANCHOR --><A NAME="htoc97">7.1</A>&#XA0;&#XA0;<A HREF="#logfiles">Log Files</A></H2><!--SEC END --><P> <A NAME="logfiles"></A> </P><P>An <TT>ejabberd</TT> node writes two log files:
+<H2 CLASS="section"><!--SEC ANCHOR --><A NAME="htoc95">7.1</A>&#XA0;&#XA0;<A HREF="#logfiles">Log Files</A></H2><!--SEC END --><P> <A NAME="logfiles"></A> </P><P>An <TT>ejabberd</TT> node writes two log files:
</P><DL CLASS="description"><DT CLASS="dt-description">
<B><TT>ejabberd.log</TT></B></DT><DD CLASS="dd-description"> is the ejabberd service log, with the messages reported by <TT>ejabberd</TT> code
</DD><DT CLASS="dt-description"><B><TT>erlang.log</TT></B></DT><DD CLASS="dd-description"> is the Erlang/OTP system log, with the messages reported by Erlang/OTP using SASL (System Architecture Support Libraries)
-</DD></DL><P>The option <TT>loglevel</TT> modifies the verbosity of the file ejabberd.log. The syntax is one of:
+</DD></DL><P>The option <TT>loglevel</TT> modifies the verbosity of the file ejabberd.log. The syntax:
</P><DL CLASS="description"><DT CLASS="dt-description">
-<B><TT>{loglevel, Level}.</TT></B></DT><DD CLASS="dd-description"> The standard form to set a global log level.
-</DD><DT CLASS="dt-description"><B><TT>{loglevel, {Level, [{Module, Level}, ...]}}.</TT></B></DT><DD CLASS="dd-description"> The given Erlang modules will be logged with specific log levels, all others will use the default log level.
+<B><TT>loglevel: Level</TT></B></DT><DD CLASS="dd-description"> The standard form to set a global log level.
</DD></DL><P>The possible <TT>Level</TT> are:
</P><DL CLASS="description"><DT CLASS="dt-description">
<B><TT>0</TT></B></DT><DD CLASS="dd-description"> No ejabberd log at all (not recommended)
@@ -4422,39 +4557,41 @@ domain.</P><P> <A NAME="servicelb"></A> </P><!--TOC section Service Load-Balanci
</DD><DT CLASS="dt-description"><B><TT>5</TT></B></DT><DD CLASS="dd-description"> Debug
</DD></DL><P>
For example, the default configuration is:
-</P><PRE CLASS="verbatim">{loglevel, 4}.
+</P><PRE CLASS="verbatim">loglevel: 4
</PRE><P>The log files grow continually, so it is recommended to rotate them periodically.
To rotate the log files, rename the files and then reopen them.
The ejabberdctl command <TT>reopen-log</TT>
(please refer to section <A HREF="#ectl-commands">4.1.1</A>)
reopens the log files,
and also renames the old ones if you didn&#X2019;t rename them.</P><P> <A NAME="debugconsole"></A> </P><!--TOC section Debug Console-->
-<H2 CLASS="section"><!--SEC ANCHOR --><A NAME="htoc98">7.2</A>&#XA0;&#XA0;<A HREF="#debugconsole">Debug Console</A></H2><!--SEC END --><P> <A NAME="debugconsole"></A> </P><P>The Debug Console is an Erlang shell attached to an already running <TT>ejabberd</TT> server.
+<H2 CLASS="section"><!--SEC ANCHOR --><A NAME="htoc96">7.2</A>&#XA0;&#XA0;<A HREF="#debugconsole">Debug Console</A></H2><!--SEC END --><P> <A NAME="debugconsole"></A> </P><P>The Debug Console is an Erlang shell attached to an already running <TT>ejabberd</TT> server.
With this Erlang shell, an experienced administrator can perform complex tasks.</P><P>This shell gives complete control over the <TT>ejabberd</TT> server,
so it is important to use it with extremely care.
There are some simple and safe examples in the article
<A HREF="http://www.ejabberd.im/interconnect-erl-nodes">Interconnecting Erlang Nodes</A></P><P>To exit the shell, close the window or press the keys: control+c control+c.</P><P> <A NAME="watchdog"></A> </P><!--TOC section Watchdog Alerts-->
-<H2 CLASS="section"><!--SEC ANCHOR --><A NAME="htoc99">7.3</A>&#XA0;&#XA0;<A HREF="#watchdog">Watchdog Alerts</A></H2><!--SEC END --><P> <A NAME="watchdog"></A>
+<H2 CLASS="section"><!--SEC ANCHOR --><A NAME="htoc97">7.3</A>&#XA0;&#XA0;<A HREF="#watchdog">Watchdog Alerts</A></H2><!--SEC END --><P> <A NAME="watchdog"></A>
</P><P><TT>ejabberd</TT> includes a watchdog mechanism that may be useful to developers
when troubleshooting a problem related to memory usage.
If a process in the <TT>ejabberd</TT> server consumes more memory than the configured threshold,
a message is sent to the XMPP accounts defined with the option
<TT>watchdog_admins</TT>
in the <TT>ejabberd</TT> configuration file.</P><P>The syntax is:
-</P><DL CLASS="description"><DT CLASS="dt-description"><B><TT>{watchdog_admins, [JID, ...]}.</TT></B></DT></DL><P>The memory consumed is measured in <TT>words</TT>:
+</P><DL CLASS="description"><DT CLASS="dt-description"><B><TT>watchdog_admins: [JID, ...]</TT></B></DT></DL><P>The memory consumed is measured in <TT>words</TT>:
a word on 32-bit architecture is 4 bytes,
and a word on 64-bit architecture is 8 bytes.
The threshold by default is 1000000 words.
This value can be configured with the option <TT>watchdog_large_heap</TT>,
or in a conversation with the watchdog alert bot.</P><P>The syntax is:
-</P><DL CLASS="description"><DT CLASS="dt-description"><B><TT>{watchdog_large_heap, Number}.</TT></B></DT></DL><P>Example configuration:
-</P><PRE CLASS="verbatim">{watchdog_admins, ["admin2@localhost", "admin2@example.org"]}.
-{watchdog_large_heap, 30000000}.
+</P><DL CLASS="description"><DT CLASS="dt-description"><B><TT>watchdog_large_heap: Number</TT></B></DT></DL><P>Example configuration:
+</P><PRE CLASS="verbatim">watchdog_admins:
+ - "admin2@localhost"
+ - "admin2@example.org"
+watchdog_large_heap: 30000000
</PRE><P>To remove watchdog admins, remove them in the option.
To remove all watchdog admins, set the option with an empty list:
-</P><PRE CLASS="verbatim">{watchdog_admins, []}.
+</P><PRE CLASS="verbatim">watchdog_admins: []
</PRE><P> <A NAME="i18ni10n"></A> </P><!--TOC chapter Internationalization and Localization-->
-<H1 CLASS="chapter"><!--SEC ANCHOR --><A NAME="htoc100">Appendix&#XA0;A</A>&#XA0;&#XA0;<A HREF="#i18ni10n">Internationalization and Localization</A></H1><!--SEC END --><P> <A NAME="i18ni10n"></A>
+<H1 CLASS="chapter"><!--SEC ANCHOR --><A NAME="htoc98">Appendix&#XA0;A</A>&#XA0;&#XA0;<A HREF="#i18ni10n">Internationalization and Localization</A></H1><!--SEC END --><P> <A NAME="i18ni10n"></A>
</P><P>The source code of <TT>ejabberd</TT> supports localization.
The translators can edit the
<A HREF="http://www.gnu.org/software/gettext/">gettext</A> .po files
@@ -4489,9 +4626,9 @@ HTTP header &#X2018;Accept-Language: ru&#X2019;</TD></TR>
</TABLE></DIV>
<A NAME="fig:webadmmainru"></A>
<DIV CLASS="center"><HR WIDTH="80%" SIZE=2></DIV></DIV></BLOCKQUOTE><P> <A NAME="releasenotes"></A> </P><!--TOC chapter Release Notes-->
-<H1 CLASS="chapter"><!--SEC ANCHOR --><A NAME="htoc101">Appendix&#XA0;B</A>&#XA0;&#XA0;<A HREF="#releasenotes">Release Notes</A></H1><!--SEC END --><P> <A NAME="releasenotes"></A>
+<H1 CLASS="chapter"><!--SEC ANCHOR --><A NAME="htoc99">Appendix&#XA0;B</A>&#XA0;&#XA0;<A HREF="#releasenotes">Release Notes</A></H1><!--SEC END --><P> <A NAME="releasenotes"></A>
</P><P>Release notes are available from <A HREF="http://www.process-one.net/en/ejabberd/release_notes/">ejabberd Home Page</A></P><P> <A NAME="acknowledgements"></A> </P><!--TOC chapter Acknowledgements-->
-<H1 CLASS="chapter"><!--SEC ANCHOR --><A NAME="htoc102">Appendix&#XA0;C</A>&#XA0;&#XA0;<A HREF="#acknowledgements">Acknowledgements</A></H1><!--SEC END --><P> <A NAME="acknowledgements"></A> </P><P>Thanks to all people who contributed to this guide:
+<H1 CLASS="chapter"><!--SEC ANCHOR --><A NAME="htoc100">Appendix&#XA0;C</A>&#XA0;&#XA0;<A HREF="#acknowledgements">Acknowledgements</A></H1><!--SEC END --><P> <A NAME="acknowledgements"></A> </P><P>Thanks to all people who contributed to this guide:
</P><UL CLASS="itemize"><LI CLASS="li-itemize">
Alexey Shchepin (<A HREF="xmpp:aleksey@jabber.ru"><TT>xmpp:aleksey@jabber.ru</TT></A>)
</LI><LI CLASS="li-itemize">Badlop (<A HREF="xmpp:badlop@jabberes.org"><TT>xmpp:badlop@jabberes.org</TT></A>)
@@ -4505,7 +4642,7 @@ Alexey Shchepin (<A HREF="xmpp:aleksey@jabber.ru"><TT>xmpp:aleksey@jabber.ru</TT
</LI><LI CLASS="li-itemize">Sergei Golovan (<A HREF="xmpp:sgolovan@nes.ru"><TT>xmpp:sgolovan@nes.ru</TT></A>)
</LI><LI CLASS="li-itemize">Vsevolod Pelipas (<A HREF="xmpp:vsevoload@jabber.ru"><TT>xmpp:vsevoload@jabber.ru</TT></A>)
</LI></UL><P> <A NAME="copyright"></A> </P><!--TOC chapter Copyright Information-->
-<H1 CLASS="chapter"><!--SEC ANCHOR --><A NAME="htoc103">Appendix&#XA0;D</A>&#XA0;&#XA0;<A HREF="#copyright">Copyright Information</A></H1><!--SEC END --><P> <A NAME="copyright"></A> </P><P>Ejabberd Installation and Operation Guide.<BR>
+<H1 CLASS="chapter"><!--SEC ANCHOR --><A NAME="htoc101">Appendix&#XA0;D</A>&#XA0;&#XA0;<A HREF="#copyright">Copyright Information</A></H1><!--SEC END --><P> <A NAME="copyright"></A> </P><P>Ejabberd Installation and Operation Guide.<BR>
Copyright &#XA9; 2003 &#X2014; 2013 ProcessOne</P><P>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 1c3e0f023..08ceb78f6 100644
--- a/doc/guide.tex
+++ b/doc/guide.tex
@@ -109,15 +109,15 @@
%\ifthenelse{\boolean{modhttpbind}}{\input{mod_http_bind.tex}}{}
%% Common options
-\newcommand{\iqdiscitem}[1]{\titem{\{iqdisc, Discipline\}} \ind{options!iqdisc}This specifies
+\newcommand{\iqdiscitem}[1]{\titem{iqdisc: Discipline} \ind{options!iqdisc}This specifies
the processing discipline for #1 IQ queries (see section~\ref{modiqdiscoption}).}
\newcommand{\hostitem}[1]{
- \titem{\{host, HostName\}} \ind{options!host} This option defines the Jabber ID of the
+ \titem{host: HostName} \ind{options!host} This option defines the Jabber ID of the
service. If the \texttt{host} option is not specified, the Jabber ID will be the
hostname of the virtual host with the prefix `\jid{#1.}'. The keyword "@HOST@"
is replaced at start time with the real virtual host name.
}
-\newcommand{\dbtype}{\titem{\{db\_type, mnesia|odbc\}} \ind{options!dbtype}
+\newcommand{\dbtype}{\titem{db\_type: internal|odbc} \ind{options!dbtype}
Define the type of storage where the module will create the tables and store user information.
The default is to store in the internal Mnesia database.
If \term{odbc} value is defined, make sure you have defined the database, see~\ref{database}.
@@ -320,10 +320,9 @@ To compile \ejabberd{} on a `Unix-like' operating system, you need:
\item GCC
\item Libexpat 1.95 or higher
\item Erlang/OTP R15B or higher.
+\item Libyaml 1.4 or higher
\item OpenSSL 0.9.8 or higher, for STARTTLS, SASL and SSL encryption.
\item Zlib 1.2.3 or higher, for Stream Compression support (\xepref{0138}). Optional.
-\item Erlang mysql library. Optional. For MySQL authentication or storage. See section \ref{compilemysql}.
-\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}.
@@ -388,10 +387,10 @@ Some options that you may be interested in modifying:
Enable the use of development tools.
\titem{--enable-mysql}
- Enable MySQL support (see section \ref{mysql}).
+ Enable MySQL support (see section \ref{odbc}).
\titem{--enable-pgsql}
- Enable PostgreSQL support (see section \ref{pgsql}).
+ Enable PostgreSQL support (see section \ref{odbc}).
\titem{--enable-zlib}
Enable Stream Compression (XEP-0138) using zlib.
@@ -431,7 +430,7 @@ The files and directories created are, by default:
\begin{description}
\titem{/etc/ejabberd/} Configuration directory:
\begin{description}
- \titem{ejabberd.cfg} ejabberd configuration file
+ \titem{ejabberd.yml} ejabberd configuration file
\titem{ejabberdctl.cfg} Configuration file of the administration script
\titem{inetrc} Network DNS configuration file
\end{description}
@@ -583,7 +582,7 @@ We assume that we will try to put as much library as possible into \verb|C:\sdk\
configure.bat
nmake -f Makefile.win32
\end{verbatim}
-\item Edit the file \verb|ejabberd\src\ejabberd.cfg| and run
+\item Edit the file \verb|ejabberd\src\ejabberd.yml| and run
\begin{verbatim}
werl -s ejabberd -name ejabberd
\end{verbatim}
@@ -608,8 +607,13 @@ ejabberdctl register admin1 example.org FgT5bk3
\end{enumerate}
\item Edit the \ejabberd{} configuration file to give administration rights to the XMPP account you created:
\begin{verbatim}
-{acl, admin, {user, "admin1", "example.org"}}.
-{access, configure, [{allow, admin}]}.
+acl:
+ admin:
+ user:
+ - "admin1": "example.org"
+access:
+ configure:
+ admin: allow
\end{verbatim}
You can grant administrative privileges to many XMPP accounts,
and also to accounts in other XMPP servers.
@@ -638,34 +642,56 @@ indicates you need to also update those tables.
\makesection{basicconfig}{Basic Configuration}
-The configuration file will be loaded the first time you start \ejabberd{}. The
-content from this file will be parsed and stored in the internal \ejabberd{} database. Subsequently the
-configuration will be loaded from the database and any commands in the
-configuration file are appended to the entries in the database.
+The configuration file will be loaded the first time you start \ejabberd{}.
+The configuration file name MUST have ``.yml'' extension. This helps ejabberd
+to differentiate between the new and legacy file formats (see section~\ref{oldconfig}).
Note that \ejabberd{} never edits the configuration file.
-So, the configuration changes done using the Web Admin
-are stored in the database, but are not reflected in the configuration file.
-If you want those changes to be use after \ejabberd{} restart, you can either
-edit the configuration file, or remove all its content.
-The configuration file contains a sequence of Erlang terms. Lines beginning with a
-\term{`\%'} sign are ignored. Each term is a tuple of which the first element is
-the name of an option, and any further elements are that option's values. If the
-configuration file do not contain for instance the `hosts' option, the old
-host name(s) stored in the database will be used.
-
-
-You can override the old values stored in the database by adding next lines to
-the beginning of the configuration file:
+The configuration file is written in
+\footahref{http://en.wikipedia.org/wiki/YAML}{YAML}.
+However, different scalars are treated as different types:
+\begin{itemize}
+\item unquoted or single-quoted strings. The type is called \verb|atom()|
+ in this document.
+ Examples: \verb|dog|, \verb|'Jupiter'|, \verb|'3.14159'|, \verb|YELLOW|.
+\item numeric literals. The type is called \verb|integer()|, \verb|float()| or,
+ if both are allowed, \verb|number()|.
+ Examples: \verb|3|, \verb|-45.0|, \verb|.0|
+\item double-quoted or folded strings. The type is called \verb|string()|.
+ Examples of a double-quoted string:
+ \verb|"Lizzard"|, \verb|"orange"|, \verb|"3.14159"|.
+ Examples of a folded string:
+\begin{verbatim}
+> Art thou not Romeo,
+ and a Montague?
+\end{verbatim}
\begin{verbatim}
-override_global.
-override_local.
-override_acls.
+| Neither, fair saint,
+ if either thee dislike.
\end{verbatim}
-With these lines the old global options (shared between all \ejabberd{} nodes in a
-cluster), local options (which are specific for this particular \ejabberd{} node)
-and ACLs will be removed before new ones are added.
+For associative arrays ("mappings") and lists you can use both outline
+indentation and compact syntax (aka ``JSON style''). For example, the following is equivalent:
+\begin{verbatim}
+{param1: ["val1", "val2"], param2: ["val3", "val4"]}
+\end{verbatim}
+and
+\begin{verbatim}
+param1:
+ - "val1"
+ - "val2"
+param2:
+ - "val3"
+ - "val4"
+\end{verbatim}
+Note that both styles are used in this document.
+\end{itemize}
+
+\makesubsection{oldconfig}{Legacy Configuration File}
+In previous \ejabberd{} version the configuration file should be written
+in Erlang terms. The format is still supported, but it is highly recommended
+to convert it to the new YAML format using \term{convert\_to\_yaml} command
+from \term{ejabberdctl} (see~\ref{ejabberdctl} for details).
\makesubsection{hostnames}{Host Names}
\ind{options!hosts}\ind{host names}
@@ -674,17 +700,20 @@ The option \option{hosts} defines a list containing one or more domains that
\ejabberd{} will serve.
The syntax is:
-\esyntax{\{hosts, [HostName, ...]\}.}
+\esyntax{[HostName]}
Examples:
\begin{itemize}
\item Serving one domain:
\begin{verbatim}
-{hosts, ["example.org"]}.
+hosts: ["example.org"]
\end{verbatim}
\item Serving three domains:
\begin{verbatim}
-{hosts, ["example.net", "example.com", "jabber.somesite.org"]}.
+hosts:
+ - "example.net"
+ - "example.com"
+ - "jabber.somesite.org"
\end{verbatim}
\end{itemize}
@@ -695,7 +724,7 @@ Options can be defined separately for every virtual host using the
\term{host\_config} option.
The syntax is: \ind{options!host\_config}
-\esyntax{\{host\_config, HostName, [Option, ...]\}}
+\esyntax{\{HostName: [Option, ...]\}}
Examples:
\begin{itemize}
@@ -703,82 +732,89 @@ Examples:
domain \jid{example.com} is using the \ind{LDAP}LDAP server running on the
domain \jid{localhost} to perform authentication:
\begin{verbatim}
-{host_config, "example.net", [{auth_method, internal}]}.
-
-{host_config, "example.com", [{auth_method, ldap},
- {ldap_servers, ["localhost"]},
- {ldap_uids, [{"uid"}]},
- {ldap_rootdn, "dc=localdomain"},
- {ldap_rootdn, "dc=example,dc=com"},
- {ldap_password, ""}]}.
-\end{verbatim}
-\item Domain \jid{example.net} is using \ind{ODBC}ODBC to perform authentication
+host_config:
+ "example.net"
+ auth_method: internal
+ "example.com":
+ auth_method: ldap
+ ldap_servers:
+ - "localhost"
+ ldap_uids:
+ - "uid"
+ ldap_rootdn: "dc=localdomain"
+ ldap_rootdn: "dc=example,dc=com"
+ ldap_password: ""
+\end{verbatim}
+\item Domain \jid{example.net} is using \ind{odbc}ODBC to perform authentication
while domain \jid{example.com} is using the LDAP servers running on the domains
\jid{localhost} and \jid{otherhost}:
\begin{verbatim}
-{host_config, "example.net", [{auth_method, odbc},
- {odbc_server, "DSN=ejabberd;UID=ejabberd;PWD=ejabberd"}]}.
-
-{host_config, "example.com", [{auth_method, ldap},
- {ldap_servers, ["localhost", "otherhost"]},
- {ldap_uids, [{"uid"}]},
- {ldap_rootdn, "dc=localdomain"},
- {ldap_rootdn, "dc=example,dc=com"},
- {ldap_password, ""}]}.
+host_config:
+ "example.net":
+ auth_method: odbc
+ odbc_type: odbc
+ odbc_server: "DSN=ejabberd;UID=ejabberd;PWD=ejabberd"
+ "example.com":
+ auth_method: ldap
+ ldap_servers:
+ - "localhost"
+ - "otherhost"
+ ldap_uids:
+ - "uid"
+ ldap_rootdn: "dc=localdomain"
+ ldap_rootdn: "dc=example,dc=com"
+ ldap_password: ""
\end{verbatim}
\end{itemize}
To define specific ejabberd modules in a virtual host,
you can define the global \term{modules} option with the common modules,
and later add specific modules to certain virtual hosts.
-To accomplish that, instead of defining each option in \term{host\_config} with the general syntax
-\esyntax{\{OptionName, OptionValue\}}
-use this syntax:
-\esyntax{\{\{add, OptionName\}, OptionValue\}}
+To accomplish that, instead of defining each option in \term{host\_config}
+use \term{append\_host\_config} with the same syntax.
In this example three virtual hosts have some similar modules, but there are also
other different modules for some specific virtual hosts:
\begin{verbatim}
-%% This ejabberd server has three vhosts:
-{hosts, ["one.example.org", "two.example.org", "three.example.org"]}.
-
-%% Configuration of modules that are common to all vhosts
-{modules,
- [
- {mod_roster, []},
- {mod_configure, []},
- {mod_disco, []},
- {mod_private, []},
- {mod_time, []},
- {mod_last, []},
- {mod_version, []}
- ]}.
-
-%% Add some modules to vhost one:
-{host_config, "one.example.org",
- [{{add, modules}, [
- {mod_echo, [{host, "echo-service.one.example.org"}]}
- {mod_http_bind, []},
- {mod_logxml, []}
- ]
- }
- ]}.
-
-%% Add a module just to vhost two:
-{host_config, "two.example.org",
- [{{add, modules}, [
- {mod_echo, [{host, "mirror.two.example.org"}]}
- ]
- }
- ]}.
+## This ejabberd server has three vhosts:
+hosts:
+ - "one.example.org"
+ - "two.example.org"
+ - "three.example.org"
+
+## Configuration of modules that are common to all vhosts
+modules:
+ mod_roster: {}
+ mod_configure: {}
+ mod_disco: {}
+ mod_private: {}
+ mod_time: {}
+ mod_last: {}
+ mod_version: {}
+
+## Add some modules to vhost one:
+append_host_config:
+ "one.example.org":
+ modules:
+ mod_echo:
+ host: "echo-service.one.example.org"
+ mod_http_bind: {}
+ mod_logxml: {}
+
+## Add a module just to vhost two:
+append_host_config:
+ "two.example.org":
+ modules:
+ mod_echo:
+ host: "mirror.two.example.org"
\end{verbatim}
\makesubsection{listened}{Listening Ports}
\ind{options!listen}
The option \option{listen} defines for which ports, addresses and network protocols \ejabberd{}
-will listen and what services will be run on them. Each element of the list is a
-tuple with the following elements:
+will listen and what services will be run on them. Each element of the list is an
+associative array with the following elements:
\begin{itemize}
\item Port number. Optionally also the IP address and/or a transport protocol.
\item Listening module that serves this port.
@@ -786,14 +822,20 @@ tuple with the following elements:
\end{itemize}
The option syntax is:
-\esyntax{\{listen, [Listener, ...]\}.}
-
-To define a listener there are several syntax.
-\esyntax{\{PortNumber, Module, [Option, ...]\}}
-\esyntax{\{\{PortNumber, IPaddress\}, Module, [Option, ...]\}}
-\esyntax{\{\{PortNumber, TransportProtocol\}, Module, [Option, ...]\}}
-\esyntax{\{\{PortNumber, IPaddress, TransportProtocol\}, Module, [Option, ...]\}}
-
+\esyntax{[Listener, ...]}
+Example:
+\begin{verbatim}
+listen:
+ -
+ port: 5222
+ module: ejabberd_c2s
+ starttls: true
+ certfile: "/path/to/certfile.pem"
+ -
+ port: 5269
+ module: ejabberd_s2s_in
+ transport: tcp
+\end{verbatim}
\makesubsubsection{listened-port}{Port Number, IP Address and Transport Protocol}
@@ -801,8 +843,7 @@ The port number defines which port to listen for incoming connections.
It can be a Jabber/XMPP standard port
(see section \ref{firewall}) or any other valid port number.
-The IP address can be represented with a string
-or an Erlang tuple with decimal or hexadecimal numbers.
+The IP address can be represented as a string.
The socket will listen only in that network interface.
It is possible to specify a generic address,
so \ejabberd{} will listen in all addresses.
@@ -815,9 +856,6 @@ Some example values for IP address:
\item \verb|"::"| to listen in all IPv6 network interfaces
\item \verb|"10.11.12.13"| is the IPv4 address \verb|10.11.12.13|
\item \verb|"::FFFF:127.0.0.1"| is the IPv6 address \verb|::FFFF:127.0.0.1/128|
-\item \verb|{10, 11, 12, 13}| is the IPv4 address \verb|10.11.12.13|
-\item \verb|{0, 0, 0, 0, 0, 65535, 32512, 1}| is the IPv6 address \verb|::FFFF:127.0.0.1/128|
-\item \verb|{16#fdca, 16#8ab6, 16#a243, 16#75ef, 0, 0, 0, 1}| is the IPv6 address \verb|FDCA:8AB6:A243:75EF::1/128|
\end{itemize}
The transport protocol can be \term{tcp} or \term{udp}.
@@ -858,33 +896,33 @@ The available modules, their purpose and the options allowed by each one are:
This is a detailed description of each option allowed by the listening modules:
\begin{description}
- \titem{\{access, AccessName\}} \ind{options!access}This option defines
+ \titem{access: AccessName} \ind{options!access}This option defines
access to the port. The default value is \term{all}.
- \titem{\{backlog, Value\}} \ind{options!backlog}The backlog value
+ \titem{backlog: Value} \ind{options!backlog}The backlog value
defines the maximum length that the queue of pending connections may
grow to. This should be increased if the server is going to handle
lots of new incoming connections as they may be dropped if there is
no space in the queue (and ejabberd was not able to accept them
immediately). Default value is 5.
- \titem{captcha} \ind{options!http-captcha}
+ \titem{captcha: true|false} \ind{options!http-captcha}
Simple web page that allows a user to fill a CAPTCHA challenge (see section \ref{captcha}).
- \titem{\{certfile, Path\}} Full path to a file containing the default SSL certificate.
+ \titem{certfile: Path} Full path to a file containing the default SSL certificate.
To define a certificate file specific for a given domain, use the global option \term{domain\_certfile}.
- \titem{\{default\_host, undefined|HostName\}}
+ \titem{default\_host: undefined|HostName\}}
If the HTTP request received by ejabberd contains the HTTP header \term{Host}
with an ambiguous virtual host that doesn't match any one defined in ejabberd (see \ref{hostnames}),
then this configured HostName is set as the request Host.
The default value of this option is: \term{undefined}.
- \titem{\{hosts, [Hostname, ...], [HostOption, ...]\}} \ind{options!hosts}
+ \titem{hosts: \{Hostname: [HostOption, ...]\}}\ind{options!hosts}
The external Jabber component that connects to this \term{ejabberd\_service}
can serve one or more hostnames.
As \term{HostOption} you can define options for the component;
currently the only allowed option is the password required to the component
- when attempt to connect to ejabberd: \poption{\{password, Secret\}}.
+ when attempt to connect to ejabberd: \poption{password: Secret}.
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{http\_bind} \ind{options!http\_bind}\ind{protocols!XEP-0206: HTTP Binding}\ind{JWChat}\ind{web-based XMPP client}
+ \titem{http\_bind: true|false} \ind{options!http\_bind}\ind{protocols!XEP-0206: HTTP Binding}\ind{JWChat}\ind{web-based XMPP 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
do not allow outgoing sockets on port 5222.
@@ -899,7 +937,7 @@ This is a detailed description of each option allowed by the listening modules:
(check the tutorials to install JWChat with ejabberd and an
\footahref{http://www.ejabberd.im/jwchat-localserver}{embedded local web server}
or \footahref{http://www.ejabberd.im/jwchat-apache}{Apache}).
- \titem{http\_poll} \ind{options!http\_poll}\ind{protocols!XEP-0025: HTTP Polling}\ind{JWChat}\ind{web-based XMPP client}
+ \titem{http\_poll: true|false} \ind{options!http\_poll}\ind{protocols!XEP-0025: HTTP Polling}\ind{JWChat}\ind{web-based XMPP client}
This option enables HTTP Polling (\xepref{0025}) support. HTTP Polling
enables access via HTTP requests to \ejabberd{} from behind firewalls which
do not allow outgoing sockets on port 5222.
@@ -913,9 +951,9 @@ This is a detailed description of each option allowed by the listening modules:
The maximum period of time to keep a client session active without
an incoming POST request can be configured with the global option
\term{http\_poll\_timeout}. The default value is five minutes.
- The option can be defined in \term{ejabberd.cfg}, expressing the time
+ The option can be defined in \term{ejabberd.yml}, expressing the time
in seconds: \verb|{http_poll_timeout, 300}.|
- \titem{\{max\_fsm\_queue, Size\}}
+ \titem{max\_fsm\_queue: Size}
This option specifies the maximum number of elements in the queue of the FSM
(Finite State Machine).
Roughly speaking, each message in such queues represents one XML
@@ -933,7 +971,7 @@ This is a detailed description of each option allowed by the listening modules:
the globally configured value is used.
The allowed values are integers and 'undefined'.
Default value: 'undefined'.
- \titem{\{max\_stanza\_size, Size\}}
+ \titem{max\_stanza\_size: Size}
\ind{options!max\_stanza\_size}This option specifies an
approximate maximum size in bytes of XML stanzas. Approximate,
because it is calculated with the precision of one block of read
@@ -942,12 +980,17 @@ This is a detailed description of each option allowed by the listening modules:
connections and 131072 for s2s connections. s2s max stanza size
must always much higher than c2s limit. Change this value with
extreme care as it can cause unwanted disconnect if set too low.
- \titem{\{request\_handlers, [ \{Path, Module\}, ...]\}} To define one or several handlers that will serve HTTP requests.
- The Path is a list of strings; so the URIs that start with that Path will be served by Module.
+ \titem{request\_handlers: \{Path: Module\}} To define one or several handlers that will serve HTTP requests.
+ The Path is a string; so the URIs that start with that Path will be served by Module.
For example, if you want \term{mod\_foo} to serve the URIs that start with \term{/a/b/},
and you also want \term{mod\_http\_bind} to serve the URIs \term{/http-bind/},
- use this option: \term{\{request\_handlers, [\{["a", "b"], mod\_foo\}, \{["http-bind"], mod\_http\_bind\}]\}}
- \titem{\{service\_check\_from, true|false\}}
+ use this option:
+\begin{verbatim}
+request_handlers:
+ /"a"/"b": mod_foo
+ /"http-bind": mod_http_bind
+\end{verbatim}
+ \titem{service\_check\_from: true|false}
\ind{options!service\_check\_from}
This option can be used with \term{ejabberd\_service} only.
\xepref{0114} requires that the domain must match the hostname of the component.
@@ -955,22 +998,25 @@ This is a detailed description of each option allowed by the listening modules:
to send stanzas with any arbitrary domain in the 'from' attribute.
Only use this option if you are completely sure about it.
The default value is \term{true}, to be compliant with \xepref{0114}.
- \titem{\{shaper, none|ShaperName\}} \ind{options!shaper}This option defines a
+ \titem{shaper: none|ShaperName} \ind{options!shaper}This option defines a
shaper for the port (see section~\ref{shapers}). The default value
is \term{none}.
- \titem{\{shaper\_rule, none|ShaperRule\}} \ind{options!shaperrule}This option defines a
+ \titem{shaper\_rule: none|ShaperRule} \ind{options!shaperrule}This option defines a
shaper rule for the \term{ejabberd\_service} (see section~\ref{shapers}). The recommended value
is \term{fast}.
- \titem{starttls} \ind{options!starttls}\ind{STARTTLS}This option
+ \titem{starttls: true|false} \ind{options!starttls}\ind{STARTTLS}This option
specifies that STARTTLS encryption is available on connections to the port.
You should also set the \option{certfile} option.
You can define a certificate file for a specific domain using the global option \option{domain\_certfile}.
- \titem{starttls\_required} \ind{options!starttls\_required}This option
+ \titem{starttls\_required: true|false} \ind{options!starttls\_required}This option
specifies that STARTTLS encryption is required on connections to the port.
No unencrypted connections will be allowed.
You should also set the \option{certfile} option.
You can define a certificate file for a specific domain using the global option \option{domain\_certfile}.
- \titem{tls} \ind{options!tls}\ind{TLS}This option specifies that traffic on
+ \titem{timeout: Integer} \ind{options!timeout}
+ Timeout of the connections, expressed in milliseconds.
+ Default: 5000
+ \titem{tls: true|false} \ind{options!tls}\ind{TLS}This option specifies that traffic on
the port will be encrypted using SSL immediately after connecting.
This was the traditional encryption method in the early Jabber software,
commonly on port 5223 for client-to-server communications.
@@ -980,56 +1026,53 @@ This is a detailed description of each option allowed by the listening modules:
which can be enabled in \ejabberd{} with the option \term{starttls}.
If this option is set, you should also set the \option{certfile} option.
The option \term{tls} can also be used in \term{ejabberd\_http} to support HTTPS.
- \titem{\{tls\_compression, true|false\}}
+ \titem{tls\_compression: true|false}
Whether to enable or disable TLS compression. The default value is \term{true}.
- \titem{\{trusted\_proxies, all | [IpString]\}} \ind{options!trusted\_proxies}
+ \titem{trusted\_proxies: all | [IpString]} \ind{options!trusted\_proxies}
Specify what proxies are trusted when an HTTP request contains the header \term{X-Forwarded-For}
You can specify \term{all} to allow all proxies, or specify a list of IPs in string format.
The default value is: \term{["127.0.0.1"]}
- \titem{web\_admin} \ind{options!web\_admin}\ind{web admin}This option
+ \titem{web\_admin: true|false} \ind{options!web\_admin}\ind{web admin}This option
enables the Web Admin for \ejabberd{} administration which is available
at \verb|http://server:port/admin/|. Login and password are the username and
password of one of the registered users who are granted access by the
`configure' access rule.
- \titem{zlib} \ind{options!zlib}\ind{protocols!XEP-0138: Stream Compression}\ind{Zlib}This
+ \titem{zlib: true|false} \ind{options!zlib}\ind{protocols!XEP-0138: Stream Compression}\ind{Zlib}This
option specifies that Zlib stream compression (as defined in \xepref{0138})
is available on connections to the port.
\end{description}
There are some additional global options that can be specified in the ejabberd configuration file (outside \term{listen}):
\begin{description}
- \titem{\{s2s\_use\_starttls, false|optional|required|required\_trusted\}}
+ \titem{s2s\_use\_starttls: false|optional|required|required\_trusted}
\ind{options!s2s\_use\_starttls}\ind{STARTTLS}This option defines if
s2s connections don't use STARTTLS encryption; if STARTTLS can be used optionally;
if STARTTLS is required to establish the connection;
or if STARTTLS is required and the remote certificate must be valid and trusted.
The default value is to not use STARTTLS: \term{false}.
- \titem{\{s2s\_certfile, Path\}} \ind{options!s2s\_certificate}Full path to a
+ \titem{s2s\_certfile: Path} \ind{options!s2s\_certificate}Full path to a
file containing a SSL certificate.
- \titem{\{domain\_certfile, Domain, Path\}} \ind{options!domain\_certfile}
+ \titem{domain\_certfile: Path} \ind{options!domain\_certfile}
Full path to the file containing the SSL certificate for a specific domain.
- \titem{\{outgoing\_s2s\_options, [Family, ...], Timeout\}} \ind{options!outgoing\_s2s\_options}
- Specify which address families to try, in what order, and connect timeout in milliseconds.
- By default it first tries connecting with IPv4, if that fails it tries using IPv6,
- with a timeout of 10000 milliseconds.
- \titem{\{s2s\_dns\_options, [ \{Property, Value\}, ...]\}}
- \ind{options!s2s\_dns\_options}Define properties to use for DNS resolving.
- Allowed Properties are: \term{timeout} in seconds which default value is \term{10}
- and \term{retries} which default value is \term{2}.
- \titem{\{s2s\_default\_policy, allow|deny\}}
- The default policy for incoming and outgoing s2s connections to other XMPP servers.
- The default value is \term{allow}.
- \titem{\{\{s2s\_host, Host\}, allow|deny\}}
- Defines if incoming and outgoing s2s connections with a specific remote host are allowed or denied.
- This allows to restrict ejabberd to only establish s2s connections
- with a small list of trusted servers, or to block some specific servers.
- \titem{\{s2s\_max\_retry\_delay, Seconds\}} \ind{options!s2s\_max\_retry\_delay}
+ \titem{outgoing\_s2s\_families: [Family, ...]} \ind{options!outgoing\_s2s\_families}
+ Specify which address families to try, in what order.
+ By default it first tries connecting with IPv4, if that fails it tries using IPv6.
+ \titem{outgoing\_s2s\_timeout: Timeout} \ind{options!outgoing\_s2s\_timeout}
+ The timeout in milliseconds for outgoing S2S connection attempts.
+ \titem{s2s\_dns\_timeout: Timeout} \ind{options!s2s\_dns\_timeout}
+ The timeout in seconds for DNS resolving. The default value is \term{10}.
+ \titem{s2s\_dns\_retries: Number} \ind{options!s2s\_dns\_retries}
+ DNS resolving retries in seconds. The default value is \term{2}.
+ \titem{s2s\_policy: Access} \ind{options!s2s\_policy}
+ The policy for incoming and outgoing s2s connections to other XMPP servers.
+ The default value is \term{all}.
+ \titem{s2s\_max\_retry\_delay: Seconds} \ind{options!s2s\_max\_retry\_delay}
The maximum allowed delay for retry to connect after a failed connection attempt.
Specified in seconds. The default value is 300 seconds (5 minutes).
- \titem{\{s2s\_tls\_compression, true|false\}}
+ \titem{s2s\_tls\_compression: true|false}
Whether to enable or disable TLS compression for s2s connections.
The default value is \term{true}.
- \titem{\{max\_fsm\_queue, Size\}}
+ \titem{max\_fsm\_queue: Size}
This option specifies the maximum number of elements in the queue of the FSM
(Finite State Machine).
Roughly speaking, each message in such queues represents one XML
@@ -1047,7 +1090,7 @@ There are some additional global options that can be specified in the ejabberd c
the globally configured value is used.
The allowed values are integers and 'undefined'.
Default value: 'undefined'.
- \titem{\{route\_subdomains, local|s2s\}}
+ \titem{route\_subdomains: local|s2s}
Defines if ejabberd must route stanzas directed to subdomains locally (compliant with
\footahref{http://xmpp.org/rfcs/rfc3920.html\#rules.subdomain}{RFC 3920: XMPP Core}),
or to foreign server using S2S (compliant with
@@ -1070,40 +1113,60 @@ However, the c2s and s2s connections to the domain \term{example.com} use the fi
section~\ref{webadmin}. The socket only listens connections to the IP address 127.0.0.1.
\end{itemize}
\begin{verbatim}
-{hosts, ["example.com", "example.org", "example.net"]}.
-{listen,
- [
- {5222, ejabberd_c2s, [
- {access, c2s},
- {shaper, c2s_shaper},
- starttls, {certfile, "/etc/ejabberd/server.pem"},
- {max_stanza_size, 65536}
- ]},
- {5223, ejabberd_c2s, [
- {access, c2s},
- {shaper, c2s_shaper},
- tls, {certfile, "/etc/ejabberd/server.pem"},
- {max_stanza_size, 65536}
- ]},
- {{5269, "::"}, ejabberd_s2s_in, [
- {shaper, s2s_shaper},
- {max_stanza_size, 131072}
- ]},
- {{3478, udp}, ejabberd_stun, []},
- {5280, ejabberd_http, [
- http_poll
- ]},
- {{5281, "127.0.0.1"}, ejabberd_http, [
- web_admin,
- http_bind,
- tls, {certfile, "/etc/ejabberd/server.pem"},
- ]}
- ]
-}.
-{s2s_use_starttls, optional}.
-{s2s_certfile, "/etc/ejabberd/server.pem"}.
-{domain_certfile, "example.com", "/etc/ejabberd/example_com.pem"}.
-{outgoing_s2s_options, [ipv4, ipv6], 10000}.
+hosts:
+ - "example.com"
+ - "example.org"
+ - "example.net"
+
+listen:
+ -
+ port: 5222
+ module: ejabberd_c2s
+ access: c2s
+ shaper: c2s_shaper
+ starttls: true
+ certfile: "/etc/ejabberd/server.pem"
+ max_stanza_size: 65536
+ -
+ port: 5223
+ module: ejabberd_c2s
+ access: c2s
+ shaper: c2s_shaper
+ tls: true
+ certfile: "/etc/ejabberd/server.pem"
+ max_stanza_size: 65536
+ -
+ port: 5269
+ ip: "::"
+ module: ejabberd_s2s_in
+ shaper: s2s_shaper
+ max_stanza_size: 131072
+ -
+ port: 3478
+ transport: udp
+ module: ejabberd_stun
+ -
+ port: 5280
+ module: ejabberd_http
+ http_poll: true
+ -
+ port: 5281
+ ip: "127.0.0.1"
+ module: ejabberd_http
+ web_admin: true
+ http_bind: true
+ tls: true
+ certfile: "/etc/ejabberd/server.pem"
+
+s2s_use_starttls: optional
+s2s_certfile: "/etc/ejabberd/server.pem"
+host_config:
+ "example.com":
+ domain_certfile: "/etc/ejabberd/example_com.pem"
+outgoing_s2s_families:
+ - ipv4
+ - ipv6
+outgoing_s2s_timeout: 10000
\end{verbatim}
In this example, the following configuration defines that:
@@ -1145,59 +1208,117 @@ In this example, the following configuration defines that:
\item The service custom has enabled the special option to avoiding checking the \term{from} attribute in the packets send by this component. The component can send packets in behalf of any users from the server, or even on behalf of any server.
\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, {192, 168, 0, 1}}, ejabberd_c2s, [
- {access, c2s},
- ssl, {certfile, "/path/to/ssl.pem"}
- ]},
- {{5223, {16#fdca, 16#8ab6, 16#a243, 16#75ef, 0, 0, 0, 1}},
- ejabberd_c2s, [
- {access, c2s},
- ssl, {certfile, "/path/to/ssl.pem"}
- ]},
- {5269, ejabberd_s2s_in, []},
- {{5280, {0, 0, 0, 0}}, ejabberd_http, [
- http_poll,
- web_admin
- ]},
- {{5233, {127, 0, 0, 1}}, ejabberd_service, [
- {hosts, ["aim.example.org"],
- [{password, "aimsecret"}]}
- ]},
- {{5233, "::1"}, ejabberd_service, [
- {hosts, ["aim.example.org"],
- [{password, "aimsecret"}]}
- ]},
- {5234, ejabberd_service, [{hosts, ["icq.example.org", "sms.example.org"],
- [{password, "jitsecret"}]}]},
- {5235, ejabberd_service, [{hosts, ["msn.example.org"],
- [{password, "msnsecret"}]}]},
- {5236, ejabberd_service, [{hosts, ["yahoo.example.org"],
- [{password, "yahoosecret"}]}]},
- {5237, ejabberd_service, [{hosts, ["gg.example.org"],
- [{password, "ggsecret"}]}]},
- {5238, ejabberd_service, [{hosts, ["jmc.example.org"],
- [{password, "jmcsecret"}]}]},
- {5239, ejabberd_service, [{hosts, ["custom.example.org"],
- [{password, "customsecret"}]},
- {service_check_from, false}]}
- ]
-}.
-{s2s_use_starttls, required_trusted}.
-{s2s_certfile, "/path/to/ssl.pem"}.
-{s2s_default_policy, deny}.
-{{s2s_host,"jabber.example.org"}, allow}.
-{{s2s_host,"example.com"}, allow}.
+acl:
+ blocked:
+ user: "bad"
+ trusted_servers:
+ server:
+ - "example.com"
+ - "jabber.example.org"
+ xmlrpc_bot:
+ user:
+ - "xmlrpc-robot": "example.org"
+shaper:
+ normal: 1000
+access:
+ c2s:
+ blocked: deny
+ all: allow
+ c2s_shaper:
+ admin: none
+ all: normal
+ xmlrpc_access:
+ xmlrpc_bot: allow
+ s2s_access:
+ trusted_servers: allow
+ all: deny
+s2s_certfile: "/path/to/ssl.pem"
+s2s_policy: s2s_access
+s2s_use_starttls: required_trusted
+listen:
+ -
+ port: 5222
+ module: ejabberd_c2s
+ shaper: c2s_shaper
+ access: c2s
+ -
+ ip: "192.168.0.1"
+ port: 5223
+ module: ejabberd_c2s
+ certfile: "/path/to/ssl.pem"
+ tls: true
+ access: c2s
+ -
+ ip: "FDCA:8AB6:A243:75EF::1"
+ port: 5223
+ module: ejabberd_c2s
+ certfile: "/path/to/ssl.pem"
+ tls: true
+ access: c2s
+ -
+ port: 5269
+ module: ejabberd_s2s_in
+ -
+ port: 5280
+ module: ejabberd_http
+ web_admin: true
+ http_poll: true
+ -
+ port: 4560
+ module: ejabberd_xmlrpc
+ -
+ ip: "127.0.0.1"
+ port: 5233
+ module: ejabberd_service
+ hosts:
+ "aim.example.org":
+ password: "aimsecret"
+ -
+ ip: "::1"
+ port: 5233
+ module: ejabberd_service
+ hosts:
+ "aim.example.org":
+ password: "aimsecret"
+ -
+ port: 5234
+ module: ejabberd_service
+ hosts:
+ "icq.example.org":
+ password: "jitsecret"
+ "sms.example.org":
+ password: "jitsecret"
+ -
+ port: 5235
+ module: ejabberd_service
+ hosts:
+ "msn.example.org":
+ password: "msnsecret"
+ -
+ port: 5236
+ module: ejabberd_service
+ hosts:
+ "yahoo.example.org":
+ password: "yahoosecret"
+ -
+ port: 5237
+ module: ejabberd_service
+ hosts:
+ "gg.example.org":
+ password: "ggsecret"
+ -
+ port: 5238
+ module: ejabberd_service
+ hosts:
+ "jmc.example.org":
+ password: "jmcsecret"
+ -
+ port: 5239
+ module: ejabberd_service
+ service_check_from: false
+ hosts:
+ "custom.example.org":
+ password: "customsecret"
\end{verbatim}
Note, that for services based in \ind{jabberd14}jabberd14 or \ind{WPJabber}WPJabber
you have to make the transports log and do \ind{XDB}XDB by themselves:
@@ -1237,15 +1358,14 @@ you have to make the transports log and do \ind{XDB}XDB by themselves:
The option \option{auth\_method} defines the authentication methods that are used
for user authentication. The syntax is:
-\esyntax{\{auth\_method, [Method, ...]\}.}
+\esyntax{[Method, ...]}
The following authentication methods are supported by \ejabberd{}:
\begin{itemize}
\item internal (default) --- See section~\ref{internalauth}.
\item external --- See section~\ref{extauth}.
\item ldap --- See section~\ref{ldap}.
-\item odbc --- See section~\ref{mysql}, \ref{pgsql},
- \ref{mssql} and \ref{odbc}.
+\item odbc --- See section~\ref{odbc}.
\item anonymous --- See section~\ref{saslanonymous}.
\item pam --- See section~\ref{pam}.
\end{itemize}
@@ -1255,7 +1375,7 @@ Account creation is only supported by internal, external and odbc methods.
The option \option{resource\_conflict} defines the action when a client attempts to
login to an account with a resource that is already connected.
The option syntax is:
-\esyntax{\{resource\_conflict, setresource|closenew|closeold\}.}
+\esyntax{resource\_conflict: setresource|closenew|closeold}
The possible values match exactly the three possibilities described in
\footahref{http://tools.ietf.org/html/rfc6120\#section-7.7.2.2}{XMPP Core: section 7.7.2.2}.
The default value is \term{closeold}.
@@ -1266,7 +1386,7 @@ The option \option{fqdn} allows you to define the Fully Qualified Domain Name
of the machine, in case it isn't detected automatically.
The FQDN is used to authenticate some clients that use the DIGEST-MD5 SASL mechanism.
The option syntax is:
-\esyntax{\{fqdn, undefined|FqdnString|[FqdnString]\}.}
+\esyntax{fqdn: undefined|FqdnString|[FqdnString]}
\makesubsubsection{internalauth}{Internal}
\ind{internal authentication}\ind{Mnesia}
@@ -1274,7 +1394,7 @@ The option syntax is:
\ejabberd{} uses its internal Mnesia database as the default authentication method.
The value \term{internal} will enable the internal authentication method.
-The option \term{\{auth\_password\_format, plain|scram\}}
+The option \term{auth\_password\_format: plain|scram}
defines in what format the users passwords are stored:
\begin{description}
\titem{plain}
@@ -1297,13 +1417,16 @@ Examples:
\item To use internal authentication on \jid{example.org} and LDAP
authentication on \jid{example.net}:
\begin{verbatim}
-{host_config, "example.org", [{auth_method, [internal]}]}.
-{host_config, "example.net", [{auth_method, [ldap]}]}.
+host_config:
+ "example.org":
+ auth_method: [internal]
+ "example.net":
+ auth_method: [ldap]
\end{verbatim}
\item To use internal authentication with hashed passwords on all virtual hosts:
\begin{verbatim}
-{auth_method, internal}.
-{auth_password_format, scram}.
+auth_method: internal
+auth_password_format: scram
\end{verbatim}
\end{itemize}
@@ -1321,15 +1444,15 @@ There are also \footahref{http://www.ejabberd.im/extauth}{several example authen
These are the specific options:
\begin{description}
- \titem{\{extauth\_program, PathToScript\}}
+ \titem{extauth\_program: PathToScript}
Indicate in this option the full path to the external authentication script.
The script must be executable by ejabberd.
- \titem{\{extauth\_instances, Integer\}}
+ \titem{extauth\_instances: Integer}
Indicate how many instances of the script to run simultaneously to serve authentication in the virtual host.
The default value is the minimum number: 1.
- \titem{\{extauth\_cache, false|CacheTimeInteger\}}
+ \titem{extauth\_cache: false|CacheTimeInteger}
The value \term{false} disables the caching feature, this is the default.
The integer \term{0} (zero) enables caching for statistics, but doesn't use that cached information to authenticate users.
If another integer value is set, caching is enabled both for statistics and for authentication:
@@ -1343,10 +1466,10 @@ These are the specific options:
This example sets external authentication, the extauth script, enables caching for 10 minutes,
and starts three instances of the script for each virtual host defined in ejabberd:
\begin{verbatim}
-{auth_method, [external]}.
-{extauth_program, "/etc/ejabberd/JabberAuth.class.php"}.
-{extauth_cache, 600}.
-{extauth_instances, 3}.
+auth_method: [external]
+extauth_program: "/etc/ejabberd/JabberAuth.class.php"
+extauth_cache: 600
+extauth_instances: 3
\end{verbatim}
@@ -1378,13 +1501,13 @@ options. Remember that you can use the \term{host\_config} option to set virtual
host specific options (see section~\ref{virtualhost}).
\begin{description}
-\titem{\{allow\_multiple\_connections, false|true\}} This option is only used
+\titem{allow\_multiple\_connections: false|true} This option is only used
when the anonymous mode is
enabled. Setting it to \term{true} means that the same username can be taken
multiple times in anonymous login mode if different resource are used to
connect. This option is only useful in very special occasions. The default
value is \term{false}.
-\titem{\{anonymous\_protocol, login\_anon | sasl\_anon | both\}}
+\titem{anonymous\_protocol: login\_anon | sasl\_anon | both}
\term{login\_anon} means that the anonymous login method will be used.
\term{sasl\_anon} means that the SASL Anonymous method will be used.
\term{both} means that SASL Anonymous and login anonymous are both enabled.
@@ -1397,34 +1520,48 @@ Examples:
\begin{itemize}
\item To enable anonymous login on all virtual hosts:
\begin{verbatim}
-{auth_method, [anonymous]}.
-{anonymous_protocol, login_anon}.
+auth_method: [anonymous]
+anonymous_protocol: login_anon
\end{verbatim}
\item Similar as previous example, but limited to \jid{public.example.org}:
\begin{verbatim}
-{host_config, "public.example.org", [{auth_method, [anonymous]},
- {anonymous_protocol, login_anon}]}.
+host_config:
+ "public.example.org":
+ auth_method: [anonymous]
+ anonymous_protoco: login_anon
\end{verbatim}
\item To enable anonymous login and internal authentication on a virtual host:
\begin{verbatim}
-{host_config, "public.example.org", [{auth_method, [internal,anonymous]},
- {anonymous_protocol, login_anon}]}.
+host_config:
+ "public.example.org":
+ auth_method:
+ - internal
+ - anonymous
+ anonymous_protocol: login_anon
\end{verbatim}
\item To enable SASL Anonymous on a virtual host:
\begin{verbatim}
-{host_config, "public.example.org", [{auth_method, [anonymous]},
- {anonymous_protocol, sasl_anon}]}.
+host_config:
+ "public.example.org":
+ auth_method: [anonymous]
+ anonymous_protocol: sasl_anon
\end{verbatim}
\item To enable SASL Anonymous and anonymous login on a virtual host:
\begin{verbatim}
-{host_config, "public.example.org", [{auth_method, [anonymous]},
- {anonymous_protocol, both}]}.
+host_config:
+ "public.example.org":
+ auth_method: [anonymous]
+ anonymous_protocol: both
\end{verbatim}
\item To enable SASL Anonymous, anonymous login, and internal authentication on
a virtual host:
\begin{verbatim}
-{host_config, "public.example.org", [{auth_method, [internal,anonymous]},
- {anonymous_protocol, both}]}.
+host_config:
+ "public.example.org":
+ auth_method:
+ - internal
+ - anonymous
+ anonymous_protocol: both
\end{verbatim}
\end{itemize}
@@ -1445,10 +1582,10 @@ PAM authentication is disabled by default, so you have to configure and compile
Options:
\begin{description}
-\titem{\{pam\_service, Name\}}\ind{options!pam\_service}This option defines the PAM service name.
+\titem{pam\_service: Name}\ind{options!pam\_service}This option defines the PAM service name.
Default is \term{"ejabberd"}. Refer to the PAM documentation of your operation system
for more information.
-\titem{\{pam\_userinfotype, username|jid\}}\ind{options!pam\_userinfotype}
+\titem{pam\_userinfotype: username|jid}\ind{options!pam\_userinfotype}
This option defines what type of information about the user ejabberd
provides to the PAM service: only the username, or the user JID.
Default is \term{username}.
@@ -1456,8 +1593,8 @@ Default is \term{username}.
Example:
\begin{verbatim}
-{auth_method, [pam]}.
-{pam_service, "ejabberd"}.
+auth_method: [pam]
+pam_service: "ejabberd"
\end{verbatim}
Though it is quite easy to set up PAM support in \ejabberd{}, PAM itself introduces some
@@ -1506,74 +1643,109 @@ then \term{/etc/nsswitch.conf} must be configured to use \term{winbind} as well.
Access control in \ejabberd{} is performed via Access Control Lists (ACLs). The
declarations of ACLs in the configuration file have the following syntax:
-\esyntax{\{acl, ACLName, ACLValue\}.}
+\esyntax{acl: \{ ACLName: \{ ACLType: ACLValue \} \}}
-\term{ACLValue} can be one of the following:
+\term{ACLType: ACLValue} can be one of the following:
\begin{description}
\titem{all} Matches all JIDs. Example:
\begin{verbatim}
-{acl, all, all}.
+acl:
+ world: all
\end{verbatim}
-\titem{\{user, Username\}} Matches the user with the name
+\titem{user: Username} Matches the user with the name
\term{Username} at the first virtual host. Example:
\begin{verbatim}
-{acl, admin, {user, "yozhik"}}.
+acl:
+ admin:
+ user: "yozhik"
\end{verbatim}
-\titem{\{user, Username, Server\}} Matches the user with the JID
+\titem{user: \{Username: Server\}} Matches the user with the JID
\term{Username@Server} and any resource. Example:
\begin{verbatim}
-{acl, admin, {user, "yozhik", "example.org"}}.
+acl:
+ admin:
+ user:
+ "yozhik": "example.org"
\end{verbatim}
-\titem{\{server, Server\}} Matches any JID from server
+\titem{server: Server} Matches any JID from server
\term{Server}. Example:
\begin{verbatim}
-{acl, exampleorg, {server, "example.org"}}.
+acl:
+ exampleorg:
+ server: "example.org"
\end{verbatim}
-\titem{\{resource, Resource\}} Matches any JID with a resource
+\titem{resource: Resource} Matches any JID with a resource
\term{Resource}. Example:
\begin{verbatim}
-{acl, mucklres, {resource, "muckl"}}.
+acl:
+ mucklres:
+ resource: "muckl"
+\end{verbatim}
+\titem{shared\_group: Groupname} Matches any member of a Shared Roster Group with name \term{Groupname} in the virtual host. Example:
+\begin{verbatim}
+acl:
+ techgroupmembers:
+ shared_group: "techteam"
\end{verbatim}
-\titem{\{shared\_group, Groupname\}} Matches any member of a Shared Roster Group with name \term{Groupname} in the virtual host. Example:
+\titem{shared\_group: \{Groupname: Server\}} Matches any member of a Shared Roster Group with name \term{Groupname} in the virtual host \term{Server}. Example:
\begin{verbatim}
-{acl, techgroupmembers, {shared_group, "techteam"}}.
+acl:
+ techgroupmembers:
+ shared_group:
+ "techteam": "example.org"
\end{verbatim}
-\titem{\{shared\_group, Groupname, Server\}} Matches any member of a Shared Roster Group with name \term{Groupname} in the virtual host \term{Server}. Example:
+\titem{ip: Network} Matches any IP address from the \term{Network}. Example:
\begin{verbatim}
-{acl, techgroupmembers, {shared_group, "techteam", "example.org"}}.
+acl:
+ loopback:
+ ip:
+ - "127.0.0.0/8"
+ - "::"
\end{verbatim}
-\titem{\{user\_regexp, Regexp\}} Matches any local user with a name that
+\titem{user\_regexp: Regexp} Matches any local user with a name that
matches \term{Regexp} on local virtual hosts. Example:
\begin{verbatim}
-{acl, tests, {user_regexp, "^test[0-9]*$"}}.
+acl:
+ tests:
+ user_regexp: "^test[0-9]*$"
\end{verbatim}
%$
-\titem{\{user\_regexp, Regexp, Server\}} Matches any user with a name
+\titem{user\_regexp: \{Regexp: Server\}} Matches any user with a name
that matches \term{Regexp} at server \term{Server}. Example:
\begin{verbatim}
-{acl, tests, {user_regexp, "^test", "example.org"}}.
+acl:
+ tests:
+ user_regexp:
+ "^test": "example.org"
\end{verbatim}
-\titem{\{server\_regexp, Regexp\}} Matches any JID from the server that
+\titem{server\_regexp: Regexp} Matches any JID from the server that
matches \term{Regexp}. Example:
\begin{verbatim}
-{acl, icq, {server_regexp, "^icq\\."}}.
+acl:
+ icq:
+ server_regexp: "^icq\\."
\end{verbatim}
-\titem{\{resource\_regexp, Regexp\}} Matches any JID with a resource that
+\titem{resource\_regexp: Regexp} Matches any JID with a resource that
matches \term{Regexp}. Example:
\begin{verbatim}
-{acl, icq, {resource_regexp, "^laptop\\."}}.
+acl:
+ icq:
+ resource_regexp: "^laptop\\."
\end{verbatim}
-\titem{\{node\_regexp, UserRegexp, ServerRegexp\}} Matches any user
+\titem{node\_regexp: \{UserRegexp: ServerRegexp\}} Matches any user
with a name that matches \term{UserRegexp} at any server that matches
\term{ServerRegexp}. Example:
\begin{verbatim}
-{acl, yozhik, {node_regexp, "^yozhik$", "^example.(com|org)$"}}.
+acl:
+ yozhik:
+ node_regexp:
+ "^yozhik$": "^example.(com|org)$"
\end{verbatim}
-\titem{\{user\_glob, Glob\}}
-\titem{\{user\_glob, Glob, Server\}}
-\titem{\{server\_glob, Glob\}}
-\titem{\{resource\_glob, Glob\}}
-\titem{\{node\_glob, UserGlob, ServerGlob\}} This is the same as
+\titem{user\_glob: Glob\}}
+\titem{user\_glob: \{Glob: Server\}}
+\titem{server\_glob: Glob}
+\titem{resource\_glob: Glob}
+\titem{node\_glob: \{UserGlob: ServerGlob\}} This is the same as
above. However, it uses shell glob patterns instead of regexp. These patterns
can have the following special characters:
\begin{description}
@@ -1597,7 +1769,7 @@ The following \term{ACLName} are pre-defined:
An entry allowing or denying access to different services.
The syntax is:
-\esyntax{\{access, AccessName, [ \{allow|deny, ACLName\}, ...]\}.}
+\esyntax{access: \{ AccessName: \{ ACLName: allow|deny \} \}}
When a JID is checked to have access to \term{Accessname}, the server
sequentially checks if that JID matches any of the ACLs that are named in the
@@ -1612,9 +1784,12 @@ and the Access of a virtual host doesn't have effect.
Example:
\begin{verbatim}
-{access, configure, [{allow, admin}]}.
-{access, something, [{deny, badmans},
- {allow, all}]}.
+access:
+ configure:
+ admin: allow
+ something
+ badmans: deny
+ all: allow
\end{verbatim}
The following \term{AccessName} are pre-defined:
@@ -1635,11 +1810,14 @@ can be either a number, or \term{infinity}. The default value is
\term{infinity}.
The syntax is:
-\esyntax{\{access, max\_user\_sessions, [ \{MaxNumber, ACLName\}, ...]\}.}
+\esyntax{\{ max\_user\_sessions: \{ ACLName: MaxNumber \} \}}
This example limits the number of sessions per user to 5 for all users, and to 10 for admins:
\begin{verbatim}
-{access, max_user_sessions, [{10, admin}, {5, all}]}.
+access:
+ max_user_sessions:
+ admin: 10
+ all: 5
\end{verbatim}
\makesubsubsection{configmaxs2sconns}{Several connections to a remote XMPP server with ACL}
@@ -1651,25 +1829,24 @@ The default value is \term{1}.
There's also available the access \term{max\_s2s\_connections\_per\_node}.
The syntax is:
-\esyntax{\{access, max\_s2s\_connections, [ \{MaxNumber, ACLName\}, ...]\}.}
+\esyntax{\{ max\_s2s\_connections: \{ ACLName: MaxNumber \} \}}
Examples:
\begin{itemize}
\item Allow up to 3 connections with each remote server:
\begin{verbatim}
-{access, max_s2s_connections, [{3, all}]}.
+access:
+ max_s2s_connections:
+ all: 3
\end{verbatim}
\end{itemize}
\makesubsection{shapers}{Shapers}
-\ind{options!shaper}\ind{options!maxrate}\ind{shapers}\ind{maxrate}\ind{traffic speed}
+\ind{options!shaper}\ind{shapers}\ind{traffic speed}
Shapers enable you to limit connection traffic.
The syntax is:
-\esyntax{\{shaper, ShaperName, Kind\}.}
-Currently only one kind of shaper called \term{maxrate} is available. It has the
-following syntax:
-\esyntax{\{maxrate, Rate\}}
+\esyntax{shaper: \{ ShaperName: Rate \}}
where \term{Rate} stands for the maximum allowed incoming rate in bytes per
second.
When a connection exceeds this limit, \ejabberd{} stops reading from the socket
@@ -1680,12 +1857,14 @@ Examples:
\item To define a shaper named `\term{normal}' with traffic speed limited to
1,000\,bytes/second:
\begin{verbatim}
-{shaper, normal, {maxrate, 1000}}.
+shaper:
+ normal: 1000
\end{verbatim}
\item To define a shaper named `\term{fast}' with traffic speed limited to
50,000\,bytes/second:
\begin{verbatim}
-{shaper, fast, {maxrate, 50000}}.
+shaper:
+ fast: 50000
\end{verbatim}
\end{itemize}
@@ -1697,7 +1876,7 @@ can be seen by \XMPP{} clients. If a \XMPP{} client does not support
\option{xml:lang}, the specified language is used.
The option syntax is:
-\esyntax{\{language, Language\}.}
+\esyntax{language: Language}
The default value is \term{en}.
In order to take effect there must be a translation file
@@ -1705,7 +1884,7 @@ In order to take effect there must be a translation file
For example, to set Russian as default language:
\begin{verbatim}
-{language, "ru"}.
+language: "ru"
\end{verbatim}
Appendix \ref{i18ni10n} provides more details about internationalization and localization.
@@ -1723,10 +1902,10 @@ using ImageMagick's Convert program.
The configurable options are:
\begin{description}
- \titem{\{captcha\_cmd, Path\}}
+ \titem{captcha\_cmd: Path}
Full path to a script that generates the image.
The default value disables the feature: \term{undefined}
- \titem{\{captcha\_host, ProtocolHostPort\}}
+ \titem{captcha\_host: ProtocolHostPort}
ProtocolHostPort is a string with the host, and optionally the Protocol and Port number.
It must identify where ejabberd listens for CAPTCHA requests.
The URL sent to the user is formed by: \term{Protocol://Host:Port/captcha/}
@@ -1741,23 +1920,20 @@ See section \ref{listened-module}.
Example configuration:
\begin{verbatim}
-{hosts, ["example.org"]}.
+hosts: ["example.org"]
-{captcha_cmd, "/lib/ejabberd/priv/bin/captcha.sh"}.
-{captcha_host, "example.org:5280"}.
-%% {captcha_host, "https://example.org:443"}.
-%% {captcha_host, "http://example.com"}.
+captcha_cmd: "/lib/ejabberd/priv/bin/captcha.sh"
+captcha_host: "example.org:5280"
+## captcha_host: "https://example.org:443"
+## captcha_host: "http://example.com"
-{listen,
- [
+listen:
+ ...
+ -
+ port: 5280
+ module: ejabberd_http
+ captcha: true
...
- {5280, ejabberd_http, [
- captcha,
- ...
- ]
- }
-
-]}.
\end{verbatim}
\makesubsection{stun}{STUN}
@@ -1777,15 +1953,20 @@ functionality. Feel free to configure \term{udp} transport only.
Example configuration:
\begin{verbatim}
-{listen,
- [
+listen:
...
- {{3478, udp}, ejabberd_stun, []},
- {3478, ejabberd_stun, []},
- {5349, ejabberd_stun, [{certfile, "/etc/ejabberd/server.pem"}]},
+ -
+ port: 3478
+ transport: udp
+ module: ejabberd_stun
+ -
+ port: 3478
+ module: ejabberd_stun
+ -
+ port: 5349
+ module: ejabberd_stun
+ certfile: "/etc/ejabberd/server.pem"
...
- ]
-}.
\end{verbatim}
You also need to configure DNS SRV records properly so clients can easily discover a
@@ -1806,9 +1987,9 @@ _stuns._tcp IN SRV 0 0 5349 stun.example.com.
The option \option{include\_config\_file} in a configuration file instructs \ejabberd{} to include other configuration files immediately.
The basic syntax is:
-\esyntax{\{include\_config\_file, Filename\}.}
+\esyntax{include\_config\_file: [Filename]}
It is possible to specify suboptions using the full syntax:
-\esyntax{\{include\_config\_file, Filename, [Suboption, ...]\}.}
+\esyntax{include\_config\_file: \{ Filename: [Suboption, ...] \}}
The filename can be indicated either as an absolute path,
or relative to the main \ejabberd{} configuration file.
@@ -1817,37 +1998,51 @@ The file must exist and be readable.
The allowed suboptions are:
\begin{description}
- \titem{\{disallow, [Optionname, ...]\}} Disallows the usage of those options in the included configuration file.
+ \titem{disallow: [Optionname, ...]} Disallows the usage of those options in the included configuration file.
The options that match this criteria are not accepted.
The default value is an empty list: \term{[]}
- \titem{\{allow\_only, [Optionname, ...]\}} Allows only the usage of those options in the included configuration file.
+ \titem{allow\_only: [Optionname, ...]} Allows only the usage of those options in the included configuration file.
The options that do not match this criteria are not accepted.
The default value is: \term{all}
\end{description}
This is a basic example:
\begin{verbatim}
-{include_config_file, "/etc/ejabberd/additional.cfg"}.
+include_config_file: "/etc/ejabberd/additional.yml"
\end{verbatim}
In this example, the included file is not allowed to contain a \term{listen} option.
If such an option is present, the option will not be accepted.
The file is in a subdirectory from where the main configuration file is.
\begin{verbatim}
-{include_config_file, "./example.org/additional_not_listen.cfg", [{disallow, [listen]}]}.
+include_config_file:
+ "./example.org/additional_not_listen.yml":
+ disallow: [listen]
\end{verbatim}
-In this example, \term{ejabberd.cfg} defines some ACL and Access rules,
+In this example, \term{ejabberd.yml} defines some ACL and Access rules,
and later includes another file with additional rules:
\begin{verbatim}
-{acl, admin, {user, "admin", "localhost"}}.
-{access, announce, [{allow, admin}]}.
-{include_config_file, "/etc/ejabberd/acl_and_access.cfg", [{allow_only, [acl, access]}]}.
+acl:
+ admin:
+ user:
+ - "admin": "localhost"
+access:
+ announce:
+ admin: allow
+include_config_file:
+ "/etc/ejabberd/acl_and_access.yml":
+ allow_only:
+ - acl
+ - access
\end{verbatim}
-and content of the file \term{acl\_and\_access.cfg} can be, for example:
+and content of the file \term{acl\_and\_access.yml} can be, for example:
\begin{verbatim}
-{acl, admin, {user, "bob", "localhost"}}.
-{acl, admin, {user, "jan", "localhost"}}.
+acl:
+ admin:
+ user:
+ - "bob": "localhost"
+ - "jan": "localhost"
\end{verbatim}
@@ -1859,7 +2054,7 @@ 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:
-\esyntax{\{define\_macro, 'MACRO', Value\}.}
+\esyntax{define\_macro: \{ 'MACRO': Value \}}
The \term{MACRO} must be surrounded by single quotation marks,
and all letters in uppercase; check the examples bellow.
The \term{value} can be any valid arbitrary Erlang term.
@@ -1875,65 +2070,53 @@ are defined in configuration files included before the usage.
It isn't possible to use a macro in the definition
of another macro.
-There are two ways to use a macro:
-\begin{description}
-
- \titem{'MACRO'}
- You can put this instead of a value in an \ejabberd{} option,
- and will be replaced with the \term{value} previously defined.
- If the macro is not defined previously,
- the program will crash and report an error.
-
- \titem{\{use\_macro, 'MACRO', Defaultvalue\}}
- Use a macro even if it may not be defined.
- If the macro is not defined previously,
- the provided \term{defaultvalue} is used.
- This usage behaves as if it were defined and used this way:
-\begin{verbatim}
-{define_macro, 'MACRO', Defaultvalue}.
-'MACRO'
-\end{verbatim}
-
-\end{description}
-
This example shows the basic usage of a macro:
\begin{verbatim}
-{define_macro, 'LOG_LEVEL_NUMBER', 5}.
-{loglevel, 'LOG_LEVEL_NUMBER'}.
+define_macro:
+ 'LOG_LEVEL_NUMBER': 5
+loglevel: 'LOG_LEVEL_NUMBER'
\end{verbatim}
-The resulting option interpreted by \ejabberd{} is: \term{\{loglevel, 5\}}.
+The resulting option interpreted by \ejabberd{} is: \term{loglevel: 5}.
This example shows that values can be any arbitrary Erlang term:
\begin{verbatim}
-{define_macro, 'USERBOB', {user, "bob", "localhost"}}.
-{acl, admin, 'USERBOB'}.
+define_macro:
+ 'USERBOB':
+ user:
+ - "bob": "localhost"
+acl:
+ admin: 'USERBOB'
+\end{verbatim}
+The resulting option interpreted by \ejabberd{} is:
+\begin{verbatim}
+acl:
+ admin:
+ user:
+ - "bob": "localhost"
\end{verbatim}
-The resulting option interpreted by \ejabberd{} is: \term{\{acl, admin, \{user, "bob", "localhost"\}\}}.
-
This complex example:
\begin{verbatim}
-{define_macro, 'NUMBER_PORT_C2S', 5222}.
-{define_macro, 'PORT_S2S_IN', {5269, ejabberd_s2s_in, []}}.
-{listen,
- [
- {'NUMBER_PORT_C2S', ejabberd_c2s, []},
- 'PORT_S2S_IN',
- {{use_macro, 'NUMBER_PORT_HTTP', 5280}, ejabberd_http, []}
- ]
-}.
+define_macro:
+ 'NUMBER_PORT_C2S': 5222
+ 'NUMBER_PORT_HTTP': 5280
+listen:
+ -
+ port: 'NUMBER_PORT_C2S'
+ module: ejabberd_c2s
+ -
+ port: 'NUMBER_PORT_HTTP'
+ module: ejabberd_http
\end{verbatim}
produces this result after being interpreted:
\begin{verbatim}
-{listen,
- [
- {5222, ejabberd_c2s, []},
- {5269, ejabberd_s2s_in, []},
- {5280, ejabberd_http, []}
- ]
-}.
+listen:
+ -
+ port: 5222
+ module: ejabberd_c2s
+ -
+ port: 5280
+ module: ejabberd_http
\end{verbatim}
-
-
\makesection{database}{Database and LDAP Configuration}
\ind{database}
%TODO: this whole section is not yet 100% optimized
@@ -1947,7 +2130,7 @@ different storage systems for modules, and so forth.
The following databases are supported by \ejabberd{}:
\begin{itemize}
-\item \footahref{http://www.microsoft.com/sql/}{Microsoft SQL Server}
+%%\item \footahref{http://www.microsoft.com/sql/}{Microsoft SQL Server}
\item \footahref{http://www.erlang.org/doc/apps/mnesia/index.html}{Mnesia}
\item \footahref{http://www.mysql.com/}{MySQL}
\item \footahref{http://en.wikipedia.org/wiki/Open\_Database\_Connectivity}{Any ODBC compatible database}
@@ -1965,372 +2148,72 @@ The following LDAP servers are tested with \ejabberd{}:
\end{itemize}
Important note about virtual hosting:
-if you define several domains in ejabberd.cfg (see section \ref{hostnames}),
+if you define several domains in ejabberd.yml (see section \ref{hostnames}),
you probably want that each virtual host uses a different configuration of database, authentication and storage,
so that usernames do not conflict and mix between different virtual hosts.
For that purpose, the options described in the next sections
must be set inside a \term{host\_config} for each vhost (see section \ref{virtualhost}).
For example:
\begin{verbatim}
-{host_config, "public.example.org", [
- {odbc_server, {pgsql, "localhost", "database-public-example-org", "ejabberd", "password"}},
- {auth_method, [odbc]}
-]}.
-\end{verbatim}
-
-
-\makesubsection{mysql}{MySQL}
-\ind{MySQL}\ind{MySQL!schema}
-
-There is a file \term{mysql.sql} in the directory \term{odbc}.
-This file contains the \ejabberd{} schema for MySQL. At the end of the file
-you can find information to update your database schema.
-
-
-\makesubsubsection{compilemysql}{Driver Compilation}
-\ind{MySQL!Driver Compilation}
-
-You can skip this step if you installed \ejabberd{} using a binary installer or
-if the binary packages of \ejabberd{} you are using include support for ODBC.
-
-Use \term{--enable-mysql} configure option in order to build \ejabberd{} with
-MySQL support:
-\begin{verbatim}
-./configure --enable-mysql && make install
-\end{verbatim}
-
-
-\makesubsubsection{mysqlcreatedb}{Create MySQL database}
-\ind{MySQL!Create database}
-
-Before starting ejabberd, you need to create an ejabberd database in MySQL.
-This assumes the MySQL server is already installed and you have root access to it.
-
-\begin{enumerate}
-\item Create a new user 'ejabberd':
-\begin{verbatim}
-> mysql -h localhost -p -u root -S /tmp/mysql.sock
-Enter password:
-Welcome to the MySQL monitor. Commands end with ; or \g.
-Your MySQL connection id is 2 to server version: 4.1.16-max
-
-Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
-
-mysql> GRANT ALL ON ejabberd.* TO 'ejabberd'@'localhost'IDENTIFIED BY 'password';
-Query OK, 0 rows affected (0.00 sec)
-\end{verbatim}
-
-\item Create a new database 'ejabberd':
-\begin{verbatim}
-> mysql -h localhost -p -u ejabberd -S /tmp/mysql.sock
-Enter password:
-Welcome to the MySQL monitor. Commands end with ; or \g.
-Your MySQL connection id is 4 to server version: 4.1.16-max
-
-Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
-
-mysql> CREATE DATABASE ejabberd;
-Query OK, 1 row affected (0.00 sec)
-\end{verbatim}
-
-\item Get the MySQL ejabberd schema file, usually called 'mysql.sql',
-that you can find somewhere where ejabberd is installed. At the end
-of the file you can find information to update your database schema.
-
-\item Import ejabberd database schema into the ejabberd database:
-\begin{verbatim}
-> mysql -D ejabberd -h localhost -p -u ejabberd -S /tmp/mysql.sock < mysql.sql
-\end{verbatim}
-
-\item Check that the database structure has been correctly created:
-\begin{verbatim}
-> echo "show tables;" | mysql -D ejabberd -h localhost -p -u ejabberd -S /tmp/mysql.sock
-Tables_in_ejabberd
-last
-privacy_default_list
-privacy_list
-privacy_list_data
-private_storage
-pubsub_item
-pubsub_node
-pubsub_node_option
-pubsub_node_owner
-pubsub_state
-pubsub_subscription_opt
-rostergroups
-rosterusers
-roster_version
-spool
-users
-vcard
-vcard_search
-\end{verbatim}
-
-\end{enumerate}
-
-
-\makesubsubsection{configuremysql}{Database Connection}
-\ind{MySQL!Database Connection}
-
-The actual database access is defined in the option \term{odbc\_server}. Its
-value is used to define if we want to use ODBC, or one of the two native
-interface available, PostgreSQL or MySQL.
-
-To use the native MySQL interface, you can pass a tuple of the following form as
-parameter:
-\esyntax{\{mysql, "Server", "Database", "Username", "Password"\}}
-
-\term{mysql} is a keyword that should be kept as is. For example:
-\esyntax{\{odbc\_server, \{mysql, "localhost", "test", "root", "password"\}\}.}
-
-Optionally, it is possible to define the MySQL port to use. This
-option is only useful, in very rare cases, when you are not running
-MySQL with the default port setting. The \term{mysql} parameter
-can thus take the following form:
-\esyntax{\{mysql, "Server", Port, "Database", "Username", "Password"\}}
-
-The \term{Port} value should be an integer, without quotes. For example:
-\esyntax{\{odbc\_server, \{mysql, "localhost", Port, "test", "root", "password"\}\}.}
-
-By default \ejabberd{} opens 10 connections to the database for each virtual host.
-Use this option to modify the value:
-\begin{verbatim}
-{odbc_pool_size, 10}.
-\end{verbatim}
-
-You can configure an interval to make a dummy SQL request
-to keep alive the connections to the database.
-The default value is 'undefined', so no keepalive requests are made.
-Specify in seconds: for example 28800 means 8 hours.
-\begin{verbatim}
-{odbc_keepalive_interval, undefined}.
-\end{verbatim}
-
-If the connection to the database fails, \ejabberd{} waits 30 seconds before retrying.
-You can modify this interval with this option:
-\begin{verbatim}
-{odbc_start_interval, 30}.
-\end{verbatim}
-
-
-\makesubsubsection{mysqlauth}{Authentication}
-\ind{MySQL!authentication}
-
-The option value name may be misleading, as the \term{auth\_method} name is used
-for access to a relational database through ODBC, as well as through the native
-MySQL interface. Anyway, the first configuration step is to define the odbc
-\term{auth\_method}. For example:
-\begin{verbatim}
-{auth_method, [odbc]}.
-\end{verbatim}
-
-
-\makesubsubsection{mysqlstorage}{Storage}
-\ind{MySQL!storage}
-
-MySQL also can be used to store information into from several \ejabberd{}
-modules. See section~\ref{modoverview} to see which modules can be used with
-relational databases like MySQL. To enable storage to your database, just make
-sure that your database is running well (see previous sections), and add the
-module option \term{\{db\_type, odbc\}}.
-
-
-\makesubsection{mssql}{Microsoft SQL Server}
-\ind{Microsoft SQL Server}\ind{Microsoft SQL Server!schema}
-
-There is a file \term{mssql.sql} in the directory \term{odbc}.
-This file contains the \ejabberd{} schema for Microsoft SQL Server. At the end of the file
-you can find information to update your database schema.
-
-
-\makesubsubsection{compilemssql}{Driver Compilation}
-\ind{Microsoft SQL Server!Driver Compilation}
-
-You can skip this step if you installed \ejabberd{} using a binary installer or
-if the binary packages of \ejabberd{} you are using include support for ODBC.
-
-Use \term{--enable-mssql} configure option in order to build \ejabberd{} with
-Microsoft SQL Server support:
-\begin{verbatim}
-./configure --enable-mssql && make install
-\end{verbatim}
-
-
-\makesubsubsection{configuremssql}{Database Connection}
-\ind{Microsoft SQL Server!Database Connection}
-
-The configuration of Database Connection for a Microsoft SQL Server
-is the same as the configuration for
-ODBC compatible servers (see section~\ref{configureodbc}).
-
-
-\begin{enumerate}
-\item Install Microsoft SQL Server 2000.
-
-\item Open "SQL Server Enterprise Manager" to create and setup the database. Create a new database called 'ejabberd'.
-
-\item Use the "Query Analyzer" tool to run the database creation script.
-
-\item Create an ODBC datasource (from "Config Panel" -> "Data source (ODBC)"). The new ODBC datasource can be named ejabberd.
-
-\item Modify the config file to use your newly created MSSQL database:
-The configuration of Authentication for a Microsoft SQL Server
-is the same as the configuration for ODBC compatible servers (see section~\ref{odbcauth}).
-\begin{verbatim}
-% Comment Internal Authentication:
-%{auth_method, internal}.
-% Define ODBC authentication:
-{auth_method, odbc}.
-{odbc_server, "DSN=ejabberd;UID=sa;PWD=nimda"}.
-Start ejabberd (from the "Start" menu, and from the console try creating a new user:
-(ejabberd@home-68006dc09b)2> ejabberd_auth:try_register("admin", "localhost", "nimda").
-{atomic,ok}
-\end{verbatim}
-
-\item Try connecting from a Jabber client, with your newly connected user.
-
-\item Check that the newly created user has been correctly added to your database using the MSSQL "Query Analyzer":
-\begin{verbatim}
-select * from [dbo].[users];
-\end{verbatim}
-
-\item Modify the config file to enable odbc storage in the modules you want.
-See section~\ref{modoverview} to see which modules can be used with
-relational databases like MySQL. To enable storage to your database, just make
-sure that your database is running well (see previous sections), and add the
-module option \term{\{db\_type, odbc\}}.
-
-\item Restart ejabberd
-\end{enumerate}
-
-
-\makesubsection{pgsql}{PostgreSQL}
-\ind{PostgreSQL}\ind{PostgreSQL!schema}
-
-There is a file \term{pg.sql} in the directory \term{odbc}.
-This file contains the \ejabberd{} schema for PostgreSQL. At the end of the file
-you can find information to update your database schema.
-
-
-\makesubsubsection{compilepgsql}{Driver Compilation}
-\ind{PostgreSQL!Driver Compilation}
-
-You can skip this step if you installed \ejabberd{} using a binary installer or
-if the binary packages of \ejabberd{} you are using include support for
-PostgreSQL.
-
-Use \term{--enable-pgsql} configure option in order to build \ejabberd{} with
-PostgreSQL support:
-\begin{verbatim}
-./configure --enable-pgsql && make install
-\end{verbatim}
-
-\makesubsubsection{pgsqlcreatedb}{Create PostgreSQL database}
-\ind{PgSQL!Create database}
-
-Before starting ejabberd, you need to create an ejabberd database in your PostgreSQL database.
-
-
-\makesubsubsection{configurepgsql}{Database Connection}
-\ind{PostgreSQL!Database Connection}
-
-The actual database access is defined in the option \term{odbc\_server}. Its
-value is used to define if we want to use ODBC, or one of the two native
-interface available, PostgreSQL or MySQL.
-
-To use the native PostgreSQL interface, you can pass a tuple of the following
-form as parameter:
-\esyntax{\{pgsql, "Server", "Database", "Username", "Password"\}}
-
-\term{pgsql} is a keyword that should be kept as is. For example:
-\esyntax{\{odbc\_server, \{pgsql, "localhost", "database", "ejabberd", "password"\}\}.}
-
-Optionally, it is possible to define the PostgreSQL port to use. This
-option is only useful, in very rare cases, when you are not running
-PostgreSQL with the default port setting. The \term{pgsql} parameter
-can thus take the following form:
-\esyntax{\{pgsql, "Server", Port, "Database", "Username", "Password"\}}
-
-The \term{Port} value should be an integer, without quotes. For example:
-\esyntax{\{odbc\_server, \{pgsql, "localhost", 5432, "database", "ejabberd", "password"\}\}.}
-
-By default \ejabberd{} opens 10 connections to the database for each virtual host.
-Use this option to modify the value:
-\begin{verbatim}
-{odbc_pool_size, 10}.
-\end{verbatim}
-
-You can configure an interval to make a dummy SQL request
-to keep alive the connections to the database.
-The default value is 'undefined', so no keepalive requests are made.
-Specify in seconds: for example 28800 means 8 hours.
-\begin{verbatim}
-{odbc_keepalive_interval, undefined}.
-\end{verbatim}
-
-
-\makesubsubsection{pgsqlauth}{Authentication}
-\ind{PostgreSQL!authentication}
-
-The option value name may be misleading, as the \term{auth\_method} name is used
-for access to a relational database through ODBC, as well as through the native
-PostgreSQL interface. Anyway, the first configuration step is to define the odbc
-\term{auth\_method}. For example:
-\begin{verbatim}
-{auth_method, [odbc]}.
+host_config:
+ "public.example.org":
+ odbc_type: pgsql
+ odbc_server: "localhost"
+ odbc_database: "database-public-example-org"
+ odbc_username: "ejabberd"
+ odbc_password: "password"
+ auth_method: [odbc]
\end{verbatim}
-\makesubsubsection{pgsqlstorage}{Storage}
-\ind{PostgreSQL!storage}
-
-PostgreSQL also can be used to store information into from several \ejabberd{}
-modules. See section~\ref{modoverview} to see which modules can be used with
-relational databases like MySQL. To enable storage to your database, just make
-sure that your database is running well (see previous sections), and add the
-module option \term{\{db\_type, odbc\}}.
-
-\makesubsection{odbc}{ODBC Compatible}
-\ind{databases!ODBC}
+\makesubsection{odbc}{ODBC}\ind{odbc}
-\makesubsubsection{configureodbc}{Database Connection}
-\ind{ODBC!Database Connection}
-
-The actual database access is defined in the option \term{odbc\_server}. Its
-value is used to defined if we want to use ODBC, or one of the two native
+The actual database access is defined in the options with \term{odbc\_} prefix. The
+values are used to define if we want to use ODBC, or one of the two native
interface available, PostgreSQL or MySQL.
-To use a relational database through ODBC, you can pass the ODBC connection
-string as \term{odbc\_server} parameter. For example:
-\begin{verbatim}
-{odbc_server, "DSN=database;UID=ejabberd;PWD=password"}.
-\end{verbatim}
-
-By default \ejabberd{} opens 10 connections to the database for each virtual host.
-Use this option to modify the value:
-\begin{verbatim}
-{odbc_pool_size, 10}.
-\end{verbatim}
+The following paramaters are available:
+\begin{description}
+ \titem{odbc\_type: mysql | pgsql | odbc} The type of an ODBC connection.
+ The default is \term{odbc}.
+ \titem{odbc\_server: String} A hostname of the ODBC server. The default is
+ \term{``localhost''}.
+ \titem{odbc\_port: Port} The port where the ODBC server is accepting connections.
+ The option is only valid for \term{mysql} and \term{pgsql}. The default is
+ \term{3306} and \term{5432} respectively.
+ \titem{odbc\_database: String} The database name. The default is \term{``ejabberd''}.
+ The option is only valid for \term{mysql} and \term{pgsql}.
+ \titem{odbc\_username: String} The username. The default is \term{``ejabberd''}.
+ The option is only valid for \term{mysql} and \term{pgsql}.
+ \titem{odbc\_password: String} The password. The default is empty string.
+ The option is only valid for \term{mysql} and \term{pgsql}.
+ \titem{odbc\_pool\_size: N} By default \ejabberd{} opens 10 connections to
+ the database for each virtual host. You can change this number by using this option.
+ \titem{odbc\_keepalive\_interval: N} You can configure an interval to
+ make a dummy SQL request to keep alive the connections to the database.
+ The default value is 'undefined', so no keepalive requests are made.
+ Specify in seconds: for example 28800 means 8 hours.
+ \titem{odbc\_start\_interval: N} If the connection to the database fails,
+ \ejabberd{} waits 30 seconds before retrying.
+ You can modify this interval with this option.
+\end{description}
-You can configure an interval to make a dummy SQL request
-to keep alive the connections to the database.
-The default value is 'undefined', so no keepalive requests are made.
-Specify in seconds: for example 28800 means 8 hours.
+Example of plain ODBC connection:
\begin{verbatim}
-{odbc_keepalive_interval, undefined}.
+odbc_server: "DSN=database;UID=ejabberd;PWD=password"
\end{verbatim}
-
-\makesubsubsection{odbcauth}{Authentication}
-\ind{ODBC!authentication}
-
-The first configuration step is to define the odbc \term{auth\_method}. For
-example:
+Example of MySQL connection:
\begin{verbatim}
-{auth_method, [odbc]}.
+odbc_type: mysql
+odbc_server: "server.company.com"
+odbc_port: 3306 # the default
+odbc_database: "mydb"
+odbc_username: "user1"
+odbc_password: "**********"
+odbc_pool_size: 5
\end{verbatim}
-
\makesubsubsection{odbcstorage}{Storage}
\ind{ODBC!storage}
@@ -2339,7 +2222,7 @@ several \ejabberd{}
modules. See section~\ref{modoverview} to see which modules can be used with
relational databases like MySQL. To enable storage to your database, just make
sure that your database is running well (see previous sections), and add the
-module option \term{\{db\_type, odbc\}}.
+module option \term{db\_type: odbc}.
\makesubsection{ldap}{LDAP}
\ind{databases!LDAP}
@@ -2362,47 +2245,48 @@ one for authentication and other for regular calls.
Parameters:
\begin{description}
-\titem{\{ldap\_servers, [Servers, ...]\}} \ind{options!ldap\_server}List of IP addresses or DNS names of your
+\titem{ldap\_servers: [Servers, ...]} \ind{options!ldap\_server}List of IP addresses or DNS names of your
LDAP servers. This option is required.
-\titem{\{ldap\_encrypt, none|tls\}} \ind{options!ldap\_encrypt}Type of connection encryption to the LDAP server.
+\titem{ldap\_encrypt: none|tls} \ind{options!ldap\_encrypt}Type of connection encryption to the LDAP server.
Allowed values are: \term{none}, \term{tls}.
The value \term{tls} enables encryption by using LDAP over SSL.
Note that STARTTLS encryption is not supported.
The default value is: \term{none}.
-\titem{\{ldap\_tls\_verify, false|soft|hard\}} \ind{options!ldap\_tls\_verify}
+\titem{ldap\_tls\_verify: false|soft|hard} \ind{options!ldap\_tls\_verify}
This option specifies whether to verify LDAP server certificate or not when TLS is enabled.
When \term{hard} is enabled \ejabberd{} doesn't proceed if a certificate is invalid.
When \term{soft} is enabled \ejabberd{} proceeds even if check fails.
The default is \term{false} which means no checks are performed.
-\titem{\{ldap\_tls\_cacertfile, Path\}} \ind{options!ldap\_tls\_cacertfile}
+\titem{ldap\_tls\_cacertfile: Path} \ind{options!ldap\_tls\_cacertfile}
Path to file containing PEM encoded CA certificates. This option is needed
(and required) when TLS verification is enabled.
-\titem{\{ldap\_tls\_depth, Number\}} \ind{options!ldap\_tls\_depth}
+\titem{ldap\_tls\_depth: Number} \ind{options!ldap\_tls\_depth}
Specifies the maximum verification depth when TLS verification is enabled,
i.e. how far in a chain of certificates the verification process can proceed
before the verification is considered to fail.
Peer certificate = 0, CA certificate = 1, higher level CA certificate = 2, etc.
The value 2 thus means that a chain can at most contain peer cert,
CA cert, next CA cert, and an additional CA cert. The default value is 1.
-\titem{\{ldap\_port, Number\}} \ind{options!ldap\_port}Port to connect to your LDAP server.
+\titem{ldap\_port: Number} \ind{options!ldap\_port}Port to connect to your LDAP server.
The default port is~389 if encryption is disabled; and 636 if encryption is enabled.
If you configure a value, it is stored in \ejabberd{}'s database.
Then, if you remove that value from the configuration file,
the value previously stored in the database will be used instead of the default port.
-\titem{\{ldap\_rootdn, RootDN\}} \ind{options!ldap\_rootdn}Bind DN. The default value
+\titem{ldap\_rootdn: RootDN} \ind{options!ldap\_rootdn}Bind DN. The default value
is~\term{""} which means `anonymous connection'.
-\titem{\{ldap\_password, Password\}} \ind{options!ldap\_password}Bind password. The default
+\titem{ldap\_password: Password} \ind{options!ldap\_password}Bind password. The default
value is \term{""}.
-\titem{\{ldap\_deref\_aliases, never|always|finding|searching\}} \ind{options!ldap\_deref\_aliases} Whether or not to dereference aliases. The default is \term{never}.
+\titem{ldap\_deref\_aliases: never|always|finding|searching} \ind{options!ldap\_deref\_aliases} Whether or not to dereference aliases. The default is \term{never}.
\end{description}
Example:
\begin{verbatim}
-{auth_method, ldap}.
-{ldap_servers, ["ldap.example.org"]}.
-{ldap_port, 389}.
-{ldap_rootdn, "cn=Manager,dc=domain,dc=org"}.
-{ldap_password, "secret"}.
+auth_method: [ldap]
+ldap_servers:
+ - "ldap1.example.org"
+ldap_port: 389
+ldap_rootdn: "cn=Manager,dc=domain,dc=org"
+ldap_password: "**********"
\end{verbatim}
\makesubsubsection{ldapauth}{Authentication}
@@ -2413,9 +2297,9 @@ Note that current LDAP implementation does not support SASL authentication.
Available options are:
\begin{description}
-\titem{\{ldap\_base, Base\}}\ind{options!ldap\_base}LDAP base directory which stores
+\titem{ldap\_base: Base}\ind{options!ldap\_base}LDAP base directory which stores
users accounts. This option is required.
- \titem{\{ldap\_uids, [ \{ldap\_uidattr\} | \{ldap\_uidattr, ldap\_uidattr\_format\}, ...]\}}\ind{options!ldap\_uids}
+ \titem{ldap\_uids: [ ldap\_uidattr | \{ldap\_uidattr: ldap\_uidattr\_format\} ]}\ind{options!ldap\_uids}
LDAP attribute which holds a list of attributes to use as alternatives for getting the JID.
The default attributes are \term{[\{"uid", "\%u"\}]}.
The attributes are of the form:
@@ -2432,7 +2316,7 @@ Available options are:
user's part of a JID. For example, \term{"\%u@example.org"}. The default
value is \term{"\%u"}.
\end{description}
- \titem{\{ldap\_filter, Filter\}}\ind{options!ldap\_filter}\ind{protocols!RFC 4515:
+ \titem{ldap\_filter: Filter}\ind{options!ldap\_filter}\ind{protocols!RFC 4515:
LDAP String Representation of Search Filters}
\footahref{http://tools.ietf.org/html/rfc4515}{RFC 4515} LDAP filter. The
default Filter value is: \term{undefined}. Example:
@@ -2440,7 +2324,7 @@ Available options are:
not forget to close brackets and do not use superfluous whitespaces. Also you
\emph{must not} use \option{ldap\_uidattr} attribute in filter because this
attribute will be substituted in LDAP filter automatically.
- \titem{\{ldap\_dn\_filter, \{ Filter, FilterAttrs \}\}}\ind{options!ldap\_dn\_filter}
+ \titem{ldap\_dn\_filter: \{ Filter: FilterAttrs \}}\ind{options!ldap\_dn\_filter}
This filter is applied on the results returned by the main filter. This filter
performs additional LDAP lookup to make the complete result. This is useful
when you are unable to define all filter rules in \term{ldap\_filter}. You
@@ -2452,7 +2336,8 @@ Available options are:
\term{ldap\_dn\_filter} is undefined.
Example:
\begin{verbatim}
-{ldap_dn_filter, {"(&(name=%s)(owner=%D)(user=%u@%d))", ["sn"]}}.
+ldap_dn_filter:
+ "(&(name=%s)(owner=%D)(user=%u@%d))": ["sn"]
\end{verbatim}
Since this filter makes additional LDAP lookups, use it only in the
last resort: try to define all filter rules in \term{ldap\_filter} if possible.
@@ -2485,19 +2370,19 @@ and using the custom port 6123.
Corresponding authentication section should looks like this:
\begin{verbatim}
-%% Authentication method
-{auth_method, ldap}.
-%% DNS name of our LDAP server
-{ldap_servers, ["ldap.example.org"]}.
-%% Bind to LDAP server as "cn=Manager,dc=example,dc=org" with password "secret"
-{ldap_rootdn, "cn=Manager,dc=example,dc=org"}.
-{ldap_password, "secret"}.
-{ldap_encrypt, tls}.
-{ldap_port, 6123}.
-%% Define the user's base
-{ldap_base, "ou=Users,dc=example,dc=org"}.
-%% We want to authorize users from 'shadowAccount' object class only
-{ldap_filter, "(objectClass=shadowAccount)"}.
+## Authentication method
+auth_method: [ldap]
+## DNS name of our LDAP server
+ldap_servers: ["ldap.example.org"]
+## Bind to LDAP server as "cn=Manager,dc=example,dc=org" with password "secret"
+ldap_rootdn: "cn=Manager,dc=example,dc=org"
+ldap_password: "secret"
+ldap_encrypt: tls
+ldap_port: 6123
+## Define the user's base
+ldap_base: "ou=Users,dc=example,dc=org"
+## We want to authorize users from 'shadowAccount' object class only
+ldap_filter: "(objectClass=shadowAccount)"
\end{verbatim}
Now we want to use users LDAP-info as their vCards. We have four attributes
@@ -2506,48 +2391,45 @@ defined in our LDAP schema: \term{"mail"} --- email address, \term{"givenName"}
Also we want users to search each other. Let's see how we can set it up:
\begin{verbatim}
-{modules,
- [
+modules:
...
- {mod_vcard_ldap,
- [
- %% We use the same server and port, but want to bind anonymously because
- %% our LDAP server accepts anonymous requests to
- %% "ou=AddressBook,dc=example,dc=org" subtree.
- {ldap_rootdn, ""},
- {ldap_password, ""},
- %% define the addressbook's base
- {ldap_base, "ou=AddressBook,dc=example,dc=org"},
- %% uidattr: user's part of JID is located in the "mail" attribute
- %% uidattr_format: common format for our emails
- {ldap_uids, [{"mail", "%u@mail.example.org"}]},
- %% We have to define empty filter here, because entries in addressbook does not
- %% belong to shadowAccount object class
- {ldap_filter, ""},
- %% Now we want to define vCard pattern
- {ldap_vcard_map,
- [{"NICKNAME", "%u", []}, % just use user's part of JID as his nickname
- {"GIVEN", "%s", ["givenName"]},
- {"FAMILY", "%s", ["sn"]},
- {"FN", "%s, %s", ["sn", "givenName"]}, % example: "Smith, John"
- {"EMAIL", "%s", ["mail"]},
- {"BDAY", "%s", ["birthDay"]}]},
- %% Search form
- {ldap_search_fields,
- [{"User", "%u"},
- {"Name", "givenName"},
- {"Family Name", "sn"},
- {"Email", "mail"},
- {"Birthday", "birthDay"}]},
- %% vCard fields to be reported
- %% Note that JID is always returned with search results
- {ldap_search_reported,
- [{"Full Name", "FN"},
- {"Nickname", "NICKNAME"},
- {"Birthday", "BDAY"}]}
- ]},
+ mod_vcard_ldap:
+ ## We use the same server and port, but want to bind anonymously because
+ ## our LDAP server accepts anonymous requests to
+ ## "ou=AddressBook,dc=example,dc=org" subtree.
+ ldap_rootdn: ""
+ ldap_password: ""
+ ## define the addressbook's base
+ ldap_base: "ou=AddressBook,dc=example,dc=org"
+ ## uidattr: user's part of JID is located in the "mail" attribute
+ ## uidattr_format: common format for our emails
+ ldap_uids:
+ "mail": "%u@mail.example.org"
+ ## We have to define empty filter here, because entries in addressbook does not
+ ## belong to shadowAccount object class
+ ldap_filter: ""
+ ## Now we want to define vCard pattern
+ ldap_vcard_map:
+ "NICKNAME": {"%u": []} # just use user's part of JID as his nickname
+ "GIVEN": {"%s": ["givenName"]}
+ "FAMILY": {"%s": ["sn"]}
+ "FN": {"%s, %s": ["sn", "givenName"]}, # example: "Smith, John"
+ "EMAIL": {"%s": ["mail"]}
+ "BDAY": {"%s": ["birthDay"]}]}
+ ## Search form
+ ldap_search_fields:
+ "User": "%u"
+ "Name": "givenName"
+ "Family Name": "sn"
+ "Email": "mail"
+ "Birthday": "birthDay"
+ ## vCard fields to be reported
+ ## Note that JID is always returned with search results
+ ldap_search_reported:
+ "Full Name": "FN"
+ "Nickname": "NICKNAME"
+ "Birthday": "BDAY"
...
- ]}.
\end{verbatim}
Note that \modvcardldap{} module checks for the existence of the user before
@@ -2561,53 +2443,50 @@ Active Directory is just an LDAP-server with predefined attributes. A sample
configuration is shown below:
\begin{verbatim}
-{auth_method, ldap}.
-{ldap_servers, ["office.org"]}. % List of LDAP servers
-{ldap_base, "DC=office,DC=org"}. % Search base of LDAP directory
-{ldap_rootdn, "CN=Administrator,CN=Users,DC=office,DC=org"}. % LDAP manager
-{ldap_password, "*******"}. % Password to LDAP manager
-{ldap_uids, [{"sAMAccountName"}]}.
-{ldap_filter, "(memberOf=*)"}.
+auth_method: [ldap]
+ldap_servers: ["office.org"] # List of LDAP servers
+ldap_base: "DC=office,DC=org" # Search base of LDAP directory
+ldap_rootdn: "CN=Administrator,CN=Users,DC=office,DC=org" # LDAP manager
+ldap_password: "*******" # Password to LDAP manager
+ldap_uids: ["sAMAccountName"]
+ldap_filter: "(memberOf=*)"
-{modules,
- [
+modules:
...
- {mod_vcard_ldap,
- [{ldap_vcard_map,
- [{"NICKNAME", "%u", []},
- {"GIVEN", "%s", ["givenName"]},
- {"MIDDLE", "%s", ["initials"]},
- {"FAMILY", "%s", ["sn"]},
- {"FN", "%s", ["displayName"]},
- {"EMAIL", "%s", ["mail"]},
- {"ORGNAME", "%s", ["company"]},
- {"ORGUNIT", "%s", ["department"]},
- {"CTRY", "%s", ["c"]},
- {"LOCALITY", "%s", ["l"]},
- {"STREET", "%s", ["streetAddress"]},
- {"REGION", "%s", ["st"]},
- {"PCODE", "%s", ["postalCode"]},
- {"TITLE", "%s", ["title"]},
- {"URL", "%s", ["wWWHomePage"]},
- {"DESC", "%s", ["description"]},
- {"TEL", "%s", ["telephoneNumber"]}]},
- {ldap_search_fields,
- [{"User", "%u"},
- {"Name", "givenName"},
- {"Family Name", "sn"},
- {"Email", "mail"},
- {"Company", "company"},
- {"Department", "department"},
- {"Role", "title"},
- {"Description", "description"},
- {"Phone", "telephoneNumber"}]},
- {ldap_search_reported,
- [{"Full Name", "FN"},
- {"Nickname", "NICKNAME"},
- {"Email", "EMAIL"}]}
- ]},
+ mod_vcard_ldap:
+ ldap_vcard_map:
+ "NICKNAME": {"%u", []}
+ "GIVEN": {"%s", ["givenName"]}
+ "MIDDLE": {"%s", ["initials"]}
+ "FAMILY": {"%s", ["sn"]}
+ "FN": {"%s", ["displayName"]}
+ "EMAIL": {"%s", ["mail"]}
+ "ORGNAME": {"%s", ["company"]}
+ "ORGUNIT": {"%s", ["department"]}
+ "CTRY": {"%s", ["c"]}
+ "LOCALITY": {"%s", ["l"]}
+ "STREET": {"%s", ["streetAddress"]}
+ "REGION": {"%s", ["st"]}
+ "PCODE": {"%s", ["postalCode"]}
+ "TITLE": {"%s", ["title"]}
+ "URL": {"%s", ["wWWHomePage"]}
+ "DESC": {"%s", ["description"]}
+ "TEL": {"%s", ["telephoneNumber"]}]}
+ ldap_search_fields:
+ "User": "%u"
+ "Name": "givenName"
+ "Family Name": "sn"
+ "Email": "mail"
+ "Company": "company"
+ "Department": "department"
+ "Role": "title"
+ "Description": "description"
+ "Phone": "telephoneNumber"
+ ldap_search_reported:
+ "Full Name": "FN"
+ "Nickname": "NICKNAME"
+ "Email": "EMAIL"
...
- ]}.
\end{verbatim}
@@ -2620,28 +2499,24 @@ element is the name of a module and the second is a list of options for that
module.
The syntax is:
-\esyntax{\{modules, [ \{ModuleName, ModuleOptions\}, ...]\}.}
+\esyntax{modules: \{ ModuleName: ModuleOptions \}}
Examples:
\begin{itemize}
\item In this example only the module \modecho{} is loaded and no module
options are specified between the square brackets:
\begin{verbatim}
-{modules,
- [
- {mod_echo, []}
- ]}.
+modules:
+ mod_echo: {}
\end{verbatim}
\item In the second example the modules \modecho{}, \modtime{}, and
\modversion{} are loaded without options. Remark that, besides the last entry,
all entries end with a comma:
\begin{verbatim}
-{modules,
- [
- {mod_echo, []},
- {mod_time, []},
- {mod_version, []}
- ]}.
+modules:
+ mod_echo: {}
+ mod_time: {}
+ mod_version: {}
\end{verbatim}
\end{itemize}
@@ -2725,7 +2600,7 @@ to this server or to a user (e.\,g.\ to \jid{example.org} or to
these queries.
The syntax is:
-\esyntax{\{iqdisc, Value\}}
+\esyntax{iqdisc: Value}
Possible \term{Value} are:
\begin{description}
@@ -2738,7 +2613,7 @@ Possible \term{Value} are:
of IQ queries of a namespace with this discipline. In addition, the processing
of this queue is done in parallel with that of other packets. This discipline
is most recommended.
-\titem{\{queues, N\}} N separate queues are created to process the
+\titem{N} N separate queues are created to process the
queries. The queries are thus processed in parallel, but in a
controlled way.
\titem{parallel} For every packet with this discipline a separate Erlang process
@@ -2750,12 +2625,11 @@ Possible \term{Value} are:
Example:
\begin{verbatim}
-{modules,
- [
+modules:
...
- {mod_time, [{iqdisc, no_queue}]},
+ mod_time:
+ iqdisc: no_queue
...
- ]}.
\end{verbatim}
\makesubsubsection{modhostoption}{\option{host}}
@@ -2764,7 +2638,7 @@ Example:
This option defines the Jabber ID of a service provided by an \ejabberd{} module.
The syntax is:
-\esyntax{\{host, HostName\}}
+\esyntax{host: HostName}
If you include the keyword "@HOST@" in the HostName,
it is replaced at start time with the real virtual host string.
@@ -2773,23 +2647,21 @@ This example configures
the \ind{modules!\modecho{}}echo module to provide its echoing service
in the Jabber ID \jid{mirror.example.org}:
\begin{verbatim}
-{modules,
- [
+modules:
...
- {mod_echo, [{host, "mirror.example.org"}]},
+ mod_echo:
+ host: "mirror.example.org"
...
- ]}.
\end{verbatim}
However, if there are several virtual hosts and this module is enabled in all of them,
the "@HOST@" keyword must be used:
\begin{verbatim}
-{modules,
- [
+modules:
...
- {mod_echo, [{host, "mirror.@HOST@"}]},
+ mod_echo:
+ host: "mirror.@HOST@"
...
- ]}.
\end{verbatim}
\makesubsection{modannounce}{\modannounce{}}
@@ -2832,7 +2704,7 @@ hosts in ejabberd.
Options:
\begin{description}
\dbtype
-\titem{\{access, AccessName\}} \ind{options!access}This option specifies who is allowed to
+\titem{access: AccessName} \ind{options!access}This option specifies who is allowed to
send announcements and to set the message of the day (by default, nobody is
able to send such messages).
\end{description}
@@ -2841,32 +2713,38 @@ Examples:
\begin{itemize}
\item Only administrators can send announcements:
\begin{verbatim}
-{access, announce, [{allow, admin}]}.
+access:
+ announce:
+ admin: allow
-{modules,
- [
+modules:
...
- {mod_adhoc, []},
- {mod_announce, [{access, announce}]},
+ mod_adhoc: {}
+ mod_announce:
+ access: announce
...
- ]}.
\end{verbatim}
\item Administrators as well as the direction can send announcements:
\begin{verbatim}
-{acl, direction, {user, "big_boss", "example.org"}}.
-{acl, direction, {user, "assistant", "example.org"}}.
-{acl, admin, {user, "admin", "example.org"}}.
-
-{access, announce, [{allow, admin},
- {allow, direction}]}.
-
-{modules,
- [
+acl:
+ direction:
+ user:
+ "big_boss": "example.org"
+ "assistant": "example.org"
+ admin:
+ user:
+ "admin": "example.org"
+access:
+ announce:
+ admin: allow
+ direction: allow
+
+modules:
...
- {mod_adhoc, []},
- {mod_announce, [{access, announce}]},
+ mod_adhoc: {}
+ mod_announce:
+ access: announce
...
- ]}.
\end{verbatim}
\end{itemize}
@@ -2893,72 +2771,80 @@ Options:
\begin{description}
\iqdiscitem{Service Discovery (\ns{http://jabber.org/protocol/disco\#items} and
\ns{http://jabber.org/protocol/disco\#info})}
-\titem{\{extra\_domains, [Domain, ...]\}} \ind{options!extra\_domains}With this option,
+\titem{extra\_domains: [Domain, ...]} \ind{options!extra\_domains}With this option,
you can specify a list of extra domains that are added to the Service Discovery item list.
-\titem{\{server\_info, [ \{Modules, Field, [Value, ...]\}, ... ]\}} \ind{options!server\_info}
+\titem{server\_info: [ \{ modules: Modules, name: Name, urls: [URL, ...] \} ]} \ind{options!server\_info}
Specify additional information about the server,
as described in Contact Addresses for XMPP Services (\xepref{0157}).
\term{Modules} can be the keyword `all',
in which case the information is reported in all the services;
or a list of \ejabberd{} modules,
in which case the information is only specified for the services provided by those modules.
- Any arbitrary \term{Field} and \term{Value} can be specified, not only contact addresses.
+ Any arbitrary \term{Name} and \term{URL} can be specified, not only contact addresses.
\end{description}
Examples:
\begin{itemize}
\item To serve a link to the Jabber User Directory on \jid{jabber.org}:
\begin{verbatim}
-{modules,
- [
+modules:
...
- {mod_disco, [{extra_domains, ["users.jabber.org"]}]},
+ mod_disco:
+ extra_domains: ["users.jabber.org"]
...
- ]}.
\end{verbatim}
\item To serve a link to the transports on another server:
\begin{verbatim}
-{modules,
- [
+modules:
...
- {mod_disco, [{extra_domains, ["icq.example.com",
- "msn.example.com"]}]},
+ mod_disco:
+ extra_domains:
+ - "icq.example.com"
+ - "msn.example.com"
...
- ]}.
\end{verbatim}
\item To serve a link to a few friendly servers:
\begin{verbatim}
-{modules,
- [
+modules:
...
- {mod_disco, [{extra_domains, ["example.org",
- "example.com"]}]},
+ mod_disco:
+ extra_domains:
+ - "example.org"
+ - "example.com"
...
- ]}.
\end{verbatim}
\item With this configuration, all services show abuse addresses,
feedback address on the main server,
and admin addresses for both the main server and the vJUD service:
\begin{verbatim}
-{modules,
- [
+modules:
...
- {mod_disco, [{server_info, [
- {all,
- "abuse-addresses",
- ["mailto:abuse@shakespeare.lit"]},
- {[mod_muc],
- "Web chatroom logs",
- ["http://www.example.org/muc-logs"]},
- {[mod_disco],
- "feedback-addresses",
- ["http://shakespeare.lit/feedback.php", "mailto:feedback@shakespeare.lit", "xmpp:feedback@shakespeare.lit"]},
- {[mod_disco, mod_vcard],
- "admin-addresses",
- ["mailto:xmpp@shakespeare.lit", "xmpp:admins@shakespeare.lit"]}
- ]}]},
+ mod_disco:
+ server_info:
+ -
+ modules: all
+ name: "abuse-addresses"
+ urls: ["mailto:abuse@shakespeare.lit"]
+ -
+ modules: [mod_muc]
+ name: "Web chatroom logs"
+ urls: ["http://www.example.org/muc-logs"]
+ -
+ modules: [mod_disco]
+ name: "feedback-addresses"
+ urls:
+ - "http://shakespeare.lit/feedback.php"
+ - "mailto:feedback@shakespeare.lit"
+ - "xmpp:feedback@shakespeare.lit"
+ -
+ modules:
+ - mod_disco
+ - mod_vcard
+ name: "admin-addresses"
+ urls:
+ - "mailto:xmpp@shakespeare.lit"
+ - "xmpp:admins@shakespeare.lit"
...
- ]}.
\end{verbatim}
\end{itemize}
@@ -2977,12 +2863,11 @@ Options:
Example: Mirror, mirror, on the wall, who is the most beautiful
of them all?
\begin{verbatim}
-{modules,
- [
+modules:
...
- {mod_echo, [{host, "mirror.example.org"}]},
+ mod_echo:
+ host: "mirror.example.org"
...
- ]}.
\end{verbatim}
\makesubsection{modhttpbind}{\modhttpbind{}}
@@ -2995,26 +2880,22 @@ resource at which this service will be hosted.
To use HTTP-Binding, enable the module:
\begin{verbatim}
-{modules,
- [
+modules:
...
- {mod_http_bind, []},
+ mod_http_bind: {}
...
-]}.
\end{verbatim}
and add \verb|http_bind| in the HTTP service. For example:
\begin{verbatim}
-{listen,
- [
+listen:
...
- {5280, ejabberd_http, [
- http_bind,
- http_poll,
- web_admin
- ]
- },
+ -
+ port: 5280
+ module: ejabberd_http
+ http_bind: true
+ http_poll: true
+ web_admin: true
...
-]}.
\end{verbatim}
With this configuration, the module will serve the requests sent to
\verb|http://example.org:5280/http-bind/|
@@ -3025,17 +2906,16 @@ If you want to set the service in a different URI path or use a different module
you can configure it manually using the option \verb|request_handlers|.
For example:
\begin{verbatim}
-{listen,
- [
+listen:
...
- {5280, ejabberd_http, [
- {request_handlers, [{["http-bind"], mod_http_bind}]},
- http_poll,
- web_admin
- ]
- },
+ -
+ port: 5280
+ module: ejabberd_http
+ request_handlers:
+ "/http-bind": mod_http_bind
+ http_poll: true
+ web_admin: true
...
-]}.
\end{verbatim}
Options:
@@ -3045,12 +2925,11 @@ Options:
Default value is 30 seconds.
For example, to set 50 seconds:
\begin{verbatim}
-{modules,
- [
+modules:
...
- {mod_http_bind, [ {max_inactivity, 50} ]},
+ mod_http_bind:
+ max_inactivity: 50
...
-]}.
\end{verbatim}
\end{description}
@@ -3062,25 +2941,25 @@ This simple module serves files from the local disk over HTTP.
Options:
\begin{description}
- \titem{\{docroot, Path\}} \ind{options!docroot}
+ \titem{docroot: Path} \ind{options!docroot}
Directory to serve the files.
- \titem{\{accesslog, Path\}} \ind{options!accesslog}
+ \titem{accesslog: Path} \ind{options!accesslog}
File to log accesses using an Apache-like format.
No log will be recorded if this option is not specified.
- \titem{\{directory\_indices, [Index, ...]\}} \ind{options!directoryindices}
+ \titem{directory\_indices: [Index, ...]} \ind{options!directoryindices}
Indicate one or more directory index files, similarly to Apache's
DirectoryIndex variable. When a web request hits a directory
instead of a regular file, those directory indices are looked in
order, and the first one found is returned.
- \titem{\{custom\_headers, [ \{Name, Value\}, ...]\}} \ind{options!customheaders}
+ \titem{custom\_headers: \{Name: Value\}} \ind{options!customheaders}
Indicate custom HTTP headers to be included in all responses.
Default value is: \term{[]}
- \titem{\{content\_types, [ \{Name, Type\}, ...]\}} \ind{options!contenttypes}
+ \titem{content\_types: \{Name: Type\}} \ind{options!contenttypes}
Specify mappings of extension to content type.
There are several content types already defined,
with this option you can add new definitions, modify or delete existing ones.
To delete an existing definition, simply define it with a value: `undefined'.
- \titem{\{default\_content\_type, Type\}} \ind{options!defaultcontenttype}
+ \titem{default\_content\_type: Type} \ind{options!defaultcontenttype}
Specify the content type to use for unknown extensions.
Default value is `application/octet-stream'.
\end{description}
@@ -3092,44 +2971,36 @@ In this example a new content type \term{ogg} is defined,
\term{png} is redefined, and \term{jpg} definition is deleted.
To use this module you must enable it:
\begin{verbatim}
-{modules,
- [
+modules:
...
- {mod_http_fileserver, [
- {docroot, "/var/www"},
- {accesslog, "/var/log/ejabberd/access.log"},
- {directory_indices, ["index.html", "main.htm"]},
- {custom_headers, [{"X-Powered-By", "Erlang/OTP"},
- {"X-Fry", "It's a widely-believed fact!"}
- ]},
- {content_types, [{".ogg", "audio/ogg"},
- {".png", "image/png"},
- {".jpg", undefined}
- ]},
- {default_content_type, "text/html"}
- ]
- },
+ mod_http_fileserver:
+ docroot: "/var/www"
+ accesslog: "/var/log/ejabberd/access.log"
+ directory_indices:
+ - "index.html"
+ - "main.htm"
+ custom_headers:
+ "X-Powered-By": "Erlang/OTP"
+ "X-Fry": "It's a widely-believed fact!"
+ content_types:
+ ".ogg": "audio/ogg"
+ ".png": "image/png"
+ ".jpg": undefined
+ default_content_type: "text/html"
...
-]}.
\end{verbatim}
And define it as a handler in the HTTP service:
\begin{verbatim}
-{listen,
- [
+listen:
...
- {5280, ejabberd_http, [
- ...
- {request_handlers, [
- ...
- {["pub", "archive"], mod_http_fileserver},
- ...
- ]
- },
- ...
- ]
- },
+ -
+ port: 5280
+ module: ejabberd_http
+ request_handlers:
+ ...
+ "/pub/archive": mod_http_fileserver
+ ...
...
-]}.
\end{verbatim}
\makesubsection{modirc}{\modirc{}}
@@ -3163,9 +3034,9 @@ Options:
\begin{description}
\hostitem{irc}
\dbtype
-\titem{\{access, AccessName\}} \ind{options!access}This option can be used to specify who
+\titem{access: AccessName} \ind{options!access}This option can be used to specify who
may use the IRC transport (default value: \term{all}).
-\titem{\{default\_encoding, Encoding\}} \ind{options!defaultencoding}Set the default IRC encoding.
+\titem{default\_encoding: Encoding} \ind{options!defaultencoding}Set the default IRC encoding.
Default value: \term{"iso8859-1"}
\end{description}
@@ -3175,30 +3046,35 @@ Examples:
virtual host(s) with the prefix `\jid{irc.}'. Furthermore, anyone is
able to use the transport. The default encoding is set to "iso8859-15".
\begin{verbatim}
-{modules,
- [
+modules:
...
- {mod_irc, [{access, all}, {default_encoding, "iso8859-15"}]},
+ mod_irc:
+ access: all
+ default_encoding: "iso8859-15"
...
- ]}.
\end{verbatim}
\item In next example the IRC transport is available with JIDs with prefix \jid{irc-t.net}.
Moreover, the transport is only accessible to two users
of \term{example.org}, and any user of \term{example.com}:
\begin{verbatim}
-{acl, paying_customers, {user, "customer1", "example.org"}}.
-{acl, paying_customers, {user, "customer2", "example.org"}}.
-{acl, paying_customers, {server, "example.com"}}.
+acl:
+ paying_customers:
+ user:
+ - "customer1": "example.org"
+ - "customer2": "example.org"
+ server: "example.com"
-{access, irc_users, [{allow, paying_customers}, {deny, all}]}.
+access:
+ irc_users:
+ paying_customers: allow
+ all: deny
-{modules,
- [
+modules:
...
- {mod_irc, [{access, irc_users},
- {host, "irc.example.net"}]},
+ mod_irc:
+ access: irc_users
+ host: "irc.example.net"
...
- ]}.
\end{verbatim}
\end{itemize}
@@ -3249,15 +3125,15 @@ Module options:
\begin{description}
\hostitem{conference}
\dbtype
-\titem{\{access, AccessName\}} \ind{options!access}You can specify who is allowed to use
+\titem{access: AccessName} \ind{options!access}You can specify who is allowed to use
the Multi-User Chat service. By default everyone is allowed to use it.
-\titem{\{access\_create, AccessName\}} \ind{options!access\_create}To configure who is
+\titem{access\_create: AccessName} \ind{options!access\_create}To configure who is
allowed to create new rooms at the Multi-User Chat service, this option can be used.
By default any account in the local ejabberd server is allowed to create rooms.
-\titem{\{access\_persistent, AccessName\}} \ind{options!access\_persistent}To configure who is
+\titem{access\_persistent: AccessName} \ind{options!access\_persistent}To configure who is
allowed to modify the 'persistent' room option.
By default any account in the local ejabberd server is allowed to modify that option.
-\titem{\{access\_admin, AccessName\}} \ind{options!access\_admin}This option specifies
+\titem{access\_admin: AccessName} \ind{options!access\_admin}This option specifies
who is allowed to administrate the Multi-User Chat service. The default
value is \term{none}, which means that only the room creator can
administer his room.
@@ -3265,7 +3141,7 @@ Module options:
and it will be shown in all active rooms as a service message.
The administrators can send a groupchat message to the JID of an active room,
and the message will be shown in the room as a service message.
-\titem{\{history\_size, Size\}} \ind{options!history\_size}A small history of
+\titem{history\_size: Size} \ind{options!history\_size}A small history of
the current discussion is sent to users when they enter the
room. With this option you can define the number of history messages
to keep and send to users joining the room. The value is an
@@ -3273,35 +3149,35 @@ Module options:
and, as a result, nothing is kept in memory. The default value is
\term{20}. This value is global and thus affects all rooms on the
service.
-\titem{\{max\_users, Number\}} \ind{options!max\_users} This option defines at
+\titem{max\_users: Number} \ind{options!max\_users} This option defines at
the service level, the maximum number of users allowed per
room. It can be lowered in each room configuration but cannot be
increased in individual room configuration. The default value is
200.
-\titem{\{max\_users\_admin\_threshold, Number\}}
+\titem{max\_users\_admin\_threshold: Number}
\ind{options!max\_users\_admin\_threshold} This option defines the
number of service admins or room owners allowed to enter the room when
the maximum number of allowed occupants was reached. The default limit
is 5.
-\titem{\{max\_user\_conferences, Number\}}
+\titem{max\_user\_conferences: Number}
\ind{options!max\_user\_conferences} This option defines the maximum
number of rooms that any given user can join. The default value
is 10. This option is used to prevent possible abuses. Note that
this is a soft limit: some users can sometimes join more conferences
in cluster configurations.
-\titem{\{max\_room\_id, Number\}} \ind{options!max\_room\_id}
+\titem{max\_room\_id: Number} \ind{options!max\_room\_id}
This option defines the maximum number of characters that Room ID
can have when creating a new room.
The default value is to not limit: infinite.
-\titem{\{max\_room\_name, Number\}} \ind{options!max\_room\_name}
+\titem{max\_room\_name: Number} \ind{options!max\_room\_name}
This option defines the maximum number of characters that Room Name
can have when configuring the room.
The default value is to not limit: infinite.
-\titem{\{max\_room\_desc, Number\}} \ind{options!max\_room\_desc}
+\titem{max\_room\_desc: Number} \ind{options!max\_room\_desc}
This option defines the maximum number of characters that Room Description
can have when configuring the room.
The default value is to not limit: infinite.
-\titem{\{min\_message\_interval, Number\}} \ind{options!min\_message\_interval}
+\titem{min\_message\_interval: Number} \ind{options!min\_message\_interval}
This option defines the minimum interval between two messages send
by an occupant in seconds. This option is global and valid for all
rooms. A decimal value can be used. When this option is not defined,
@@ -3311,7 +3187,7 @@ Module options:
interval is 0.4 second. If an occupant tries to send messages faster, an
error is send back explaining that the message has been discarded
and describing the reason why the message is not acceptable.
-\titem{\{min\_presence\_interval, Number\}}
+\titem{min\_presence\_interval: Number}
\ind{options!min\_presence\_interval} This option defines the
minimum of time between presence changes coming from a given occupant in
seconds. This option is global and valid for all rooms. A
@@ -3323,41 +3199,41 @@ Module options:
broadcasted to all occupants in the room after expiration of the
interval delay. Intermediate presence packets are silently
discarded. A good value for this option is 4 seconds.
-\titem{\{default\_room\_options, [ \{OptionName, OptionValue\}, ...]\}} \ind{options!default\_room\_options}
+\titem{default\_room\_options: \{OptionName: OptionValue\}} \ind{options!default\_room\_options}
This module option allows to define the desired default room options.
Note that the creator of a room can modify the options of his room
at any time using an XMPP client with MUC capability.
The available room options and the default values are:
\begin{description}
- \titem{\{allow\_change\_subj, true|false\}} Allow occupants to change the subject.
- \titem{\{allow\_private\_messages, true|false\}} Occupants can send private messages to other occupants.
- \titem{\{allow\_private\_messages\_from\_visitors, anyone|moderators|nobody\}} Visitors can send private messages to other occupants.
- \titem{\{allow\_query\_users, true|false\}} Occupants can send IQ queries to other occupants.
- \titem{\{allow\_user\_invites, false|true\}} Allow occupants to send invitations.
- \titem{\{allow\_visitor\_nickchange, true|false\}} Allow visitors to
+ \titem{allow\_change\_subj: true|false} Allow occupants to change the subject.
+ \titem{allow\_private\_messages: true|false} Occupants can send private messages to other occupants.
+ \titem{allow\_private\_messages\_from\_visitors: anyone|moderators|nobody} Visitors can send private messages to other occupants.
+ \titem{allow\_query\_users: true|false} Occupants can send IQ queries to other occupants.
+ \titem{allow\_user\_invites: false|true} Allow occupants to send invitations.
+ \titem{allow\_visitor\_nickchange: true|false} Allow visitors to
change nickname.
- \titem{\{allow\_visitor\_status, true|false\}} Allow visitors to send
+ \titem{allow\_visitor\_status: true|false} Allow visitors to send
status text in presence updates. If disallowed, the \term{status}
text is stripped before broadcasting the presence update to all
the room occupants.
- \titem{\{anonymous, true|false\}} The room is anonymous:
+ \titem{anonymous: true|false} The room is anonymous:
occupants don't see the real JIDs of other occupants.
Note that the room moderators can always see the real JIDs of the occupants.
- \titem{\{captcha\_protected, false\}}
+ \titem{captcha\_protected: false}
When a user tries to join a room where he has no affiliation (not owner, admin or member),
the room requires him to fill a CAPTCHA challenge (see section \ref{captcha})
in order to accept her join in the room.
- \titem{\{logging, false|true\}} The public messages are logged using \term{mod\_muc\_log}.
- \titem{\{max\_users, 200\}} Maximum number of occupants in the room.
- \titem{\{members\_by\_default, true|false\}} The occupants that enter the room are participants by default, so they have 'voice'.
- \titem{\{members\_only, false|true\}} Only members of the room can enter.
- \titem{\{moderated, true|false\}} Only occupants with 'voice' can send public messages.
- \titem{\{password, "roompass123"\}} Password of the room. You may want to enable the next option too.
- \titem{\{password\_protected, false|true\}} The password is required to enter the room.
- \titem{\{persistent, false|true\}} The room persists even if the last participant leaves.
- \titem{\{public, true|false\}} The room is public in the list of the MUC service, so it can be discovered.
- \titem{\{public\_list, true|false\}} The list of participants is public, without requiring to enter the room.
- \titem{\{title, "Room Title"\}} A human-readable title of the room.
+ \titem{logging: false|true} The public messages are logged using \term{mod\_muc\_log}.
+ \titem{max\_users: 200} Maximum number of occupants in the room.
+ \titem{members\_by\_default: true|false} The occupants that enter the room are participants by default, so they have 'voice'.
+ \titem{members\_only: false|true} Only members of the room can enter.
+ \titem{moderated: true|false} Only occupants with 'voice' can send public messages.
+ \titem{password: "roompass123"} Password of the room. You may want to enable the next option too.
+ \titem{password\_protected: false|true} The password is required to enter the room.
+ \titem{persistent: false|true} The room persists even if the last participant leaves.
+ \titem{public: true|false} The room is public in the list of the MUC service, so it can be discovered.
+ \titem{public\_list: true|false} The list of participants is public, without requiring to enter the room.
+ \titem{title: "Room Title"} A human-readable title of the room.
\end{description}
All of those room options can be set to \term{true} or \term{false},
except \term{password} and \term{title} which are strings,
@@ -3376,19 +3252,23 @@ Examples:
it will be displayed in all active rooms. In this example the history
feature is disabled.
\begin{verbatim}
-{acl, admin, {user, "admin", "example.org"}}.
+acl:
+ admin:
+ user:
+ - "admin": "example.org"
-{access, muc_admin, [{allow, admin}]}.
+access:
+ muc_admin:
+ admin: allow
-{modules,
- [
+modules:
...
- {mod_muc, [{access, all},
- {access_create, all},
- {access_admin, muc_admin},
- {history_size, 0}]},
+ mod_muc:
+ access: all
+ access_create: all
+ access_admin: muc_admin
+ history_size: 0
...
- ]}.
\end{verbatim}
\item In the second example the Multi-User Chat service is only accessible by
paying customers registered on our domains and on other servers. Of course
@@ -3401,25 +3281,32 @@ Examples:
\term{history\_size} option is used, this means that the feature is enabled
and the default value of 20 history messages will be send to the users.
\begin{verbatim}
-{acl, paying_customers, {user, "customer1", "example.net"}}.
-{acl, paying_customers, {user, "customer2", "example.com"}}.
-{acl, paying_customers, {user, "customer3", "example.org"}}.
-{acl, admin, {user, "admin", "example.org"}}.
-
-{access, muc_admin, [{allow, admin},
- {deny, all}]}.
-{access, muc_access, [{allow, paying_customers},
- {allow, admin},
- {deny, all}]}.
-
-{modules,
- [
+acl:
+ paying_customers:
+ user:
+ - "customer1": "example.net"
+ - "customer2": "example.com"
+ - "customer3": "example.org"
+ admin:
+ user:
+ - "admin": "example.org"
+
+access:
+ muc_admin
+ admin: allow
+ all: deny
+ muc_access:
+ paying_customers: allow
+ admin: allow
+ all: deny
+
+modules:
...
- {mod_muc, [{access, muc_access},
- {access_create, muc_admin},
- {access_admin, muc_admin}]},
+ mod_muc:
+ access: muc_access
+ access_create: muc_admin
+ access_admin: muc_admin
...
- ]}.
\end{verbatim}
\item In the following example, MUC anti abuse options are used. An
@@ -3430,38 +3317,34 @@ and Room Description to 300 characters. No ACLs are
defined, but some user restriction could be added as well:
\begin{verbatim}
-{modules,
- [
+modules:
...
- {mod_muc, [{min_message_interval, 0.4},
- {min_presence_interval, 4},
- {max_room_id, 20},
- {max_room_name, 20},
- {max_room_desc, 300}]},
+ mod_muc:
+ min_message_interval: 0.4
+ min_presence_interval: 4
+ max_room_id: 20
+ max_room_name: 20
+ max_room_desc: 300
...
- ]}.
\end{verbatim}
\item This example shows how to use \option{default\_room\_options} to make sure
the newly created rooms have by default those options.
\begin{verbatim}
-{modules,
- [
+modules:
...
- {mod_muc, [{access, muc_access},
- {access_create, muc_admin},
- {default_room_options,
- [
- {allow_change_subj, false},
- {allow_query_users, true},
- {allow_private_messages, true},
- {members_by_default, false},
- {title, "New chatroom"},
- {anonymous, false}
- ]},
- {access_admin, muc_admin}]},
+ mod_muc:
+ access: muc_access
+ access_create: muc_admin
+ default_room_options:
+ allow_change_subj: false
+ allow_query_users: true
+ allow_private_messages: true
+ members_by_default: false
+ title: "New chatroom"
+ anonymous: false
+ access_admin: muc_admin
...
- ]}.
\end{verbatim}
\end{itemize}
@@ -3494,54 +3377,54 @@ Features:
Options:
\begin{description}
-\titem{\{access\_log, AccessName\}}\ind{options!access\_log}
+\titem{access\_log: AccessName}\ind{options!access\_log}
This option restricts which occupants are allowed to enable or disable room
logging. The default value is \term{muc\_admin}. Note for this default setting
you need to have an access rule for \term{muc\_admin} in order to take effect.
-\titem{\{cssfile, false|URL\}}\ind{options!cssfile}
+\titem{cssfile: false|URL}\ind{options!cssfile}
With this option you can set whether the HTML files should have a custom CSS
file or if they need to use the embedded CSS file. Allowed values are
\term{false} and an URL to a CSS file. With the first value, HTML files will
include the embedded CSS code. With the latter, you can specify the URL of the
custom CSS file (for example: \term{"http://example.com/my.css"}). The default value
is \term{false}.
-\titem{\{dirname, room\_jid|room\_name\}}\ind{options!dirname}
+\titem{dirname: room\_jid|room\_name}\ind{options!dirname}
Allows to configure the name of the room directory.
Allowed values are \term{room\_jid} and \term{room\_name}.
With the first value, the room directory name will be the full room JID.
With the latter, the room directory name will be only the room name,
not including the MUC service name.
The default value is \term{room\_jid}.
-\titem{\{dirtype, subdirs|plain\}}\ind{options!dirtype}
+\titem{dirtype: subdirs|plain}\ind{options!dirtype}
The type of the created directories can be specified with this option. Allowed
values are \term{subdirs} and \term{plain}. With the first value,
subdirectories are created for each year and month. With the latter, the
names of the log files contain the full date, and there are no subdirectories.
The default value is \term{subdirs}.
-\titem{\{file\_format, html|plaintext\}}\ind{options!file\_format}
+\titem{file\_format: html|plaintext}\ind{options!file\_format}
Define the format of the log files:
\term{html} stores in HTML format,
\term{plaintext} stores in plain text.
The default value is \term{html}.
-\titem{\{file\_permissions, \{Mode, Group\}\}}\ind{options!file\_permissions}
+\titem{file\_permissions: \{mode: Mode, group: Group\}}\ind{options!file\_permissions}
Define the permissions that must be used when creating the log files:
the number of the mode, and the numeric id of the group that will own the files.
The default value is \term{\{644, 33\}}.
-\titem{\{outdir, Path\}}\ind{options!outdir}
+\titem{outdir: Path}\ind{options!outdir}
This option sets the full path to the directory in which the HTML files should
be stored. Make sure the \ejabberd{} daemon user has write access on that
directory. The default value is \term{"www/muc"}.
-\titem{\{spam\_prevention true|false\}}\ind{options!spam\_prevention}
+\titem{spam\_prevention: true|false}\ind{options!spam\_prevention}
To prevent spam, the \term{spam\_prevention} option adds a special attribute
to links that prevent their indexation by search engines. The default value
is \term{true}, which mean that nofollow attributes will be added to user
submitted links.
-\titem{\{timezone, local|universal\}}\ind{options!timezone}
+\titem{timezone: local|universal}\ind{options!timezone}
The time zone for the logs is configurable with this option. Allowed values
are \term{local} and \term{universal}. With the first value, the local time,
as reported to Erlang by the operating system, will be used. With the latter,
GMT/UTC time will be used. The default value is \term{local}.
-\titem{\{top\_link, \{URL, Text\}\}}\ind{options!top\_link}
+\titem{top\_link: \{URL: Text\}}\ind{options!top\_link}
With this option you can customize the link on the top right corner of each
log file. The default value is \term{\{"/", "Home"\}}.
\end{description}
@@ -3555,23 +3438,23 @@ Examples:
time zone will be GMT/UTC. Finally, the top link will be
\verb|<a href="http://www.jabber.ru/">Jabber.ru</a>|.
\begin{verbatim}
-{access, muc, [{allow, all}]}.
+access:
+ muc:
+ all: allow
-{modules,
- [
+modules:
...
- {mod_muc_log, [
- {access_log, muc},
- {cssfile, "http://example.com/my.css"},
- {dirtype, plain},
- {dirname, room_jid},
- {outdir, "/var/www/muclogs"},
- {timezone, universal},
- {spam_prevention, true},
- {top_link, {"http://www.jabber.ru/", "Jabber.ru"}}
- ]},
+ mod_muc_log:
+ access_log: muc
+ cssfile: "http://example.com/my.css"
+ dirtype: plain
+ dirname: room_jid
+ outdir: "/var/www/muclogs"
+ timezone: universal
+ spam_prevention: true
+ top_link:
+ "http://www.jabber.ru/": "Jabber.ru"
...
- ]}.
\end{verbatim}
\item In the second example only \jid{admin1@example.org} and
\jid{admin2@example.net} can enable logging, and the embedded CSS file will be
@@ -3580,26 +3463,28 @@ Examples:
be stored in /var/www/muclogs, and the local time will be used. Finally, the
top link will be the default \verb|<a href="/">Home</a>|.
\begin{verbatim}
-{acl, admin, {user, "admin1", "example.org"}}.
-{acl, admin, {user, "admin2", "example.net"}}.
-
-{access, muc_log, [{allow, admin},
- {deny, all}]}.
-
-{modules,
- [
+acl:
+ admin:
+ user:
+ - "admin1": "example.org"
+ - "admin2": "example.net"
+access:
+ muc_log:
+ admin: allow
+ all: deny
+
+modules:
...
- {mod_muc_log, [
- {access_log, muc_log},
- {cssfile, false},
- {dirtype, subdirs},
- {dirtype, subdirs},
- {file_permissions, {644, 33}},
- {outdir, "/var/www/muclogs"},
- {timezone, local}
- ]},
+ mod_muc_log:
+ access_log: muc_log
+ cssfile: false
+ dirtype: subdirs
+ file_permissions:
+ mode: 644
+ group: 33
+ outdir: "/var/www/muclogs"
+ timezone: local
...
- ]}.
\end{verbatim}
\end{itemize}
@@ -3615,7 +3500,7 @@ online again. Thus it is very similar to how email works. Note that
\begin{description}
\dbtype
- \titem{\{access\_max\_user\_messages, AccessName\}}\ind{options!access\_max\_user\_messages}
+ \titem{access\_max\_user\_messages: AccessName}\ind{options!access\_max\_user\_messages}
This option defines which access rule will be enforced to limit
the maximum number of offline messages that a user can have (quota).
When a user has too many offline messages, any new messages that he receive are discarded,
@@ -3629,19 +3514,27 @@ This example allows power users to have as much as 5000 offline messages,
administrators up to 2000,
and all the other users up to 100.
\begin{verbatim}
-{acl, admin, {user, "admin1", "localhost"}}.
-{acl, admin, {user, "admin2", "example.org"}}.
-{acl, poweruser, {user, "bob", "example.org"}}.
-{acl, poweruser, {user, "jane", "example.org"}}.
-
-{access, max_user_offline_messages, [ {5000, poweruser}, {2000, admin}, {100, all} ]}.
-
-{modules,
- [
+acl:
+ admin:
+ user:
+ - "admin1": "localhost"
+ - "admin2": "example.org"
+ poweruser:
+ user:
+ - "bob": "example.org"
+ - "jane": "example.org"
+
+access:
+ max_user_offline_messages:
+ poweruser: 5000
+ admin: 2000
+ all: 100
+
+modules:
...
- {mod_offline, [ {access_max_user_messages, max_user_offline_messages} ]},
+ mod_offline:
+ access_max_user_messages: max_user_offline_messages
...
- ]}.
\end{verbatim}
\makesubsection{modping}{\modping{}}
@@ -3653,18 +3546,18 @@ ping requests, as defined in the protocol.
Configuration options:
\begin{description}
- \titem{\{send\_pings, true|false\}}\ind{options!send\_pings}
+ \titem{send\_pings: true|false}\ind{options!send\_pings}
If this option is set to \term{true}, the server sends pings to connected clients
that are not active in a given interval \term{ping\_interval}.
This is useful to keep client connections alive or checking availability.
By default this option is disabled.
% because it is mostly not needed and consumes resources.
- \titem{\{ping\_interval, Seconds\}}\ind{options!ping\_interval}
+ \titem{ping\_interval: Seconds}\ind{options!ping\_interval}
How often to send pings to connected clients, if the previous option is enabled.
If a client connection does not send or receive any stanza in this interval,
a ping request is sent to the client.
The default value is 60 seconds.
- \titem{\{timeout\_action, none|kill\}}\ind{options!timeout\_action}
+ \titem{timeout\_action: none|kill}\ind{options!timeout\_action}
What to do when a client does not answer to a server ping request in less than 32 seconds.
% Those 32 seconds are defined in ejabberd_local.erl: -define(IQ_TIMEOUT, 32000).
The default is to do nothing.
@@ -3674,12 +3567,13 @@ This example enables Ping responses, configures the module to send pings
to client connections that are inactive for 4 minutes,
and if a client does not answer to the ping in less than 32 seconds, its connection is closed:
\begin{verbatim}
-{modules,
- [
+modules:
...
- {mod_ping, [{send_pings, true}, {ping_interval, 240}, {timeout_action, kill}]},
+ mod_ping:
+ send_pings: true
+ ping_interval: 240
+ timeout_action: kill
...
- ]}.
\end{verbatim}
\makesubsection{modprescounter}{\modprescounter{}}
@@ -3691,7 +3585,7 @@ the exceeding stanzas are silently dropped, and warning is logged.
Configuration options:
\begin{description}
- \titem{\{count, StanzaNumber\}}\ind{options!count}
+ \titem{count: StanzaNumber}\ind{options!count}
The number of subscription presence stanzas
(subscribe, unsubscribe, subscribed, unsubscribed)
allowed for any direction (input or output)
@@ -3699,7 +3593,7 @@ Configuration options:
Please note that two users subscribing to each other usually generate
4 stanzas, so the recommended value is 4 or more.
The default value is: 5.
- \titem{\{interval, Seconds\}}\ind{options!interval}
+ \titem{interval: Seconds}\ind{options!interval}
The time interval defined in seconds.
The default value is 60.
\end{description}
@@ -3707,12 +3601,12 @@ Configuration options:
This example enables the module, and allows up to 5 presence subscription stanzas
to be sent or received by the users in 60 seconds:
\begin{verbatim}
-{modules,
- [
+modules:
...
- {mod_pres_counter, [{count, 5}, {interval, 60}]},
+ mod_pres_counter:
+ count: 5
+ interval: 60
...
- ]}.
\end{verbatim}
\makesubsection{modprivacy}{\modprivacy{}}
@@ -3775,27 +3669,27 @@ XMPP clients.
Options:
\begin{description}
\hostitem{proxy}
-\titem{\{name, Text\}}\ind{options!name}Defines Service Discovery name of the service.
+\titem{name: Text}\ind{options!name}Defines Service Discovery name of the service.
Default is \term{"SOCKS5 Bytestreams"}.
-\titem{\{ip, IPTuple\}}\ind{options!ip}This option specifies which network interface
+\titem{ip: IP}\ind{options!ip}This option specifies which network interface
to listen for. Default is an IP address of the service's DNS name, or,
-if fails, \verb|{127,0,0,1}|.
-\titem{\{port, Number\}}\ind{options!port}This option defines port to listen for
+if fails, \verb|"127.0.0.1"|.
+\titem{port: Number}\ind{options!port}This option defines port to listen for
incoming connections. Default is~7777.
-\titem{\{hostname, HostName\}}\ind{options!hostname}Defines a hostname advertised
+\titem{hostname: HostName}\ind{options!hostname}Defines a hostname advertised
by the service when establishing a session with clients. This is useful when
you run the service behind a NAT. The default is the value of \term{ip} option.
Examples: \term{"proxy.mydomain.org"}, \term{"200.150.100.50"}. Note that
not all clients understand domain names in stream negotiation,
so you should think twice before setting domain name in this option.
-\titem{\{auth\_type, anonymous|plain\}}\ind{options!auth\_type}SOCKS5 authentication type.
+\titem{auth\_type: anonymous|plain}\ind{options!auth\_type}SOCKS5 authentication type.
Possible values are \term{anonymous} and \term{plain}. Default is
\term{anonymous}.
-\titem{\{access, AccessName\}}\ind{options!access}Defines ACL for file transfer initiators.
+\titem{access: AccessName}\ind{options!access}Defines ACL for file transfer initiators.
Default is \term{all}.
-\titem{\{max\_connections, Number\}}\ind{options!max\_connections}Maximum number of
+\titem{max\_connections: Number}\ind{options!max\_connections}Maximum number of
active connections per file transfer initiator. No limit by default.
-\titem{\{shaper, none|ShaperName\}}\ind{options!shaper}This option defines shaper for
+\titem{shaper: none|ShaperName}\ind{options!shaper}This option defines shaper for
the file transfer peers. Shaper with the maximum bandwidth will be selected.
Default is \term{none}.
\end{description}
@@ -3804,34 +3698,43 @@ Examples:
\begin{itemize}
\item The simpliest configuration of the module:
\begin{verbatim}
-{modules,
- [
+modules:
...
- {mod_proxy65, []},
+ mod_proxy65: {}
...
- ]}.
\end{verbatim}
\item More complicated configuration.
\begin{verbatim}
-{acl, proxy_users, {server, "example.org"}}.
-{access, proxy65_access, [{allow, proxy_users}, {deny, all}]}.
-
-{acl, admin, {user, "admin", "example.org"}}.
-{shaper, proxyrate, {maxrate, 10240}}. %% 10 Kbytes/sec
-{access, proxy65_shaper, [{none, admin}, {proxyrate, proxy_users}]}.
-
-{modules,
- [
+acl:
+ admin:
+ user:
+ - "admin": "example.org"
+ proxy_users:
+ server:
+ - "example.org"
+
+access:
+ proxy65_access:
+ proxy_users: allow
+ all: deny
+ proxy65_shaper:
+ admin: none
+ proxy_users: proxyrate
+
+shaper:
+ proxyrate: 10240
+
+modules:
...
- {mod_proxy65, [{host, "proxy1.example.org"},
- {name, "File Transfer Proxy"},
- {ip, {200,150,100,1}},
- {port, 7778},
- {max_connections, 5},
- {access, proxy65_access},
- {shaper, proxy65_shaper}]},
+ mod_proxy65:
+ host: "proxy1.example.org"
+ name: "File Transfer Proxy"
+ ip: "200.150.100.1"
+ port: 7778
+ max_connections: 5
+ access: proxy65_access
+ shaper: proxy65_shaper
...
- ]}.
\end{verbatim}
\end{itemize}
@@ -3849,20 +3752,20 @@ Options:
\hostitem{pubsub}
If you use \modpubsubodbc, please ensure the prefix contains only one dot,
for example `\jid{pubsub.}', or `\jid{publish.}',.
-\titem{\{access\_createnode, AccessName\}} \ind{options!access\_createnode}
+\titem{access\_createnode: AccessName} \ind{options!access\_createnode}
This option restricts which users are allowed to create pubsub nodes using
ACL and ACCESS.
By default any account in the local ejabberd server is allowed to create pubsub nodes.
-\titem{\{max\_items\_node, MaxItems\}} \ind{options!max\_items\_node}
+\titem{max\_items\_node: MaxItems} \ind{options!max\_items\_node}
Define the maximum number of items that can be stored in a node.
Default value is 10.
-\titem{\{plugins, [ Plugin, ...]\}} \ind{options!plugins}
+\titem{plugins: [ Plugin, ...]} \ind{options!plugins}
To specify which pubsub node plugins to use.
The first one in the list is used by default.
If this option is not defined, the default plugins list is: \term{["flat"]}.
PubSub clients can define which plugin to use when creating a node:
add \term{type='plugin-name'} attribute to the \term{create} stanza element.
-\titem{\{nodetree, Nodetree\}} \ind{options!nodetree}
+\titem{nodetree: Nodetree} \ind{options!nodetree}
To specify which nodetree to use.
If not defined, the default pubsub nodetree is used: "tree".
Only one nodetree can be used per host, and is shared by all node plugins.
@@ -3880,21 +3783,26 @@ Options:
The "dag" nodetree provides experimental support for PubSub Collection Nodes (\xepref{0248}).
In that case you should also add "dag" node plugin as default, for example:
- \term{\{plugins, ["dag","flat","hometree","pep"]\}}
-\titem{\{ignore\_pep\_from\_offline, false|true\}} \ind{options!ignore\_pep\_from\_offline}
+ \term{plugins: ["dag","flat","hometree","pep"]}
+\titem{ignore\_pep\_from\_offline: false|true} \ind{options!ignore\_pep\_from\_offline}
To specify whether or not we should get last published PEP items
from users in our roster which are offline when we connect. Value is true or false.
If not defined, pubsub assumes true so we only get last items of online contacts.
-\titem{\{last\_item\_cache, false|true\}} \ind{options!last\_item\_cache}
+\titem{last\_item\_cache: false|true} \ind{options!last\_item\_cache}
To specify whether or not pubsub should cache last items. Value is true
or false. If not defined, pubsub do not cache last items. On systems with not so many nodes,
caching last items speeds up pubsub and allows to raise user connection rate. The cost is memory
usage, as every item is stored in memory.
-\titem{\{pep\_mapping, [ \{Key, Value\}, ...]\}} \ind{pep\_mapping}
+\titem{pep\_mapping: \{Key, Value\}} \ind{pep\_mapping}
This allow to define a Key-Value list to choose defined node plugins on given PEP namespace.
The following example will use node\_tune instead of node\_pep for every PEP node with tune namespace:
\begin{verbatim}
- {mod_pubsub, [{pep_mapping, [{"http://jabber.org/protocol/tune", "tune"}]}]}
+modules:
+ ...
+ mod_pubsub:
+ pep_mapping:
+ "http://jabber.org/protocol/tune": "tune"
+ ...
\end{verbatim}
%\titem{served\_hosts} \ind{options!served\_hosts}
% This option allows to create additional pubsub virtual hosts in a single module instance.
@@ -3902,29 +3810,29 @@ Options:
Example of configuration that uses flat nodes as default, and allows use of flat, nodetree and pep nodes:
\begin{verbatim}
-{modules,
- [
+modules:
...
- {mod_pubsub, [
- {access_createnode, pubsub_createnode},
- {plugins, ["flat", "hometree", "pep"]}
- ]},
+ mod_pubsub:
+ access_createnode: pubsub_createnode
+ plugins:
+ - "flat"
+ - "hometree"
+ - "pep"
...
- ]}.
\end{verbatim}
Using ODBC database requires using mod\_pubsub\_odbc without option changes. Only flat, hometree and pep plugins supports ODBC.
The following example shows previous configuration with ODBC usage:
\begin{verbatim}
-{modules,
- [
+modules:
...
- {mod_pubsub_odbc, [
- {access_createnode, pubsub_createnode},
- {plugins, ["flat", "hometree", "pep"]}
- ]},
+ mod_pubsub_odbc:
+ access_createnode: pubsub_createnode
+ plugins:
+ - "flat"
+ - "hometree"
+ - "pep"
...
- ]}.
\end{verbatim}
\makesubsection{modregister}{\modregister{}}
@@ -3941,38 +3849,36 @@ enables end users to use a \XMPP{} client to:
Options:
\begin{description}
-\titem{\{access, AccessName\}} \ind{options!access}
+\titem{access: AccessName} \ind{options!access}
Specify rules to restrict what usernames can be registered and unregistered.
If a rule returns `deny' on the requested username,
registration and unregistration of that user name is denied.
There are no restrictions by default.
-\titem{\{access\_from, AccessName\}} \ind{options!access\_from}By default, \ejabberd{}
+\titem{access\_from: AccessName} \ind{options!access\_from}By default, \ejabberd{}
doesn't allow to register new accounts from s2s or existing c2s sessions. You can
change it by defining access rule in this option. Use with care: allowing registration
from s2s leads to uncontrolled massive accounts creation by rogue users.
-\titem{\{captcha\_protected, false|true\}} \ind{options!captcha\_protected}
+\titem{captcha\_protected: false|true} \ind{options!captcha\_protected}
Protect registrations with CAPTCHA (see section \ref{captcha}). The default is \term{false}.
-\titem{\{ip\_access, [ \{allow|deny, IPaddress\}, ...]\}} \ind{options!ip\_access}
+\titem{ip\_access: AccessName} \ind{options!ip\_access}
Define rules to allow or deny account registration depending
- in the IP address of the XMPP client.
- If there is no matching IP mask, the default rule is ``allow''.
- IPv6 addresses are supported, but not tested.
- The default option value is an empty list: \term{[]}.
-\titem{\{password\_strength, Entropy\}} \ind{options!password\_strength}
+ on the IP address of the XMPP client. The \term{AccessName} should be
+ of type \term{ip}. The default value is \term{all}.
+\titem{password\_strength: Entropy} \ind{options!password\_strength}
This option sets the minimum informational entropy for passwords. The value \term{Entropy}
is a number of bits of entropy. The recommended minimum is 32 bits.
The default is 0, i.e. no checks are performed.
-\titem{\{welcome\_message, \{Subject, Body\}\}} \ind{options!welcomem}Set a welcome message that
+\titem{welcome\_message: \{subject: Subject, body: Body\}}
+ \ind{options!welcomem} Set a welcome message that
is sent to each newly registered account. The first string is the subject, and
the second string is the message body.
- In the body you can set a newline with the characters: \verb|\n|
-\titem{\{registration\_watchers, [ JID, ...]\}} \ind{options!rwatchers}This option defines a
+\titem{registration\_watchers: [ JID, ...]} \ind{options!rwatchers}This option defines a
list of JIDs which will be notified each time a new account is registered.
\iqdiscitem{In-Band Registration (\ns{jabber:iq:register})}
\end{description}
This module reads also another option defined globally for the server:
-\term{\{registration\_timeout, Timeout\}}. \ind{options!registratimeout}
+\term{registration\_timeout: Timeout}. \ind{options!registratimeout}
This option limits the frequency of registration from a given IP or username.
So, a user that tries to register a new account from the same IP address or JID during
this number of seconds after his previous registration
@@ -3988,62 +3894,74 @@ Examples:
\item Next example prohibits the registration of too short account names,
and allows to create accounts only to clients of the local network:
\begin{verbatim}
-{acl, shortname, {user_glob, "?"}}.
-{acl, shortname, {user_glob, "??"}}.
-%% The same using regexp:
-%%{acl, shortname, {user_regexp, "^..?$"}}.
-
-{access, register, [{deny, shortname},
- {allow, all}]}.
-
-{modules,
- [
- ...
- {mod_register, [{access, register},
- {ip_access, [{allow, "127.0.0.0/8"},
- {deny, "0.0.0.0/0"}]}
- ]},
- ...
- ]}.
+acl:
+ loopback:
+ ip:
+ - "127.0.0.0/8"
+ - "::"
+ shortname:
+ user_glob:
+ - "?"
+ - "??"
+ ## The same using regexp:
+ ##user_regexp: "^..?$"
+
+access:
+ mynetworks:
+ loopback: allow
+ all: deny
+ register:
+ shortname: deny
+ all: allow
+
+modules:
+ mod_register:
+ ip_access: mynetworks
+ access: register
\end{verbatim}
\item This configuration prohibits usage of In-Band Registration
to create or delete accounts,
but allows existing accounts to change the password:
\begin{verbatim}
-{access, register, [{deny, all}]}.
+access:
+ register:
+ all: deny
-{modules,
- [
+modules:
...
- {mod_register, [{access, register}]},
+ mod_register:
+ access: register
...
- ]}.
\end{verbatim}
\item
This configuration disables all In-Band Registration
functionality: create, delete accounts and change password:
\begin{verbatim}
-{modules,
- [
+modules:
...
- %% {mod_register, [{access, register}]},
+ ## mod_register:
+ ## access: register
...
- ]}.
\end{verbatim}
\item Define the welcome message and two registration watchers.
Also define a registration timeout of one hour:
\begin{verbatim}
-{registration_timeout, 3600}.
-{modules,
- [
+registration_timeout: 3600
+modules:
...
- {mod_register,
- [
- {welcome_message, {"Welcome!", "Hi.\nWelcome to this Jabber server.\n Check http://www.jabber.org\n\nBye"}},
- {registration_watchers, ["admin1@example.org", "boss@example.net"]}
- ]},
+ mod_register:
+ welcome_message:
+ subject: "Welcome!"
+ body: |-
+ Hi.
+ Welcome to this Jabber server.
+ Check http://www.jabber.org
+
+ Bye
+ registration_watchers:
+ - "admin1@example.org"
+ - "boss@example.net"
...
- ]}.
\end{verbatim}
\end{itemize}
@@ -4062,30 +3980,30 @@ To enable this feature, configure the options captcha\_cmd and captcha\_host.
Options:
\begin{description}
-\titem{\{registration\_watchers, [ JID, ...]\}} \ind{options!rwatchers}This option defines a
+\titem{registration\_watchers: [ JID, ...]} \ind{options!rwatchers}This option defines a
list of JIDs which will be notified each time a new account is registered.
\end{description}
This example configuration shows how to enable the module and the web handler:
\begin{verbatim}
-{hosts, ["localhost", "example.org", "example.com"]}.
-
-{listen, [
+hosts:
+ - "localhost"
+ - "example.org"
+ - "example.com"
+listen:
...
- {5281, ejabberd_http, [
- tls,
- {certfile, "/etc/ejabberd/certificate.pem"},
- register
- ]},
+ -
+ port: 5281
+ module: ejabberd_http
+ register: true
+ certfile: "/etc/ejabberd/certificate.pem"
+ tls: true
...
-]}.
-{modules,
- [
+modules:
...
- {mod_register_web, []},
+ mod_register_web: {}
...
- ]}.
\end{verbatim}
For example, the users of the host \term{example.org} can visit the page:
@@ -4104,10 +4022,10 @@ Options:
\begin{description}
\iqdiscitem{Roster Management (\ns{jabber:iq:roster})}
\dbtype
- \titem{\{versioning, false|true\}} \ind{options!versioning}Enables
+ \titem{versioning: false|true} \ind{options!versioning}Enables
Roster Versioning.
This option is disabled by default.
- \titem{\{store\_current\_id, false|true\}} \ind{options!storecurrentid}
+ \titem{store\_current\_id: false|true} \ind{options!storecurrentid}
If this option is enabled, the current version number is stored on the database.
If disabled, the version number is calculated on the fly each time.
Enabling this option reduces the load for both ejabberd and the database.
@@ -4120,12 +4038,12 @@ Options:
This example configuration enables Roster Versioning with storage of current id:
\begin{verbatim}
-{modules,
- [
+modules:
...
- {mod_roster, [{versioning, true}, {store_current_id, true}]},
+ mod_roster:
+ versioning: true
+ store_current_id: true
...
- ]}.
\end{verbatim}
\makesubsection{modservicelog}{\modservicelog{}}
@@ -4139,7 +4057,7 @@ service(s).
Options:
\begin{description}
-\titem{\{loggers, [Names, ...]\}} \ind{options!loggers}With this option a (list of) service(s)
+\titem{loggers: [Names, ...]} \ind{options!loggers}With this option a (list of) service(s)
that will receive the packets can be specified.
\end{description}
@@ -4148,24 +4066,23 @@ Examples:
\item To log all end user packets to the Bandersnatch service running on
\jid{bandersnatch.example.com}:
\begin{verbatim}
-{modules,
- [
+modules:
...
- {mod_service_log, [{loggers, ["bandersnatch.example.com"]}]},
+ mod_service_log:
+ loggers: ["bandersnatch.example.com"]
...
- ]}.
\end{verbatim}
\item To log all end user packets to the Bandersnatch service running on
\jid{bandersnatch.example.com} and the backup service on
\jid{bandersnatch.example.org}:
\begin{verbatim}
-{modules,
- [
+modules:
...
- {mod_service_log, [{loggers, ["bandersnatch.example.com",
- "bandersnatch.example.org"]}]},
+ mod_service_log:
+ loggers:
+ - "bandersnatch.example.com"
+ - "bandersnatch.example.org"
...
- ]}.
\end{verbatim}
\end{itemize}
@@ -4572,14 +4489,16 @@ Such layout has a few downsides, including:
This however seems to be a common DIT layout, so the module keeps supporting it.
You can use the following configuration\ldots
\begin{verbatim}
- {mod_shared_roster_ldap,[
- {ldap_base, "ou=flat,dc=nodomain"},
- {ldap_rfilter, "(objectClass=inetOrgPerson)"},
- {ldap_groupattr, "ou"},
- {ldap_memberattr, "cn"},
- {ldap_filter, "(objectClass=inetOrgPerson)"},
- {ldap_userdesc, "displayName"}
- ]},
+modules:
+ ...
+ mod_shared_roster_ldap:
+ ldap_base: "ou=flat,dc=nodomain"
+ ldap_rfilter: "(objectClass=inetOrgPerson)"
+ ldap_groupattr: "ou"
+ ldap_memberattr: "cn"
+ ldap_filter: "(objectClass=inetOrgPerson)"
+ ldap_userdesc: "displayName"
+ ...
\end{verbatim}
\ldots to be provided with a roster as shown in figure~\ref{fig:msrl-roster-flat} upon connecting as user {\tt czesio}.
@@ -4605,17 +4524,19 @@ They are shown separated into different subtrees, but it's not a requirement.
If you use the following example module configuration with it:
\begin{verbatim}
- {mod_shared_roster_ldap,[
- {ldap_base, "ou=deep,dc=nodomain"},
- {ldap_rfilter, "(objectClass=groupOfUniqueNames)"},
- {ldap_filter, ""},
- {ldap_gfilter, "(&(objectClass=groupOfUniqueNames)(cn=%g))"},
- {ldap_groupdesc, "description"},
- {ldap_memberattr, "uniqueMember"},
- {ldap_memberattr_format, "cn=%u,ou=people,ou=deep,dc=nodomain"},
- {ldap_ufilter, "(&(objectClass=inetOrgPerson)(cn=%u))"},
- {ldap_userdesc, "displayName"}
- ]},
+modules:
+ ...
+ mod_shared_roster_ldap:
+ ldap_base: "ou=deep,dc=nodomain"
+ ldap_rfilter: "(objectClass=groupOfUniqueNames)"
+ ldap_filter: ""
+ ldap_gfilter: "(&(objectClass=groupOfUniqueNames)(cn=%g))"
+ ldap_groupdesc: "description"
+ ldap_memberattr: "uniqueMember"
+ ldap_memberattr_format: "cn=%u,ou=people,ou=deep,dc=nodomain"
+ ldap_ufilter: "(&(objectClass=inetOrgPerson)(cn=%u))"
+ ldap_userdesc: "displayName"
+ ...
\end{verbatim}
\ldots and connect as user {\tt czesio}, then \ejabberd{} will provide you with
@@ -4705,19 +4626,19 @@ Options:
\hostitem{vjud}
\iqdiscitem{\ns{vcard-temp}}
\dbtype
-\titem{\{search, true|false\}}\ind{options!search}This option specifies whether the search
+\titem{search: true|false}\ind{options!search}This option specifies whether the search
functionality is enabled or not
If disabled, the option \term{host} will be ignored and the
\Jabber{} User Directory service will not appear in the Service Discovery item
list. The default value is \term{true}.
-\titem{\{matches, infinity|Number\}}\ind{options!matches}With this option, the number of reported
+\titem{matches: infinity|Number}\ind{options!matches}With this option, the number of reported
search results can be limited. If the option's value is set to \term{infinity},
all search results are reported. The default value is \term{30}.
-\titem{\{allow\_return\_all, false|true\}}\ind{options!allow\_return\_all}This option enables
+\titem{allow\_return\_all: false|true}\ind{options!allow\_return\_all}This option enables
you to specify if search operations with empty input fields should return all
users who added some information to their vCard. The default value is
\term{false}.
-\titem{\{search\_all\_hosts, true|false\}}\ind{options!search\_all\_hosts}If this option is set
+\titem{search\_all\_hosts, true|false}\ind{options!search\_all\_hosts}If this option is set
to \term{true}, search operations will apply to all virtual hosts. Otherwise
only the current host will be searched. The default value is \term{true}.
This option is available in \modvcard when using Mnesia, but not when using ODBC storage.
@@ -4729,27 +4650,25 @@ Examples:
every user who added information to their vCard will be listed when people
do an empty search, and only users from the current host will be returned:
\begin{verbatim}
-{modules,
- [
+modules:
...
- {mod_vcard, [{search, true},
- {matches, 20},
- {allow_return_all, true},
- {search_all_hosts, false}]},
+ mod_vcard:
+ search: true
+ matches: 20
+ allow_return_all: true
+ search_all_hosts: false
...
- ]}.
\end{verbatim}
\item The second situation differs in a way that search results are not limited,
and that all virtual hosts will be searched instead of only the current one:
\begin{verbatim}
-{modules,
- [
+modules:
...
- {mod_vcard, [{search, true},
- {matches, infinity},
- {allow_return_all, true}]},
+ mod_vcard:
+ search: true
+ matches: infinity
+ allow_return_all: true
...
- ]}.
\end{verbatim}
\end{itemize}
@@ -5006,7 +4925,7 @@ answers \ejabberd{}'s version when queried.
Options:
\begin{description}
-\titem{\{show\_os, true|false\}}\ind{options!showos}Should the operating system be revealed or not.
+\titem{show\_os: true|false}\ind{options!showos}Should the operating system be revealed or not.
The default value is \term{true}.
\iqdiscitem{Software Version (\ns{jabber:iq:version})}
\end{description}
@@ -5059,14 +4978,15 @@ The \term{ejabberdctl commands} are:
The \term{ejabberdctl} script can be restricted to require authentication
and execute some \term{ejabberd commands}; see \ref{accesscommands}.
-Add the option to the file \term{ejabberd.cfg}.
+Add the option to the file \term{ejabberd.yml}.
In this example there is no restriction:
\begin{verbatim}
-{ejabberdctl_access_commands, []}.
+ejabberdctl_access_commands: []
\end{verbatim}
If account \term{robot1@example.org} is registered in \ejabberd{} with password \term{abcdef}
-and \term{ejabberd.cfg} contains this setting:
+(which MD5 is E8B501798950FC58AAD83C8C14978E),
+and \term{ejabberd.yml} contains this setting:
\begin{verbatim}
{hosts, ["example.org"]}.
{acl, bots, {user, "robot1", "example.org"}}.
@@ -5353,42 +5273,60 @@ Example configurations:
administer the virtual host \jid{example.com}.
The account `\jid{reviewer@example.com}' can browse that vhost in read-only mode.
\begin{verbatim}
-{acl, admin, {user, "admin", "example.net"}}.
-{host_config, "example.com", [{acl, admin, {user, "admin", "example.com"}}]}.
-{host_config, "example.com", [{acl, viewers, {user, "reviewer", "example.com"}}]}.
-
-{access, configure, [{allow, admin}]}.
-{access, webadmin_view, [{allow, viewers}]}.
-
-{hosts, ["example.org"]}.
-
-{listen,
- [
+acl:
+ admin:
+ user:
+ - "admin": "example.net"
+
+host_config:
+ "example.com":
+ acl:
+ admin:
+ user:
+ - "admin": "example.com"
+ viewers:
+ user:
+ - "reviewer": "example.com"
+
+access:
+ configure:
+ admin: allow
+ webadmin_view:
+ viewers: allow
+
+hosts:
+ - "example.org"
+
+listen:
...
- {5280, ejabberd_http, [http_poll, web_admin]},
+ -
+ port: 5280
+ module: ejabberd_http
+ web_admin: true
+ http_poll: true
...
- ]}.
\end{verbatim}
\item For security reasons, you can serve the Web Admin on a secured
connection, on a port differing from the HTTP Polling interface, and bind it
to the internal LAN IP. The Web Admin will be accessible by pointing your
web browser to \verb|https://192.168.1.1:5282/admin/|:
\begin{verbatim}
-
-{hosts, ["example.org"]}.
-
-{listen,
- [
+hosts:
+ - "example.org"
+listen:
...
- {5280, ejabberd_http, [
- http_poll
- ]},
- {{5282, "192.168.1.1"}, ejabberd_http, [
- web_admin,
- tls, {certfile, "/usr/local/etc/server.pem"}
- ]},
+ -
+ port: 5280
+ module: ejabberd_http
+ http_poll: true
+ -
+ ip: "192.168.1.1"
+ port: 5282
+ module: ejabberd_http
+ certfile: "/usr/local/etc/server.pem"
+ tls: true
+ web_admin: true
...
- ]}.
\end{verbatim}
\end{itemize}
@@ -5607,7 +5545,7 @@ The file system permissions should be set to only allow the proper user to read,
write and execute those files and directories.
\begin{description}
- \titem{ejabberd configuration file: /etc/ejabberd/ejabberd.cfg}
+ \titem{ejabberd configuration file: /etc/ejabberd/ejabberd.yml}
Contains the JID of administrators
and passwords of external components.
The backup files probably contain also this information,
@@ -5783,7 +5721,7 @@ domain.
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 \option{domain\_balancing}. The syntax of the option is the following:
-\esyntax{\{domain\_balancing, "component.example.com", BalancingCriteria\}.}
+\esyntax{domain\_balancing: BalancingCriteria}
Several balancing criteria are available:
\begin{itemize}
@@ -5803,7 +5741,7 @@ When there is a risk of failure for a given component, domain balancing can caus
In this case, it is best to limit the problem to the sessions handled by the failing component. This is what the \term{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:
-\esyntax{\{domain\_balancing\_component\_number, "component.example.com", Number\}.}
+\esyntax{domain\_balancing\_component\_number: Number}
@@ -5824,10 +5762,9 @@ An \ejabberd{} node writes two log files:
\titem{erlang.log} is the Erlang/OTP system log, with the messages reported by Erlang/OTP using SASL (System Architecture Support Libraries)
\end{description}
-The option \term{loglevel} modifies the verbosity of the file ejabberd.log. The syntax is one of:
+The option \term{loglevel} modifies the verbosity of the file ejabberd.log. The syntax:
\begin{description}
- \titem{\{loglevel, Level\}.} The standard form to set a global log level.
- \titem{\{loglevel, \{Level, [\{Module, Level\}, ...]\}\}.} The given Erlang modules will be logged with specific log levels, all others will use the default log level.
+ \titem{loglevel: Level} The standard form to set a global log level.
\end{description}
The possible \term{Level} are:
@@ -5841,7 +5778,7 @@ The possible \term{Level} are:
\end{description}
For example, the default configuration is:
\begin{verbatim}
-{loglevel, 4}.
+loglevel: 4
\end{verbatim}
The log files grow continually, so it is recommended to rotate them periodically.
@@ -5876,7 +5813,7 @@ a message is sent to the XMPP accounts defined with the option
\ind{options!watchdog\_admins} in the \ejabberd{} configuration file.
The syntax is:
-\esyntax{\{watchdog\_admins, [JID, ...]\}.}
+\esyntax{watchdog\_admins: [JID, ...]}
The memory consumed is measured in \term{words}:
a word on 32-bit architecture is 4 bytes,
@@ -5886,18 +5823,20 @@ This value can be configured with the option \term{watchdog\_large\_heap},
or in a conversation with the watchdog alert bot.
The syntax is:
-\esyntax{\{watchdog\_large\_heap, Number\}.}
+\esyntax{watchdog\_large\_heap: Number}
Example configuration:
\begin{verbatim}
-{watchdog_admins, ["admin2@localhost", "admin2@example.org"]}.
-{watchdog_large_heap, 30000000}.
+watchdog_admins:
+ - "admin2@localhost"
+ - "admin2@example.org"
+watchdog_large_heap: 30000000
\end{verbatim}
To remove watchdog admins, remove them in the option.
To remove all watchdog admins, set the option with an empty list:
\begin{verbatim}
-{watchdog_admins, []}.
+watchdog_admins: []
\end{verbatim}
\appendix{}
diff --git a/ejabberd.cfg.example b/ejabberd.cfg.example
deleted file mode 100644
index d1d68feac..000000000
--- a/ejabberd.cfg.example
+++ /dev/null
@@ -1,609 +0,0 @@
-%%%
-%%% ejabberd configuration file
-%%%
-%%%'
-
-%%% The parameters used in this configuration file are explained in more detail
-%%% in the ejabberd Installation and Operation Guide.
-%%% Please consult the Guide in case of doubts, it is included with
-%%% your copy of ejabberd, and is also available online at
-%%% http://www.process-one.net/en/ejabberd/docs/
-
-%%% This configuration file contains Erlang terms.
-%%% In case you want to understand the syntax, here are the concepts:
-%%%
-%%% - The character to comment a line is %
-%%%
-%%% - Each term ends in a dot, for example:
-%%% override_global.
-%%%
-%%% - A tuple has a fixed definition, its elements are
-%%% enclosed in {}, and separated with commas:
-%%% {loglevel, 4}.
-%%%
-%%% - A list can have as many elements as you want,
-%%% and is enclosed in [], for example:
-%%% [http_poll, web_admin, tls]
-%%%
-%%% - A keyword of ejabberd is a word in lowercase.
-%%% Strings are enclosed in "" and can contain spaces, dots, ...
-%%% {language, "en"}.
-%%% {ldap_rootdn, "dc=example,dc=com"}.
-%%%
-%%% - This term includes a tuple, a keyword, a list, and two strings:
-%%% {hosts, ["jabber.example.net", "im.example.com"]}.
-%%%
-
-
-%%%. =======================
-%%%' OVERRIDE STORED OPTIONS
-
-%%
-%% Override the old values stored in the database.
-%%
-
-%%
-%% Override global options (shared by all ejabberd nodes in a cluster).
-%%
-%%override_global.
-
-%%
-%% Override local options (specific for this particular ejabberd node).
-%%
-%%override_local.
-
-%%
-%% Remove the Access Control Lists before new ones are added.
-%%
-%%override_acls.
-
-
-%%%. =========
-%%%' DEBUGGING
-
-%%
-%% loglevel: Verbosity of log files generated by ejabberd.
-%% 0: No ejabberd log at all (not recommended)
-%% 1: Critical
-%% 2: Error
-%% 3: Warning
-%% 4: Info
-%% 5: Debug
-%%
-{loglevel, 4}.
-
-%%
-%% watchdog_admins: Only useful for developers: if an ejabberd process
-%% consumes a lot of memory, send live notifications to these XMPP
-%% accounts.
-%%
-%%{watchdog_admins, ["bob@example.com"]}.
-
-
-%%%. ================
-%%%' SERVED HOSTNAMES
-
-%%
-%% hosts: Domains served by ejabberd.
-%% You can define one or several, for example:
-%% {hosts, ["example.net", "example.com", "example.org"]}.
-%%
-{hosts, ["localhost"]}.
-
-%%
-%% route_subdomains: Delegate subdomains to other XMPP servers.
-%% For example, if this ejabberd serves example.org and you want
-%% to allow communication with an XMPP server called im.example.org.
-%%
-%%{route_subdomains, s2s}.
-
-
-%%%. ===============
-%%%' LISTENING PORTS
-
-%%
-%% listen: The ports ejabberd will listen on, which service each is handled
-%% by and what options to start it with.
-%%
-{listen,
- [
-
- {5222, ejabberd_c2s, [
-
- %%
- %% If TLS is compiled in and you installed a SSL
- %% certificate, specify the full path to the
- %% file and uncomment this line:
- %%
- %%{certfile, "/path/to/ssl.pem"}, starttls,
-
- {access, c2s},
- {shaper, c2s_shaper},
- {max_stanza_size, 65536}
- ]},
-
- %%
- %% To enable the old SSL connection method on port 5223:
- %%
- %%{5223, ejabberd_c2s, [
- %% {access, c2s},
- %% {shaper, c2s_shaper},
- %% {certfile, "/path/to/ssl.pem"}, tls,
- %% {max_stanza_size, 65536}
- %% ]},
-
- {5269, ejabberd_s2s_in, [
- {shaper, s2s_shaper},
- {max_stanza_size, 131072}
- ]},
-
- %%
- %% ejabberd_service: Interact with external components (transports, ...)
- %%
- %%{8888, ejabberd_service, [
- %% {access, all},
- %% {shaper_rule, fast},
- %% {hosts, ["icq.example.org", "sms.example.org"],
- %% [{password, "secret"}]
- %% }
- %% ]},
-
- %%
- %% ejabberd_stun: Handles STUN Binding requests
- %%
- %%{{3478, udp}, ejabberd_stun, []},
-
- {5280, ejabberd_http, [
- %%{request_handlers,
- %% [
- %% {["pub", "archive"], mod_http_fileserver}
- %% ]},
- captcha,
- http_bind,
- http_poll,
- %%register,
- web_admin
- ]}
-
- ]}.
-
-%%
-%% s2s_use_starttls: Enable STARTTLS + Dialback for S2S connections.
-%% Allowed values are: false optional required required_trusted
-%% You must specify a certificate file.
-%%
-%%{s2s_use_starttls, optional}.
-
-%%
-%% s2s_certfile: Specify a certificate file.
-%%
-%%{s2s_certfile, "/path/to/ssl.pem"}.
-
-%%
-%% domain_certfile: Specify a different certificate for each served hostname.
-%%
-%%{domain_certfile, "example.org", "/path/to/example_org.pem"}.
-%%{domain_certfile, "example.com", "/path/to/example_com.pem"}.
-
-%%
-%% S2S whitelist or blacklist
-%%
-%% Default s2s policy for undefined hosts.
-%%
-%%{s2s_default_policy, allow}.
-
-%%
-%% Allow or deny communication with specific servers.
-%%
-%%{{s2s_host, "goodhost.org"}, allow}.
-%%{{s2s_host, "badhost.org"}, deny}.
-
-%%
-%% Outgoing S2S options
-%%
-%% Preferred address families (which to try first) and connect timeout
-%% in milliseconds.
-%%
-%%{outgoing_s2s_options, [ipv4, ipv6], 10000}.
-
-
-%%%. ==============
-%%%' AUTHENTICATION
-
-%%
-%% auth_method: Method used to authenticate the users.
-%% The default method is the internal.
-%% If you want to use a different method,
-%% comment this line and enable the correct ones.
-%%
-{auth_method, internal}.
-%%
-%% Store the plain passwords or hashed for SCRAM:
-%%{auth_password_format, plain}.
-%%{auth_password_format, scram}.
-%%
-%% Define the FQDN if ejabberd doesn't detect it:
-%%{fqdn, "server3.example.com"}.
-
-%%
-%% Authentication using external script
-%% Make sure the script is executable by ejabberd.
-%%
-%%{auth_method, external}.
-%%{extauth_program, "/path/to/authentication/script"}.
-
-%%
-%% Authentication using ODBC
-%% Remember to setup a database in the next section.
-%%
-%%{auth_method, odbc}.
-
-%%
-%% Authentication using PAM
-%%
-%%{auth_method, pam}.
-%%{pam_service, "pamservicename"}.
-
-%%
-%% Authentication using LDAP
-%%
-%%{auth_method, ldap}.
-%%
-%% List of LDAP servers:
-%%{ldap_servers, ["localhost"]}.
-%%
-%% Encryption of connection to LDAP servers:
-%%{ldap_encrypt, none}.
-%%{ldap_encrypt, tls}.
-%%
-%% Port to connect to on LDAP servers:
-%%{ldap_port, 389}.
-%%{ldap_port, 636}.
-%%
-%% LDAP manager:
-%%{ldap_rootdn, "dc=example,dc=com"}.
-%%
-%% Password of LDAP manager:
-%%{ldap_password, "******"}.
-%%
-%% Search base of LDAP directory:
-%%{ldap_base, "dc=example,dc=com"}.
-%%
-%% LDAP attribute that holds user ID:
-%%{ldap_uids, [{"mail", "%u@mail.example.org"}]}.
-%%
-%% LDAP filter:
-%%{ldap_filter, "(objectClass=shadowAccount)"}.
-
-%%
-%% Anonymous login support:
-%% auth_method: anonymous
-%% anonymous_protocol: sasl_anon | login_anon | both
-%% allow_multiple_connections: true | false
-%%
-%%{host_config, "public.example.org", [{auth_method, anonymous},
-%% {allow_multiple_connections, false},
-%% {anonymous_protocol, sasl_anon}]}.
-%%
-%% To use both anonymous and internal authentication:
-%%
-%%{host_config, "public.example.org", [{auth_method, [internal, anonymous]}]}.
-
-
-%%%. ==============
-%%%' DATABASE SETUP
-
-%% ejabberd by default uses the internal Mnesia database,
-%% so you do not necessarily need this section.
-%% This section provides configuration examples in case
-%% you want to use other database backends.
-%% Please consult the ejabberd Guide for details on database creation.
-
-%%
-%% MySQL server:
-%%
-%%{odbc_server, {mysql, "server", "database", "username", "password"}}.
-%%
-%% If you want to specify the port:
-%%{odbc_server, {mysql, "server", 1234, "database", "username", "password"}}.
-
-%%
-%% PostgreSQL server:
-%%
-%%{odbc_server, {pgsql, "server", "database", "username", "password"}}.
-%%
-%% If you want to specify the port:
-%%{odbc_server, {pgsql, "server", 1234, "database", "username", "password"}}.
-%%
-%% If you use PostgreSQL, have a large database, and need a
-%% faster but inexact replacement for "select count(*) from users"
-%%
-%%{pgsql_users_number_estimate, true}.
-
-%%
-%% ODBC compatible or MSSQL server:
-%%
-%%{odbc_server, "DSN=ejabberd;UID=ejabberd;PWD=ejabberd"}.
-
-%%
-%% Number of connections to open to the database for each virtual host
-%%
-%%{odbc_pool_size, 10}.
-
-%%
-%% Interval to make a dummy SQL request to keep the connections to the
-%% database alive. Specify in seconds: for example 28800 means 8 hours
-%%
-%%{odbc_keepalive_interval, undefined}.
-
-
-%%%. ===============
-%%%' TRAFFIC SHAPERS
-
-%%
-%% The "normal" shaper limits traffic speed to 1000 B/s
-%%
-{shaper, normal, {maxrate, 1000}}.
-
-%%
-%% The "fast" shaper limits traffic speed to 50000 B/s
-%%
-{shaper, fast, {maxrate, 50000}}.
-
-%%
-%% This option specifies the maximum number of elements in the queue
-%% of the FSM. Refer to the documentation for details.
-%%
-{max_fsm_queue, 1000}.
-
-
-%%%. ====================
-%%%' ACCESS CONTROL LISTS
-
-%%
-%% The 'admin' ACL grants administrative privileges to XMPP accounts.
-%% You can put here as many accounts as you want.
-%%
-%%{acl, admin, {user, "aleksey", "localhost"}}.
-%%{acl, admin, {user, "ermine", "example.org"}}.
-
-%%
-%% Blocked users
-%%
-%%{acl, blocked, {user, "baduser", "example.org"}}.
-%%{acl, blocked, {user, "test"}}.
-
-%%
-%% Local users: don't modify this line.
-%%
-{acl, local, {user_regexp, ""}}.
-
-%%
-%% More examples of ACLs
-%%
-%%{acl, jabberorg, {server, "jabber.org"}}.
-%%{acl, aleksey, {user, "aleksey", "jabber.ru"}}.
-%%{acl, test, {user_regexp, "^test"}}.
-%%{acl, test, {user_glob, "test*"}}.
-
-%%
-%% Define specific ACLs in a virtual host.
-%%
-%%{host_config, "localhost",
-%% [
-%% {acl, admin, {user, "bob-local", "localhost"}}
-%% ]
-%%}.
-
-
-%%%. ============
-%%%' ACCESS RULES
-
-%% Maximum number of simultaneous sessions allowed for a single user:
-{access, max_user_sessions, [{10, all}]}.
-
-%% Maximum number of offline messages that users can have:
-{access, max_user_offline_messages, [{5000, admin}, {100, all}]}.
-
-%% This rule allows access only for local users:
-{access, local, [{allow, local}]}.
-
-%% Only non-blocked users can use c2s connections:
-{access, c2s, [{deny, blocked},
- {allow, all}]}.
-
-%% For C2S connections, all users except admins use the "normal" shaper
-{access, c2s_shaper, [{none, admin},
- {normal, all}]}.
-
-%% All S2S connections use the "fast" shaper
-{access, s2s_shaper, [{fast, all}]}.
-
-%% Only admins can send announcement messages:
-{access, announce, [{allow, admin}]}.
-
-%% Only admins can use the configuration interface:
-{access, configure, [{allow, admin}]}.
-
-%% Admins of this server are also admins of the MUC service:
-{access, muc_admin, [{allow, admin}]}.
-
-%% Only accounts of the local ejabberd server can create rooms:
-{access, muc_create, [{allow, local}]}.
-
-%% All users are allowed to use the MUC service:
-{access, muc, [{allow, all}]}.
-
-%% Only accounts on the local ejabberd server can create Pubsub nodes:
-{access, pubsub_createnode, [{allow, local}]}.
-
-%% In-band registration allows registration of any possible username.
-%% To disable in-band registration, replace 'allow' with 'deny'.
-{access, register, [{allow, all}]}.
-
-%% By default the frequency of account registrations from the same IP
-%% is limited to 1 account every 10 minutes. To disable, specify: infinity
-%%{registration_timeout, 600}.
-
-%%
-%% Define specific Access Rules in a virtual host.
-%%
-%%{host_config, "localhost",
-%% [
-%% {access, c2s, [{allow, admin}, {deny, all}]},
-%% {access, register, [{deny, all}]}
-%% ]
-%%}.
-
-
-%%%. ================
-%%%' DEFAULT LANGUAGE
-
-%%
-%% language: Default language used for server messages.
-%%
-{language, "en"}.
-
-%%
-%% Set a different default language in a virtual host.
-%%
-%%{host_config, "localhost",
-%% [{language, "ru"}]
-%%}.
-
-
-%%%. =======
-%%%' CAPTCHA
-
-%%
-%% Full path to a script that generates the image.
-%%
-%%{captcha_cmd, "/lib/ejabberd/priv/bin/captcha.sh"}.
-
-%%
-%% Host for the URL and port where ejabberd listens for CAPTCHA requests.
-%%
-%%{captcha_host, "example.org:5280"}.
-
-%%
-%% Limit CAPTCHA calls per minute for JID/IP to avoid DoS.
-%%
-%%{captcha_limit, 5}.
-
-%%%. =======
-%%%' MODULES
-
-%%
-%% Modules enabled in all ejabberd virtual hosts.
-%%
-{modules,
- [
- {mod_adhoc, []},
- {mod_announce, [{access, announce}]}, % recommends mod_adhoc
- {mod_blocking,[]}, % requires mod_privacy
- {mod_caps, []},
- {mod_configure,[]}, % requires mod_adhoc
- {mod_disco, []},
- %%{mod_echo, [{host, "echo.localhost"}]},
- {mod_irc, []},
- {mod_http_bind, []},
- %%{mod_http_fileserver, [
- %% {docroot, "/var/www"},
- %% {accesslog, "/var/log/ejabberd/access.log"}
- %% ]},
- {mod_last, []},
- {mod_muc, [
- %%{host, "conference.@HOST@"},
- {access, muc},
- {access_create, muc_create},
- {access_persistent, muc_create},
- {access_admin, muc_admin}
- ]},
- %%{mod_muc_log,[]},
- {mod_offline, [{access_max_user_messages, max_user_offline_messages}]},
- {mod_ping, []},
- %%{mod_pres_counter,[{count, 5}, {interval, 60}]},
- {mod_privacy, []},
- {mod_private, []},
- %%{mod_proxy65,[]},
- {mod_pubsub, [
- {access_createnode, pubsub_createnode},
- {ignore_pep_from_offline, true}, % reduces resource comsumption, but XEP incompliant
- %%{ignore_pep_from_offline, false}, % XEP compliant, but increases resource comsumption
- {last_item_cache, false},
- {plugins, ["flat", "hometree", "pep"]} % pep requires mod_caps
- ]},
- {mod_register, [
- %%
- %% Protect In-Band account registrations with CAPTCHA.
- %%
- %%{captcha_protected, true},
-
- %%
- %% Set the minimum informational entropy for passwords.
- %%
- %%{password_strength, 32},
-
- %%
- %% After successful registration, the user receives
- %% a message with this subject and body.
- %%
- {welcome_message, {"Welcome!",
- "Hi.\nWelcome to this XMPP server."}},
-
- %%
- %% When a user registers, send a notification to
- %% these XMPP accounts.
- %%
- %%{registration_watchers, ["admin1@example.org"]},
-
- %%
- %% Only clients in the server machine can register accounts
- %%
- {ip_access, [{allow, "127.0.0.0/8"},
- {deny, "0.0.0.0/0"}]},
-
- %%
- %% Local c2s or remote s2s users cannot register accounts
- %%
- %%{access_from, deny},
-
- {access, register}
- ]},
- %%{mod_register_web, [
- %%
- %% When a user registers, send a notification to
- %% these XMPP accounts.
- %%
- %%{registration_watchers, ["admin1@example.org"]}
- %% ]},
- {mod_roster, []},
- %%{mod_service_log,[]},
- {mod_shared_roster,[]},
- {mod_stats, []},
- {mod_time, []},
- {mod_vcard, []},
- {mod_version, []}
- ]}.
-
-%%
-%% Enable modules with custom options in a specific virtual host
-%%
-%%{host_config, "localhost",
-%% [{{add, modules},
-%% [
-%% {mod_echo, [{host, "mirror.localhost"}]}
-%% ]
-%% }
-%% ]}.
-
-
-%%%.
-%%%'
-
-%%% $Id$
-
-%%% Local Variables:
-%%% mode: erlang
-%%% End:
-%%% vim: set filetype=erlang tabstop=8 foldmarker=%%%',%%%. foldmethod=marker:
diff --git a/ejabberd.yml.example b/ejabberd.yml.example
new file mode 100644
index 000000000..aa152e6ef
--- /dev/null
+++ b/ejabberd.yml.example
@@ -0,0 +1,615 @@
+###
+### ejabberd configuration file
+###
+###
+
+### The parameters used in this configuration file are explained in more detail
+### in the ejabberd Installation and Operation Guide.
+### Please consult the Guide in case of doubts, it is included with
+### your copy of ejabberd, and is also available online at
+### http://www.process-one.net/en/ejabberd/docs/
+
+### The configuration file is written in YAML.
+### Refer to http://en.wikipedia.org/wiki/YAML for the brief description.
+### However, ejabberd treats different literals as different types:
+###
+### - unquoted or single-quoted strings. They are called "atoms".
+### Example: dog, 'Jupiter', '3.14159', YELLOW
+###
+### - numeric literals. Example: 3, -45.0, .0
+###
+### - quoted or folded strings.
+### Examples of quoted string: "Lizzard", "orange".
+### Example of folded string:
+### > Art thou not Romeo,
+### and a Montague?
+
+### =========
+### DEBUGGING
+
+##
+## loglevel: Verbosity of log files generated by ejabberd.
+## 0: No ejabberd log at all (not recommended)
+## 1: Critical
+## 2: Error
+## 3: Warning
+## 4: Info
+## 5: Debug
+##
+loglevel: 4
+
+##
+## watchdog_admins: Only useful for developers: if an ejabberd process
+## consumes a lot of memory, send live notifications to these XMPP
+## accounts.
+##
+## watchdog_admins:
+## - "bob@example.com"
+
+
+### ================
+### SERVED HOSTNAMES
+
+##
+## hosts: Domains served by ejabberd.
+## You can define one or several, for example:
+## hosts:
+## - "example.net"
+## - "example.com"
+## - "example.org"
+##
+hosts:
+ - "localhost"
+
+##
+## route_subdomains: Delegate subdomains to other XMPP servers.
+## For example, if this ejabberd serves example.org and you want
+## to allow communication with an XMPP server called im.example.org.
+##
+## route_subdomains: s2s
+
+### ===============
+### LISTENING PORTS
+
+##
+## listen: The ports ejabberd will listen on, which service each is handled
+## by and what options to start it with.
+##
+listen:
+ -
+ port: 5222
+ module: ejabberd_c2s
+ ##
+ ## If TLS is compiled in and you installed a SSL
+ ## certificate, specify the full path to the
+ ## file and uncomment this line:
+ ##
+ ## certfile: "/path/to/ssl.pem"
+ ## starttls: true
+ max_stanza_size: 65536
+ shaper: c2s_shaper
+ access: c2s
+ -
+ port: 5269
+ module: ejabberd_s2s_in
+ ##
+ ## ejabberd_service: Interact with external components (transports, ...)
+ ##
+ ## -
+ ## port: 8888
+ ## module: ejabberd_service
+ ## access: all
+ ## shaper_rule: fast
+ ## ip: "127.0.0.1"
+ ## hosts:
+ ## "icq.example.org":
+ ## password: "secret"
+ ## "sms.example.org":
+ ## password: "secret"
+
+ ##
+ ## ejabberd_stun: Handles STUN Binding requests
+ ##
+ ## -
+ ## port: 3478
+ ## transport: udp
+ ## module: ejabberd_stun
+
+ ##
+ ## To handle XML-RPC requests that provide admin credentials:
+ ##
+ ## -
+ ## port: 4560
+ ## module: ejabberd_xmlrpc
+ -
+ port: 5280
+ module: ejabberd_http
+ ## request_handlers:
+ ## "/pub/archive": mod_http_fileserver
+ web_admin: true
+ http_poll: true
+ http_bind: true
+ ## register: true
+ captcha: true
+
+##
+## s2s_use_starttls: Enable STARTTLS + Dialback for S2S connections.
+## Allowed values are: false optional required required_trusted
+## You must specify a certificate file.
+##
+## s2s_use_starttls: optional
+
+##
+## s2s_certfile: Specify a certificate file.
+##
+## s2s_certfile: "/path/to/ssl.pem"
+
+##
+## domain_certfile: Specify a different certificate for each served hostname.
+##
+## host_config:
+## "example.org":
+## domain_certfile: "/path/to/example_org.pem"
+## "example.com":
+## domain_certfile: "/path/to/example_com.pem"
+
+##
+## S2S whitelist or blacklist
+##
+## Default s2s policy for undefined hosts.
+##
+## s2s_policy: s2s_access
+
+##
+## Outgoing S2S options
+##
+## Preferred address families (which to try first) and connect timeout
+## in milliseconds.
+##
+## outgoing_s2s_families:
+## - ipv4
+## - ipv6
+## outgoing_s2s_timeout: 10000
+
+### ==============
+### AUTHENTICATION
+
+##
+## auth_method: Method used to authenticate the users.
+## The default method is the internal.
+## If you want to use a different method,
+## comment this line and enable the correct ones.
+##
+auth_method: internal
+
+##
+## Store the plain passwords or hashed for SCRAM:
+## auth_password_format: plain
+## auth_password_format: scram
+##
+## Define the FQDN if ejabberd doesn't detect it:
+## fqdn: "server3.example.com"
+
+##
+## Authentication using external script
+## Make sure the script is executable by ejabberd.
+##
+## auth_method: external
+## extauth_program: "/path/to/authentication/script"
+
+##
+## Authentication using ODBC
+## Remember to setup a database in the next section.
+##
+## auth_method: odbc
+
+##
+## Authentication using PAM
+##
+## auth_method: pam
+## pam_service: "pamservicename"
+
+##
+## Authentication using LDAP
+##
+## auth_method: ldap
+##
+## List of LDAP servers:
+## ldap_servers:
+## - "localhost"
+##
+## Encryption of connection to LDAP servers:
+## ldap_encrypt: none
+## ldap_encrypt: tls
+##
+## Port to connect to on LDAP servers:
+## ldap_port: 389
+## ldap_port: 636
+##
+## LDAP manager:
+## ldap_rootdn: "dc=example,dc=com"
+##
+## Password of LDAP manager:
+## ldap_password: "******"
+##
+## Search base of LDAP directory:
+## ldap_base: "dc=example,dc=com"
+##
+## LDAP attribute that holds user ID:
+## ldap_uids:
+## - "mail": "%u@mail.example.org"
+##
+## LDAP filter:
+## ldap_filter: "(objectClass=shadowAccount)"
+
+##
+## Anonymous login support:
+## auth_method: anonymous
+## anonymous_protocol: sasl_anon | login_anon | both
+## allow_multiple_connections: true | false
+##
+## host_config:
+## "public.example.org":
+## auth_method: anonymous
+## allow_multiple_connections: false
+## anonymous_protocol: sasl_anon
+##
+## To use both anonymous and internal authentication:
+##
+## host_config:
+## "public.example.org":
+## auth_method:
+## - internal
+## - anonymous
+
+### ==============
+### DATABASE SETUP
+
+## ejabberd by default uses the internal Mnesia database,
+## so you do not necessarily need this section.
+## This section provides configuration examples in case
+## you want to use other database backends.
+## Please consult the ejabberd Guide for details on database creation.
+
+##
+## MySQL server:
+##
+## odbc_type: mysql
+## odbc_server: "server"
+## odbc_database: "database"
+## odbc_username: "username"
+## odbc_password: "password"
+##
+## If you want to specify the port:
+## odbc_port: 1234
+
+##
+## PostgreSQL server:
+##
+## odbc_type: pgsql
+## odbc_server: "server"
+## odbc_database: "database"
+## odbc_username: "username"
+## odbc_password: "password"
+##
+## If you want to specify the port:
+## odbc_port: 1234
+##
+## If you use PostgreSQL, have a large database, and need a
+## faster but inexact replacement for "select count(*) from users"
+##
+## pgsql_users_number_estimate: true
+
+##
+## ODBC compatible or MSSQL server:
+##
+## odbc_type: odbc
+## odbc_server: "DSN=ejabberd;UID=ejabberd;PWD=ejabberd"
+
+##
+## Number of connections to open to the database for each virtual host
+##
+## odbc_pool_size: 10
+
+##
+## Interval to make a dummy SQL request to keep the connections to the
+## database alive. Specify in seconds: for example 28800 means 8 hours
+##
+## odbc_keepalive_interval: undefined
+
+### ===============
+### TRAFFIC SHAPERS
+
+shaper:
+ ##
+ ## The "normal" shaper limits traffic speed to 1000 B/s
+ ##
+ normal: 1000
+
+ ##
+ ## The "fast" shaper limits traffic speed to 50000 B/s
+ ##
+ fast: 50000
+
+##
+## This option specifies the maximum number of elements in the queue
+## of the FSM. Refer to the documentation for details.
+##
+max_fsm_queue: 1000
+
+###. ====================
+###' ACCESS CONTROL LISTS
+acl:
+ ##
+ ## The 'admin' ACL grants administrative privileges to XMPP accounts.
+ ## You can put here as many accounts as you want.
+ ##
+ ## admin:
+ ## user:
+ ## - "aleksey": "localhost"
+ ## - "ermine": "example.org"
+ ##
+ ## Blocked users
+ ##
+ ## blocked:
+ ## user:
+ ## - "baduser": "example.org"
+ ## - "test": global
+
+ ## Local users: don't modify this.
+ ##
+ local:
+ user_regexp:
+ - "": global
+
+ ##
+ ## More examples of ACLs
+ ##
+ ## jabberorg:
+ ## server:
+ ## - "jabber.org"
+ ## aleksey:
+ ## user:
+ ## - "aleksey": "jabber.ru"
+ ## test:
+ ## user_regexp:
+ ## - "^test": global
+ ## user_glob:
+ ## - "test*": global
+
+ ##
+ ## Loopback network
+ ##
+ loopback:
+ ip:
+ - "127.0.0.0/8"
+
+ ##
+ ## Bad XMPP servers
+ ##
+ ## bad_servers:
+ ## server:
+ ## - "xmpp.zombie.org"
+ ## - "xmpp.spam.com"
+
+##
+## Define specific ACLs in a virtual host.
+##
+## host_config:
+## "localhost":
+## acl:
+## admin:
+## user:
+## - "bob-local": "localhost"
+
+### ============
+### ACCESS RULES
+access:
+ ## Maximum number of simultaneous sessions allowed for a single user:
+ max_user_sessions:
+ all: 10
+ ## Maximum number of offline messages that users can have:
+ max_user_offline_messages:
+ admin: 5000
+ all: 100
+ ## This rule allows access only for local users:
+ local:
+ local: allow
+ ## Only non-blocked users can use c2s connections:
+ c2s:
+ blocked: deny
+ all: allow
+ ## For C2S connections, all users except admins use the "normal" shaper
+ c2s_shaper:
+ admin: none
+ all: normal
+ ## All S2S connections use the "fast" shaper
+ s2s_shaper:
+ all: fast
+ ## Only admins can send announcement messages:
+ announce:
+ admin: allow
+ ## Only admins can use the configuration interface:
+ configure:
+ admin: allow
+ ## Admins of this server are also admins of the MUC service:
+ muc_admin:
+ admin: allow
+ ## Only accounts of the local ejabberd server can create rooms:
+ muc_create:
+ local: allow
+ ## All users are allowed to use the MUC service:
+ muc:
+ all: allow
+ ## Only accounts on the local ejabberd server can create Pubsub nodes:
+ pubsub_createnode:
+ local: allow
+ ## In-band registration allows registration of any possible username.
+ ## To disable in-band registration, replace 'allow' with 'deny'.
+ register:
+ all: allow
+ ## Only allow to register from localhost
+ trusted_network:
+ loopback: allow
+ ## Do not establish S2S connections with bad servers
+ ## s2s_access:
+ ## bad_servers: deny
+ ## all: allow
+
+## By default the frequency of account registrations from the same IP
+## is limited to 1 account every 10 minutes. To disable, specify: infinity
+## registration_timeout: 600
+
+##
+## Define specific Access Rules in a virtual host.
+##
+## host_config:
+## "localhost":
+## access:
+## c2s:
+## admin: allow
+## all: deny
+## register:
+## all: deny
+
+### ================
+### DEFAULT LANGUAGE
+
+##
+## language: Default language used for server messages.
+##
+language: "en"
+
+##
+## Set a different default language in a virtual host.
+##
+## host_config:
+## "localhost":
+## language: "ru"
+
+### =======
+### CAPTCHA
+
+##
+## Full path to a script that generates the image.
+##
+## captcha_cmd: "/lib/ejabberd/priv/bin/captcha.sh"
+
+##
+## Host for the URL and port where ejabberd listens for CAPTCHA requests.
+##
+## captcha_host: "example.org:5280"
+
+##
+## Limit CAPTCHA calls per minute for JID/IP to avoid DoS.
+##
+## captcha_limit: 5
+
+### =======
+### MODULES
+
+##
+## Modules enabled in all ejabberd virtual hosts.
+##
+modules:
+ mod_adhoc: {}
+ mod_announce: # recommends mod_adhoc
+ access: announce
+ mod_blocking: {} # requires mod_privacy
+ mod_caps: {}
+ mod_configure: {} # requires mod_adhoc
+ mod_disco: {}
+ ## mod_echo: {}
+ mod_irc: {}
+ mod_http_bind: {}
+ ## mod_http_fileserver:
+ ## docroot: "/var/www"
+ ## accesslog: "/var/log/ejabberd/access.log"
+ mod_last: {}
+ mod_muc:
+ ## host: "conference.@HOST@"
+ access: muc
+ access_create: muc_create
+ access_persistent: muc_create
+ access_admin: muc_admin
+ ## mod_muc_log: {}
+ mod_offline:
+ access_max_user_messages: max_user_offline_messages
+ mod_ping: {}
+ ## mod_pres_counter:
+ ## count: 5
+ ## interval: 60
+ mod_privacy: {}
+ mod_private: {}
+ ## mod_proxy65: {}
+ mod_pubsub:
+ access_createnode: pubsub_createnode
+ ## reduces resource comsumption, but XEP incompliant
+ ignore_pep_from_offline: true
+ ## XEP compliant, but increases resource comsumption
+ ## ignore_pep_from_offline: false
+ last_item_cache: false
+ plugins:
+ - "flat"
+ - "hometree"
+ - "pep" # pep requires mod_caps
+ mod_register:
+ ##
+ ## Protect In-Band account registrations with CAPTCHA.
+ ##
+ ## captcha_protected: true
+
+ ##
+ ## Set the minimum informational entropy for passwords.
+ ##
+ ## password_strength: 32
+
+ ##
+ ## After successful registration, the user receives
+ ## a message with this subject and body.
+ ##
+ welcome_message:
+ subject: "Welcome!"
+ body: |-
+ Hi.
+ Welcome to this XMPP server.
+
+ ##
+ ## When a user registers, send a notification to
+ ## these XMPP accounts.
+ ##
+ ## registration_watchers:
+ ## - "admin1@example.org"
+
+ ##
+ ## Only clients in the server machine can register accounts
+ ##
+ ip_access: trusted_network
+
+ ##
+ ## Local c2s or remote s2s users cannot register accounts
+ ##
+ ## access_from: deny
+
+ access: register
+ mod_roster: {}
+ mod_shared_roster: {}
+ mod_stats: {}
+ mod_time: {}
+ mod_vcard: {}
+ mod_version: {}
+
+##
+## Enable modules with custom options in a specific virtual host
+##
+## host_config:
+## "localhost":
+## add:
+## modules:
+## mod_echo:
+## host: "mirror.localhost"
+
+### Local Variables:
+### mode: yaml
+### End:
+### vim: set filetype=yaml tabstop=8
diff --git a/ejabberdctl.template b/ejabberdctl.template
index b0f5a4b3f..e77196dfc 100755
--- a/ejabberdctl.template
+++ b/ejabberdctl.template
@@ -65,7 +65,7 @@ if [ -f "$EJABBERDCTL_CONFIG_PATH" ] ; then
. "$EJABBERDCTL_CONFIG_PATH"
fi
if [ "$EJABBERD_CONFIG_PATH" = "" ] ; then
- EJABBERD_CONFIG_PATH=$ETCDIR/ejabberd.cfg
+ EJABBERD_CONFIG_PATH=$ETCDIR/ejabberd.yml
fi
if [ "$LOGS_DIR" = "" ] ; then
LOGS_DIR={{localstatedir}}/log/ejabberd
diff --git a/rebar.config.script b/rebar.config.script
index a814506e5..da838689d 100644
--- a/rebar.config.script
+++ b/rebar.config.script
@@ -56,6 +56,7 @@ Deps = [{p1_cache_tab, ".*", {git, "git://github.com/processone/cache_tab"}},
{p1_tls, ".*", {git, "git://github.com/processone/tls"}},
{p1_stringprep, ".*", {git, "git://github.com/processone/stringprep"}},
{p1_xml, ".*", {git, "git://github.com/processone/xml"}},
+ {p1_yaml, ".*", {git, "git://github.com/processone/p1_yaml"}},
{xmlrpc, ".*", {git, "git://github.com/rds13/xmlrpc"}}],
ConfigureCmd = fun(Pkg, Flags) ->
diff --git a/rel/reltool.config.script b/rel/reltool.config.script
index 517258660..ad647c74b 100644
--- a/rel/reltool.config.script
+++ b/rel/reltool.config.script
@@ -28,7 +28,7 @@ ConfiguredOTPApps = lists:flatmap(
OTPApps = RequiredOTPApps ++ ConfiguredOTPApps,
-DepRequiredApps = [p1_cache_tab, p1_tls, p1_stringprep, p1_xml, xmlrpc],
+DepRequiredApps = [p1_cache_tab, p1_tls, p1_stringprep, p1_xml, p1_yaml, xmlrpc],
DepConfiguredApps = lists:flatmap(
fun({mysql, true}) -> [p1_mysql];
@@ -39,7 +39,7 @@ DepConfiguredApps = lists:flatmap(
({json, true}) -> [jiffy];
({iconv, true}) -> [p1_iconv];
({http, true}) -> [ibrowse, lhttpc];
- ({lager, true}) -> [lager];
+ ({lager, true}) -> [lager, goldrush];
({lager, false}) -> [p1_logger];
(_) -> []
end, Vars),
@@ -89,7 +89,7 @@ Overlay = [
{template, "files/erl", "\{\{erts_vsn\}\}/bin/erl"},
{template, "../ejabberdctl.template", "bin/ejabberdctl"},
{copy, "../ejabberdctl.cfg.example", "etc/ejabberd/ejabberdctl.cfg"},
- {copy, "../ejabberd.cfg.example", "etc/ejabberd/ejabberd.cfg"},
+ {copy, "../ejabberd.yml.example", "etc/ejabberd/ejabberd.yml"},
{copy, "../inetrc", "etc/ejabberd/inetrc"},
{copy, "files/install_upgrade.escript", "bin/install_upgrade.escript"}
],
diff --git a/src/acl.erl b/src/acl.erl
index 1338e55b6..4c4523617 100644
--- a/src/acl.erl
+++ b/src/acl.erl
@@ -29,35 +29,38 @@
-author('alexey@process-one.net').
-export([start/0, to_record/3, add/3, add_list/3,
- add_local/3, add_list_local/3,
- match_rule/3, match_acl/3]).
+ add_local/3, add_list_local/3, load_from_config/0,
+ match_rule/3, match_acl/3, transform_options/1]).
-include("ejabberd.hrl").
-include("logger.hrl").
-include("jlib.hrl").
-record(acl, {aclname, aclspec}).
+-record(access, {name :: access_name(),
+ rules = [] :: [access_rule()]}).
-type regexp() :: binary().
-type glob() :: binary().
+-type access_name() :: atom().
+-type access_rule() :: {atom(), any()}.
+-type host() :: binary().
-type aclname() :: {atom(), binary() | global}.
-type aclspec() :: all | none |
- {user, binary()} |
- {user, binary(), binary()} |
+ {user, {binary(), host()} | binary()} |
{server, binary()} |
{resource, binary()} |
- {user_regexp, regexp()} |
- {shared_group, binary()} |
- {shared_group, binary(), binary()} |
- {user_regexp, regexp(), binary()} |
+ {user_regexp, {regexp(), host()} | regexp()} |
+ {shared_group, {binary(), host()} | binary()} |
+ {user_regexp, {regexp(), host()} | regexp()} |
{server_regexp, regexp()} |
{resource_regexp, regexp()} |
- {node_regexp, regexp(), regexp()} |
- {user_glob, glob()} |
- {user_glob, glob(), binary()} |
+ {node_regexp, {regexp(), regexp()}} |
+ {user_glob, {glob(), host()} | glob()} |
{server_glob, glob()} |
{resource_glob, glob()} |
- {node_glob, glob(), glob()}.
+ {ip, {inet:ip_address(), integer()}} |
+ {node_glob, {glob(), glob()}}.
-type acl() :: #acl{aclname :: aclname(),
aclspec :: aclspec()}.
@@ -65,12 +68,23 @@
-export_type([acl/0]).
start() ->
+ case catch mnesia:table_info(acl, storage_type) of
+ disc_copies ->
+ mnesia:delete_table(acl);
+ _ ->
+ ok
+ end,
mnesia:create_table(acl,
- [{disc_copies, [node()]}, {type, bag},
+ [{ram_copies, [node()]}, {type, bag},
{local_content, true},
{attributes, record_info(fields, acl)}]),
+ mnesia:create_table(access,
+ [{ram_copies, [node()]},
+ {local_content, true},
+ {attributes, record_info(fields, access)}]),
mnesia:add_table_copy(acl, node(), ram_copies),
- update_table(),
+ mnesia:add_table_copy(access, node(), ram_copies),
+ load_from_config(),
ok.
-spec to_record(binary(), atom(), aclspec()) -> acl().
@@ -82,7 +96,7 @@ to_record(Host, ACLName, ACLSpec) ->
-spec add(binary(), aclname(), aclspec()) -> ok | {error, any()}.
add(Host, ACLName, ACLSpec) ->
- {ResL, BadNodes} = rpc:multicall(ejabberd_cluster:get_nodes(),
+ {ResL, BadNodes} = rpc:multicall(mnesia:system_info(running_db_nodes),
?MODULE, add_local,
[Host, ACLName, ACLSpec]),
case lists:keyfind(aborted, 1, ResL) of
@@ -109,7 +123,7 @@ add_local(Host, ACLName, ACLSpec) ->
-spec add_list(binary(), [acl()], boolean()) -> ok | {error, any()}.
add_list(Host, ACLs, Clear) ->
- {ResL, BadNodes} = rpc:multicall(ejabberd_cluster:get_nodes(),
+ {ResL, BadNodes} = rpc:multicall(mnesia:system_info(running_db_nodes),
?MODULE, add_list_local,
[Host, ACLs, Clear]),
case lists:keyfind(aborted, 1, ResL) of
@@ -147,130 +161,196 @@ add_list_local(Host, ACLs, Clear) ->
end,
mnesia:transaction(F).
-normalize(A) -> jlib:nodeprep(iolist_to_binary(A)).
-
-normalize_spec({A, B}) -> {A, normalize(B)};
-normalize_spec({A, B, C}) ->
- {A, normalize(B), normalize(C)};
-normalize_spec(all) -> all;
-normalize_spec(none) -> none.
-
--spec match_rule(global | binary(), atom(), jid() | ljid()) -> any().
-
-match_rule(global, Rule, JID) ->
- case Rule of
- all -> allow;
- none -> deny;
- _ ->
- case ejabberd_config:get_global_option(
- {access, Rule, global}, fun(V) -> V end)
- of
- undefined -> deny;
- GACLs -> match_acls(GACLs, JID, global)
- end
- end;
-match_rule(Host, Rule, JID) ->
- case Rule of
- all -> allow;
- none -> deny;
- _ ->
- case ejabberd_config:get_global_option(
- {access, Rule, global}, fun(V) -> V end)
- of
- undefined ->
- case ejabberd_config:get_global_option(
- {access, Rule, Host}, fun(V) -> V end)
- of
- undefined -> deny;
- ACLs -> match_acls(ACLs, JID, Host)
- end;
- GACLs ->
- case ejabberd_config:get_global_option(
- {access, Rule, Host}, fun(V) -> V end)
- of
- undefined -> match_acls(GACLs, JID, Host);
- ACLs ->
- case lists:reverse(GACLs) of
- [{allow, all} | Rest] ->
- match_acls(lists:reverse(Rest) ++
- ACLs ++ [{allow, all}],
- JID, Host);
- _ -> match_acls(GACLs ++ ACLs, JID, Host)
- end
- end
- end
+-spec add_access(binary() | global,
+ access_name(), [access_rule()]) -> ok | {error, any()}.
+
+add_access(Host, Access, Rules) ->
+ case mnesia:transaction(
+ fun() ->
+ mnesia:write(
+ #access{name = {Access, Host},
+ rules = Rules})
+ end) of
+ {atomic, ok} ->
+ ok;
+ Err ->
+ {error, Err}
+ end.
+
+-spec load_from_config() -> ok.
+
+load_from_config() ->
+ Hosts = [global|?MYHOSTS],
+ lists:foreach(
+ fun(Host) ->
+ ACLs = ejabberd_config:get_option(
+ {acl, Host}, fun(V) -> V end, []),
+ AccessRules = ejabberd_config:get_option(
+ {access, Host}, fun(V) -> V end, []),
+ lists:foreach(
+ fun({ACLName, SpecList}) ->
+ lists:foreach(
+ fun({ACLType, ACLSpecs}) when is_list(ACLSpecs) ->
+ lists:foreach(
+ fun(ACLSpec) ->
+ add(Host, ACLName,
+ {ACLType, ACLSpec})
+ end, lists:flatten(ACLSpecs));
+ ({ACLType, ACLSpecs}) ->
+ add(Host, ACLName, {ACLType, ACLSpecs})
+ end, lists:flatten(SpecList))
+ end, ACLs),
+ lists:foreach(
+ fun({Access, Rules}) ->
+ add_access(Host, Access, Rules)
+ end, AccessRules)
+ end, Hosts).
+
+b(S) ->
+ iolist_to_binary(S).
+
+nodeprep(S) ->
+ jlib:nodeprep(b(S)).
+
+nameprep(S) ->
+ jlib:nameprep(b(S)).
+
+resourceprep(S) ->
+ jlib:resourceprep(b(S)).
+
+normalize_spec(Spec) ->
+ case Spec of
+ all -> all;
+ none -> none;
+ {user, {U, S}} -> {user, {nodeprep(U), nameprep(S)}};
+ {user, U} -> {user, nodeprep(U)};
+ {shared_group, {G, H}} -> {shared_group, {b(G), nameprep(H)}};
+ {shared_group, G} -> {shared_group, b(G)};
+ {user_regexp, {UR, S}} -> {user_regexp, {b(UR), nameprep(S)}};
+ {user_regexp, UR} -> {user_regexp, b(UR)};
+ {node_regexp, {UR, SR}} -> {node_regexp, {b(UR), b(SR)}};
+ {user_glob, {UR, S}} -> {user_glob, {b(UR), nameprep(S)}};
+ {user_glob, UR} -> {user_glob, b(UR)};
+ {node_glob, {UR, SR}} -> {node_glob, {b(UR), b(SR)}};
+ {server, S} -> {server, nameprep(S)};
+ {resource, R} -> {resource, resourceprep(R)};
+ {server_regexp, SR} -> {server_regexp, b(SR)};
+ {server_glob, S} -> {server_glob, b(S)};
+ {resource_glob, R} -> {resource_glob, b(R)};
+ {ip, S} ->
+ case parse_ip_netmask(b(S)) of
+ {ok, Net, Mask} ->
+ {ip, {Net, Mask}};
+ error ->
+ ?INFO_MSG("Invalid network address: ~p", [S]),
+ none
+ end
+ end.
+
+-spec match_rule(global | binary(), access_name(),
+ jid() | ljid() | inet:ip_address()) -> any().
+
+match_rule(_Host, all, _JID) ->
+ allow;
+match_rule(_Host, none, _JID) ->
+ deny;
+match_rule(Host, Access, JID) ->
+ GAccess = ets:lookup(access, {Access, global}),
+ LAccess = if Host /= global ->
+ ets:lookup(access, {Access, Host});
+ true ->
+ []
+ end,
+ case GAccess ++ LAccess of
+ [] ->
+ ?WARNING_MSG("Attempt to match against unspecified "
+ "access rule '~s' (scope: ~s)",
+ [Access, Host]),
+ deny;
+ AccessList ->
+ Rules = lists:flatmap(
+ fun(#access{rules = Rs}) ->
+ Rs
+ end, AccessList),
+ match_acls(Rules, JID, Host)
end.
match_acls([], _, _Host) -> deny;
-match_acls([{Access, ACL} | ACLs], JID, Host) ->
+match_acls([{ACL, Access} | ACLs], JID, Host) ->
case match_acl(ACL, JID, Host) of
true -> Access;
_ -> match_acls(ACLs, JID, Host)
end.
--spec match_acl(atom(), jid() | ljid(), binary()) -> boolean().
+-spec match_acl(atom(),
+ jid() | ljid() | inet:ip_address(),
+ binary()) -> boolean().
+match_acl(all, _JID, _Host) ->
+ true;
+match_acl(none, _JID, _Host) ->
+ false;
+match_acl(ACL, IP, Host) when tuple_size(IP) == 4;
+ tuple_size(IP) == 8 ->
+ lists:any(
+ fun(#acl{aclspec = {ip, {Net, Mask}}}) ->
+ is_ip_match(IP, Net, Mask);
+ (_) ->
+ false
+ end,
+ ets:lookup(acl, {ACL, Host}) ++
+ ets:lookup(acl, {ACL, global}));
match_acl(ACL, JID, Host) ->
- case ACL of
- all -> true;
- none -> false;
- _ ->
- {User, Server, Resource} = jlib:jid_tolower(JID),
- lists:any(fun (#acl{aclspec = Spec}) ->
- case Spec of
- all -> true;
- {user, U} ->
- U == User andalso
- (Host == Server orelse
- Host == global andalso
- lists:member(Server, ?MYHOSTS));
- {user, U, S} -> U == User andalso S == Server;
- {server, S} -> S == Server;
- {resource, R} -> R == Resource;
- {user_regexp, UR} ->
- (Host == Server orelse
- Host == global andalso
- lists:member(Server, ?MYHOSTS))
- andalso is_regexp_match(User, UR);
- {shared_group, G} ->
- Mod = loaded_shared_roster_module(Host),
- Mod:is_user_in_group({User, Server}, G, Host);
- {shared_group, G, H} ->
- Mod = loaded_shared_roster_module(H),
- Mod:is_user_in_group({User, Server}, G, H);
- {user_regexp, UR, S} ->
- S == Server andalso is_regexp_match(User, UR);
- {server_regexp, SR} ->
- is_regexp_match(Server, SR);
- {resource_regexp, RR} ->
- is_regexp_match(Resource, RR);
- {node_regexp, UR, SR} ->
- is_regexp_match(Server, SR) andalso
- is_regexp_match(User, UR);
- {user_glob, UR} ->
- (Host == Server orelse
- Host == global andalso
- lists:member(Server, ?MYHOSTS))
- andalso is_glob_match(User, UR);
- {user_glob, UR, S} ->
- S == Server andalso is_glob_match(User, UR);
- {server_glob, SR} -> is_glob_match(Server, SR);
- {resource_glob, RR} ->
- is_glob_match(Resource, RR);
- {node_glob, UR, SR} ->
- is_glob_match(Server, SR) andalso
- is_glob_match(User, UR);
- WrongSpec ->
- ?ERROR_MSG("Wrong ACL expression: ~p~nCheck your "
- "config file and reload it with the override_a"
- "cls option enabled",
- [WrongSpec]),
- false
- end
- end,
- ets:lookup(acl, {ACL, global}) ++
- ets:lookup(acl, {ACL, Host}))
- end.
+ {User, Server, Resource} = jlib:jid_tolower(JID),
+ lists:any(
+ fun(#acl{aclspec = Spec}) ->
+ case Spec of
+ all -> true;
+ {user, {U, S}} -> U == User andalso S == Server;
+ {user, U} ->
+ U == User andalso
+ lists:member(Server, ?MYHOSTS);
+ {server, S} -> S == Server;
+ {resource, R} -> R == Resource;
+ {shared_group, {G, H}} ->
+ Mod = loaded_shared_roster_module(H),
+ Mod:is_user_in_group({User, Server}, G, H);
+ {shared_group, G} ->
+ Mod = loaded_shared_roster_module(Host),
+ Mod:is_user_in_group({User, Server}, G, Host);
+ {user_regexp, {UR, S}} ->
+ S == Server andalso is_regexp_match(User, UR);
+ {user_regexp, UR} ->
+ lists:member(Server, ?MYHOSTS)
+ andalso is_regexp_match(User, UR);
+ {server_regexp, SR} ->
+ is_regexp_match(Server, SR);
+ {resource_regexp, RR} ->
+ is_regexp_match(Resource, RR);
+ {node_regexp, {UR, SR}} ->
+ is_regexp_match(Server, SR) andalso
+ is_regexp_match(User, UR);
+ {user_glob, {UR, S}} ->
+ S == Server andalso is_glob_match(User, UR);
+ {user_glob, UR} ->
+ lists:member(Server, ?MYHOSTS)
+ andalso is_glob_match(User, UR);
+ {server_glob, SR} -> is_glob_match(Server, SR);
+ {resource_glob, RR} ->
+ is_glob_match(Resource, RR);
+ {node_glob, {UR, SR}} ->
+ is_glob_match(Server, SR) andalso
+ is_glob_match(User, UR);
+ WrongSpec ->
+ ?ERROR_MSG("Wrong ACL expression: ~p~nCheck your "
+ "config file and reload it with the override_a"
+ "cls option enabled",
+ [WrongSpec]),
+ false
+ end
+ end,
+ ets:lookup(acl, {ACL, Host}) ++
+ ets:lookup(acl, {ACL, global})).
is_regexp_match(String, RegExp) ->
case ejabberd_regexp:run(String, RegExp) of
@@ -286,34 +366,115 @@ is_glob_match(String, Glob) ->
is_regexp_match(String,
ejabberd_regexp:sh_to_awk(Glob)).
+is_ip_match({_, _, _, _} = IP, {_, _, _, _} = Net, Mask) ->
+ IPInt = ip_to_integer(IP),
+ NetInt = ip_to_integer(Net),
+ M = bnot (1 bsl (32 - Mask) - 1),
+ IPInt band M =:= NetInt band M;
+is_ip_match({_, _, _, _, _, _, _, _} = IP,
+ {_, _, _, _, _, _, _, _} = Net, Mask) ->
+ IPInt = ip_to_integer(IP),
+ NetInt = ip_to_integer(Net),
+ M = bnot (1 bsl (128 - Mask) - 1),
+ IPInt band M =:= NetInt band M;
+is_ip_match(_, _, _) ->
+ false.
+
+ip_to_integer({IP1, IP2, IP3, IP4}) ->
+ IP1 bsl 8 bor IP2 bsl 8 bor IP3 bsl 8 bor IP4;
+ip_to_integer({IP1, IP2, IP3, IP4, IP5, IP6, IP7,
+ IP8}) ->
+ IP1 bsl 16 bor IP2 bsl 16 bor IP3 bsl 16 bor IP4 bsl 16
+ bor IP5
+ bsl 16
+ bor IP6
+ bsl 16
+ bor IP7
+ bsl 16
+ bor IP8.
+
loaded_shared_roster_module(Host) ->
case gen_mod:is_loaded(Host, mod_shared_roster_ldap) of
true -> mod_shared_roster_ldap;
false -> mod_shared_roster
end.
-update_table() ->
- Fields = record_info(fields, acl),
- case mnesia:table_info(acl, attributes) of
- Fields ->
- ejabberd_config:convert_table_to_binary(
- acl, Fields, bag,
- fun(#acl{aclspec = Spec}) when is_tuple(Spec) ->
- element(2, Spec);
- (_) ->
- '$next'
- end,
- fun(#acl{aclname = {ACLName, Host},
- aclspec = Spec} = R) ->
- NewHost = if Host == global ->
- Host;
- true ->
- iolist_to_binary(Host)
- end,
- R#acl{aclname = {ACLName, NewHost},
- aclspec = normalize_spec(Spec)}
- end);
- _ ->
- ?INFO_MSG("Recreating acl table", []),
- mnesia:transform_table(acl, ignore, Fields)
+parse_ip_netmask(S) ->
+ case str:tokens(S, <<"/">>) of
+ [IPStr] ->
+ case inet_parse:address(binary_to_list(IPStr)) of
+ {ok, {_, _, _, _} = IP} -> {ok, IP, 32};
+ {ok, {_, _, _, _, _, _, _, _} = IP} -> {ok, IP, 128};
+ _ -> error
+ end;
+ [IPStr, MaskStr] ->
+ case catch jlib:binary_to_integer(MaskStr) of
+ Mask when is_integer(Mask), Mask >= 0 ->
+ case inet_parse:address(binary_to_list(IPStr)) of
+ {ok, {_, _, _, _} = IP} when Mask =< 32 ->
+ {ok, IP, Mask};
+ {ok, {_, _, _, _, _, _, _, _} = IP} when Mask =< 128 ->
+ {ok, IP, Mask};
+ _ -> error
+ end;
+ _ -> error
+ end;
+ _ -> error
end.
+
+transform_options(Opts) ->
+ Opts1 = lists:foldl(fun transform_options/2, [], Opts),
+ {ACLOpts, Opts2} = lists:mapfoldl(
+ fun({acl, Os}, Acc) ->
+ {Os, Acc};
+ (O, Acc) ->
+ {[], [O|Acc]}
+ end, [], Opts1),
+ {AccessOpts, Opts3} = lists:mapfoldl(
+ fun({access, Os}, Acc) ->
+ {Os, Acc};
+ (O, Acc) ->
+ {[], [O|Acc]}
+ end, [], Opts2),
+ ACLOpts1 = ejabberd_config:collect_options(lists:flatten(ACLOpts)),
+ AccessOpts1 = case ejabberd_config:collect_options(
+ lists:flatten(AccessOpts)) of
+ [] -> [];
+ L1 -> [{access, L1}]
+ end,
+ ACLOpts2 = case lists:map(
+ fun({ACLName, Os}) ->
+ {ACLName, ejabberd_config:collect_options(Os)}
+ end, ACLOpts1) of
+ [] -> [];
+ L2 -> [{acl, L2}]
+ end,
+ ACLOpts2 ++ AccessOpts1 ++ Opts3.
+
+transform_options({acl, Name, Type}, Opts) ->
+ T = case Type of
+ all -> all;
+ none -> none;
+ {user, U} -> {user, [U]};
+ {user, U, S} -> {user, [[{U, S}]]};
+ {shared_group, G} -> {shared_group, [G]};
+ {shared_group, G, H} -> {shared_group, [[{G, H}]]};
+ {user_regexp, UR} -> {user_regexp, [UR]};
+ {user_regexp, UR, S} -> {user_regexp, [[{UR, S}]]};
+ {node_regexp, UR, SR} -> {node_regexp, [[{UR, SR}]]};
+ {user_glob, UR} -> {user_glob, [UR]};
+ {user_glob, UR, S} -> {user_glob, [[{UR, S}]]};
+ {node_glob, UR, SR} -> {node_glob, [[{UR, SR}]]};
+ {server, S} -> {server, [S]};
+ {resource, R} -> {resource, [R]};
+ {server_regexp, SR} -> {server_regexp, [SR]};
+ {server_glob, S} -> {server_glob, [S]};
+ {ip, S} -> {ip, [S]};
+ {resource_glob, R} -> {resource_glob, [R]}
+ end,
+ [{acl, [{Name, [T]}]}|Opts];
+transform_options({access, Name, Rules}, Opts) ->
+ NewRules = [{ACL, Action} || {Action, ACL} <- Rules],
+ [{access, [{Name, NewRules}]}|Opts];
+transform_options(Opt, Opts) ->
+ [Opt|Opts].
diff --git a/src/cyrsasl_digest.erl b/src/cyrsasl_digest.erl
index ecb50c159..3f7133943 100644
--- a/src/cyrsasl_digest.erl
+++ b/src/cyrsasl_digest.erl
@@ -204,11 +204,11 @@ get_local_fqdn() ->
Str when is_binary(Str) -> Str;
_ ->
<<"unknown-fqdn, please configure fqdn "
- "option in ejabberd.cfg!">>
+ "option in ejabberd.yml!">>
end.
get_local_fqdn2() ->
- case ejabberd_config:get_local_option(
+ case ejabberd_config:get_option(
fqdn, fun iolist_to_binary/1) of
ConfiguredFqdn when is_binary(ConfiguredFqdn) ->
ConfiguredFqdn;
diff --git a/src/ejabberd_admin.erl b/src/ejabberd_admin.erl
index 5218d588a..a21331536 100644
--- a/src/ejabberd_admin.erl
+++ b/src/ejabberd_admin.erl
@@ -164,6 +164,12 @@ commands() ->
module = ejd2odbc, function = export,
args = [{host, string}, {file, string}], result = {res, rescode}},
+ #ejabberd_commands{name = convert_to_yaml, tags = [config],
+ desc = "Convert the input file from Erlang to YAML format",
+ module = ejabberd_config, function = convert_to_yaml,
+ args = [{in, string}, {out, string}],
+ result = {res, rescode}},
+
#ejabberd_commands{name = delete_expired_messages, tags = [purge],
desc = "Delete expired offline messages from database",
module = ?MODULE, function = delete_expired_messages,
diff --git a/src/ejabberd_app.erl b/src/ejabberd_app.erl
index ed67f0335..dba61b7d9 100644
--- a/src/ejabberd_app.erl
+++ b/src/ejabberd_app.erl
@@ -47,12 +47,14 @@ start(normal, _Args) ->
db_init(),
start(),
translate:start(),
- acl:start(),
ejabberd_ctl:init(),
ejabberd_commands:init(),
ejabberd_admin:start(),
gen_mod:start(),
ejabberd_config:start(),
+ set_loglevel_from_config(),
+ acl:start(),
+ shaper:start(),
connect_nodes(),
Sup = ejabberd_sup:start_link(),
ejabberd_rdbms:start(),
@@ -119,7 +121,7 @@ db_init() ->
start_modules() ->
lists:foreach(
fun(Host) ->
- Modules = ejabberd_config:get_local_option(
+ Modules = ejabberd_config:get_option(
{modules, Host},
fun(Mods) ->
lists:map(
@@ -137,7 +139,7 @@ start_modules() ->
stop_modules() ->
lists:foreach(
fun(Host) ->
- Modules = ejabberd_config:get_local_option(
+ Modules = ejabberd_config:get_option(
{modules, Host},
fun(Mods) ->
lists:map(
@@ -152,7 +154,7 @@ stop_modules() ->
end, ?MYHOSTS).
connect_nodes() ->
- Nodes = ejabberd_config:get_local_option(
+ Nodes = ejabberd_config:get_option(
cluster_nodes,
fun(Ns) ->
true = lists:all(fun is_atom/1, Ns),
@@ -212,9 +214,17 @@ delete_pid_file() ->
file:delete(PidFilename)
end.
+set_loglevel_from_config() ->
+ Level = ejabberd_config:get_option(
+ loglevel,
+ fun(P) when P>=0, P=<5 -> P end,
+ 4),
+ ejabberd_logger:set(Level).
+
start_apps() ->
ejabberd:start_app(sasl),
ejabberd:start_app(ssl),
+ ejabberd:start_app(p1_yaml),
ejabberd:start_app(p1_tls),
ejabberd:start_app(p1_xml),
ejabberd:start_app(p1_stringprep),
diff --git a/src/ejabberd_auth.erl b/src/ejabberd_auth.erl
index 7cc40ae1e..704c82cd4 100644
--- a/src/ejabberd_auth.erl
+++ b/src/ejabberd_auth.erl
@@ -423,7 +423,7 @@ auth_modules() ->
%% Return the list of authenticated modules for a given host
auth_modules(Server) ->
LServer = jlib:nameprep(Server),
- Methods = ejabberd_config:get_local_option(
+ Methods = ejabberd_config:get_option(
{auth_method, LServer},
fun(V) when is_list(V) ->
true = lists:all(fun is_atom/1, V),
diff --git a/src/ejabberd_auth_anonymous.erl b/src/ejabberd_auth_anonymous.erl
index d8101efc4..180e9d0df 100644
--- a/src/ejabberd_auth_anonymous.erl
+++ b/src/ejabberd_auth_anonymous.erl
@@ -104,7 +104,7 @@ is_login_anonymous_enabled(Host) ->
%% Return the anonymous protocol to use: sasl_anon|login_anon|both
%% defaults to login_anon
anonymous_protocol(Host) ->
- ejabberd_config:get_local_option(
+ ejabberd_config:get_option(
{anonymous_protocol, Host},
fun(sasl_anon) -> sasl_anon;
(login_anon) -> login_anon;
@@ -115,7 +115,7 @@ anonymous_protocol(Host) ->
%% Return true if multiple connections have been allowed in the config file
%% defaults to false
allow_multiple_connections(Host) ->
- ejabberd_config:get_local_option(
+ ejabberd_config:get_option(
{allow_multiple_connections, Host},
fun(V) when is_boolean(V) -> V end,
false).
diff --git a/src/ejabberd_auth_external.erl b/src/ejabberd_auth_external.erl
index 2d1bb7cb9..514b551d7 100644
--- a/src/ejabberd_auth_external.erl
+++ b/src/ejabberd_auth_external.erl
@@ -48,7 +48,7 @@
%%% API
%%%----------------------------------------------------------------------
start(Host) ->
- Cmd = ejabberd_config:get_local_option(
+ Cmd = ejabberd_config:get_option(
{extauth_program, Host},
fun(V) ->
binary_to_list(iolist_to_binary(V))
@@ -171,7 +171,7 @@ remove_user(User, Server, Password) ->
%% @spec (Host::string()) -> false | {true, CacheTime::integer()}
get_cache_option(Host) ->
- case ejabberd_config:get_local_option(
+ case ejabberd_config:get_option(
{extauth_cache, Host},
fun(I) when is_integer(I), I > 0 -> I end) of
undefined -> false;
diff --git a/src/ejabberd_auth_internal.erl b/src/ejabberd_auth_internal.erl
index 5a6c1b10a..8d7d0a0dd 100644
--- a/src/ejabberd_auth_internal.erl
+++ b/src/ejabberd_auth_internal.erl
@@ -406,7 +406,7 @@ is_scrammed() ->
is_option_scram() ->
scram ==
- ejabberd_config:get_local_option({auth_password_format, ?MYNAME},
+ ejabberd_config:get_option({auth_password_format, ?MYNAME},
fun(V) -> V end).
maybe_alert_password_scrammed_without_option() ->
diff --git a/src/ejabberd_auth_ldap.erl b/src/ejabberd_auth_ldap.erl
index 1baf43887..1c1a4f313 100644
--- a/src/ejabberd_auth_ldap.erl
+++ b/src/ejabberd_auth_ldap.erl
@@ -369,8 +369,10 @@ parse_options(Host) ->
{iolist_to_binary(U),
iolist_to_binary(P)};
({U}) ->
+ {iolist_to_binary(U)};
+ (U) ->
{iolist_to_binary(U)}
- end, Us)
+ end, lists:flatten(Us))
end, [{<<"uid">>, <<"%u">>}]),
UIDs = eldap_utils:uids_domain_subst(Host, UIDsTemp),
SubFilter = eldap_utils:generate_subfilter(UIDs),
diff --git a/src/ejabberd_auth_pam.erl b/src/ejabberd_auth_pam.erl
index c81208494..8e744e2c4 100644
--- a/src/ejabberd_auth_pam.erl
+++ b/src/ejabberd_auth_pam.erl
@@ -107,13 +107,13 @@ store_type() -> external.
%% Internal functions
%%====================================================================
get_pam_service(Host) ->
- ejabberd_config:get_local_option(
+ ejabberd_config:get_option(
{pam_service, Host},
fun iolist_to_binary/1,
<<"ejabberd">>).
get_pam_userinfotype(Host) ->
- ejabberd_config:get_local_option(
+ ejabberd_config:get_option(
{pam_userinfotype, Host},
fun(username) -> username;
(jid) -> jid
diff --git a/src/ejabberd_c2s.erl b/src/ejabberd_c2s.erl
index 5e50d9bf9..610f22c24 100644
--- a/src/ejabberd_c2s.erl
+++ b/src/ejabberd_c2s.erl
@@ -47,7 +47,8 @@
del_aux_field/2,
get_subscription/2,
broadcast/4,
- get_subscribed/1]).
+ get_subscribed/1,
+ transform_listen_option/2]).
%% gen_fsm callbacks
-export([init/1,
@@ -233,11 +234,10 @@ init([{SockMod, Socket}, Opts]) ->
{value, {_, XS}} -> XS;
_ -> false
end,
- Zlib = lists:member(zlib, Opts),
- StartTLS = lists:member(starttls, Opts),
- StartTLSRequired = lists:member(starttls_required,
- Opts),
- TLSEnabled = lists:member(tls, Opts),
+ Zlib = proplists:get_bool(zlib, Opts),
+ StartTLS = proplists:get_bool(starttls, Opts),
+ StartTLSRequired = proplists:get_bool(starttls_required, Opts),
+ TLSEnabled = proplists:get_bool(tls, Opts),
TLS = StartTLS orelse
StartTLSRequired orelse TLSEnabled,
TLSOpts1 = lists:filter(fun ({certfile, _}) -> true;
@@ -682,7 +682,7 @@ wait_for_feature_request({xmlstreamelement, El},
when TLS == true, TLSEnabled == false,
SockMod == gen_tcp ->
TLSOpts = case
- ejabberd_config:get_local_option(
+ ejabberd_config:get_option(
{domain_certfile, StateData#state.server},
fun iolist_to_binary/1)
of
@@ -876,7 +876,7 @@ resource_conflict_action(U, S, R) ->
R)
of
true ->
- ejabberd_config:get_local_option(
+ ejabberd_config:get_option(
{resource_conflict, S},
fun(setresource) -> setresource;
(closeold) -> closeold;
@@ -2279,7 +2279,7 @@ fsm_limit_opts(Opts) ->
case lists:keysearch(max_fsm_queue, 1, Opts) of
{value, {_, N}} when is_integer(N) -> [{max_queue, N}];
_ ->
- case ejabberd_config:get_local_option(
+ case ejabberd_config:get_option(
max_fsm_queue,
fun(I) when is_integer(I), I > 0 -> I end) of
undefined -> [];
@@ -2377,3 +2377,6 @@ pack_string(String, Pack) ->
{value, PackedString} -> {PackedString, Pack};
none -> {String, gb_trees:insert(String, String, Pack)}
end.
+
+transform_listen_option(Opt, Opts) ->
+ [Opt|Opts].
diff --git a/src/ejabberd_c2s_config.erl b/src/ejabberd_c2s_config.erl
index 4dbc48f38..2229e5ef1 100644
--- a/src/ejabberd_c2s_config.erl
+++ b/src/ejabberd_c2s_config.erl
@@ -34,7 +34,7 @@
%% Get first c2s configuration limitations to apply it to other c2s
%% connectors.
get_c2s_limits() ->
- case ejabberd_config:get_local_option(listen, fun(V) -> V end) of
+ case ejabberd_config:get_option(listen, fun(V) -> V end) of
undefined -> [];
C2SFirstListen ->
case lists:keysearch(ejabberd_c2s, 2, C2SFirstListen) of
diff --git a/src/ejabberd_captcha.erl b/src/ejabberd_captcha.erl
index 7442cf73c..e9a3ea3a9 100644
--- a/src/ejabberd_captcha.erl
+++ b/src/ejabberd_captcha.erl
@@ -504,7 +504,7 @@ do_create_image(Key) ->
end.
get_prog_name() ->
- case ejabberd_config:get_local_option(
+ case ejabberd_config:get_option(
captcha_cmd,
fun(FileName) ->
F = iolist_to_binary(FileName),
@@ -521,7 +521,7 @@ get_prog_name() ->
end.
get_url(Str) ->
- CaptchaHost = ejabberd_config:get_local_option(
+ CaptchaHost = ejabberd_config:get_option(
captcha_host,
fun iolist_to_binary/1,
<<"">>),
@@ -549,7 +549,7 @@ get_transfer_protocol(PortString) ->
get_captcha_transfer_protocol(PortListeners).
get_port_listeners(PortNumber) ->
- AllListeners = ejabberd_config:get_local_option(listen, fun(V) -> V end),
+ AllListeners = ejabberd_config:get_option(listen, fun(V) -> V end),
lists:filter(fun ({{Port, _Ip, _Netp}, _Module1,
_Opts1})
when Port == PortNumber ->
@@ -579,7 +579,7 @@ get_captcha_transfer_protocol([_ | Listeners]) ->
is_limited(undefined) -> false;
is_limited(Limiter) ->
- case ejabberd_config:get_local_option(
+ case ejabberd_config:get_option(
captcha_limit,
fun(I) when is_integer(I), I > 0 -> I end) of
undefined -> false;
diff --git a/src/ejabberd_config.erl b/src/ejabberd_config.erl
index b46603270..0551b49a5 100644
--- a/src/ejabberd_config.erl
+++ b/src/ejabberd_config.erl
@@ -27,16 +27,16 @@
-module(ejabberd_config).
-author('alexey@process-one.net').
--export([start/0, load_file/1,
+-export([start/0, load_file/1, read_file/1,
add_global_option/2, add_local_option/2,
get_global_option/2, get_local_option/2,
get_global_option/3, get_local_option/3,
- get_option/2, get_option/3, add_option/2]).
--export([get_vh_by_auth_method/1]).
--export([is_file_readable/1]).
--export([get_version/0, get_myhosts/0, get_mylang/0]).
--export([prepare_opt_val/4]).
--export([convert_table_to_binary/5]).
+ get_option/2, get_option/3, add_option/2,
+ get_vh_by_auth_method/1, is_file_readable/1,
+ get_version/0, get_myhosts/0, get_mylang/0,
+ prepare_opt_val/4, convert_table_to_binary/5,
+ transform_options/1, collect_options/1,
+ convert_to_yaml/1, convert_to_yaml/2]).
-include("ejabberd.hrl").
-include("logger.hrl").
@@ -53,21 +53,29 @@
start() ->
+ case catch mnesia:table_info(local_config, storage_type) of
+ disc_copies ->
+ mnesia:delete_table(local_config);
+ _ ->
+ ok
+ end,
mnesia:create_table(local_config,
- [{disc_copies, [node()]},
+ [{ram_copies, [node()]},
{local_content, true},
{attributes, record_info(fields, local_config)}]),
mnesia:add_table_copy(local_config, node(), ram_copies),
Config = get_ejabberd_config_path(),
- load_file(Config),
+ State = read_file(Config),
%% This start time is used by mod_last:
- add_option(node_start, now()),
- ok.
+ {MegaSecs, Secs, _} = now(),
+ UnixTime = MegaSecs*1000000 + Secs,
+ State1 = set_option({node_start, global}, UnixTime, State),
+ set_opts(State1).
%% @doc Get the filename of the ejabberd configuration file.
-%% The filename can be specified with: erl -config "/path/to/ejabberd.cfg".
+%% The filename can be specified with: erl -config "/path/to/ejabberd.yml".
%% It can also be specified with the environtment variable EJABBERD_CONFIG_PATH.
-%% If not specified, the default value 'ejabberd.cfg' is assumed.
+%% If not specified, the default value 'ejabberd.yml' is assumed.
%% @spec () -> string()
get_ejabberd_config_path() ->
case application:get_env(config) of
@@ -81,16 +89,59 @@ get_ejabberd_config_path() ->
end
end.
-%% @doc Load the ejabberd configuration file.
+%% @doc Read the ejabberd configuration file.
%% It also includes additional configuration files and replaces macros.
%% This function will crash if finds some error in the configuration file.
-%% @spec (File::string()) -> ok
-load_file(File) ->
- Terms = get_plain_terms_file(File),
+%% @spec (File::string()) -> #state{}.
+read_file(File) ->
+ read_file(File, [{replace_macros, true},
+ {include_files, true}]).
+
+read_file(File, Opts) ->
+ Terms1 = get_plain_terms_file(File, Opts),
+ Terms_macros = case proplists:get_bool(replace_macros, Opts) of
+ true -> replace_macros(Terms1);
+ false -> Terms1
+ end,
+ Terms = transform_terms(Terms_macros),
State = lists:foldl(fun search_hosts/2, #state{}, Terms),
- Terms_macros = replace_macros(Terms),
- Res = lists:foldl(fun process_term/2, State, Terms_macros),
- set_opts(Res).
+ {Head, Tail} = lists:partition(
+ fun({host_config, _}) -> false;
+ ({append_host_config, _}) -> false;
+ (_) -> true
+ end, Terms),
+ State1 = lists:foldl(fun process_term/2, State, Head ++ Tail),
+ State1#state{opts = compact(State1#state.opts)}.
+
+-spec load_file(string()) -> ok.
+
+load_file(File) ->
+ State = read_file(File),
+ set_opts(State).
+
+-spec convert_to_yaml(file:filename()) -> ok | {error, any()}.
+
+convert_to_yaml(File) ->
+ convert_to_yaml(File, stdout).
+
+-spec convert_to_yaml(file:filename(),
+ stdout | file:filename()) -> ok | {error, any()}.
+
+convert_to_yaml(File, Output) ->
+ State = read_file(File, [{include_files, false}]),
+ Opts = [{K, V} || #local_config{key = K, value = V} <- State#state.opts],
+ {GOpts, HOpts} = split_by_hosts(Opts),
+ NewOpts = GOpts ++ lists:map(
+ fun({Host, Opts1}) ->
+ {host_config, [{Host, Opts1}]}
+ end, HOpts),
+ Data = p1_yaml:encode(lists:reverse(NewOpts)),
+ case Output of
+ stdout ->
+ io:format("~s~n", [Data]);
+ FileName ->
+ file:write_file(FileName, Data)
+ end.
%% @doc Read an ejabberd configuration file and return the terms.
%% Input is an absolute or relative path to an ejabberd config file.
@@ -99,22 +150,47 @@ load_file(File) ->
%% and the terms in those files were included.
%% @spec(string()) -> [term()]
%% @spec(iolist()) -> [term()]
-get_plain_terms_file(File) when is_binary(File) ->
- get_plain_terms_file(binary_to_list(File));
-get_plain_terms_file(File1) ->
+get_plain_terms_file(File) ->
+ get_plain_terms_file(File, [{include_files, true}]).
+
+get_plain_terms_file(File, Opts) when is_binary(File) ->
+ get_plain_terms_file(binary_to_list(File), Opts);
+get_plain_terms_file(File1, Opts) ->
File = get_absolute_path(File1),
- case file:consult(File) of
+ case consult(File) of
{ok, Terms} ->
BinTerms = strings_to_binary(Terms),
- include_config_files(BinTerms);
- {error, {LineNumber, erl_parse, _ParseMessage} = Reason} ->
- ExitText = describe_config_problem(File, Reason, LineNumber),
- ?ERROR_MSG(ExitText, []),
- exit_or_halt(ExitText);
+ case proplists:get_bool(include_files, Opts) of
+ true ->
+ include_config_files(BinTerms);
+ false ->
+ BinTerms
+ end;
{error, Reason} ->
- ExitText = describe_config_problem(File, Reason),
- ?ERROR_MSG(ExitText, []),
- exit_or_halt(ExitText)
+ ?ERROR_MSG(Reason, []),
+ exit_or_halt(Reason)
+ end.
+
+consult(File) ->
+ case filename:extension(File) of
+ ".yml" ->
+ case p1_yaml:decode_from_file(File, [plain_as_atom]) of
+ {ok, []} ->
+ {ok, []};
+ {ok, [Document|_]} ->
+ {ok, Document};
+ {error, Err} ->
+ {error, p1_yaml:format_error(Err)}
+ end;
+ _ ->
+ case file:consult(File) of
+ {ok, Terms} ->
+ {ok, Terms};
+ {error, {LineNumber, erl_parse, _ParseMessage} = Reason} ->
+ {error, describe_config_problem(File, Reason, LineNumber)};
+ {error, Reason} ->
+ {error, describe_config_problem(File, Reason)}
+ end
end.
%% @doc Convert configuration filename to absolute path.
@@ -158,7 +234,7 @@ search_hosts(Term, State) ->
add_hosts_to_option(Hosts, State) ->
PrepHosts = normalize_hosts(Hosts),
- add_option(hosts, PrepHosts, State#state{hosts = PrepHosts}).
+ set_option({hosts, global}, PrepHosts, State#state{hosts = PrepHosts}).
normalize_hosts(Hosts) ->
normalize_hosts(Hosts,[]).
@@ -232,21 +308,37 @@ exit_or_halt(ExitText) ->
%% @doc Include additional configuration files in the list of terms.
%% @spec ([term()]) -> [term()]
include_config_files(Terms) ->
- include_config_files(Terms, []).
+ {FileOpts, Terms1} =
+ lists:mapfoldl(
+ fun({include_config_file, _} = T, Ts) ->
+ {[transform_include_option(T)], Ts};
+ ({include_config_file, _, _} = T, Ts) ->
+ {[transform_include_option(T)], Ts};
+ (T, Ts) ->
+ {[], [T|Ts]}
+ end, [], Terms),
+ Terms2 = lists:flatmap(
+ fun({File, Opts}) ->
+ include_config_file(File, Opts)
+ end, lists:flatten(FileOpts)),
+ Terms1 ++ Terms2.
+
+transform_include_option({include_config_file, File}) when is_list(File) ->
+ case is_string(File) of
+ true -> {File, []};
+ false -> File
+ end;
+transform_include_option({include_config_file, Filename}) ->
+ {Filename, []};
+transform_include_option({include_config_file, Filename, Options}) ->
+ {Filename, Options}.
-include_config_files([], Res) ->
- Res;
-include_config_files([{include_config_file, Filename} | Terms], Res) ->
- include_config_files([{include_config_file, Filename, []} | Terms], Res);
-include_config_files([{include_config_file, Filename, Options} | Terms], Res) ->
+include_config_file(Filename, Options) ->
Included_terms = get_plain_terms_file(Filename),
Disallow = proplists:get_value(disallow, Options, []),
Included_terms2 = delete_disallowed(Disallow, Included_terms),
Allow_only = proplists:get_value(allow_only, Options, all),
- Included_terms3 = keep_only_allowed(Allow_only, Included_terms2),
- include_config_files(Terms, Res ++ Included_terms3);
-include_config_files([Term | Terms], Res) ->
- include_config_files(Terms, Res ++ [Term]).
+ keep_only_allowed(Allow_only, Included_terms2).
%% @doc Filter from the list of terms the disallowed.
%% Returns a sublist of Terms without the ones which first element is
@@ -308,12 +400,19 @@ split_terms_macros(Terms) ->
fun(Term, {TOs, Ms}) ->
case Term of
{define_macro, Key, Value} ->
- case is_atom(Key) and is_all_uppercase(Key) of
+ case is_correct_macro({Key, Value}) of
true ->
{TOs, Ms++[{Key, Value}]};
false ->
exit({macro_not_properly_defined, Term})
end;
+ {define_macro, KeyVals} ->
+ case lists:all(fun is_correct_macro/1, KeyVals) of
+ true ->
+ {TOs, Ms ++ KeyVals};
+ false ->
+ exit({macros_not_properly_defined, Term})
+ end;
Term ->
{TOs ++ [Term], Ms}
end
@@ -321,6 +420,11 @@ split_terms_macros(Terms) ->
{[], []},
Terms).
+is_correct_macro({Key, _Val}) ->
+ is_atom(Key) and is_all_uppercase(Key);
+is_correct_macro(_) ->
+ false.
+
%% @doc Recursively replace in Terms macro usages with the defined value.
%% @spec (Terms, Macros) -> Terms
%% Terms = [term()]
@@ -328,7 +432,9 @@ split_terms_macros(Terms) ->
replace([], _) ->
[];
replace([Term|Terms], Macros) ->
- [replace_term(Term, Macros) | replace(Terms, Macros)].
+ [replace_term(Term, Macros) | replace(Terms, Macros)];
+replace(Term, Macros) ->
+ replace_term(Term, Macros).
replace_term(Key, Macros) when is_atom(Key) ->
case is_all_uppercase(Key) of
@@ -362,121 +468,65 @@ is_all_uppercase(Atom) ->
process_term(Term, State) ->
case Term of
- override_global ->
- State#state{override_global = true};
- override_local ->
- State#state{override_local = true};
- override_acls ->
- State#state{override_acls = true};
- {host_config, Host, Terms} ->
- lists:foldl(fun(T, S) -> process_host_term(T, Host, S) end,
- State, Terms);
- {listen, Listeners} ->
- Listeners2 =
- lists:map(
- fun({PortIP, Module, Opts}) ->
- {Port, IPT, _, _, Proto, OptsClean} =
- ejabberd_listener:parse_listener_portip(PortIP, Opts),
- {{Port, IPT, Proto}, Module, OptsClean}
- end,
- Listeners),
- add_option(listen, Listeners2, State);
- {s2s_certfile, CertFile} ->
- CertFileS = binary_to_list(CertFile),
- case ejabberd_config:is_file_readable(CertFileS) of
- true -> add_option(s2s_certfile, CertFile, State);
- false ->
- ErrorText = "There is a problem in the configuration: "
- "the specified file is not readable: ",
- throw({error, ErrorText ++ CertFileS})
- end;
- {domain_certfile, Domain, CertFile} ->
- CertFileS = binary_to_list(CertFile),
- case ejabberd_config:is_file_readable(CertFileS) of
- true -> add_option({domain_certfile, Domain}, CertFile, State);
- false ->
- ErrorText = "There is a problem in the configuration: "
- "the specified file is not readable: ",
- throw({error, ErrorText ++ CertFileS})
- end;
- {loglevel, Loglevel} ->
- ejabberd_logger:set(Loglevel),
- State;
+ {host_config, HostTerms} ->
+ lists:foldl(
+ fun({Host, Terms}, AccState) ->
+ lists:foldl(fun(T, S) ->
+ process_host_term(T, Host, S, set)
+ end, AccState, Terms)
+ end, State, HostTerms);
+ {append_host_config, HostTerms} ->
+ lists:foldl(
+ fun({Host, Terms}, AccState) ->
+ lists:foldl(fun(T, S) ->
+ process_host_term(T, Host, S, append)
+ end, AccState, Terms)
+ end, State, HostTerms);
_ ->
- lists:foldl(fun(Host, S) -> process_host_term(Term, Host, S) end,
- State, [global|State#state.hosts])
+ process_host_term(Term, global, State, set)
end.
-process_host_term(Term, Host, State) ->
+process_host_term(Term, Host, State, Action) ->
case Term of
- {acl, ACLName, ACLData} ->
- State#state{opts =
- [acl:to_record(Host, ACLName, ACLData) | State#state.opts]};
- {access, RuleName, Rules} ->
- add_option({access, RuleName, Host}, Rules, State);
- {shaper, Name, Data} ->
- add_option({shaper, Name, Host}, Data, State);
- {modules, Modules} ->
- add_option({modules, Host}, replace_modules(Modules), State);
+ {modules, Modules} when Action == set ->
+ set_option({modules, Host}, replace_modules(Modules), State);
+ {modules, Modules} when Action == append ->
+ append_option({modules, Host}, replace_modules(Modules), State);
{host, _} ->
State;
{hosts, _} ->
State;
- {Opt, Val} ->
- add_option({Opt, Host}, Val, State)
- end.
-
-add_option(Opt, Val, State) when is_atom(Opt) ->
- add_option({Opt, global}, Val, State);
-add_option(Opt, Val, State) ->
- case Opt of
- {{add, OptName}, Host} ->
- State#state{opts = compact({OptName, Host}, Val,
- State#state.opts, [])};
- _ ->
- State#state{opts = [#local_config{key = Opt, value = Val} |
- State#state.opts]}
- end.
-
-compact({OptName, Host} = Opt, Val, [], Os) ->
- ?WARNING_MSG("The option '~p' is defined for the host ~p using host_config "
- "before the global '~p' option. This host_config option may get overwritten.", [OptName, Host, OptName]),
- [#local_config{key = Opt, value = Val}] ++ Os;
-%% Traverse the list of the options already parsed
-compact(Opt, Val, [O | Os1], Os2) ->
- case catch O#local_config.key of
- %% If the key of a local_config matches the Opt that wants to be added
- Opt ->
- %% Then prepend the new value to the list of old values
- Os2 ++ [#local_config{key = Opt,
- value = Val++O#local_config.value}
- ] ++ Os1;
- _ ->
- compact(Opt, Val, Os1, Os2++[O])
+ {Opt, Val} when Action == set ->
+ set_option({Opt, Host}, Val, State);
+ {Opt, Val} when Action == append ->
+ append_option({Opt, Host}, Val, State);
+ Opt ->
+ ?WARNING_MSG("Ignore invalid (outdated?) option ~p", [Opt]),
+ State
end.
+set_option(Opt, Val, State) ->
+ State#state{opts = [#local_config{key = Opt, value = Val} |
+ State#state.opts]}.
+
+append_option({Opt, Host}, Val, State) ->
+ GlobalVals = lists:flatmap(
+ fun(#local_config{key = {O, global}, value = V})
+ when O == Opt ->
+ if is_list(V) -> V;
+ true -> [V]
+ end;
+ (_) ->
+ []
+ end, State#state.opts),
+ NewVal = if is_list(Val) -> Val ++ GlobalVals;
+ true -> [Val|GlobalVals]
+ end,
+ set_option({Opt, Host}, NewVal, State).
set_opts(State) ->
- Opts = lists:reverse(State#state.opts),
+ Opts = State#state.opts,
F = fun() ->
- if
- State#state.override_local ->
- Ksl = mnesia:all_keys(local_config),
- lists:foreach(fun(K) ->
- mnesia:delete({local_config, K})
- end, Ksl);
- true ->
- ok
- end,
- if
- State#state.override_acls ->
- Ksa = mnesia:all_keys(acl),
- lists:foreach(fun(K) ->
- mnesia:delete({acl, K})
- end, Ksa);
- true ->
- ok
- end,
lists:foreach(fun(R) ->
mnesia:write(R)
end, Opts)
@@ -565,11 +615,22 @@ get_option(Opt, F) ->
get_option(Opt, F, Default) when is_atom(Opt) ->
get_option({Opt, global}, F, Default);
get_option(Opt, F, Default) ->
+ case Opt of
+ {O, global} when is_atom(O) -> ok;
+ {O, H} when is_atom(O), is_binary(H) -> ok;
+ _ -> ?WARNING_MSG("Option ~p has invalid (outdated?) format. "
+ "This is likely a bug", [Opt])
+ end,
case ets:lookup(local_config, Opt) of
[#local_config{value = Val}] ->
prepare_opt_val(Opt, Val, F, Default);
- _ ->
- Default
+ _ ->
+ case Opt of
+ {Key, Host} when Host /= global ->
+ get_option({Key, global}, F, Default);
+ _ ->
+ Default
+ end
end.
-spec get_vh_by_auth_method(atom()) -> [binary()].
@@ -632,14 +693,14 @@ replace_modules(Modules) ->
emit_deprecation_warning(Module, NewModule, DBType),
NewOpts = [{db_type, DBType} |
lists:keydelete(db_type, 1, Opts)],
- {NewModule, NewOpts};
+ {NewModule, transform_module_options(Module, NewOpts)};
NewModule ->
if Module /= NewModule ->
emit_deprecation_warning(Module, NewModule);
true ->
ok
end,
- {NewModule, Opts}
+ {NewModule, transform_module_options(Module, Opts)}
end
end, Modules).
@@ -695,6 +756,142 @@ format_term(S) when is_list(S), S /= [] ->
format_term(T) ->
io_lib:format("~p", [binary_to_strings(T)]).
+transform_terms(Terms) ->
+ %% We could check all ejabberd beams, but this
+ %% slows down start-up procedure :(
+ Mods = [mod_register,
+ mod_last,
+ ejabberd_s2s,
+ ejabberd_listener,
+ ejabberd_odbc_sup,
+ shaper,
+ ejabberd_s2s_out,
+ acl,
+ ejabberd_config],
+ collect_options(transform_terms(Mods, Terms)).
+
+transform_terms([Mod|Mods], Terms) ->
+ case catch Mod:transform_options(Terms) of
+ {'EXIT', _} = Err ->
+ ?ERROR_MSG("Failed to transform terms by ~p: ~p", [Mod, Err]),
+ transform_terms(Mods, Terms);
+ NewTerms ->
+ transform_terms(Mods, NewTerms)
+ end;
+transform_terms([], NewTerms) ->
+ NewTerms.
+
+transform_module_options(Module, Opts) ->
+ Opts1 = gen_iq_handler:transform_module_options(Opts),
+ try
+ Module:transform_module_options(Opts1)
+ catch error:undef ->
+ Opts1
+ end.
+
+compact(Cfg) ->
+ Opts = [{K, V} || #local_config{key = K, value = V} <- Cfg],
+ {GOpts, HOpts} = split_by_hosts(Opts),
+ [#local_config{key = {O, global}, value = V} || {O, V} <- GOpts] ++
+ lists:flatmap(
+ fun({Host, OptVal}) ->
+ case lists:member(OptVal, GOpts) of
+ true ->
+ [];
+ false ->
+ [#local_config{key = {Opt, Host}, value = Val}
+ || {Opt, Val} <- OptVal]
+ end
+ end, lists:flatten(HOpts)).
+
+split_by_hosts(Opts) ->
+ Opts1 = orddict:to_list(
+ lists:foldl(
+ fun({{Opt, Host}, Val}, D) ->
+ orddict:append(Host, {Opt, Val}, D)
+ end, orddict:new(), Opts)),
+ case lists:keytake(global, 1, Opts1) of
+ {value, {global, GlobalOpts}, HostOpts} ->
+ {GlobalOpts, HostOpts};
+ _ ->
+ {[], Opts1}
+ end.
+
+collect_options(Opts) ->
+ {D, InvalidOpts} =
+ lists:foldl(
+ fun({K, V}, {D, Os}) when is_list(V) ->
+ {orddict:append_list(K, V, D), Os};
+ ({K, V}, {D, Os}) ->
+ {orddict:store(K, V, D), Os};
+ (Opt, {D, Os}) ->
+ {D, [Opt|Os]}
+ end, {orddict:new(), []}, Opts),
+ InvalidOpts ++ orddict:to_list(D).
+
+transform_options(Opts) ->
+ Opts1 = lists:foldl(fun transform_options/2, [], Opts),
+ {HOpts, Opts2} = lists:mapfoldl(
+ fun({host_config, O}, Os) ->
+ {[O], Os};
+ (O, Os) ->
+ {[], [O|Os]}
+ end, [], Opts1),
+ {AHOpts, Opts3} = lists:mapfoldl(
+ fun({append_host_config, O}, Os) ->
+ {[O], Os};
+ (O, Os) ->
+ {[], [O|Os]}
+ end, [], Opts2),
+ HOpts1 = case collect_options(lists:flatten(HOpts)) of
+ [] ->
+ [];
+ HOs ->
+ [{host_config,
+ [{H, transform_terms(O)} || {H, O} <- HOs]}]
+ end,
+ AHOpts1 = case collect_options(lists:flatten(AHOpts)) of
+ [] ->
+ [];
+ AHOs ->
+ [{append_host_config,
+ [{H, transform_terms(O)} || {H, O} <- AHOs]}]
+ end,
+ HOpts1 ++ AHOpts1 ++ Opts3.
+
+transform_options({domain_certfile, Domain, CertFile}, Opts) ->
+ ?WARNING_MSG("Option 'domain_certfile' now should be defined "
+ "per virtual host or globally. The old format is "
+ "still supported but it is better to fix your config", []),
+ [{host_config, [{Domain, [{domain_certfile, CertFile}]}]}|Opts];
+transform_options(Opt, Opts) when Opt == override_global;
+ Opt == override_local;
+ Opt == override_acls ->
+ ?WARNING_MSG("Ignoring '~s' option which has no effect anymore", [Opt]),
+ Opts;
+transform_options({host_config, Host, HOpts}, Opts) ->
+ {AddOpts, HOpts1} =
+ lists:mapfoldl(
+ fun({{add, Opt}, Val}, Os) ->
+ ?WARNING_MSG("Option 'add' is deprecated. "
+ "The option is still supported "
+ "but it is better to fix your config: "
+ "use 'append_host_config' instead.", []),
+ {[{Opt, Val}], Os};
+ (O, Os) ->
+ {[], [O|Os]}
+ end, [], HOpts),
+ [{append_host_config, [{Host, lists:flatten(AddOpts)}]},
+ {host_config, [{Host, HOpts1}]}|Opts];
+transform_options({define_macro, Macro, Val}, Opts) ->
+ [{define_macro, [{Macro, Val}]}|Opts];
+transform_options({include_config_file, _} = Opt, Opts) ->
+ [{include_config_file, [transform_include_option(Opt)]} | Opts];
+transform_options({include_config_file, _, _} = Opt, Opts) ->
+ [{include_config_file, [transform_include_option(Opt)]} | Opts];
+transform_options(Opt, Opts) ->
+ [Opt|Opts].
+
-spec convert_table_to_binary(atom(), [atom()], atom(),
fun(), fun()) -> ok.
diff --git a/src/ejabberd_ctl.erl b/src/ejabberd_ctl.erl
index 38b94ef4d..d3944e266 100644
--- a/src/ejabberd_ctl.erl
+++ b/src/ejabberd_ctl.erl
@@ -237,7 +237,7 @@ process2(Args, Auth, AccessCommands) ->
end.
get_accesscommands() ->
- ejabberd_config:get_local_option(ejabberdctl_access_commands,
+ ejabberd_config:get_option(ejabberdctl_access_commands,
fun(V) when is_list(V) -> V end, []).
%%-----------------------------
diff --git a/src/ejabberd_frontend_socket.erl b/src/ejabberd_frontend_socket.erl
index adc7c2579..583396ec9 100644
--- a/src/ejabberd_frontend_socket.erl
+++ b/src/ejabberd_frontend_socket.erl
@@ -280,7 +280,7 @@ code_change(_OldVsn, State, _Extra) -> {ok, State}.
%%% Internal functions
%%--------------------------------------------------------------------
check_starttls(SockMod, Socket, Receiver, Opts) ->
- TLSEnabled = lists:member(tls, Opts),
+ TLSEnabled = proplists:get_bool(tls, Opts),
TLSOpts = lists:filter(fun({certfile, _}) -> true;
(_) -> false
end, Opts),
@@ -292,4 +292,3 @@ check_starttls(SockMod, Socket, Receiver, Opts) ->
true ->
{SockMod, Socket}
end.
-
diff --git a/src/ejabberd_http.erl b/src/ejabberd_http.erl
index 899d50eb3..151a34ef4 100644
--- a/src/ejabberd_http.erl
+++ b/src/ejabberd_http.erl
@@ -30,7 +30,8 @@
%% External exports
-export([start/2, start_link/2, become_controller/1,
- socket_type/0, receive_headers/1, url_encode/1]).
+ socket_type/0, receive_headers/1, url_encode/1,
+ transform_listen_option/2]).
%% Callbacks
-export([init/2]).
@@ -91,7 +92,7 @@ start_link(SockData, Opts) ->
[SockData, Opts])}.
init({SockMod, Socket}, Opts) ->
- TLSEnabled = lists:member(tls, Opts),
+ TLSEnabled = proplists:get_bool(tls, Opts),
TLSOpts1 = lists:filter(fun ({certfile, _}) -> true;
(_) -> false
end,
@@ -133,12 +134,13 @@ init({SockMod, Socket}, Opts) ->
true -> [{[<<"http-poll">>], ejabberd_http_poll}];
false -> []
end,
- DefinedHandlers = case lists:keysearch(request_handlers,
- 1, Opts)
- of
- {value, {request_handlers, H}} -> H;
- false -> []
- end,
+ DefinedHandlers = gen_mod:get_opt(
+ request_handlers, Opts,
+ fun(Hs) ->
+ [{str:tokens(
+ iolist_to_binary(Path), <<"/">>),
+ Mod} || {Path, Mod} <- Hs]
+ end, []),
RequestHandlers = DefinedHandlers ++ Captcha ++ Register ++
Admin ++ Bind ++ Poll,
?DEBUG("S: ~p~n", [RequestHandlers]),
@@ -484,7 +486,7 @@ analyze_ip_xff(IP, [], _Host) -> IP;
analyze_ip_xff({IPLast, Port}, XFF, Host) ->
[ClientIP | ProxiesIPs] = str:tokens(XFF, <<", ">>) ++
[jlib:ip_to_list(IPLast)],
- TrustedProxies = ejabberd_config:get_local_option(
+ TrustedProxies = ejabberd_config:get_option(
{trusted_proxies, Host},
fun(TPs) ->
[iolist_to_binary(TP) || TP <- TPs]
@@ -834,3 +836,25 @@ normalize_path([_Parent, <<"..">>|Path], Norm) ->
normalize_path(Path, Norm);
normalize_path([Part | Path], Norm) ->
normalize_path(Path, [Part|Norm]).
+
+transform_listen_option(captcha, Opts) ->
+ [{captcha, true}|Opts];
+transform_listen_option(register, Opts) ->
+ [{register, true}|Opts];
+transform_listen_option(web_admin, Opts) ->
+ [{web_admin, true}|Opts];
+transform_listen_option(http_bind, Opts) ->
+ [{http_bind, true}|Opts];
+transform_listen_option(http_poll, Opts) ->
+ [{http_poll, true}|Opts];
+transform_listen_option({request_handlers, Hs}, Opts) ->
+ Hs1 = lists:map(
+ fun({PList, Mod}) when is_list(PList) ->
+ Path = iolist_to_binary([[$/, P] || P <- PList]),
+ {Path, Mod};
+ (Opt) ->
+ Opt
+ end, Hs),
+ [{request_handlers, Hs1} | Opts];
+transform_listen_option(Opt, Opts) ->
+ [Opt|Opts].
diff --git a/src/ejabberd_http_poll.erl b/src/ejabberd_http_poll.erl
index f144aeb59..89933a595 100644
--- a/src/ejabberd_http_poll.erl
+++ b/src/ejabberd_http_poll.erl
@@ -205,7 +205,7 @@ get_human_html_xmlel() ->
init([ID, Key, IP]) ->
?INFO_MSG("started: ~p", [{ID, Key, IP}]),
Opts = ejabberd_c2s_config:get_c2s_limits(),
- HTTPPollTimeout = ejabberd_config:get_local_option(
+ HTTPPollTimeout = ejabberd_config:get_option(
{http_poll_timeout, ?MYNAME},
fun(I) when is_integer(I), I>0 -> I end,
?HTTP_POLL_TIMEOUT) * 1000,
diff --git a/src/ejabberd_listener.erl b/src/ejabberd_listener.erl
index be90cf92f..033eb0e0f 100644
--- a/src/ejabberd_listener.erl
+++ b/src/ejabberd_listener.erl
@@ -36,7 +36,8 @@
parse_listener_portip/2,
add_listener/3,
delete_listener/2,
- validate_cfg/1
+ transform_options/1,
+ validate_cfg/1
]).
-include("ejabberd.hrl").
@@ -55,7 +56,7 @@ init(_) ->
{ok, {{one_for_one, 10, 1}, []}}.
bind_tcp_ports() ->
- case ejabberd_config:get_local_option(listen, fun validate_cfg/1) of
+ case ejabberd_config:get_option(listen, fun validate_cfg/1) of
undefined ->
ignore;
Ls ->
@@ -88,7 +89,7 @@ bind_tcp_port(PortIP, Module, RawOpts) ->
end.
start_listeners() ->
- case ejabberd_config:get_local_option(listen, fun validate_cfg/1) of
+ case ejabberd_config:get_option(listen, fun validate_cfg/1) of
undefined ->
ignore;
Ls ->
@@ -267,7 +268,7 @@ strip_ip_option(Opts) ->
Opts),
case IPL of
%% Only the first ip option is considered
- [{ip, T1} | _] when is_tuple(T1) ->
+ [{ip, T1} | _] ->
{T1, OptsNoIP};
[] ->
{no_ip_option, OptsNoIP}
@@ -364,7 +365,7 @@ start_listener_sup(Port, Module, Opts) ->
supervisor:start_child(ejabberd_listeners, ChildSpec).
stop_listeners() ->
- Ports = ejabberd_config:get_local_option(listen, fun validate_cfg/1),
+ Ports = ejabberd_config:get_option(listen, fun validate_cfg/1),
lists:foreach(
fun({PortIpNetp, Module, _Opts}) ->
delete_listener(PortIpNetp, Module)
@@ -397,7 +398,7 @@ add_listener(PortIP, Module, Opts) ->
PortIP1 = {Port, IPT, Proto},
case start_listener(PortIP1, Module, Opts) of
{ok, _Pid} ->
- Ports = case ejabberd_config:get_local_option(
+ Ports = case ejabberd_config:get_option(
listen, fun validate_cfg/1) of
undefined ->
[];
@@ -406,7 +407,8 @@ add_listener(PortIP, Module, Opts) ->
end,
Ports1 = lists:keydelete(PortIP1, 1, Ports),
Ports2 = [{PortIP1, Module, Opts} | Ports1],
- ejabberd_config:add_local_option(listen, Ports2),
+ Ports3 = lists:map(fun transform_option/1, Ports2),
+ ejabberd_config:add_option(listen, Ports3),
ok;
{error, {already_started, _Pid}} ->
{error, {already_started, PortIP}};
@@ -428,7 +430,7 @@ delete_listener(PortIP, Module) ->
delete_listener(PortIP, Module, Opts) ->
{Port, IPT, _, _, Proto, _} = parse_listener_portip(PortIP, Opts),
PortIP1 = {Port, IPT, Proto},
- Ports = case ejabberd_config:get_local_option(
+ Ports = case ejabberd_config:get_option(
listen, fun validate_cfg/1) of
undefined ->
[];
@@ -436,7 +438,8 @@ delete_listener(PortIP, Module, Opts) ->
Ls
end,
Ports1 = lists:keydelete(PortIP1, 1, Ports),
- ejabberd_config:add_local_option(listen, Ports1),
+ Ports2 = lists:map(fun transform_option/1, Ports1),
+ ejabberd_config:add_option(listen, Ports2),
stop_listener(PortIP1, Module).
@@ -541,6 +544,55 @@ format_error(Reason) ->
-define(IS_PORT(P), (is_integer(P) and (P > 0) and (P =< 65535))).
-define(IS_TRANSPORT(T), ((T == tcp) or (T == udp))).
+transform_option({{Port, IP, Transport}, Mod, Opts}) ->
+ IPStr = if is_tuple(IP) ->
+ list_to_binary(inet_parse:ntoa(IP));
+ true ->
+ IP
+ end,
+ Opts1 = lists:map(
+ fun({ip, IPT}) when is_tuple(IPT) ->
+ {ip, list_to_binary(inet_parse:ntoa(IP))};
+ (tls) -> {tls, true};
+ (ssl) -> {tls, true};
+ (zlib) -> {zlib, true};
+ (starttls) -> {starttls, true};
+ (starttls_required) -> {starttls_required, true};
+ (Opt) -> Opt
+ end, Opts),
+ Opts2 = lists:foldl(
+ fun(Opt, Acc) ->
+ try
+ Mod:transform_listen_option(Opt, Acc)
+ catch error:undef ->
+ Acc
+ end
+ end, [], Opts1),
+ TransportOpt = if Transport == tcp -> [];
+ true -> [{transport, Transport}]
+ end,
+ IPOpt = if IPStr == <<"0.0.0.0">> -> [];
+ true -> [{ip, IPStr}]
+ end,
+ IPOpt ++ TransportOpt ++ [{port, Port}, {module, Mod} | Opts2];
+transform_option({{Port, Transport}, Mod, Opts})
+ when ?IS_TRANSPORT(Transport) ->
+ transform_option({{Port, {0,0,0,0}, Transport}, Mod, Opts});
+transform_option({{Port, IP}, Mod, Opts}) ->
+ transform_option({{Port, IP, tcp}, Mod, Opts});
+transform_option({Port, Mod, Opts}) ->
+ transform_option({{Port, {0,0,0,0}, tcp}, Mod, Opts});
+transform_option(Opt) ->
+ Opt.
+
+transform_options(Opts) ->
+ lists:foldl(fun transform_options/2, [], Opts).
+
+transform_options({listen, LOpts}, Opts) ->
+ [{listen, lists:map(fun transform_option/1, LOpts)} | Opts];
+transform_options(Opt, Opts) ->
+ [Opt|Opts].
+
-type transport() :: udp | tcp.
-type port_ip_transport() :: inet:port_number() |
{inet:port_number(), transport()} |
@@ -551,18 +603,21 @@ format_error(Reason) ->
validate_cfg(L) ->
lists:map(
- fun({PortIPTransport, Mod1, Opts}) when is_atom(Mod1), is_list(Opts) ->
- Mod = prepare_mod(Mod1),
- case PortIPTransport of
- Port when ?IS_PORT(Port) ->
- {Port, Mod, Opts};
- {Port, Trans} when ?IS_PORT(Port) and ?IS_TRANSPORT(Trans) ->
- {{Port, Trans}, Mod, Opts};
- {Port, IP} when ?IS_PORT(Port) ->
- {{Port, prepare_ip(IP)}, Mod, Opts};
- {Port, IP, Trans} when ?IS_PORT(Port) and ?IS_TRANSPORT(Trans) ->
- {{Port, prepare_ip(IP), Trans}, Mod, Opts}
- end
+ fun(LOpts) ->
+ lists:foldl(
+ fun({port, Port}, {{_, IP, T}, Mod, Opts}) ->
+ true = ?IS_PORT(Port),
+ {{Port, IP, T}, Mod, Opts};
+ ({ip, IP}, {{Port, _, T}, Mod, Opts}) ->
+ {{Port, prepare_ip(IP), T}, Mod, Opts};
+ ({transport, T}, {{Port, IP, _}, Mod, Opts}) ->
+ true = ?IS_TRANSPORT(T),
+ {{Port, IP, T}, Mod, Opts};
+ ({module, Mod}, {Port, _, Opts}) ->
+ {Port, prepare_mod(Mod), Opts};
+ (Opt, {Port, Mod, Opts}) ->
+ {Port, Mod, [Opt|Opts]}
+ end, {{5222, {0,0,0,0}, tcp}, ejabberd_c2s, []}, LOpts)
end, L).
prepare_ip({A, B, C, D} = IP)
@@ -583,5 +638,5 @@ prepare_mod(ejabberd_stun) ->
prepare_mod(stun) ->
ejabberd:start_app(p1_stun),
stun;
-prepare_mod(Mod) ->
+prepare_mod(Mod) when is_atom(Mod) ->
Mod.
diff --git a/src/ejabberd_node_groups.erl b/src/ejabberd_node_groups.erl
index 4e0335b97..eb39b7265 100644
--- a/src/ejabberd_node_groups.erl
+++ b/src/ejabberd_node_groups.erl
@@ -84,7 +84,12 @@ get_closest_node(Name) ->
%%--------------------------------------------------------------------
init([]) ->
{FE, BE} =
- case ejabberd_config:get_local_option(node_type, fun(N) -> N end) of
+ case ejabberd_config:get_option(
+ node_type,
+ fun(frontend) -> frontend;
+ (backend) -> backend;
+ (generic) -> generic
+ end, generic) of
frontend ->
{true, false};
backend ->
diff --git a/src/ejabberd_odbc.erl b/src/ejabberd_odbc.erl
index 937805579..40a15a5ce 100644
--- a/src/ejabberd_odbc.erl
+++ b/src/ejabberd_odbc.erl
@@ -71,12 +71,12 @@
-define(TOP_LEVEL_TXN, 0).
--define(MAX_TRANSACTION_RESTARTS, 10).
-
-define(PGSQL_PORT, 5432).
-define(MYSQL_PORT, 3306).
+-define(MAX_TRANSACTION_RESTARTS, 10).
+
-define(TRANSACTION_TIMEOUT, 60000).
-define(KEEPALIVE_TIMEOUT, 60000).
@@ -201,8 +201,8 @@ decode_term(Bin) ->
%%% Callback functions from gen_fsm
%%%----------------------------------------------------------------------
init([Host, StartInterval]) ->
- case ejabberd_config:get_local_option(
- {odbc_keepalive_interval, Host},
+ case ejabberd_config:get_option(
+ {keepalive_interval, Host},
fun(I) when is_integer(I), I>0 -> I end) of
undefined ->
ok;
@@ -573,39 +573,39 @@ log(Level, Format, Args) ->
end.
db_opts(Host) ->
- case ejabberd_config:get_local_option(
- {odbc_server, Host},
- fun({Type, Server, DB, User, Pass}) ->
- {Type,
- iolist_to_binary(Server),
- case Type of
- mysql -> ?MYSQL_PORT;
- pgsql -> ?PGSQL_PORT
- end,
- iolist_to_binary(DB),
- iolist_to_binary(User),
- iolist_to_binary(Pass)};
- ({Type, Server, Port, DB, User, Pass})
- when ((Type == mysql) or (Type == pgsql))
- and (is_integer(Port) and ((Port > 0)
- and (Port < 65536))) ->
- {Type,
- iolist_to_binary(Server),
- Port,
- iolist_to_binary(DB),
- iolist_to_binary(User),
- iolist_to_binary(Pass)};
- (S) ->
- iolist_to_binary(S)
- end, <<"localhost">>) of
- {Type, Server, Port, DB, User, Pass} ->
- [Type, Server, Port, DB, User, Pass];
- SQLServer ->
- [odbc, SQLServer]
+ Type = ejabberd_config:get_option({odbc_type, Host},
+ fun(mysql) -> mysql;
+ (pgsql) -> pgsql;
+ (odbc) -> odbc
+ end, odbc),
+ Server = ejabberd_config:get_option({odbc_server, Host},
+ fun iolist_to_binary/1,
+ <<"localhost">>),
+ case Type of
+ odbc ->
+ [odbc, Server];
+ _ ->
+ Port = ejabberd_config:get_option(
+ {port, Host},
+ fun(P) when is_integer(P), P > 0, P < 65536 -> P end,
+ case Type of
+ mysql -> ?MYSQL_PORT;
+ pgsql -> ?PGSQL_PORT
+ end),
+ DB = ejabberd_config:get_option({odbc_database, Host},
+ fun iolist_to_binary/1,
+ <<"ejabberd">>),
+ User = ejabberd_config:get_option({odbc_username, Host},
+ fun iolist_to_binary/1,
+ <<"ejabberd">>),
+ Pass = ejabberd_config:get_option({odbc_password, Host},
+ fun iolist_to_binary/1,
+ <<"">>),
+ [Type, Server, Port, DB, User, Pass]
end.
max_fsm_queue() ->
- ejabberd_config:get_local_option(
+ ejabberd_config:get_option(
max_fsm_queue,
fun(N) when is_integer(N), N > 0 -> N end).
diff --git a/src/ejabberd_odbc_sup.erl b/src/ejabberd_odbc_sup.erl
index 2ddc751f8..86b737948 100644
--- a/src/ejabberd_odbc_sup.erl
+++ b/src/ejabberd_odbc_sup.erl
@@ -30,11 +30,15 @@
%% API
-export([start_link/1, init/1, add_pid/2, remove_pid/2,
- get_pids/1, get_random_pid/1]).
+ get_pids/1, get_random_pid/1, transform_options/1]).
-include("ejabberd.hrl").
-include("logger.hrl").
+-define(PGSQL_PORT, 5432).
+
+-define(MYSQL_PORT, 3306).
+
-define(DEFAULT_POOL_SIZE, 10).
-define(DEFAULT_ODBC_START_INTERVAL, 30).
@@ -56,11 +60,11 @@ start_link(Host) ->
?MODULE, [Host]).
init([Host]) ->
- PoolSize = ejabberd_config:get_local_option(
+ PoolSize = ejabberd_config:get_option(
{odbc_pool_size, Host},
fun(I) when is_integer(I), I>0 -> I end,
?DEFAULT_POOL_SIZE),
- StartInterval = ejabberd_config:get_local_option(
+ StartInterval = ejabberd_config:get_option(
{odbc_start_interval, Host},
fun(I) when is_integer(I), I>0 -> I end,
?DEFAULT_ODBC_START_INTERVAL),
@@ -93,3 +97,20 @@ remove_pid(Host, Pid) ->
mnesia:delete_object(#sql_pool{host = Host, pid = Pid})
end,
mnesia:ets(F).
+
+transform_options(Opts) ->
+ lists:foldl(fun transform_options/2, [], Opts).
+
+transform_options({odbc_server, {Type, Server, Port, DB, User, Pass}}, Opts) ->
+ [{odbc_type, Type},
+ {odbc_server, Server},
+ {odbc_port, Port},
+ {odbc_database, DB},
+ {odbc_username, User},
+ {odbc_password, Pass}|Opts];
+transform_options({odbc_server, {mysql, Server, DB, User, Pass}}, Opts) ->
+ transform_options({odbc_server, {mysql, Server, ?MYSQL_PORT, DB, User, Pass}}, Opts);
+transform_options({odbc_server, {pgsql, Server, DB, User, Pass}}, Opts) ->
+ transform_options({odbc_server, {pgsql, Server, ?PGSQL_PORT, DB, User, Pass}}, Opts);
+transform_options(Opt, Opts) ->
+ [Opt|Opts].
diff --git a/src/ejabberd_rdbms.erl b/src/ejabberd_rdbms.erl
index a7324e4ca..b5525de10 100644
--- a/src/ejabberd_rdbms.erl
+++ b/src/ejabberd_rdbms.erl
@@ -69,18 +69,16 @@ start_odbc(Host, App) ->
start_odbc(Host, App)
end.
-%% Returns {true, App} if we have configured odbc_server for the given host
+%% Returns {true, App} if we have configured odbc for the given host
needs_odbc(Host) ->
LHost = jlib:nameprep(Host),
- case ejabberd_config:get_local_option(
- {odbc_server, LHost}, fun(Res) -> Res end) of
- {mysql, _, _, _, _} -> {true, p1_mysql};
- {pgsql, _, _, _, _} -> {true, p1_pgsql};
- {mysql, _, _, _, _, _} -> {true, p1_mysql};
- {pgsql, _, _, _, _, _} -> {true, p1_pgsql};
- S ->
- case catch iolist_to_binary(S) of
- {'EXIT', _} -> false;
- _ -> true
- end
+ case ejabberd_config:get_option({odbc_type, LHost},
+ fun(mysql) -> mysql;
+ (pgsql) -> pgsql;
+ (odbc) -> odbc
+ end, undefined) of
+ mysql -> {true, p1_mysql};
+ pgsql -> {true, p1_pgsql};
+ odbc -> {true, odbc};
+ undefined -> false
end.
diff --git a/src/ejabberd_router.erl b/src/ejabberd_router.erl
index ea020a186..24f52d329 100644
--- a/src/ejabberd_router.erl
+++ b/src/ejabberd_router.erl
@@ -387,14 +387,10 @@ do_route(OrigFrom, OrigTo, OrigPacket) ->
end.
get_component_number(LDomain) ->
- case
- ejabberd_config:get_local_option({domain_balancing_component_number,
- LDomain}, fun(D) -> D end)
- of
- N when is_integer(N), N > 1 -> N;
- _ -> undefined
- end.
-
+ ejabberd_config:get_option(
+ {domain_balancing_component_number, LDomain},
+ fun(N) when is_integer(N), N > 1 -> N end,
+ undefined).
update_tables() ->
case catch mnesia:table_info(route, attributes) of
diff --git a/src/ejabberd_s2s.erl b/src/ejabberd_s2s.erl
index 591d31da2..b13fdd58e 100644
--- a/src/ejabberd_s2s.erl
+++ b/src/ejabberd_s2s.erl
@@ -45,7 +45,7 @@
handle_info/2, terminate/2, code_change/3]).
%% ejabberd API
--export([get_info_s2s_connections/1]).
+-export([get_info_s2s_connections/1, transform_options/1]).
-include("ejabberd.hrl").
-include("logger.hrl").
@@ -461,12 +461,12 @@ needed_connections_number(Ls, MaxS2SConnectionsNumber,
%% --------------------------------------------------------------------
is_service(From, To) ->
LFromDomain = From#jid.lserver,
- case ejabberd_config:get_local_option(
+ case ejabberd_config:get_option(
{route_subdomains, LFromDomain},
- fun(s2s) -> s2s end) of
+ fun(s2s) -> s2s; (local) -> local end, local) of
s2s -> % bypass RFC 3920 10.3
false;
- undefined ->
+ local ->
Hosts = (?MYHOSTS),
P = fun (ParentDomain) ->
lists:member(ParentDomain, Hosts)
@@ -548,34 +548,50 @@ allow_host2(MyServer, S2SHost) ->
end.
allow_host1(MyHost, S2SHost) ->
- case ejabberd_config:get_local_option(
- {{s2s_host, S2SHost}, MyHost},
- fun(deny) -> deny; (allow) -> allow end)
- of
- deny -> false;
- allow -> true;
- undefined ->
- case ejabberd_config:get_local_option(
- {s2s_default_policy, MyHost},
- fun(deny) -> deny; (allow) -> allow end)
- of
- deny -> false;
- _ ->
- case ejabberd_hooks:run_fold(s2s_allow_host, MyHost,
- allow, [MyHost, S2SHost])
- of
- deny -> false;
- allow -> true;
- _ -> true
- end
- end
+ Rule = ejabberd_config:get_option(
+ s2s_access,
+ fun(A) when is_atom(A) -> A end,
+ all),
+ JID = jlib:make_jid(<<"">>, S2SHost, <<"">>),
+ case acl:match_rule(MyHost, Rule, JID) of
+ deny -> false;
+ allow ->
+ case ejabberd_hooks:run_fold(s2s_allow_host, MyHost,
+ allow, [MyHost, S2SHost]) of
+ deny -> false;
+ allow -> true;
+ _ -> true
+ end
end.
+transform_options(Opts) ->
+ lists:foldl(fun transform_options/2, [], Opts).
+
+transform_options({{s2s_host, Host}, Action}, Opts) ->
+ ?WARNING_MSG("Option 's2s_host' is deprecated. "
+ "The option is still supported but it is better to "
+ "fix your config: use access rules instead.", []),
+ ACLName = jlib:binary_to_atom(
+ iolist_to_binary(["s2s_access_", Host])),
+ [{acl, ACLName, {server, Host}},
+ {access, s2s, [{Action, ACLName}]},
+ {s2s_access, s2s} |
+ Opts];
+transform_options({s2s_default_policy, Action}, Opts) ->
+ ?WARNING_MSG("Option 's2s_default_policy' is deprecated. "
+ "The option is still supported but it is better to "
+ "fix your config: "
+ "use 's2s_access' with an access rule.", []),
+ [{access, s2s, [{Action, all}]},
+ {s2s_access, s2s} |
+ Opts];
+transform_options(Opt, Opts) ->
+ [Opt|Opts].
+
%% Get information about S2S connections of the specified type.
%% @spec (Type) -> [Info]
%% where Type = in | out
%% Info = [{InfoName::atom(), InfoValue::any()}]
-
get_info_s2s_connections(Type) ->
ChildType = case Type of
in -> ejabberd_s2s_in_sup;
diff --git a/src/ejabberd_s2s_in.erl b/src/ejabberd_s2s_in.erl
index 7692614ea..2ad335657 100644
--- a/src/ejabberd_s2s_in.erl
+++ b/src/ejabberd_s2s_in.erl
@@ -149,7 +149,7 @@ init([{SockMod, Socket}, Opts]) ->
_ -> none
end,
{StartTLS, TLSRequired, TLSCertverify} =
- case ejabberd_config:get_local_option(
+ case ejabberd_config:get_option(
s2s_use_starttls,
fun(false) -> false;
(true) -> true;
@@ -171,7 +171,7 @@ init([{SockMod, Socket}, Opts]) ->
required_trusted ->
{true, true, true}
end,
- TLSOpts1 = case ejabberd_config:get_local_option(
+ TLSOpts1 = case ejabberd_config:get_option(
s2s_certfile,
fun iolist_to_binary/1) of
undefined -> [];
@@ -324,7 +324,7 @@ wait_for_feature_request({xmlstreamelement, El},
?DEBUG("starttls", []),
Socket = StateData#state.socket,
TLSOpts1 = case
- ejabberd_config:get_local_option(
+ ejabberd_config:get_option(
{domain_certfile, StateData#state.server},
fun iolist_to_binary/1) of
undefined -> StateData#state.tls_options;
@@ -332,7 +332,7 @@ wait_for_feature_request({xmlstreamelement, El},
[{certfile, CertFile} | lists:keydelete(certfile, 1,
StateData#state.tls_options)]
end,
- TLSOpts = case ejabberd_config:get_local_option(
+ TLSOpts = case ejabberd_config:get_option(
{s2s_tls_compression, StateData#state.server},
fun(true) -> true;
(false) -> false
@@ -843,7 +843,7 @@ fsm_limit_opts(Opts) ->
case lists:keysearch(max_fsm_queue, 1, Opts) of
{value, {_, N}} when is_integer(N) -> [{max_queue, N}];
_ ->
- case ejabberd_config:get_local_option(
+ case ejabberd_config:get_option(
max_fsm_queue,
fun(I) when is_integer(I), I > 0 -> I end) of
undefined -> [];
diff --git a/src/ejabberd_s2s_out.erl b/src/ejabberd_s2s_out.erl
index 1aaaa9998..f52a673e4 100644
--- a/src/ejabberd_s2s_out.erl
+++ b/src/ejabberd_s2s_out.erl
@@ -35,7 +35,8 @@
start_link/3,
start_connection/1,
terminate_if_waiting_delay/2,
- stop_connection/1]).
+ stop_connection/1,
+ transform_options/1]).
%% p1_fsm callbacks (same as gen_fsm)
-export([init/1,
@@ -161,7 +162,7 @@ init([From, Server, Type]) ->
process_flag(trap_exit, true),
?DEBUG("started: ~p", [{From, Server, Type}]),
{TLS, TLSRequired} = case
- ejabberd_config:get_local_option(
+ ejabberd_config:get_option(
s2s_use_starttls,
fun(true) -> true;
(false) -> false;
@@ -184,13 +185,13 @@ init([From, Server, Type]) ->
end,
UseV10 = TLS,
TLSOpts1 = case
- ejabberd_config:get_local_option(
+ ejabberd_config:get_option(
s2s_certfile, fun iolist_to_binary/1)
of
undefined -> [connect];
CertFile -> [{certfile, CertFile}, connect]
end,
- TLSOpts = case ejabberd_config:get_local_option(
+ TLSOpts = case ejabberd_config:get_option(
{s2s_tls_compression, From},
fun(true) -> true;
(false) -> false
@@ -702,7 +703,7 @@ wait_for_starttls_proceed({xmlstreamelement, El},
[{StateData#state.myname, StateData#state.server}]),
Socket = StateData#state.socket,
TLSOpts = case
- ejabberd_config:get_local_option(
+ ejabberd_config:get_option(
{domain_certfile, StateData#state.myname},
fun iolist_to_binary/1)
of
@@ -1142,16 +1143,15 @@ get_addr_port(Server) ->
end.
srv_lookup(Server) ->
- Options = case
- ejabberd_config:get_local_option(
- s2s_dns_options, fun(L) when is_list(L) -> L end)
- of
- undefined -> [];
- L -> L
- end,
- TimeoutMs = timer:seconds(proplists:get_value(timeout,
- Options, 10)),
- Retries = proplists:get_value(retries, Options, 2),
+ TimeoutMs = timer:seconds(
+ ejabberd_config:get_option(
+ s2s_dns_timeout,
+ fun(I) when is_integer(I), I>=0 -> I end,
+ 10)),
+ Retries = ejabberd_config:get_option(
+ s2s_dns_retries,
+ fun(I) when is_integer(I), I>=0 -> I end,
+ 2),
srv_lookup(binary_to_list(Server), TimeoutMs, Retries).
%% XXX - this behaviour is suboptimal in the case that the domain
@@ -1211,15 +1211,15 @@ get_addrs(Host, Family) ->
end.
outgoing_s2s_port() ->
- ejabberd_config:get_local_option(
+ ejabberd_config:get_option(
outgoing_s2s_port,
fun(I) when is_integer(I), I > 0, I =< 65536 -> I end,
5269).
outgoing_s2s_families() ->
- ejabberd_config:get_local_option(
- outgoing_s2s_options,
- fun({Families, _}) ->
+ ejabberd_config:get_option(
+ outgoing_s2s_families,
+ fun(Families) ->
true = lists:all(
fun(ipv4) -> true;
(ipv6) -> true
@@ -1228,14 +1228,43 @@ outgoing_s2s_families() ->
end, [ipv4, ipv6]).
outgoing_s2s_timeout() ->
- ejabberd_config:get_local_option(
- outgoing_s2s_options,
- fun({_, TimeOut}) when is_integer(TimeOut), TimeOut > 0 ->
+ ejabberd_config:get_option(
+ outgoing_s2s_timeout,
+ fun(TimeOut) when is_integer(TimeOut), TimeOut > 0 ->
TimeOut;
- ({_, infinity}) ->
+ (infinity) ->
infinity
end, 10000).
+transform_options(Opts) ->
+ lists:foldl(fun transform_options/2, [], Opts).
+
+transform_options({outgoing_s2s_options, Families, Timeout}, Opts) ->
+ ?WARNING_MSG("Option 'outgoing_s2s_options' is deprecated. "
+ "The option is still supported "
+ "but it is better to fix your config: "
+ "use 'outgoing_s2s_timeout' and "
+ "'outgoing_s2s_families' instead.", []),
+ [{outgoing_s2s_families, Families},
+ {outgoing_s2s_timeout, Timeout}
+ | Opts];
+transform_options({s2s_dns_options, S2SDNSOpts}, AllOpts) ->
+ ?WARNING_MSG("Option 's2s_dns_options' is deprecated. "
+ "The option is still supported "
+ "but it is better to fix your config: "
+ "use 's2s_dns_timeout' and "
+ "'s2s_dns_retries' instead", []),
+ lists:foldr(
+ fun({timeout, T}, AccOpts) ->
+ [{s2s_dns_timeout, T}|AccOpts];
+ ({retries, R}, AccOpts) ->
+ [{s2s_dns_retries, R}|AccOpts];
+ (_, AccOpts) ->
+ AccOpts
+ end, AllOpts, S2SDNSOpts);
+transform_options(Opt, Opts) ->
+ [Opt|Opts].
+
%% Human readable S2S logging: Log only new outgoing connections as INFO
%% Do not log dialback
log_s2s_out(false, _, _, _) -> ok;
@@ -1278,7 +1307,7 @@ wait_before_reconnect(StateData) ->
queue = queue:new()}}.
get_max_retry_delay() ->
- case ejabberd_config:get_local_option(
+ case ejabberd_config:get_option(
s2s_max_retry_delay,
fun(I) when is_integer(I), I > 0 -> I end) of
undefined -> ?MAX_RETRY_DELAY;
@@ -1295,7 +1324,7 @@ terminate_if_waiting_delay(From, To) ->
Pids).
fsm_limit_opts() ->
- case ejabberd_config:get_local_option(
+ case ejabberd_config:get_option(
max_fsm_queue,
fun(I) when is_integer(I), I > 0 -> I end) of
undefined -> [];
diff --git a/src/ejabberd_service.erl b/src/ejabberd_service.erl
index 49bea8950..35f7c187a 100644
--- a/src/ejabberd_service.erl
+++ b/src/ejabberd_service.erl
@@ -34,7 +34,7 @@
%% External exports
-export([start/2, start_link/2, send_text/2,
- send_element/2, socket_type/0]).
+ send_element/2, socket_type/0, transform_listen_option/2]).
%% gen_fsm callbacks
-export([init/1, wait_for_stream/2,
@@ -124,29 +124,18 @@ init([{SockMod, Socket}, Opts]) ->
{value, {_, A}} -> A;
_ -> all
end,
- {Hosts, Password} = case lists:keysearch(hosts, 1, Opts)
- of
- {value, {_, Hs, HOpts}} ->
- case lists:keysearch(password, 1, HOpts) of
- {value, {_, P}} -> {Hs, P};
- _ ->
- % TODO: generate error
- false
- end;
- _ ->
- case lists:keysearch(host, 1, Opts) of
- {value, {_, H, HOpts}} ->
- case lists:keysearch(password, 1, HOpts) of
- {value, {_, P}} -> {[H], P};
- _ ->
- % TODO: generate error
- false
- end;
- _ ->
- % TODO: generate error
- false
- end
- end,
+ %% This should be improved probably
+ {Hosts, HostOpts} = case lists:keyfind(hosts, 1, Opts) of
+ {_, HOpts} ->
+ {[H || {H, _} <- HOpts],
+ lists:flatten(
+ [O || {_, O} <- HOpts])};
+ _ ->
+ {[], []}
+ end,
+ Password = gen_mod:get_opt(password, HostOpts,
+ fun iolist_to_binary/1,
+ p1_sha:sha(crypto:rand_bytes(20))),
Shaper = case lists:keysearch(shaper_rule, 1, Opts) of
{value, {_, S}} -> S;
_ -> none
@@ -384,12 +373,30 @@ send_element(StateData, El) ->
new_id() -> randoms:get_string().
+transform_listen_option({hosts, Hosts, O}, Opts) ->
+ case lists:keyfind(hosts, 1, Opts) of
+ {_, PrevHostOpts} ->
+ NewHostOpts =
+ lists:foldl(
+ fun(H, Acc) ->
+ dict:append_list(H, O, Acc)
+ end, dict:from_list(PrevHostOpts), Hosts),
+ [{hosts, dict:to_list(NewHostOpts)}|
+ lists:keydelete(hosts, 1, Opts)];
+ _ ->
+ [{hosts, [{H, O} || H <- Hosts]}|Opts]
+ end;
+transform_listen_option({host, Host, Os}, Opts) ->
+ transform_listen_option({hosts, [Host], Os}, Opts);
+transform_listen_option(Opt, Opts) ->
+ [Opt|Opts].
+
fsm_limit_opts(Opts) ->
case lists:keysearch(max_fsm_queue, 1, Opts) of
{value, {_, N}} when is_integer(N) ->
[{max_queue, N}];
_ ->
- case ejabberd_config:get_local_option(
+ case ejabberd_config:get_option(
max_fsm_queue,
fun(I) when is_integer(I), I > 0 -> I end) of
undefined -> [];
diff --git a/src/ejabberd_system_monitor.erl b/src/ejabberd_system_monitor.erl
index 2f5d1c330..92a41b9d8 100644
--- a/src/ejabberd_system_monitor.erl
+++ b/src/ejabberd_system_monitor.erl
@@ -53,7 +53,7 @@
%% Description: Starts the server
%%--------------------------------------------------------------------
start_link() ->
- LH = ejabberd_config:get_local_option(
+ LH = ejabberd_config:get_option(
watchdog_large_heap,
fun(I) when is_integer(I), I > 0 -> I end,
1000000),
@@ -200,7 +200,7 @@ send_message(From, To, Body) ->
[{xmlcdata, Body}]}]}).
get_admin_jids() ->
- ejabberd_config:get_local_option(
+ ejabberd_config:get_option(
watchdog_admins,
fun(JIDs) ->
[jlib:jid_tolower(
diff --git a/src/ejabberd_web_admin.erl b/src/ejabberd_web_admin.erl
index 8a2bacf15..4506455bd 100644
--- a/src/ejabberd_web_admin.erl
+++ b/src/ejabberd_web_admin.erl
@@ -827,14 +827,14 @@ process_admin(Host,
{value, {_, String}} ->
case parse_access_rule(String) of
{ok, Rs} ->
- ejabberd_config:add_global_option({access, Name, Host},
+ ejabberd_config:add_option({access, Name, Host},
Rs),
ok;
_ -> error
end;
_ -> nothing
end,
- Rules = case ejabberd_config:get_global_option(
+ Rules = case ejabberd_config:get_option(
{access, Name, Host}, fun(V) -> V end)
of
undefined -> [];
@@ -1198,7 +1198,7 @@ access_parse_addnew(_AccessRules, Host, Query) ->
case lists:keysearch(<<"namenew">>, 1, Query) of
{value, {_, String}} when String /= <<"">> ->
Name = jlib:binary_to_atom(String),
- ejabberd_config:add_global_option({access, Name, Host},
+ ejabberd_config:add_option({access, Name, Host},
[]),
ok
end.
diff --git a/src/eldap_utils.erl b/src/eldap_utils.erl
index 6209802a8..a18a04ed6 100644
--- a/src/eldap_utils.erl
+++ b/src/eldap_utils.erl
@@ -182,7 +182,7 @@ get_opt({Key, Host}, Opts, F) ->
get_opt({Key, Host}, Opts, F, Default) ->
case gen_mod:get_opt(Key, Opts, F, undefined) of
undefined ->
- ejabberd_config:get_local_option(
+ ejabberd_config:get_option(
{Key, Host}, F, Default);
Val ->
Val
diff --git a/src/extauth.erl b/src/extauth.erl
index 23a409ce5..e57ac0b8d 100644
--- a/src/extauth.erl
+++ b/src/extauth.erl
@@ -106,7 +106,7 @@ random_instance(MaxNum) ->
random:uniform(MaxNum) - 1.
get_instances(Server) ->
- ejabberd_config:get_local_option(
+ ejabberd_config:get_option(
{extauth_instances, Server},
fun(V) when is_integer(V), V > 0 ->
V
diff --git a/src/gen_iq_handler.erl b/src/gen_iq_handler.erl
index d53971fe4..628c1c90c 100644
--- a/src/gen_iq_handler.erl
+++ b/src/gen_iq_handler.erl
@@ -33,7 +33,7 @@
%% API
-export([start_link/3, add_iq_handler/6,
remove_iq_handler/3, stop_iq_handler/3, handle/7,
- process_iq/6, check_type/1]).
+ process_iq/6, check_type/1, transform_module_options/1]).
%% gen_server callbacks
-export([init/1, handle_call/3, handle_cast/2,
@@ -46,7 +46,7 @@
-record(state, {host, module, function}).
-type component() :: ejabberd_sm | ejabberd_local.
--type type() :: no_queue | one_queue | {queues, pos_integer()} | parallel.
+-type type() :: no_queue | one_queue | pos_integer() | parallel.
-type opts() :: no_queue | {one_queue, pid()} | {queues, [pid()]} | parallel.
%%====================================================================
@@ -71,7 +71,7 @@ add_iq_handler(Component, Host, NS, Module, Function,
[Host, Module, Function]),
Component:register_iq_handler(Host, NS, Module,
Function, {one_queue, Pid});
- {queues, N} ->
+ N when is_integer(N) ->
Pids = lists:map(fun (_) ->
{ok, Pid} =
supervisor:start_child(ejabberd_iq_sup,
@@ -130,9 +130,19 @@ process_iq(_Host, Module, Function, From, To, IQ) ->
check_type(no_queue) -> no_queue;
check_type(one_queue) -> one_queue;
-check_type({queues, N}) when is_integer(N), N>0 -> {queues, N};
+check_type(N) when is_integer(N), N>0 -> N;
check_type(parallel) -> parallel.
+-spec transform_module_options([{atom(), any()}]) -> [{atom(), any()}].
+
+transform_module_options(Opts) ->
+ lists:map(
+ fun({iqdisc, {queues, N}}) ->
+ {iqdisc, N};
+ (Opt) ->
+ Opt
+ end, Opts).
+
%%====================================================================
%% gen_server callbacks
%%====================================================================
diff --git a/src/gen_mod.erl b/src/gen_mod.erl
index 5245dc65c..0b06529b5 100644
--- a/src/gen_mod.erl
+++ b/src/gen_mod.erl
@@ -64,13 +64,11 @@ start() ->
-spec start_module(binary(), atom(), opts()) -> any().
start_module(Host, Module, Opts) ->
- set_module_opts_mnesia(Host, Module, Opts),
ets:insert(ejabberd_modules,
#ejabberd_module{module_host = {Module, Host},
opts = Opts}),
try Module:start(Host, Opts) catch
Class:Reason ->
- del_module_mnesia(Host, Module),
ets:delete(ejabberd_modules, {Module, Host}),
ErrorText =
io_lib:format("Problem starting the module ~p for host "
@@ -101,7 +99,7 @@ is_app_running(AppName) ->
stop_module(Host, Module) ->
case stop_module_keep_config(Host, Module) of
error -> error;
- ok -> del_module_mnesia(Host, Module)
+ ok -> ok
end.
%% @doc Stop the module in a host, but keep its configuration.
@@ -232,25 +230,6 @@ loaded_modules_with_opts(Host) ->
opts = '$2'},
[], [{{'$1', '$2'}}]}]).
-set_module_opts_mnesia(Host, Module, Opts) ->
- Modules = ejabberd_config:get_local_option(
- {modules, Host},
- fun(Ls) when is_list(Ls) -> Ls end,
- []),
- Modules1 = lists:keydelete(Module, 1, Modules),
- Modules2 = [{Module, Opts} | Modules1],
- ejabberd_config:add_local_option({modules, Host},
- Modules2).
-
-del_module_mnesia(Host, Module) ->
- Modules = ejabberd_config:get_local_option(
- {modules, Host},
- fun(Ls) when is_list(Ls) -> Ls end,
- []),
- Modules1 = lists:keydelete(Module, 1, Modules),
- ejabberd_config:add_local_option({modules, Host},
- Modules1).
-
-spec get_hosts(opts(), binary()) -> [binary()].
get_hosts(Opts, Prefix) ->
diff --git a/src/mod_carboncopy.erl b/src/mod_carboncopy.erl
index 9c2ab319b..087d090c8 100644
--- a/src/mod_carboncopy.erl
+++ b/src/mod_carboncopy.erl
@@ -3,7 +3,7 @@
%%% Author : Eric Cestari <ecestari@process-one.net>
%%% Purpose : Message Carbons XEP-0280 0.8
%%% Created : 5 May 2008 by Mickael Remond <mremond@process-one.net>
-%%% Usage : Add the following line in modules section of ejabberd.cfg:
+%%% Usage : Add the following line in modules section of ejabberd.yml:
%%% {mod_carboncopy, []}
%%%
%%%
diff --git a/src/mod_configure2.erl b/src/mod_configure2.erl
index e3fbe82dc..375621441 100644
--- a/src/mod_configure2.erl
+++ b/src/mod_configure2.erl
@@ -129,7 +129,7 @@ process_get(#xmlel{name = <<"info">>}) ->
children = []}};
process_get(#xmlel{name = <<"welcome-message">>,
attrs = Attrs}) ->
- {Subj, Body} = ejabberd_config:get_local_option(
+ {Subj, Body} = ejabberd_config:get_option(
welcome_message,
fun({Subj, Body}) ->
{iolist_to_binary(Subj),
@@ -145,7 +145,7 @@ process_get(#xmlel{name = <<"welcome-message">>,
children = [{xmlcdata, Body}]}]}};
process_get(#xmlel{name = <<"registration-watchers">>,
attrs = Attrs}) ->
- SubEls = ejabberd_config:get_local_option(
+ SubEls = ejabberd_config:get_option(
registration_watchers,
fun(JIDs) when is_list(JIDs) ->
lists:map(
diff --git a/src/mod_disco.erl b/src/mod_disco.erl
index d62251686..df3f320c7 100644
--- a/src/mod_disco.erl
+++ b/src/mod_disco.erl
@@ -36,7 +36,8 @@
process_sm_iq_items/3, process_sm_iq_info/3,
get_sm_identity/5, get_sm_features/5, get_sm_items/5,
get_info/5, register_feature/2, unregister_feature/2,
- register_extra_domain/2, unregister_extra_domain/2]).
+ register_extra_domain/2, unregister_extra_domain/2,
+ transform_module_options/1]).
-include("ejabberd.hrl").
-include("logger.hrl").
@@ -440,6 +441,22 @@ get_user_resources(User, Server) ->
end,
lists:sort(Rs)).
+transform_module_options(Opts) ->
+ lists:map(
+ fun({server_info, Infos}) ->
+ NewInfos = lists:map(
+ fun({Modules, Name, URLs}) ->
+ [[{modules, Modules},
+ {name, Name},
+ {urls, URLs}]];
+ (Opt) ->
+ Opt
+ end, Infos),
+ {server_info, NewInfos};
+ (Opt) ->
+ Opt
+ end, Opts).
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Support for: XEP-0157 Contact Addresses for XMPP Services
@@ -465,9 +482,17 @@ get_info(_A, Host, Mod, Node, _Lang) when Node == <<>> ->
get_info(Acc, _, _, _Node, _) -> Acc.
get_fields_xml(Host, Module) ->
- Fields = gen_mod:get_module_opt(Host, ?MODULE, server_info,
- fun(L) when is_list(L) -> L end,
- []),
+ Fields = gen_mod:get_module_opt(
+ Host, ?MODULE, server_info,
+ fun(L) ->
+ lists:map(
+ fun(Opts) ->
+ Mods = proplists:get_value(modules, Opts, all),
+ Name = proplists:get_value(names, Opts, <<>>),
+ URLs = proplists:get_value(urls, Opts, []),
+ {Mods, Name, URLs}
+ end, lists:flatmap(L))
+ end, []),
Fields_good = lists:filter(fun ({Modules, _, _}) ->
case Modules of
all -> true;
diff --git a/src/mod_last.erl b/src/mod_last.erl
index 3ea86b350..6e35938d2 100644
--- a/src/mod_last.erl
+++ b/src/mod_last.erl
@@ -32,7 +32,8 @@
-export([start/2, stop/1, process_local_iq/3, export/1,
process_sm_iq/3, on_presence_update/4, import/1, import/3,
- store_last_info/4, get_last_info/2, remove_user/2]).
+ store_last_info/4, get_last_info/2, remove_user/2,
+ transform_options/1]).
-include("ejabberd.hrl").
-include("logger.hrl").
@@ -101,18 +102,13 @@ process_local_iq(_From, _To,
%% @doc Get the uptime of the ejabberd node, expressed in seconds.
%% When ejabberd is starting, ejabberd_config:start/0 stores the datetime.
get_node_uptime() ->
- case ejabberd_config:get_local_option(
+ case ejabberd_config:get_option(
node_start,
- fun({MegaSecs, Secs, MicroSecs} = Now)
- when is_integer(MegaSecs), MegaSecs >= 0,
- is_integer(Secs), Secs >= 0,
- is_integer(MicroSecs), MicroSecs >= 0 ->
- Now
- end) of
+ fun(S) when is_integer(S), S >= 0 -> S end) of
undefined ->
trunc(element(1, erlang:statistics(wall_clock)) / 1000);
- StartNow ->
- now_to_seconds(now()) - now_to_seconds(StartNow)
+ Now ->
+ now_to_seconds(now()) - Now
end.
now_to_seconds({MegaSecs, Secs, _MicroSecs}) ->
@@ -319,3 +315,13 @@ import(_LServer, mnesia, #last_activity{} = LA) ->
mnesia:dirty_write(LA);
import(_, _, _) ->
pass.
+
+transform_options(Opts) ->
+ lists:foldl(fun transform_options/2, [], Opts).
+
+transform_options({node_start, {_, _, _} = Now}, Opts) ->
+ ?WARNING_MSG("Old 'node_start' format detected. This is still supported "
+ "but it is better to fix your config.", []),
+ [{node_start, now_to_seconds(Now)}|Opts];
+transform_options(Opt, Opts) ->
+ [Opt|Opts].
diff --git a/src/mod_muc_log.erl b/src/mod_muc_log.erl
index 97d992145..357d19216 100644
--- a/src/mod_muc_log.erl
+++ b/src/mod_muc_log.erl
@@ -33,7 +33,7 @@
-behaviour(gen_mod).
%% API
--export([start_link/2, start/2, stop/1,
+-export([start_link/2, start/2, stop/1, transform_module_options/1,
check_access_log/2, add_to_log/5]).
%% gen_server callbacks
@@ -111,6 +111,14 @@ check_access_log(Host, From) ->
Res -> Res
end.
+transform_module_options(Opts) ->
+ lists:map(
+ fun({top_link, {S1, S2}}) ->
+ {top_link, [{S1, S2}]};
+ (Opt) ->
+ Opt
+ end, Opts).
+
%%====================================================================
%% gen_server callbacks
%%====================================================================
@@ -152,14 +160,14 @@ init([Host, Opts]) ->
(universal) -> universal
end, local),
Top_link = gen_mod:get_opt(top_link, Opts,
- fun({S1, S2}) ->
+ fun([{S1, S2}]) ->
{iolist_to_binary(S1),
iolist_to_binary(S2)}
end, {<<"/">>, <<"Home">>}),
NoFollow = gen_mod:get_opt(spam_prevention, Opts,
fun(B) when is_boolean(B) -> B end,
true),
- Lang = ejabberd_config:get_local_option(
+ Lang = ejabberd_config:get_option(
{language, Host},
fun iolist_to_binary/1,
?MYLANG),
diff --git a/src/mod_proxy65.erl b/src/mod_proxy65.erl
index 3e8354caf..85bec283b 100644
--- a/src/mod_proxy65.erl
+++ b/src/mod_proxy65.erl
@@ -33,7 +33,7 @@
-behaviour(supervisor).
%% gen_mod callbacks.
--export([start/2, stop/1]).
+-export([start/2, stop/1, transform_module_options/1]).
%% supervisor callbacks.
-export([init/1]).
@@ -64,6 +64,9 @@ start_link(Host, Opts) ->
supervisor:start_link({local, Proc}, ?MODULE,
[Host, Opts]).
+transform_module_options(Opts) ->
+ mod_proxy65_service:transform_module_options(Opts).
+
init([Host, Opts]) ->
Service = {mod_proxy65_service,
{mod_proxy65_service, start_link, [Host, Opts]},
diff --git a/src/mod_proxy65_service.erl b/src/mod_proxy65_service.erl
index 7d16e0f17..33d40b1cc 100644
--- a/src/mod_proxy65_service.erl
+++ b/src/mod_proxy65_service.erl
@@ -35,7 +35,7 @@
handle_cast/2, terminate/2, code_change/3]).
%% API.
--export([start_link/2, add_listener/2,
+-export([start_link/2, add_listener/2, transform_module_options/1,
delete_listener/1]).
-include("ejabberd.hrl").
@@ -261,16 +261,15 @@ parse_options(ServerHost, Opts) ->
Name = gen_mod:get_opt(name, Opts, fun iolist_to_binary/1,
<<"SOCKS5 Bytestreams">>),
IP = gen_mod:get_opt(ip, Opts,
- fun(Addr) ->
- jlib:ip_to_list(Addr),
+ fun(S) ->
+ {ok, Addr} = inet_parse:address(
+ binary_to_list(
+ iolist_to_binary(S))),
Addr
end, get_my_ip()),
HostName = gen_mod:get_opt(hostname, Opts,
- fun(Addr) when is_tuple(Addr) ->
- jlib:ip_to_list(Addr);
- (S) ->
- iolist_to_binary(S)
- end, jlib:ip_to_list(IP)),
+ fun iolist_to_binary/1,
+ jlib:ip_to_list(IP)),
StreamAddr = [{<<"jid">>, MyHost},
{<<"host">>, HostName},
{<<"port">>, jlib:integer_to_binary(Port)}],
@@ -278,6 +277,16 @@ parse_options(ServerHost, Opts) ->
name = Name, port = Port, ip = IP,
stream_addr = StreamAddr, acl = ACL}.
+transform_module_options(Opts) ->
+ lists:map(
+ fun({ip, IP}) when is_tuple(IP) ->
+ {ip, jlib:ip_to_list(IP)};
+ ({hostname, IP}) when is_tuple(IP) ->
+ {hostname, jlib:ip_to_list(IP)};
+ (Opt) ->
+ Opt
+ end, Opts).
+
get_my_ip() ->
{ok, MyHostName} = inet:gethostname(),
case inet:getaddr(MyHostName, inet) of
diff --git a/src/mod_proxy65_stream.erl b/src/mod_proxy65_stream.erl
index 9b861f4db..b37dcc13a 100644
--- a/src/mod_proxy65_stream.erl
+++ b/src/mod_proxy65_stream.erl
@@ -279,10 +279,14 @@ select_auth_method(anonymous, AuthMethods) ->
%% Obviously, we must use shaper with maximum rate.
find_maxrate(Shaper, JID1, JID2, Host) ->
- MaxRate1 = shaper:new(acl:match_rule(Host, Shaper,
- JID1)),
- MaxRate2 = shaper:new(acl:match_rule(Host, Shaper,
- JID2)),
+ MaxRate1 = case acl:match_rule(Host, Shaper, JID1) of
+ deny -> none;
+ R1 -> shaper:new(R1)
+ end,
+ MaxRate2 = case acl:match_rule(Host, Shaper, JID2) of
+ deny -> none;
+ R2 -> shaper:new(R2)
+ end,
if MaxRate1 == none; MaxRate2 == none -> none;
true -> lists:max([MaxRate1, MaxRate2])
end.
diff --git a/src/mod_register.erl b/src/mod_register.erl
index 2b4e53de6..197927df0 100644
--- a/src/mod_register.erl
+++ b/src/mod_register.erl
@@ -32,7 +32,8 @@
-export([start/2, stop/1, stream_feature_register/2,
unauthenticated_iq_register/4, try_register/5,
- process_iq/3, send_registration_notifications/3]).
+ process_iq/3, send_registration_notifications/3,
+ transform_options/1, transform_module_options/1]).
-include("ejabberd.hrl").
-include("logger.hrl").
@@ -418,7 +419,11 @@ try_register(User, Server, Password, SourceRaw, Lang) ->
send_welcome_message(JID) ->
Host = JID#jid.lserver,
case gen_mod:get_module_opt(Host, ?MODULE, welcome_message,
- fun({S, B}) ->
+ fun(Opts) ->
+ S = proplists:get_value(
+ subject, Opts, <<>>),
+ B = proplists:get_value(
+ body, Opts, <<>>),
{iolist_to_binary(S),
iolist_to_binary(B)}
end, {<<"">>, <<"">>})
@@ -483,7 +488,7 @@ check_from(JID, Server) ->
check_timeout(undefined) -> true;
check_timeout(Source) ->
- Timeout = ejabberd_config:get_local_option(
+ Timeout = ejabberd_config:get_option(
registration_timeout,
fun(TO) when is_integer(TO), TO > 0 ->
TO;
@@ -537,7 +542,7 @@ clean_treap(Treap, CleanPriority) ->
remove_timeout(undefined) -> true;
remove_timeout(Source) ->
- Timeout = ejabberd_config:get_local_option(
+ Timeout = ejabberd_config:get_option(
registration_timeout,
fun(TO) when is_integer(TO), TO > 0 ->
TO;
@@ -604,6 +609,54 @@ is_strong_password(Server, Password) ->
ejabberd_auth:entropy(Password) >= Entropy
end.
+transform_options(Opts) ->
+ Opts1 = transform_ip_access(Opts),
+ transform_module_options(Opts1).
+
+transform_ip_access(Opts) ->
+ try
+ {value, {modules, ModOpts}, Opts1} = lists:keytake(modules, 1, Opts),
+ {value, {?MODULE, RegOpts}, ModOpts1} = lists:keytake(?MODULE, 1, ModOpts),
+ {value, {ip_access, L}, RegOpts1} = lists:keytake(ip_access, 1, RegOpts),
+ true = is_list(L),
+ ?WARNING_MSG("Old 'ip_access' format detected. "
+ "The old format is still supported "
+ "but it is better to fix your config: "
+ "use access rules instead.", []),
+ ACLs = lists:flatmap(
+ fun({Action, S}) ->
+ ACLName = jlib:binary_to_atom(
+ iolist_to_binary(
+ ["ip_", S])),
+ [{Action, ACLName},
+ {acl, ACLName, {ip, S}}]
+ end, L),
+ Access = {access, mod_register_networks,
+ [{Action, ACLName} || {Action, ACLName} <- ACLs]},
+ [ACL || {acl, _, _} = ACL <- ACLs] ++
+ [Access,
+ {modules,
+ [{mod_register,
+ [{ip_access, mod_register_networks}|RegOpts1]}
+ | ModOpts1]}|Opts1]
+ catch error:{badmatch, false} ->
+ Opts
+ end.
+
+transform_module_options(Opts) ->
+ lists:flatmap(
+ fun({welcome_message, {Subj, Body}}) ->
+ ?WARNING_MSG("Old 'welcome_message' format detected. "
+ "The old format is still supported "
+ "but it is better to fix your config: "
+ "change it to {welcome_message, "
+ "[{subject, Subject}, {body, Body}]}",
+ []),
+ [{welcome_message, [{subject, Subj}, {body, Body}]}];
+ (Opt) ->
+ [Opt]
+ end, Opts).
+
%%%
%%% ip_access management
%%%
@@ -614,75 +667,15 @@ may_remove_resource(From) -> From.
get_ip_access(Host) ->
gen_mod:get_module_opt(Host, ?MODULE, ip_access,
- fun(IPAccess) ->
- lists:flatmap(
- fun({Access, S}) ->
- {ok, IP, Mask} =
- parse_ip_netmask(
- iolist_to_binary(S)),
- [{Access, IP, Mask}]
- end, IPAccess)
- end, []).
-
-parse_ip_netmask(S) ->
- case str:tokens(S, <<"/">>) of
- [IPStr] ->
- case inet_parse:address(binary_to_list(IPStr)) of
- {ok, {_, _, _, _} = IP} -> {ok, IP, 32};
- {ok, {_, _, _, _, _, _, _, _} = IP} -> {ok, IP, 128};
- _ -> error
- end;
- [IPStr, MaskStr] ->
- case catch jlib:binary_to_integer(MaskStr) of
- Mask when is_integer(Mask), Mask >= 0 ->
- case inet_parse:address(binary_to_list(IPStr)) of
- {ok, {_, _, _, _} = IP} when Mask =< 32 ->
- {ok, IP, Mask};
- {ok, {_, _, _, _, _, _, _, _} = IP} when Mask =< 128 ->
- {ok, IP, Mask};
- _ -> error
- end;
- _ -> error
- end;
- _ -> error
- end.
+ fun(A) when is_atom(A) -> A end,
+ all).
-check_ip_access(_Source, []) -> allow;
check_ip_access({User, Server, Resource}, IPAccess) ->
case ejabberd_sm:get_user_ip(User, Server, Resource) of
- {IPAddress, _PortNumber} ->
- check_ip_access(IPAddress, IPAccess);
- _ -> true
- end;
-check_ip_access({_, _, _, _} = IP,
- [{Access, {_, _, _, _} = Net, Mask} | IPAccess]) ->
- IPInt = ip_to_integer(IP),
- NetInt = ip_to_integer(Net),
- M = bnot (1 bsl (32 - Mask) - 1),
- if IPInt band M =:= NetInt band M -> Access;
- true -> check_ip_access(IP, IPAccess)
- end;
-check_ip_access({_, _, _, _, _, _, _, _} = IP,
- [{Access, {_, _, _, _, _, _, _, _} = Net, Mask}
- | IPAccess]) ->
- IPInt = ip_to_integer(IP),
- NetInt = ip_to_integer(Net),
- M = bnot (1 bsl (128 - Mask) - 1),
- if IPInt band M =:= NetInt band M -> Access;
- true -> check_ip_access(IP, IPAccess)
+ {IPAddress, _PortNumber} ->
+ check_ip_access(IPAddress, IPAccess);
+ _ ->
+ deny
end;
-check_ip_access(IP, [_ | IPAccess]) ->
- check_ip_access(IP, IPAccess).
-
-ip_to_integer({IP1, IP2, IP3, IP4}) ->
- IP1 bsl 8 bor IP2 bsl 8 bor IP3 bsl 8 bor IP4;
-ip_to_integer({IP1, IP2, IP3, IP4, IP5, IP6, IP7,
- IP8}) ->
- IP1 bsl 16 bor IP2 bsl 16 bor IP3 bsl 16 bor IP4 bsl 16
- bor IP5
- bsl 16
- bor IP6
- bsl 16
- bor IP7
- bsl 16
- bor IP8.
+check_ip_access(IPAddress, IPAccess) ->
+ acl:match_rule(global, IPAccess, IPAddress).
diff --git a/src/mod_vcard_ldap.erl b/src/mod_vcard_ldap.erl
index 7711353d2..1c96dd4a1 100644
--- a/src/mod_vcard_ldap.erl
+++ b/src/mod_vcard_ldap.erl
@@ -38,7 +38,7 @@
-export([start/2, start_link/2, stop/1,
get_sm_features/5, process_local_iq/3, process_sm_iq/3,
- remove_user/1, route/4]).
+ remove_user/1, route/4, transform_module_options/1]).
-include("ejabberd.hrl").
-include("logger.hrl").
@@ -767,7 +767,7 @@ parse_options(Host, Opts) ->
VCardMap = gen_mod:get_opt(ldap_vcard_map, Opts,
fun(Ls) ->
lists:map(
- fun({S, P, L}) ->
+ fun({S, [{P, L}]}) ->
{iolist_to_binary(S),
iolist_to_binary(P),
[iolist_to_binary(E)
@@ -823,6 +823,20 @@ parse_options(Host, Opts) ->
search_reported_attrs = SearchReportedAttrs,
matches = Matches}.
+transform_module_options(Opts) ->
+ lists:map(
+ fun({ldap_vcard_map, Map}) ->
+ NewMap = lists:map(
+ fun({Field, Pattern, Attrs}) ->
+ {Field, [{Pattern, Attrs}]};
+ (Opt) ->
+ Opt
+ end, Map),
+ {ldap_vcard_map, NewMap};
+ (Opt) ->
+ Opt
+ end, Opts).
+
check_filter(F) ->
NewF = iolist_to_binary(F),
{ok, _} = eldap_filter:parse(NewF),
diff --git a/src/node_pep.erl b/src/node_pep.erl
index f4b0bb38c..5635dee94 100644
--- a/src/node_pep.erl
+++ b/src/node_pep.erl
@@ -490,13 +490,11 @@ path_to_node(Path) -> node_flat:path_to_node(Path).
%% Check that the mod_caps module is enabled in that Jabber Host
%% If not, show a warning message in the ejabberd log file.
complain_if_modcaps_disabled(ServerHost) ->
- Modules = ejabberd_config:get_local_option({modules, ServerHost}, fun(Ms) when is_list(Ms) -> Ms end),
- ModCaps = [mod_caps_enabled || {mod_caps, _Opts} <- Modules],
- case ModCaps of
- [] ->
+ case gen_mod:is_loaded(ServerHost, mod_caps) of
+ false ->
?WARNING_MSG("The PEP plugin is enabled in mod_pubsub "
"of host ~p. This plugin requires mod_caps "
"to be enabled, but it isn't.",
[ServerHost]);
- _ -> ok
+ true -> ok
end.
diff --git a/src/node_pep_odbc.erl b/src/node_pep_odbc.erl
index 81cb7bc53..e4e1fafa9 100644
--- a/src/node_pep_odbc.erl
+++ b/src/node_pep_odbc.erl
@@ -433,7 +433,7 @@ path_to_node(Path) -> node_flat_odbc:path_to_node(Path).
%% Check that the mod_caps module is enabled in that Jabber Host
%% If not, show a warning message in the ejabberd log file.
complain_if_modcaps_disabled(ServerHost) ->
- Modules = ejabberd_config:get_local_option({modules,
+ Modules = ejabberd_config:get_option({modules,
ServerHost},
fun(Ms) when is_list(Ms) -> Ms end),
ModCaps = [mod_caps_enabled
diff --git a/src/odbc_queries.erl b/src/odbc_queries.erl
index 23b8e8da6..314b7cc13 100644
--- a/src/odbc_queries.erl
+++ b/src/odbc_queries.erl
@@ -219,13 +219,15 @@ list_users(LServer,
[Prefix, Limit, Offset]))]).
users_number(LServer) ->
- case element(1,
- ejabberd_config:get_local_option(
- {odbc_server, LServer}, fun(V) -> V end))
- of
+ Type = ejabberd_config:get_option({odbc_type, LServer},
+ fun(pgsql) -> pgsql;
+ (mysql) -> mysql;
+ (odbc) -> odbc
+ end, odbc),
+ case Type of
pgsql ->
case
- ejabberd_config:get_local_option(
+ ejabberd_config:get_option(
{pgsql_users_number_estimate, LServer},
fun(V) when is_boolean(V) -> V end,
false)
diff --git a/src/shaper.erl b/src/shaper.erl
index 37c1a30c9..41e5f0626 100644
--- a/src/shaper.erl
+++ b/src/shaper.erl
@@ -28,7 +28,8 @@
-author('alexey@process-one.net').
--export([new/1, new1/1, update/2]).
+-export([start/0, new/1, new1/1, update/2,
+ transform_options/1, load_from_config/0]).
-include("ejabberd.hrl").
-include("logger.hrl").
@@ -37,32 +38,66 @@
lastrate = 0.0 :: float(),
lasttime = 0 :: integer()}).
--type maxrate() :: none | #maxrate{}.
+-record(shaper, {name :: {atom(), global},
+ maxrate :: integer()}).
--type shaper() :: maxrate() | {maxrate(), integer()}.
+-type shaper() :: none | #maxrate{}.
-export_type([shaper/0]).
--spec new(atom()) -> maxrate().
+-spec start() -> ok.
+start() ->
+ mnesia:create_table(shaper,
+ [{ram_copies, [node()]},
+ {local_content, true},
+ {attributes, record_info(fields, shaper)}]),
+ mnesia:add_table_copy(shaper, node(), ram_copies),
+ load_from_config(),
+ ok.
+
+-spec load_from_config() -> ok | {error, any()}.
+
+load_from_config() ->
+ Shapers = ejabberd_config:get_option(
+ shaper, fun(V) -> V end, []),
+ case mnesia:transaction(
+ fun() ->
+ lists:foreach(
+ fun({Name, MaxRate}) ->
+ mnesia:write(#shaper{name = {Name, global},
+ maxrate = MaxRate})
+ end, Shapers)
+ end) of
+ {atomic, ok} ->
+ ok;
+ Err ->
+ {error, Err}
+ end.
+
+-spec new(atom()) -> shaper().
+
+new(none) ->
+ none;
new(Name) ->
- Data = ejabberd_config:get_global_option(
- {shaper, Name, global},
- fun({maxrate, R}) when is_integer(R), R>0 ->
- {maxrate, R};
- (none) ->
- none
- end, none),
- new1(Data).
+ MaxRate = case ets:lookup(shaper, {Name, global}) of
+ [#shaper{maxrate = R}] ->
+ R;
+ [] ->
+ ?WARNING_MSG("Attempt to initialize an "
+ "unspecified shaper '~s'", [Name]),
+ none
+ end,
+ new1(MaxRate).
--spec new1(none | {maxrate, integer()}) -> maxrate().
+-spec new1(none | integer()) -> shaper().
new1(none) -> none;
-new1({maxrate, MaxRate}) ->
+new1(MaxRate) ->
#maxrate{maxrate = MaxRate, lastrate = 0.0,
lasttime = now_to_usec(now())}.
--spec update(maxrate(), integer()) -> {maxrate(), integer()}.
+-spec update(shaper(), integer()) -> {shaper(), integer()}.
update(none, _Size) -> {none, 0};
update(#maxrate{} = State, Size) ->
@@ -84,5 +119,15 @@ update(#maxrate{} = State, Size) ->
lasttime = NextNow},
Pause}.
+transform_options(Opts) ->
+ lists:foldl(fun transform_options/2, [], Opts).
+
+transform_options({shaper, Name, {maxrate, N}}, Opts) ->
+ [{shaper, [{Name, N}]}|Opts];
+transform_options({shaper, Name, none}, Opts) ->
+ [{shaper, [{Name, none}]}|Opts];
+transform_options(Opt, Opts) ->
+ [Opt|Opts].
+
now_to_usec({MSec, Sec, USec}) ->
(MSec * 1000000 + Sec) * 1000000 + USec.
diff --git a/test/ejabberd_SUITE_data/ejabberd.yml b/test/ejabberd_SUITE_data/ejabberd.yml
new file mode 100644
index 000000000..47cccb97c
--- /dev/null
+++ b/test/ejabberd_SUITE_data/ejabberd.yml
@@ -0,0 +1,267 @@
+host_config:
+ "pgsql.localhost":
+ odbc_username: "ejabberd_test"
+ odbc_type: pgsql
+ odbc_server: "localhost"
+ odbc_port: 5432
+ odbc_pool_size: 1
+ odbc_password: "ejabberd_test"
+ odbc_database: "ejabberd_test"
+ auth_method: odbc
+ modules:
+ mod_announce:
+ db_type: odbc
+ mod_blocking:
+ db_type: odbc
+ mod_caps:
+ db_type: odbc
+ mod_last:
+ db_type: odbc
+ mod_muc:
+ db_type: odbc
+ mod_offline:
+ db_type: odbc
+ mod_privacy:
+ db_type: odbc
+ mod_private:
+ db_type: odbc
+ mod_pubsub_odbc:
+ access_createnode: pubsub_createnode
+ ignore_pep_from_offline: true
+ last_item_cache: false
+ plugins:
+ - "flat"
+ - "hometree"
+ - "pep"
+ mod_roster:
+ db_type: odbc
+ mod_mam:
+ db_type: odbc
+ mod_vcard:
+ db_type: odbc
+ mod_adhoc: []
+ mod_configure: []
+ mod_disco: []
+ mod_ping: []
+ mod_proxy65: []
+ mod_register:
+ welcome_message:
+ subject: "Welcome!"
+ body: "Hi.
+Welcome to this XMPP server."
+ mod_stats: []
+ mod_time: []
+ mod_version: []
+host_config:
+ "mysql.localhost":
+ odbc_username: "ejabberd_test"
+ odbc_type: mysql
+ odbc_server: "localhost"
+ odbc_port: 3306
+ odbc_pool_size: 1
+ odbc_password: "ejabberd_test"
+ odbc_database: "ejabberd_test"
+ auth_method: odbc
+ modules:
+ mod_announce:
+ db_type: odbc
+ mod_blocking:
+ db_type: odbc
+ mod_caps:
+ db_type: odbc
+ mod_last:
+ db_type: odbc
+ mod_muc:
+ db_type: odbc
+ mod_offline:
+ db_type: odbc
+ mod_privacy:
+ db_type: odbc
+ mod_private:
+ db_type: odbc
+ mod_pubsub_odbc:
+ access_createnode: pubsub_createnode
+ ignore_pep_from_offline: true
+ last_item_cache: false
+ plugins:
+ - "flat"
+ - "hometree"
+ - "pep"
+ mod_roster:
+ db_type: odbc
+ mod_mam:
+ db_type: odbc
+ mod_vcard:
+ db_type: odbc
+ mod_adhoc: []
+ mod_configure: []
+ mod_disco: []
+ mod_ping: []
+ mod_proxy65: []
+ mod_register:
+ welcome_message:
+ subject: "Welcome!"
+ body: "Hi.
+Welcome to this XMPP server."
+ mod_stats: []
+ mod_time: []
+ mod_version: []
+host_config:
+ "mnesia.localhost":
+ auth_method: internal
+ modules:
+ mod_announce:
+ db_type: internal
+ mod_blocking:
+ db_type: internal
+ mod_caps:
+ db_type: internal
+ mod_last:
+ db_type: internal
+ mod_muc:
+ db_type: internal
+ mod_offline:
+ db_type: internal
+ mod_privacy:
+ db_type: internal
+ mod_private:
+ db_type: internal
+ mod_pubsub:
+ access_createnode: pubsub_createnode
+ ignore_pep_from_offline: true
+ last_item_cache: false
+ plugins:
+ - "flat"
+ - "hometree"
+ - "pep"
+ mod_roster:
+ db_type: internal
+ mod_mam:
+ db_type: internal
+ mod_vcard:
+ db_type: internal
+ mod_adhoc: []
+ mod_configure: []
+ mod_disco: []
+ mod_ping: []
+ mod_proxy65: []
+ mod_register:
+ welcome_message:
+ subject: "Welcome!"
+ body: "Hi.
+Welcome to this XMPP server."
+ mod_stats: []
+ mod_time: []
+ mod_version: []
+host_config:
+ "localhost":
+ auth_method: internal
+host_config:
+ "ldap.localhost":
+ ldap_servers:
+ - "localhost"
+ ldap_rootdn: "cn=admin,dc=localhost"
+ ldap_port: 1389
+ ldap_password: "password"
+ ldap_base: "ou=users,dc=localhost"
+ auth_method: ldap
+ modules:
+ mod_vcard_ldap: []
+ mod_adhoc: []
+ mod_configure: []
+ mod_disco: []
+ mod_ping: []
+ mod_proxy65: []
+ mod_register:
+ welcome_message:
+ subject: "Welcome!"
+ body: "Hi.
+Welcome to this XMPP server."
+ mod_stats: []
+ mod_time: []
+ mod_version: []
+host_config:
+ "extauth.localhost":
+ extauth_program: "python extauth.py"
+ auth_method: external
+hosts:
+ - "localhost"
+ - "mnesia.localhost"
+ - "mysql.localhost"
+ - "pgsql.localhost"
+ - "extauth.localhost"
+ - "ldap.localhost"
+access:
+ announce:
+ admin: allow
+ c2s:
+ blocked: deny
+ all: allow
+ c2s_shaper:
+ admin: none
+ all: normal
+ configure:
+ admin: allow
+ local:
+ local: allow
+ max_user_offline_messages:
+ admin: 5000
+ all: 100
+ max_user_sessions:
+ all: 10
+ muc:
+ all: allow
+ muc_admin:
+ admin: allow
+ muc_create:
+ local: allow
+ pubsub_createnode:
+ local: allow
+ register:
+ all: allow
+ s2s_shaper:
+ all: fast
+acl:
+ local:
+ user_regexp:
+ - []
+define_macro:
+ CERTFILE: "cert.pem"
+language: "en"
+listen:
+ -
+ port: 5222
+ module: ejabberd_c2s
+ max_stanza_size: 65536
+ certfile: CERTFILE
+ zlib: true
+ starttls: true
+ shaper: c2s_shaper
+ access: c2s
+ -
+ port: 5269
+ module: ejabberd_s2s_in
+ -
+ port: 5280
+ module: ejabberd_http
+ captcha: true
+loglevel: 4
+max_fsm_queue: 1000
+modules:
+ mod_adhoc: []
+ mod_configure: []
+ mod_disco: []
+ mod_ping: []
+ mod_proxy65: []
+ mod_register:
+ welcome_message:
+ subject: "Welcome!"
+ body: "Hi.
+Welcome to this XMPP server."
+ mod_stats: []
+ mod_time: []
+ mod_version: []
+registration_timeout: infinity
+shaper:
+ fast: 50000
+ normal: 1000 \ No newline at end of file
diff --git a/test/suite.erl b/test/suite.erl
index cbb4ca227..8104df75e 100644
--- a/test/suite.erl
+++ b/test/suite.erl
@@ -21,7 +21,7 @@ init_config(Config) ->
PrivDir = proplists:get_value(priv_dir, Config),
[_, _|Tail] = lists:reverse(filename:split(DataDir)),
BaseDir = filename:join(lists:reverse(Tail)),
- ConfigPath = filename:join([DataDir, "ejabberd.cfg"]),
+ ConfigPath = filename:join([DataDir, "ejabberd.yml"]),
LogPath = filename:join([PrivDir, "ejabberd.log"]),
SASLPath = filename:join([PrivDir, "sasl.log"]),
MnesiaDir = filename:join([PrivDir, "mnesia"]),