This repository has been archived by the owner on Aug 28, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
ejabberd.cfg.tpl
185 lines (147 loc) · 5.74 KB
/
ejabberd.cfg.tpl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
{% set uses_db='DATABASE_URL' in env %}
{% set has_hosts='HOSTS' in env %}
{loglevel, {{ env['LOGLEVEL'] or 3 }} }.
{% if has_hosts %}
{% set host_names=env.get('HOSTS', '').split(',') %}
{hosts, ["{{ env['XMPP_DOMAIN'] or "chat.thegeoffrey.co" }}"
{%- for host in host_names -%}
,"{{host}}"
{%- endfor -%}
] }.
{% else %}
{hosts, ["{{ env['XMPP_DOMAIN'] or "chat.thegeoffrey.co" }}"] }.
{% endif %}
{listen,
[
{ 5000, ejabberd_cowboy, [
{num_acceptors, 10},
{max_connections, 1024},
{modules, [
{"localhost", "/api", mongoose_api, [{handlers, [mongoose_api_metrics,
mongoose_api_users]}]},
{"_", "/http-bind", mod_bosh},
{"_", "/ws-xmpp", mod_websockets}
]}
]},
{ 8080, ejabberd_c2s, [
{access, c2s},
{shaper, c2s_shaper},
{max_stanza_size, 65536}
]}
]}.
{s2s_default_policy, deny }.
{outgoing_s2s_port, 5269 }.
{sm_backend, {mnesia, []} }.
% switch these lines to enable anonymous login support
% {auth_method, [external, anonymous]}.
{auth_method, [external]}.
{auth_opts, [
{extauth_program, "{{env['MONGOOSE_ROOT']}}/bin/ext_auth"},
{allow_multiple_connections, false},
{anonymous_protocol, sasl_anon}
]}.
{%if uses_db -%}
{%- set protocol = env['DATABASE_URL'].split(':', 1)[0] %}
{%- set db_url = env['DATABASE_URL'].split('//', 1)[1] -%}
{odbc_server, {pgsql, "{{db_url.rsplit('/', 1)[0].rsplit(':', 1)[0].rsplit("@", 1)[1]}}", {{db_url.rsplit('/', 1)[0].rsplit(':', 1)[1]}}, "{{db_url.rsplit('/', 1)[1]}}", "{{db_url.rsplit('@', 1)[0].split(":")[0]}}", "{{db_url.rsplit('@', 1)[0].split(":")[1]}}"}}.
{pgsql_users_number_estimate, true}.
{%- endif %}
{shaper, normal, {maxrate, 1000}}.
{shaper, fast, {maxrate, 50000}}.
{max_fsm_queue, 1000}.
{acl, local, {user_regexp, ""}}.
%% 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}]}.
%% 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}]}.
%% In-band registration allows registration of any possible username.
%% To disable in-band registration, replace 'allow' with 'deny'.
{access, register, [{deny, 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, infinity}.
%% Default settings for MAM.
%% To set non-standard value, replace 'default' with 'allow' or 'deny'.
%% Only user can access his/her archive by default.
%% An online user can read room's archive by default.
%% Only an owner can change settings and purge messages by default.
%% Empty list (i.e. `[]`) means `[{deny, all}]`.
{access, mam_set_prefs, [{default, all}]}.
{access, mam_get_prefs, [{default, all}]}.
{access, mam_lookup_messages, [{default, all}]}.
{access, mam_purge_single_message, [{default, all}]}.
{access, mam_purge_multiple_messages, [{default, all}]}.
%% 1 command of the specified type per second.
{shaper, mam_shaper, {maxrate, 1}}.
%% This shaper is primeraly for Mnesia overload protection during stress testing.
%% The limit is 1000 operations of each type per second.
{shaper, mam_global_shaper, {maxrate, 1000}}.
{access, mam_set_prefs_shaper, [{mam_shaper, all}]}.
{access, mam_get_prefs_shaper, [{mam_shaper, all}]}.
{access, mam_lookup_messages_shaper, [{mam_shaper, all}]}.
{access, mam_purge_single_message_shaper, [{mam_shaper, all}]}.
{access, mam_purge_multiple_messages_shaper, [{mam_shaper, all}]}.
{access, mam_set_prefs_global_shaper, [{mam_global_shaper, all}]}.
{access, mam_get_prefs_global_shaper, [{mam_global_shaper, all}]}.
{access, mam_lookup_messages_global_shaper, [{mam_global_shaper, all}]}.
{access, mam_purge_single_message_global_shaper, [{mam_global_shaper, all}]}.
{access, mam_purge_multiple_messages_global_shaper, [{mam_global_shaper, all}]}.
{language, "en"}.
{modules,
[
{mod_admin_extra, [{submods, [node, accounts, sessions, vcard,
roster, last, private, stanza, stats]}]},
{mod_adhoc, []},
{mod_disco, []},
{mod_last, []},
{mod_stream_management, []},
{mod_muc, [
{host, "muc.@HOST@"},
{access, muc},
{access_create, muc_create}
]},
{mod_muc_log,
[
{outdir, "/tmp/muclogs"},
{access_log, muc}
]},
{mod_offline, [{access_max_user_messages, max_user_offline_messages}]},
{mod_privacy, []},
{mod_register, [
{welcome_message, {""}},
{ip_access, [{allow, "127.0.0.0/8"},
{deny, "0.0.0.0/0"}]},
{access, register}
]},
{mod_roster, []},
{mod_sic, []},
{mod_bosh, []},
{mod_websockets, []},
{mod_metrics, []},
{mod_carboncopy, []},
{mod_mam_odbc_prefs, [pm, muc]},
{mod_mam, []},
{mod_mam_muc, [{host, "muc.@HOST@"}]}
]}.
%%% $Id$
%%% Local Variables:
%%% mode: erlang
%%% End:
%%% vim: set filetype=erlang tabstop=8 foldmarker=%%%',%%%. foldmethod=marker:
%%%.