vhost_footer.erb 899 B

123456789101112131415161718192021222324252627
  1. <% if @include_files -%>
  2. <%- @include_files.each do |file| -%>
  3. include <%= file %>;
  4. <%- end -%>
  5. <% end -%>
  6. <%# make sure that allow comes before deny by forcing the allow key (if it -%>
  7. <%# exists) to be first in the output order. The hash keys also need to be -%>
  8. <%# sorted so that the ordering is stable. -%>
  9. <% if @vhost_cfg_append -%>
  10. <%- @vhost_cfg_append.sort_by{ |k, v| k.to_s == 'allow' ? '' : k.to_s }.each do |key,value| -%>
  11. <%- if value.is_a?(Hash) -%>
  12. <%- value.sort_by {|k,v| k}.each do |subkey,subvalue| -%>
  13. <%- Array(subvalue).each do |asubvalue| -%>
  14. <%= key %> <%= subkey %> <%= asubvalue %>;
  15. <%- end -%>
  16. <%- end -%>
  17. <%- else -%>
  18. <%- Array(value).each do |asubvalue| -%>
  19. <%= key %> <%= asubvalue %>;
  20. <%- end -%>
  21. <%- end -%>
  22. <%- end -%>
  23. <% end -%>
  24. <% Array(@raw_append).each do |line| -%>
  25. <%= line %>
  26. <% end -%>
  27. }