1 VirtualHost "<%= @name %>"
2 <% if @ensure == 'present' -%>
8 <% if (@ssl_key != 'UNSET') && (@ssl_cert != 'UNSET') -%>
9 -- Assign this host a certificate for TLS, otherwise it would use the one
10 -- set in the global section (if any).
11 -- Note that old-style SSL on port 5223 only supports one certificate, and will always
12 -- use the global one.
14 key = "<%= @prosody_ssl_key %>";
15 certificate = "<%= @prosody_ssl_cert %>";
19 <%- if @custom_options != {} -%>
21 def print_recursive(object, indentation = 0)
24 '{ "' + object.join('"; "') + '" }'
26 "{\n" + ' ' * (indentation + 2) + object.map {|k,v| + "#{k} = " + print_recursive(v, indentation + 2)}.join(";\n" + ' ' * (indentation + 2)) + ";\n" + (' ' * indentation) + '}'
27 when TrueClass, FalseClass
30 '"' + object.to_s + '"'
34 ------ Custom config options ------
35 <%- @custom_options.sort.each do |option, value| -%>
36 <%= option %> = <%= print_recursive(value) %>
39 <%- if @components != {} -%>
40 ------ Components ------
41 -- You can specify components to add hosts that provide special services,
42 -- like multi-user conferences, and transports.
43 -- For more information on components, see http://prosody.im/doc/components
45 <% @components.sort.each do |name, component| %>
46 Component "<%= name %>" <% if component.include?('type') then %>"<%= component['type'] %>"<% end %>
47 <%- if component.include?('secret') -%>
48 component_secret = "<%= component['secret'] %>"
50 <%- if component.include?('options') -%>
51 <%- component['options'].sort.each do |k, v| -%>