From c52c48534d76b0a9c965784bd12eb1c1fccd94c6 Mon Sep 17 00:00:00 2001 From: mh Date: Mon, 14 Apr 2014 22:54:24 +0200 Subject: cleanup identation of if then else, especially for the produced file --- templates/vhosts/itk_plus/partial.erb | 24 ++++++++++----------- templates/vhosts/partials/authentication.erb | 2 +- templates/vhosts/partials/header_default.erb | 2 +- templates/vhosts/partials/mod_security.erb | 12 +++++------ templates/vhosts/partials/php_settings.erb | 25 +++++++++++----------- templates/vhosts/partials/std_override_options.erb | 4 ++-- templates/vhosts/php_drupal/partial.erb | 2 +- templates/vhosts/php_joomla/partial.erb | 2 +- 8 files changed, 37 insertions(+), 36 deletions(-) (limited to 'templates') diff --git a/templates/vhosts/itk_plus/partial.erb b/templates/vhosts/itk_plus/partial.erb index 5b05dd8..9c5a1ac 100644 --- a/templates/vhosts/itk_plus/partial.erb +++ b/templates/vhosts/itk_plus/partial.erb @@ -3,30 +3,30 @@ ProxyRequests off <% if vhost_part == :ssl -%> SSLProxyEngine On - <%- if run_mode.to_s == 'static-itk' -%> +<% if run_mode.to_s == 'static-itk' -%> ProxyPassMatch ^/(.*\.<%= passing_extension %>/?.*)$ https://127.0.0.1/$1 - <%- else -%> +<% else -%> ProxyPass / https://127.0.0.1/ - <%- end -%> +<% end -%> ProxyPassReverse / https://127.0.0.1/ <% else -%> - <% if run_mode.to_s == 'static-itk' -%> +<% if run_mode.to_s == 'static-itk' -%> ProxyPassMatch ^/(.*\.<%= passing_extension %>/?.*)$ http://127.0.0.1/$1 - <% else -%> +<% else -%> ProxyPass / http://127.0.0.1/ - <% end -%> +<% end -%> ProxyPassReverse / http://127.0.0.1/ -<% end %> +<% end -%> - <% if run_mode.to_s == 'static-itk' && (ssl_mode.to_s != 'force' || vhost_part == :ssl) -%> +<% if run_mode.to_s == 'static-itk' && (ssl_mode.to_s != 'force' || vhost_part == :ssl) -%> /"> AllowOverride <%= allow_override %> - <% if options.to_s != 'absent' or do_includes.to_s == 'true' then -%> - Options <% unless options.to_s == 'absent' then -%><%= options %><% end -%><% if do_includes.to_s == 'true' and not options.include?('+Includes') then -%> +Includes<% end -%> +<% if options.to_s != 'absent' or do_includes.to_s == 'true' -%> + Options <% unless options.to_s == 'absent' -%><%= options %><% end -%><% if do_includes.to_s == 'true' and not options.include?('+Includes') -%> +Includes<% end -%> - <% end -%> +<% end -%> <%= scope.function_template(['apache/vhosts/partials/authentication.erb']) %> - <% end -%> +<% end -%> diff --git a/templates/vhosts/partials/authentication.erb b/templates/vhosts/partials/authentication.erb index 6ca1b03..a6ebf3e 100644 --- a/templates/vhosts/partials/authentication.erb +++ b/templates/vhosts/partials/authentication.erb @@ -3,4 +3,4 @@ AuthName "Access fuer <%= servername %>" AuthUserFile <%= real_htpasswd_path %> require valid-user -<% end -%> \ No newline at end of file +<% end -%> diff --git a/templates/vhosts/partials/header_default.erb b/templates/vhosts/partials/header_default.erb index de707c9..398b0ce 100644 --- a/templates/vhosts/partials/header_default.erb +++ b/templates/vhosts/partials/header_default.erb @@ -12,7 +12,7 @@ <% unless documentroot == 'really_absent' -%> DocumentRoot <%= documentroot %>/ <% end -%> -<% if default_charset != 'absent' then -%> +<% if default_charset != 'absent' -%> AddDefaultCharset <%= default_charset %> <% end -%> <% if passing_extension != 'absent' -%> diff --git a/templates/vhosts/partials/mod_security.erb b/templates/vhosts/partials/mod_security.erb index 5b4fca8..f0602d8 100644 --- a/templates/vhosts/partials/mod_security.erb +++ b/templates/vhosts/partials/mod_security.erb @@ -1,11 +1,11 @@ -<% if mod_security.to_s == 'true' then -%> +<% if mod_security.to_s == 'true' -%> SecRuleEngine On -<% if mod_security_relevantonly.to_s == 'true' then -%> +<% if mod_security_relevantonly.to_s == 'true' -%> SecAuditEngine RelevantOnly -<% else -%> +<% else -%> SecAuditEngine On -<% end -%> +<% end -%> <% else -%> SecRuleEngine Off SecAuditEngine Off @@ -16,9 +16,9 @@ SecDebugLog <%= logdir %>/mod_security_debug.log <% unless mod_security_rules_to_disable.to_a.empty? -%> -<% mod_security_rules_to_disable.to_a.each do |rule| -%> +<% mod_security_rules_to_disable.to_a.each do |rule| -%> SecRuleRemoveById "<%= rule %>" -<% end -%> +<% end -%> <% end -%> <% unless mod_security_additional_options.to_s == 'absent' -%> diff --git a/templates/vhosts/partials/php_settings.erb b/templates/vhosts/partials/php_settings.erb index 7840987..fe55967 100644 --- a/templates/vhosts/partials/php_settings.erb +++ b/templates/vhosts/partials/php_settings.erb @@ -2,18 +2,19 @@ php_settings.reject{|k,v| v == :undef }.keys.sort.each do |key| dvalue = php_settings[key].to_s.downcase munged_value = if dvalue == 'true' - 'on' - elsif dvalue == 'false' - 'off' - elsif ['on','off'].include?(dvalue) - dvalue - else - php_settings[key] - end - if ['on','off' ].include?(munged_value) -%> + 'on' + elsif dvalue == 'false' + 'off' + elsif ['on','off'].include?(dvalue) + dvalue + else + php_settings[key] + end + + if ['on','off' ].include?(munged_value) -%> php_admin_flag <%= key %> <%= munged_value %> -<% else -%> +<% else -%> php_admin_value <%= key %> <%= munged_value %> -<% end -%> -<% end -%> +<% end -%> +<% end -%> <% end -%> diff --git a/templates/vhosts/partials/std_override_options.erb b/templates/vhosts/partials/std_override_options.erb index 95a5e6a..a69250d 100644 --- a/templates/vhosts/partials/std_override_options.erb +++ b/templates/vhosts/partials/std_override_options.erb @@ -1,4 +1,4 @@ AllowOverride <%= allow_override %> - <% if options.to_s != 'absent' || do_includes.to_s == 'true' || run_mode == 'fcgid' -%> +<% if options.to_s != 'absent' || do_includes.to_s == 'true' || run_mode == 'fcgid' -%> Options <%- unless options.to_s == 'absent' then -%><%= options %><% end -%><% if do_includes.to_s == 'true' && !options.include?('+Includes') -%> +Includes<% end -%><% if run_mode == 'fcgid' && !options.include?('+ExecCGI') -%> +ExecCGI<% end -%> - <% end -%> +<% end -%> diff --git a/templates/vhosts/php_drupal/partial.erb b/templates/vhosts/php_drupal/partial.erb index 3c420b1..10f1a30 100644 --- a/templates/vhosts/php_drupal/partial.erb +++ b/templates/vhosts/php_drupal/partial.erb @@ -1,7 +1,7 @@ /"> <%= scope.function_template(['apache/vhosts/partials/std_override_options.erb']) %> - + <%= scope.function_template(['apache/vhosts/partials/authentication.erb']) %> <%= scope.function_template(['apache/vhosts/partials/php_settings.erb']) %> diff --git a/templates/vhosts/php_joomla/partial.erb b/templates/vhosts/php_joomla/partial.erb index 3046129..89999e9 100644 --- a/templates/vhosts/php_joomla/partial.erb +++ b/templates/vhosts/php_joomla/partial.erb @@ -7,7 +7,7 @@ Include include.d/joomla.inc - + /administrator/"> RewriteEngine on -- cgit v1.2.3