71a8322606d4b25a235052c8e220a3c7367a44fa
[sysconfig/ejabberd.git] / ejabberd.cfg
1 %%%
2 %%%     Debian ejabberd configuration file
3 %%%     This config must be in UTF-8 encoding
4 %%%
5 %%% The parameters used in this configuration file are explained in more detail
6 %%% in the ejabberd Installation and Operation Guide.
7 %%% Please consult the Guide in case of doubts, it is available at
8 %%% /usr/share/doc/ejabberd/guide.html
9
10 %%%   ===================================
11 %%%   OVERRIDE OPTIONS STORED IN DATABASE
12
13 %%
14 %% Override global options (shared by all ejabberd nodes in a cluster).
15 %%
16 %%override_global.
17
18 %%
19 %% Override local options (specific for this particular ejabberd node).
20 %%
21 %%override_local.
22
23 %%
24 %% Remove the Access Control Lists before new ones are added.
25 %%
26 %%override_acls.
27
28
29 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
30 %% Options which are set by Debconf and managed by ucf
31
32 %% Admin user
33 {acl, admin, {user, "", "localhost"}}.
34
35 %% Hostname
36 {hosts, ["jabber.dehnerts.com"]}.
37
38 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
39
40 %%% This configuration file contains Erlang terms.
41 %%% In case you want to understand the syntax, here are the concepts:
42 %%%
43 %%%  - The character to comment a line is %
44 %%%
45 %%%  - Each term ends in a dot, for example:
46 %%%      override_global.
47 %%%
48 %%%  - A tuple has a fixed definition, its elements are
49 %%%    enclosed in {}, and separated with commas:
50 %%%      {loglevel, 4}.
51 %%%
52 %%%  - A list can have as many elements as you want,
53 %%%    and is enclosed in [], for example:
54 %%%      [http_poll, web_admin, tls]
55 %%%
56 %%%  - A keyword of ejabberd is a word in lowercase.
57 %%%    The strings are enclosed in "" and can have spaces, dots...
58 %%%      {language, "en"}.
59 %%%      {ldap_rootdn, "dc=example,dc=com"}.
60 %%%
61 %%%  - This term includes a tuple, a keyword, a list and two strings:
62 %%%      {hosts, ["jabber.example.net", "im.example.com"]}.
63 %%%
64
65
66 %%%   =========
67 %%%   DEBUGGING
68
69 %%
70 %% loglevel: Verbosity of log files generated by ejabberd.
71 %% 0: No ejabberd log at all (not recommended)
72 %% 1: Critical
73 %% 2: Error
74 %% 3: Warning
75 %% 4: Info
76 %% 5: Debug
77 %%
78 {loglevel, 4}.
79
80 %%
81 %% watchdog_admins: If an ejabberd process consumes too much memory,
82 %% send live notifications to those Jabber accounts.
83 %%
84 %%{watchdog_admins, ["bob@example.com"]}.
85
86
87 %%%   ================
88 %%%   SERVED HOSTNAMES
89
90 %%
91 %% hosts: Domains served by ejabberd.
92 %% You can define one or several, for example:
93 %% {hosts, ["example.net", "example.com", "example.org"]}.
94 %%
95 %% (This option is defined by debconf earlier)
96 %% {hosts, ["localhost"]}.
97
98 %%
99 %% route_subdomains: Delegate subdomains to other Jabber server.
100 %% For example, if this ejabberd serves example.org and you want
101 %% to allow communication with a Jabber server called im.example.org.
102 %%
103 %%{route_subdomains, s2s}.
104
105
106 %%%   ===============
107 %%%   LISTENING PORTS
108
109 %%
110 %% listen: Which ports will ejabberd listen, which service handles it
111 %% and what options to start it with.
112 %%
113 {listen,
114  [
115   {5222, ejabberd_c2s, [
116                         {access, c2s},
117                         {shaper, c2s_shaper},
118                         {max_stanza_size, 65536},
119                         starttls, {certfile, "/etc/ejabberd/ejabberd.pem"}
120                        ]},
121
122   %%
123   %% To enable the old SSL connection method (deprecated) in port 5223:
124   %%
125   %%{5223, ejabberd_c2s, [
126   %%                    {access, c2s},
127   %%                    {shaper, c2s_shaper},
128   %%                    {max_stanza_size, 65536},
129   %%                    tls, {certfile, "/etc/ejabberd/ejabberd.pem"}
130   %%                   ]},
131
132   {5269, ejabberd_s2s_in, [
133                            {shaper, s2s_shaper},
134                            {max_stanza_size, 131072}
135                           ]},
136
137   %% External MUC jabber-muc (but internal mod_muc is better :))
138   %%{5554, ejabberd_service, [
139   %%                        {ip, {127, 0, 0, 1}},
140   %%                        {access, all},
141   %%                        {shaper_rule, fast},
142   %%                        {host, "muc.localhost", [{password, "secret"}]}
143   %%                        ]},
144
145   %% Jabber ICQ Transport
146   %%{5555, ejabberd_service, [
147   %%                        {ip, {127, 0, 0, 1}},
148   %%                        {access, all},
149   %%                        {shaper_rule, fast},
150   %%                        {hosts, ["icq.localhost", "sms.localhost"],
151   %%                                   [{password, "secret"}]}
152   %%                        ]},
153
154   %% AIM Transport
155   %%{5556, ejabberd_service, [
156   %%                        {ip, {127, 0, 0, 1}},
157   %%                        {access, all},
158   %%                        {shaper_rule, fast},
159   %%                        {host, "aim.localhost", [{password, "secret"}]}
160   %%                        ]},
161
162   %% MSN Transport
163   %%{5557, ejabberd_service, [
164   %%                        {ip, {127, 0, 0, 1}},
165   %%                        {access, all},
166   %%                        {shaper_rule, fast},
167   %%                        {host, "msn.localhost", [{password, "secret"}]}
168   %%                        ]},
169
170   %% Yahoo! Transport
171   %%{5558, ejabberd_service, [
172   %%                        {ip, {127, 0, 0, 1}},
173   %%                        {access, all},
174   %%                        {shaper_rule, fast},
175   %%                        {host, "yahoo.localhost", [{password, "secret"}]}
176   %%                        ]},
177
178   %% External JUD (internal is more powerful,
179   %% but doesn't allow to register users from other servers)
180   %%{5559, ejabberd_service, [
181   %%                        {ip, {127, 0, 0, 1}},
182   %%                        {access, all},
183   %%                        {shaper_rule, fast},
184   %%                        {host, "jud.localhost", [{password, "secret"}]}
185   %%                        ]},
186
187   {5280, ejabberd_http, [
188                          http_poll,
189                          web_admin
190                         ]}
191
192  ]}.
193
194 %%
195 %% s2s_use_starttls: Enable STARTTLS + Dialback for S2S connections.
196 %% Allowed values are: true or false.
197 %% You must specify a certificate file.
198 %%
199 {s2s_use_starttls, true}.
200
201 %%
202 %% s2s_certfile: Specify a certificate file.
203 %%
204 {s2s_certfile, "/etc/ejabberd/ejabberd.pem"}.
205
206 %%
207 %% domain_certfile: Specify a different certificate for each served hostname.
208 %%
209 %%{domain_certfile, "example.org", "/path/to/example_org.pem"}.
210 %%{domain_certfile, "example.com", "/path/to/example_com.pem"}.
211
212 %%
213 %% S2S whitelist or blacklist
214 %%
215 %% Default s2s policy for undefined hosts.
216 %%
217 %%{s2s_default_policy, allow}.
218
219 %%
220 %% Allow or deny communication with specific servers.
221 %%
222 %%{{s2s_host, "goodhost.org"}, allow}.
223 %%{{s2s_host, "badhost.org"}, deny}.
224
225
226 %%%   ==============
227 %%%   AUTHENTICATION
228
229 %%
230 %% auth_method: Method used to authenticate the users.
231 %% The default method is the internal.
232 %% If you want to use a different method,
233 %% comment this line and enable the correct ones.
234 %%
235 {auth_method, internal}.
236
237 %%
238 %% Authentication using external script
239 %% Make sure the script is executable by ejabberd.
240 %%
241 %%{auth_method, external}.
242 %%{extauth_program, "/path/to/authentication/script"}.
243
244 %%
245 %% Authentication using ODBC
246 %% Remember to setup a database in the next section.
247 %%
248 %%{auth_method, odbc}.
249
250 %%
251 %% Authentication using PAM
252 %%
253 %%{auth_method, pam}.
254 %%{pam_service, "pamservicename"}.
255
256 %%
257 %% Authentication using LDAP
258 %%
259 %%{auth_method, ldap}.
260 %%
261 %% List of LDAP servers:
262 %%{ldap_servers, ["localhost"]}.
263 %%
264 %% Encryption of connection to LDAP servers (LDAPS):
265 %%{ldap_encrypt, tls}.
266 %%
267 %% Port connect to LDAP server:
268 %%{ldap_port, 636}.
269 %%
270 %% LDAP manager:
271 %%{ldap_rootdn, "dc=example,dc=com"}.
272 %%
273 %% Password to LDAP manager:
274 %%{ldap_password, "******"}.
275 %%
276 %% Search base of LDAP directory:
277 %%{ldap_base, "dc=example,dc=com"}.
278 %%
279 %% LDAP attribute that holds user ID:
280 %%{ldap_uids, [{"mail", "%u@mail.example.org"}]}.
281 %%
282 %% LDAP filter:
283 %%{ldap_filter, "(objectClass=shadowAccount)"}.
284
285 %%
286 %% Anonymous login support:
287 %%   auth_method: anonymous
288 %%   anonymous_protocol: sasl_anon | login_anon | both
289 %%   allow_multiple_connections: true | false
290 %%
291 %%{host_config, "public.example.org", [{auth_method, anonymous},
292 %%                                     {allow_multiple_connections, false},
293 %%                                     {anonymous_protocol, sasl_anon}]}.
294 %%
295 %% To use both anonymous and internal authentication:
296 %%
297 %%{host_config, "public.example.org", [{auth_method, [internal, anonymous]}]}.
298
299
300 %%%   ==============
301 %%%   DATABASE SETUP
302
303 %% ejabberd uses by default the internal Mnesia database,
304 %% so you can avoid this section.
305 %% This section provides configuration examples in case
306 %% you want to use other database backends.
307 %% Please consult the ejabberd Guide for details about database creation.
308
309 %%
310 %% MySQL server:
311 %%
312 %%{odbc_server, {mysql, "server", "database", "username", "password"}}.
313 %%
314 %% If you want to specify the port:
315 %%{odbc_server, {mysql, "server", 1234, "database", "username", "password"}}.
316
317 %%
318 %% PostgreSQL server:
319 %%
320 %%{odbc_server, {pgsql, "server", "database", "username", "password"}}.
321 %%
322 %% If you want to specify the port:
323 %%{odbc_server, {pgsql, "server", 1234, "database", "username", "password"}}.
324 %%
325 %% If you use PostgreSQL, have a large database, and need a
326 %% faster but inexact replacement for "select count(*) from users"
327 %%
328 %%{pgsql_users_number_estimate, true}.
329
330 %%
331 %% ODBC compatible or MSSQL server:
332 %%
333 %%{odbc_server, "DSN=ejabberd;UID=ejabberd;PWD=ejabberd"}.
334
335 %%
336 %% Number of connections to open to the database for each virtual host
337 %%
338 %%{odbc_pool_size, 10}.
339
340 %%
341 %% Interval to make a dummy SQL request to keep alive the connections
342 %% to the database. Specify in seconds: for example 28800 means 8 hours
343 %%
344 %%{odbc_keepalive_interval, undefined}.
345
346
347 %%%   ===============
348 %%%   TRAFFIC SHAPERS
349
350 %%
351 %% The "normal" shaper limits traffic speed to 1.000 B/s
352 %%
353 {shaper, normal, {maxrate, 1000}}.
354
355 %%
356 %% The "fast" shaper limits traffic speed to 50.000 B/s
357 %%
358 {shaper, fast, {maxrate, 50000}}.
359
360
361 %%%   ====================
362 %%%   ACCESS CONTROL LISTS
363
364 %%
365 %% The 'admin' ACL grants administrative privileges to Jabber accounts.
366 %% You can put as many accounts as you want.
367 %%
368 %%{acl, admin, {user, "aleksey", "localhost"}}.
369 {acl, admin, {user, "alex-admin" }}.
370 %%{acl, admin, {user, "ermine", "example.org"}}.
371
372 %%
373 %% Blocked users
374 %%
375 %%{acl, blocked, {user, "baduser", "example.org"}}.
376 %%{acl, blocked, {user, "test"}}.
377
378 %%
379 %% Local users: don't modify this line.
380 %%
381 {acl, local, {user_regexp, ""}}.
382
383 %%
384 %% More examples of ACLs
385 %%
386 %%{acl, jabberorg, {server, "jabber.org"}}.
387 %%{acl, aleksey, {user, "aleksey", "jabber.ru"}}.
388 %%{acl, test, {user_regexp, "^test"}}.
389 %%{acl, test, {user_glob, "test*"}}.
390
391
392 %%%   ============
393 %%%   ACCESS RULES
394
395 %% Define the maximum number of time a single user is allowed to connect:
396 {access, max_user_sessions, [{10, all}]}.
397
398 %% This rule allows access only for local users:
399 {access, local, [{allow, local}]}.
400
401 %% Only non-blocked users can use c2s connections:
402 {access, c2s, [{deny, blocked},
403                {allow, all}]}.
404
405 %% For all users except admins used "normal" shaper
406 {access, c2s_shaper, [{none, admin},
407                       {normal, all}]}.
408
409 %% For all S2S connections used "fast" shaper
410 {access, s2s_shaper, [{fast, all}]}.
411
412 %% Only admins can send announcement messages:
413 {access, announce, [{allow, admin}]}.
414
415 %% Only admins can use configuration interface:
416 {access, configure, [{allow, admin}]}.
417
418 %% Admins of this server are also admins of MUC service:
419 {access, muc_admin, [{allow, admin}]}.
420
421 %% All users are allowed to use MUC service:
422 {access, muc, [{allow, all}]}.
423
424 %% No username can be registered via in-band registration:
425 %% To enable in-band registration, replace 'deny' with 'allow'
426 % (note that if you remove mod_register from modules list then users will not
427 % be able to change their password as well as register).
428 % This setting is default because it's more safe.
429 {access, register, [{deny, all}]}.
430
431 %% Everybody can create pubsub nodes
432 {access, pubsub_createnode, [{allow, all}]}.
433
434
435 %%%   ================
436 %%%   DEFAULT LANGUAGE
437
438 %%
439 %% language: Default language used for server messages.
440 %%
441 {language, "en"}.
442
443
444 %%%   =======
445 %%%   MODULES
446
447 %%
448 %% Modules enabled in all ejabberd virtual hosts.
449 %%
450 {modules,
451  [
452   {mod_adhoc,    []},
453   {mod_announce, [{access, announce}]}, % requires mod_adhoc
454   {mod_caps,     []},
455   {mod_configure,[]}, % requires mod_adhoc
456   {mod_ctlextra, []},
457   {mod_disco,    []},
458   %%{mod_echo,   [{host, "echo.localhost"}]},
459   {mod_irc,      []},
460   {mod_last,     []},
461   {mod_muc,      [
462                   %%{host, "conference.@HOST@"},
463                   {access, muc},
464                   {access_create, muc},
465                   {access_persistent, muc},
466                   {access_admin, muc_admin},
467                   {max_users, 500}
468                  ]},
469   %%{mod_muc_log,[]},
470   {mod_offline,  []},
471   {mod_privacy,  []},
472   {mod_private,  []},
473   {mod_proxy65,  [
474                   {access, local},
475                   {shaper, c2s_shaper}
476                  ]},
477   {mod_pubsub,   [ % requires mod_caps
478                   {access_createnode, pubsub_createnode},
479                   {plugins, ["default", "pep"]}
480                  ]},
481   {mod_register, [
482                   %%
483                   %% After successful registration, the user receives
484                   %% a message with this subject and body.
485                   %%
486                   {welcome_message, {"Welcome!",
487                                      "Welcome to a Jabber service powered by Debian. "
488                                      "For information about Jabber visit "
489                                      "http://www.jabber.org"}},
490                   %% Replace it with 'none' if you don't want to send such message:
491                   %%{welcome_message, none},
492
493                   %%
494                   %% When a user registers, send a notification to
495                   %% these Jabber accounts.
496                   %%
497                   %%{registration_watchers, ["admin1@example.org"]},
498
499                   {access, register}
500                  ]},
501   {mod_roster,   []},
502   %%{mod_service_log,[]},
503   %%{mod_shared_roster,[]},
504   {mod_stats,    []},
505   {mod_time,     []},
506   {mod_vcard,    []},
507   {mod_version,  []}
508  ]}.
509
510
511 %%% $Id: ejabberd.cfg.example 1178 2008-02-08 18:28:36Z badlop $
512
513 %%% Local Variables:
514 %%% mode: erlang
515 %%% End:
516 %%% vim: set filetype=erlang tabstop=8: