Added support for multiple domains to ejabberd

This commit is contained in:
Ossi Salmi 2011-04-11 16:53:37 +03:00 committed by Timo Mkinen
parent 356e8add9a
commit b3ec5b3ea5
2 changed files with 13 additions and 8 deletions

View file

@ -2,16 +2,19 @@
# #
# === Global variables # === Global variables
# #
# $ejabberd_domain: # $ejabberd_hosts:
# Domain serverd by ejabberd. Defaults to $domain. # Array of domains serverd by ejabberd. Defaults to [ "$homename" ].
# #
# $ejabberd_adminusers: # $ejabberd_admin:
# Array of users with admin privileges. # Array of users with admin privileges.
# #
class ejabberd { class ejabberd {
if !$ejabberd_domain { if !$ejabberd_hosts {
$ejabberd_domain = $domain $ejabberd_hosts = [ "${homename}" ]
}
if !$ejabberd_admin {
$ejabberd_admin = []
} }
package { "ejabberd": package { "ejabberd":

View file

@ -81,7 +81,8 @@ override_acls.
%% You can define one or several, for example: %% You can define one or several, for example:
%% {hosts, ["example.net", "example.com", "example.org"]}. %% {hosts, ["example.net", "example.com", "example.org"]}.
%% %%
{hosts, ["<%= ejabberd_domain %>"]}. <% ejabberd_hosts.map! { |host| '"%s"' % host } -%>
{hosts, [<%= ejabberd_hosts.join(", ") %>]}.
%% %%
%% route_subdomains: Delegate subdomains to other Jabber server. %% route_subdomains: Delegate subdomains to other Jabber server.
@ -390,8 +391,9 @@ override_acls.
%% The 'admin' ACL grants administrative privileges to Jabber accounts. %% The 'admin' ACL grants administrative privileges to Jabber accounts.
%% You can put as many accounts as you want. %% You can put as many accounts as you want.
%% %%
<% ejabberd_adminusers.each do |user| -%> <% ejabberd_admin.each do |admin|
{acl, admin, {user, "<%= user %>", "<%= ejabberd_domain %>"}}. user, host = admin.split("@") -%>
{acl, admin, {user, "<%= user %>", "<%= host %>"}}.
<% end -%> <% end -%>
%% %%