From 09feb96edeaff10bde462aabb8c4d0c961eadd1a Mon Sep 17 00:00:00 2001 From: mh Date: Tue, 17 May 2011 23:30:11 +0200 Subject: migrate authentication to partials --- templates/vhosts/gitweb/gitweb.erb | 14 ++--------- templates/vhosts/partials/authentication.erb | 4 ++-- templates/vhosts/perl/perl.erb | 28 ++++------------------ templates/vhosts/php/php.erb | 28 ++++------------------ templates/vhosts/php_drupal/php_drupal.erb | 28 ++++------------------ templates/vhosts/php_gallery2/php_gallery2.erb | 28 ++++------------------ templates/vhosts/php_joomla/php_joomla.erb | 28 ++++------------------ templates/vhosts/php_mediawiki/php_mediawiki.erb | 28 ++++------------------ .../vhosts/php_silverstripe/php_silverstripe.erb | 28 ++++------------------ .../vhosts/php_simplemachine/php_simplemachine.erb | 28 ++++------------------ templates/vhosts/php_spip/php_spip.erb | 28 ++++------------------ templates/vhosts/php_typo3/php_typo3.erb | 28 ++++------------------ templates/vhosts/php_wordpress/php_wordpress.erb | 28 ++++------------------ templates/vhosts/proxy/proxy.erb | 14 ++--------- templates/vhosts/static/static.erb | 16 ++----------- templates/vhosts/webdav/webdav.erb | 14 ++--------- 16 files changed, 54 insertions(+), 316 deletions(-) (limited to 'templates') diff --git a/templates/vhosts/gitweb/gitweb.erb b/templates/vhosts/gitweb/gitweb.erb index 61ce15f..5bcfeb5 100644 --- a/templates/vhosts/gitweb/gitweb.erb +++ b/templates/vhosts/gitweb/gitweb.erb @@ -38,12 +38,7 @@ RewriteEngine on RewriteRule ^[a-zA-Z0-9_-]+.git/?(\?.)?$ /gitweb.cgi%{REQUESTURI} [L,PT] - <%- unless htpasswd_file.to_s == 'absent' then -%> - AuthType Basic - AuthName "Access fuer <%= servername %>" - AuthUserFile <%= real_htpasswd_path %> - require valid-user - <%- end -%> +<%= scope.function_template('apache/vhosts/partials/authentication.erb') %> <%- end -%> @@ -92,12 +87,7 @@ RewriteEngine on RewriteRule ^[a-zA-Z0-9_-]+.git/?(\?.)?$ /gitweb.cgi%{REQUESTURI} [L,PT] - <%- unless htpasswd_file.to_s == 'absent' then -%> - AuthType Basic - AuthName "Access fuer <%= servername %>" - AuthUserFile <%= real_htpasswd_path %> - require valid-user - <%- end -%> +<%= scope.function_template('apache/vhosts/partials/authentication.erb') %> <%- end %> diff --git a/templates/vhosts/partials/authentication.erb b/templates/vhosts/partials/authentication.erb index b038eb6..6ca1b03 100644 --- a/templates/vhosts/partials/authentication.erb +++ b/templates/vhosts/partials/authentication.erb @@ -1,6 +1,6 @@ - <%- unless htpasswd_file.to_s == 'absent' -%> +<% unless htpasswd_file.to_s == 'absent' -%> AuthType Basic AuthName "Access fuer <%= servername %>" AuthUserFile <%= real_htpasswd_path %> require valid-user - <%- end -%> \ No newline at end of file +<% end -%> \ No newline at end of file diff --git a/templates/vhosts/perl/perl.erb b/templates/vhosts/perl/perl.erb index 61bc179..1b49d62 100644 --- a/templates/vhosts/perl/perl.erb +++ b/templates/vhosts/perl/perl.erb @@ -40,12 +40,7 @@ Options <%- unless options.to_s == 'absent' then -%><%= options %><%- end -%><%- if do_includes.to_s == 'true' and not options.include?('+Includes') then -%> +Includes<%- end -%> <%- end -%> - <%- unless htpasswd_file.to_s == 'absent' then -%> - AuthType Basic - AuthName "Access fuer <%= servername %>" - AuthUserFile <%= real_htpasswd_path %> - require valid-user - <%- end -%> +<%= scope.function_template('apache/vhosts/partials/authentication.erb') %> <%- unless htpasswd_file.to_s == 'absent' then -%> @@ -103,12 +98,7 @@ Options <%- unless options.to_s == 'absent' then -%><%= options %><%- end -%><%- if do_includes.to_s == 'true' and not options.include?('+Includes') then -%> +Includes<%- end -%> <%- end -%> - <%- unless htpasswd_file.to_s == 'absent' then -%> - AuthType Basic - AuthName "Access fuer <%= servername %>" - AuthUserFile <%= real_htpasswd_path %> - require valid-user - <%- end -%> +<%= scope.function_template('apache/vhosts/partials/authentication.erb') %> ScriptAlias /cgi-bin/ <%= cgi_binpath %>/ @@ -179,12 +169,7 @@ Options <%- unless options.to_s == 'absent' then -%><%= options %><%- end -%><%- if do_includes.to_s == 'true' and not options.include?('+Includes') then -%> +Includes<%- end -%> <%- end -%> - <%- unless htpasswd_file.to_s == 'absent' then -%> - AuthType Basic - AuthName "Access fuer <%= servername %>" - AuthUserFile <%= real_htpasswd_path %> - require valid-user - <%- end -%> +<%= scope.function_template('apache/vhosts/partials/authentication.erb') %> <%- unless htpasswd_file.to_s == 'absent' then -%> @@ -249,12 +234,7 @@ Options <%- unless options.to_s == 'absent' then -%><%= options %><%- end -%><%- if do_includes.to_s == 'true' and not options.include?('+Includes') then -%> +Includes<%- end -%> <%- end -%> - <%- unless htpasswd_file.to_s == 'absent' then -%> - AuthType Basic - AuthName "Access fuer <%= servername %>" - AuthUserFile <%= real_htpasswd_path %> - require valid-user - <%- end -%> +<%= scope.function_template('apache/vhosts/partials/authentication.erb') %> <%- if htpasswd_file.to_s == 'absent' then -%> diff --git a/templates/vhosts/php/php.erb b/templates/vhosts/php/php.erb index 4531d9f..ae70a00 100644 --- a/templates/vhosts/php/php.erb +++ b/templates/vhosts/php/php.erb @@ -40,12 +40,7 @@ Options <%- unless options.to_s == 'absent' then -%><%= options %><%- end -%><%- if do_includes.to_s == 'true' and not options.include?('+Includes') then -%> +Includes<%- end -%> <%- end -%> - <%- unless htpasswd_file.to_s == 'absent' then -%> - AuthType Basic - AuthName "Access fuer <%= servername %>" - AuthUserFile <%= real_htpasswd_path %> - require valid-user - <%- end -%> +<%= scope.function_template('apache/vhosts/partials/authentication.erb') %> php_admin_flag engine on <%- if php_safe_mode.to_s == 'false' -%> php_admin_flag safe_mode Off @@ -106,12 +101,7 @@ Options <%- unless options.to_s == 'absent' then -%><%= options %><%- end -%><%- if do_includes.to_s == 'true' and not options.include?('+Includes') then -%> +Includes<%- end -%> <%- end -%> - <%- unless htpasswd_file.to_s == 'absent' then -%> - AuthType Basic - AuthName "Access fuer <%= servername %>" - AuthUserFile <%= real_htpasswd_path %> - require valid-user - <%- end -%> +<%= scope.function_template('apache/vhosts/partials/authentication.erb') %> php_admin_flag engine on <%- if php_safe_mode.to_s == 'false' -%> php_admin_flag safe_mode Off @@ -184,12 +174,7 @@ Options <%- unless options.to_s == 'absent' then -%><%= options %><%- end -%><%- if do_includes.to_s == 'true' and not options.include?('+Includes') then -%> +Includes<%- end -%> <%- end -%> - <%- unless htpasswd_file.to_s == 'absent' then -%> - AuthType Basic - AuthName "Access fuer <%= servername %>" - AuthUserFile <%= real_htpasswd_path %> - require valid-user - <%- end -%> +<%= scope.function_template('apache/vhosts/partials/authentication.erb') %> <%- end -%> <%- end -%> @@ -244,12 +229,7 @@ Options <%- unless options.to_s == 'absent' then -%><%= options %><%- end -%><%- if do_includes.to_s == 'true' and not options.include?('+Includes') then -%> +Includes<%- end -%> <%- end -%> - <%- unless htpasswd_file.to_s == 'absent' then -%> - AuthType Basic - AuthName "Access fuer <%= servername %>" - AuthUserFile <%= real_htpasswd_path %> - require valid-user - <%- end -%> +<%= scope.function_template('apache/vhosts/partials/authentication.erb') %> <%- end -%> diff --git a/templates/vhosts/php_drupal/php_drupal.erb b/templates/vhosts/php_drupal/php_drupal.erb index 01ba2fb..7300695 100644 --- a/templates/vhosts/php_drupal/php_drupal.erb +++ b/templates/vhosts/php_drupal/php_drupal.erb @@ -39,12 +39,7 @@ Options <%- unless options.to_s == 'absent' then -%><%= options %><%- end -%><%- if do_includes.to_s == 'true' and not options.include?('+Includes') then -%> +Includes<%- end -%> <%- end -%> - <%- unless htpasswd_file.to_s == 'absent' then -%> - AuthType Basic - AuthName "Access fuer <%= servername %>" - AuthUserFile <%= real_htpasswd_path %> - require valid-user - <%- end -%> +<%= scope.function_template('apache/vhosts/partials/authentication.erb') %> php_admin_flag engine on <%- unless php_default_charset.to_s == 'absent' then -%> php_admin_value default_charset <%= php_default_charset %> @@ -127,12 +122,7 @@ Options <%- unless options.to_s == 'absent' then -%><%= options %><%- end -%><%- if do_includes.to_s == 'true' and not options.include?('+Includes') then -%> +Includes<%- end -%> <%- end -%> - <%- unless htpasswd_file.to_s == 'absent' then -%> - AuthType Basic - AuthName "Access fuer <%= servername %>" - AuthUserFile <%= real_htpasswd_path %> - require valid-user - <%- end -%> +<%= scope.function_template('apache/vhosts/partials/authentication.erb') %> php_admin_flag engine on <%- unless php_default_charset.to_s == 'absent' then -%> php_admin_value default_charset <%= php_default_charset %> @@ -228,12 +218,7 @@ Options <%- unless options.to_s == 'absent' then -%><%= options %><%- end -%><%- if do_includes.to_s == 'true' and not options.include?('+Includes') then -%> +Includes<%- end -%> <%- end -%> - <%- unless htpasswd_file.to_s == 'absent' then -%> - AuthType Basic - AuthName "Access fuer <%= servername %>" - AuthUserFile <%= real_htpasswd_path %> - require valid-user - <%- end -%> +<%= scope.function_template('apache/vhosts/partials/authentication.erb') %> # Protect files and directories from prying eyes. @@ -306,12 +291,7 @@ Options <%- unless options.to_s == 'absent' then -%><%= options %><%- end -%><%- if do_includes.to_s == 'true' and not options.include?('+Includes') then -%> +Includes<%- end -%> <%- end -%> - <%- unless htpasswd_file.to_s == 'absent' then -%> - AuthType Basic - AuthName "Access fuer <%= servername %>" - AuthUserFile <%= real_htpasswd_path %> - require valid-user - <%- end -%> +<%= scope.function_template('apache/vhosts/partials/authentication.erb') %> # Protect files and directories from prying eyes. diff --git a/templates/vhosts/php_gallery2/php_gallery2.erb b/templates/vhosts/php_gallery2/php_gallery2.erb index db4068d..22d56ad 100644 --- a/templates/vhosts/php_gallery2/php_gallery2.erb +++ b/templates/vhosts/php_gallery2/php_gallery2.erb @@ -40,12 +40,7 @@ Options <%- unless options.to_s == 'absent' then -%><%= options %><%- end -%><%- if do_includes.to_s == 'true' and not options.include?('+Includes') then -%> +Includes<%- end -%> <%- end -%> - <%- unless htpasswd_file.to_s == 'absent' then -%> - AuthType Basic - AuthName "Access fuer <%= servername %>" - AuthUserFile <%= real_htpasswd_path %> - require valid-user - <%- end -%> +<%= scope.function_template('apache/vhosts/partials/authentication.erb') %> php_admin_flag engine on php_admin_flag safe_mode Off php_admin_value output_buffering Off @@ -114,12 +109,7 @@ Options <%- unless options.to_s == 'absent' then -%><%= options %><%- end -%><%- if do_includes.to_s == 'true' and not options.include?('+Includes') then -%> +Includes<%- end -%> <%- end -%> - <%- unless htpasswd_file.to_s == 'absent' then -%> - AuthType Basic - AuthName "Access fuer <%= servername %>" - AuthUserFile <%= real_htpasswd_path %> - require valid-user - <%- end -%> +<%= scope.function_template('apache/vhosts/partials/authentication.erb') %> php_admin_flag engine on php_admin_flag safe_mode Off php_admin_value output_buffering Off @@ -200,12 +190,7 @@ Options <%- unless options.to_s == 'absent' then -%><%= options %><%- end -%><%- if do_includes.to_s == 'true' and not options.include?('+Includes') then -%> +Includes<%- end -%> <%- end -%> - <%- unless htpasswd_file.to_s == 'absent' then -%> - AuthType Basic - AuthName "Access fuer <%= servername %>" - AuthUserFile <%= real_htpasswd_path %> - require valid-user - <%- end -%> +<%= scope.function_template('apache/vhosts/partials/authentication.erb') %> # Always rewrite login's # Source: http://gallery.menalto.com/node/30558 @@ -270,12 +255,7 @@ Options <%- unless options.to_s == 'absent' then -%><%= options %><%- end -%><%- if do_includes.to_s == 'true' and not options.include?('+Includes') then -%> +Includes<%- end -%> <%- end -%> - <%- unless htpasswd_file.to_s == 'absent' then -%> - AuthType Basic - AuthName "Access fuer <%= servername %>" - AuthUserFile <%= real_htpasswd_path %> - require valid-user - <%- end -%> +<%= scope.function_template('apache/vhosts/partials/authentication.erb') %> # Always rewrite login's (see above) RewriteEngine On RewriteCond %{HTTP_COOKIE} ="" diff --git a/templates/vhosts/php_joomla/php_joomla.erb b/templates/vhosts/php_joomla/php_joomla.erb index 09d1bda..dfb8136 100644 --- a/templates/vhosts/php_joomla/php_joomla.erb +++ b/templates/vhosts/php_joomla/php_joomla.erb @@ -42,12 +42,7 @@ Options <%- unless options.to_s == 'absent' then -%><%= options %><%- end -%><%- if do_includes.to_s == 'true' and not options.include?('+Includes') then -%> +Includes<%- end -%> <%- end -%> - <%- unless htpasswd_file.to_s == 'absent' then -%> - AuthType Basic - AuthName "Access fuer <%= servername %>" - AuthUserFile <%= real_htpasswd_path %> - require valid-user - <%- end -%> +<%= scope.function_template('apache/vhosts/partials/authentication.erb') %> php_admin_flag engine on <%- unless php_default_charset.to_s == 'absent' then -%> php_admin_value default_charset <%= php_default_charset %> @@ -118,12 +113,7 @@ Options <%- unless options.to_s == 'absent' then -%><%= options %><%- end -%><%- if do_includes.to_s == 'true' and not options.include?('+Includes') then -%> +Includes<%- end -%> <%- end -%> - <%- unless htpasswd_file.to_s == 'absent' then -%> - AuthType Basic - AuthName "Access fuer <%= servername %>" - AuthUserFile <%= real_htpasswd_path %> - require valid-user - <%- end -%> +<%= scope.function_template('apache/vhosts/partials/authentication.erb') %> php_admin_flag engine on <%- unless php_default_charset.to_s == 'absent' then -%> php_admin_value default_charset <%= php_default_charset %> @@ -195,12 +185,7 @@ Options <%- unless options.to_s == 'absent' then -%><%= options %><%- end -%><%- if do_includes.to_s == 'true' and not options.include?('+Includes') then -%> +Includes<%- end -%> <%- end -%> - <%- unless htpasswd_file.to_s == 'absent' then -%> - AuthType Basic - AuthName "Access fuer <%= servername %>" - AuthUserFile <%= real_htpasswd_path %> - require valid-user - <%- end -%> +<%= scope.function_template('apache/vhosts/partials/authentication.erb') %> /administrator/"> RewriteEngine on @@ -266,12 +251,7 @@ Options <%- unless options.to_s == 'absent' then -%><%= options %><%- end -%><%- if do_includes.to_s == 'true' and not options.include?('+Includes') then -%> +Includes<%- end -%> <%- end -%> - <%- unless htpasswd_file.to_s == 'absent' then -%> - AuthType Basic - AuthName "Access fuer <%= servername %>" - AuthUserFile <%= real_htpasswd_path %> - require valid-user - <%- end -%> +<%= scope.function_template('apache/vhosts/partials/authentication.erb') %> <%- end -%> diff --git a/templates/vhosts/php_mediawiki/php_mediawiki.erb b/templates/vhosts/php_mediawiki/php_mediawiki.erb index b913c10..af0ae8c 100644 --- a/templates/vhosts/php_mediawiki/php_mediawiki.erb +++ b/templates/vhosts/php_mediawiki/php_mediawiki.erb @@ -40,12 +40,7 @@ Options <%- unless options.to_s == 'absent' then -%><%= options %><%- end -%><%- if do_includes.to_s == 'true' and not options.include?('+Includes') then -%> +Includes<%- end -%><%- unless options.to_s.include?('+FollowSymLinks') -%> +FollowSymLinks<% end -%> <%- end -%> - <%- unless htpasswd_file.to_s == 'absent' then -%> - AuthType Basic - AuthName "Access fuer <%= servername %>" - AuthUserFile <%= real_htpasswd_path %> - require valid-user - <%- end -%> +<%= scope.function_template('apache/vhosts/partials/authentication.erb') %> php_admin_flag engine on php_admin_value safe_mode off <%- unless php_default_charset.to_s == 'absent' then -%> @@ -102,12 +97,7 @@ Options <%- unless options.to_s == 'absent' then -%><%= options %><%- end -%><%- if do_includes.to_s == 'true' and not options.include?('+Includes') then -%> +Includes<%- end -%> <%- end -%> - <%- unless htpasswd_file.to_s == 'absent' then -%> - AuthType Basic - AuthName "Access fuer <%= servername %>" - AuthUserFile <%= real_htpasswd_path %> - require valid-user - <%- end -%> +<%= scope.function_template('apache/vhosts/partials/authentication.erb') %> php_admin_flag engine on php_admin_value safe_mode off <%- unless php_default_charset.to_s == 'absent' then -%> @@ -175,12 +165,7 @@ Options <%- unless options.to_s == 'absent' then -%><%= options %><%- end -%><%- if do_includes.to_s == 'true' and not options.include?('+Includes') then -%> +Includes<%- end -%><%- unless options.to_s.include?('+FollowSymLinks') -%> +FollowSymLinks<% end -%> <%- end -%> - <%- unless htpasswd_file.to_s == 'absent' then -%> - AuthType Basic - AuthName "Access fuer <%= servername %>" - AuthUserFile <%= real_htpasswd_path %> - require valid-user - <%- end -%> +<%= scope.function_template('apache/vhosts/partials/authentication.erb') %> <%- end -%> <%- end -%> @@ -237,12 +222,7 @@ Options <%- unless options.to_s == 'absent' then -%><%= options %><%- end -%><%- if do_includes.to_s == 'true' and not options.include?('+Includes') then -%> +Includes<%- end -%> <%- end -%> - <%- unless htpasswd_file.to_s == 'absent' then -%> - AuthType Basic - AuthName "Access fuer <%= servername %>" - AuthUserFile <%= real_htpasswd_path %> - require valid-user - <%- end -%> +<%= scope.function_template('apache/vhosts/partials/authentication.erb') %> <%- end -%> diff --git a/templates/vhosts/php_silverstripe/php_silverstripe.erb b/templates/vhosts/php_silverstripe/php_silverstripe.erb index 19f48d1..eaf944a 100644 --- a/templates/vhosts/php_silverstripe/php_silverstripe.erb +++ b/templates/vhosts/php_silverstripe/php_silverstripe.erb @@ -44,12 +44,7 @@ Options <%- unless options.to_s == 'absent' then -%><%= options %><%- end -%><%- if do_includes.to_s == 'true' and not options.include?('+Includes') then -%> +Includes<%- end -%> <%- end -%> - <%- unless htpasswd_file.to_s == 'absent' then -%> - AuthType Basic - AuthName "Access fuer <%= servername %>" - AuthUserFile <%= real_htpasswd_path %> - require valid-user - <%- end -%> +<%= scope.function_template('apache/vhosts/partials/authentication.erb') %> php_admin_flag engine on <%- unless php_default_charset.to_s == 'absent' then -%> php_admin_value default_charset <%= php_default_charset %> @@ -125,12 +120,7 @@ Options <%- unless options.to_s == 'absent' then -%><%= options %><%- end -%><%- if do_includes.to_s == 'true' and not options.include?('+Includes') then -%> +Includes<%- end -%> <%- end -%> - <%- unless htpasswd_file.to_s == 'absent' then -%> - AuthType Basic - AuthName "Access fuer <%= servername %>" - AuthUserFile <%= real_htpasswd_path %> - require valid-user - <%- end -%> +<%= scope.function_template('apache/vhosts/partials/authentication.erb') %> php_admin_flag engine on <%- unless php_default_charset.to_s == 'absent' then -%> php_admin_value default_charset <%= php_default_charset %> @@ -223,12 +213,7 @@ Options <%- unless options.to_s == 'absent' then -%><%= options %><%- end -%><%- if do_includes.to_s == 'true' and not options.include?('+Includes') then -%> +Includes<%- end -%> <%- end -%> - <%- unless htpasswd_file.to_s == 'absent' then -%> - AuthType Basic - AuthName "Access fuer <%= servername %>" - AuthUserFile <%= real_htpasswd_path %> - require valid-user - <%- end -%> +<%= scope.function_template('apache/vhosts/partials/authentication.erb') %> # silverstripe .htaccess Order deny,allow @@ -299,12 +284,7 @@ Options <%- unless options.to_s == 'absent' then -%><%= options %><%- end -%><%- if do_includes.to_s == 'true' and not options.include?('+Includes') then -%> +Includes<%- end -%> <%- end -%> - <%- unless htpasswd_file.to_s == 'absent' then -%> - AuthType Basic - AuthName "Access fuer <%= servername %>" - AuthUserFile <%= real_htpasswd_path %> - require valid-user - <%- end -%> +<%= scope.function_template('apache/vhosts/partials/authentication.erb') %> # silverstripe .htaccess diff --git a/templates/vhosts/php_simplemachine/php_simplemachine.erb b/templates/vhosts/php_simplemachine/php_simplemachine.erb index ebab10d..5d7c87e 100644 --- a/templates/vhosts/php_simplemachine/php_simplemachine.erb +++ b/templates/vhosts/php_simplemachine/php_simplemachine.erb @@ -40,12 +40,7 @@ Options <%- unless options.to_s == 'absent' then -%><%= options %><%- end -%><%- if do_includes.to_s == 'true' and not options.include?('+Includes') then -%> +Includes<%- end -%> <%- end -%> - <%- unless htpasswd_file.to_s == 'absent' then -%> - AuthType Basic - AuthName "Access fuer <%= servername %>" - AuthUserFile <%= real_htpasswd_path %> - require valid-user - <%- end -%> +<%= scope.function_template('apache/vhosts/partials/authentication.erb') %> php_admin_flag engine on <%- unless php_default_charset.to_s == 'absent' then -%> php_admin_value default_charset <%= php_default_charset %> @@ -100,12 +95,7 @@ Options <%- unless options.to_s == 'absent' then -%><%= options %><%- end -%><%- if do_includes.to_s == 'true' and not options.include?('+Includes') then -%> +Includes<%- end -%> <%- end -%> - <%- unless htpasswd_file.to_s == 'absent' then -%> - AuthType Basic - AuthName "Access fuer <%= servername %>" - AuthUserFile <%= real_htpasswd_path %> - require valid-user - <%- end -%> +<%= scope.function_template('apache/vhosts/partials/authentication.erb') %> php_admin_flag engine on <%- unless php_default_charset.to_s == 'absent' then -%> php_admin_value default_charset <%= php_default_charset %> @@ -172,12 +162,7 @@ Options <%- unless options.to_s == 'absent' then -%><%= options %><%- end -%><%- if do_includes.to_s == 'true' and not options.include?('+Includes') then -%> +Includes<%- end -%> <%- end -%> - <%- unless htpasswd_file.to_s == 'absent' then -%> - AuthType Basic - AuthName "Access fuer <%= servername %>" - AuthUserFile <%= real_htpasswd_path %> - require valid-user - <%- end -%> +<%= scope.function_template('apache/vhosts/partials/authentication.erb') %> <%- end -%> <%- end -%> @@ -232,12 +217,7 @@ Options <%- unless options.to_s == 'absent' then -%><%= options %><%- end -%><%- if do_includes.to_s == 'true' and not options.include?('+Includes') then -%> +Includes<%- end -%> <%- end -%> - <%- unless htpasswd_file.to_s == 'absent' then -%> - AuthType Basic - AuthName "Access fuer <%= servername %>" - AuthUserFile <%= real_htpasswd_path %> - require valid-user - <%- end -%> +<%= scope.function_template('apache/vhosts/partials/authentication.erb') %> <%- end -%> diff --git a/templates/vhosts/php_spip/php_spip.erb b/templates/vhosts/php_spip/php_spip.erb index 48a6774..a4ffd19 100644 --- a/templates/vhosts/php_spip/php_spip.erb +++ b/templates/vhosts/php_spip/php_spip.erb @@ -40,12 +40,7 @@ Options <%- unless options.to_s == 'absent' then -%><%= options %><%- end -%><%- if do_includes.to_s == 'true' and not options.include?('+Includes') then -%> +Includes<%- end -%> <%- end -%> - <%- unless htpasswd_file.to_s == 'absent' then -%> - AuthType Basic - AuthName "Access fuer <%= servername %>" - AuthUserFile <%= real_htpasswd_path %> - require valid-user - <%- end -%> +<%= scope.function_template('apache/vhosts/partials/authentication.erb') %> php_admin_flag engine on <%- if php_safe_mode.to_s == 'false' -%> php_admin_flag safe_mode Off @@ -106,12 +101,7 @@ Options <%- unless options.to_s == 'absent' then -%><%= options %><%- end -%><%- if do_includes.to_s == 'true' and not options.include?('+Includes') then -%> +Includes<%- end -%> <%- end -%> - <%- unless htpasswd_file.to_s == 'absent' then -%> - AuthType Basic - AuthName "Access fuer <%= servername %>" - AuthUserFile <%= real_htpasswd_path %> - require valid-user - <%- end -%> +<%= scope.function_template('apache/vhosts/partials/authentication.erb') %> php_admin_flag engine on <%- if php_safe_mode.to_s == 'false' -%> php_admin_flag safe_mode Off @@ -184,12 +174,7 @@ Options <%- unless options.to_s == 'absent' then -%><%= options %><%- end -%><%- if do_includes.to_s == 'true' and not options.include?('+Includes') then -%> +Includes<%- end -%> <%- end -%> - <%- unless htpasswd_file.to_s == 'absent' then -%> - AuthType Basic - AuthName "Access fuer <%= servername %>" - AuthUserFile <%= real_htpasswd_path %> - require valid-user - <%- end -%> +<%= scope.function_template('apache/vhosts/partials/authentication.erb') %> <%- end -%> <%- end -%> @@ -244,12 +229,7 @@ Options <%- unless options.to_s == 'absent' then -%><%= options %><%- end -%><%- if do_includes.to_s == 'true' and not options.include?('+Includes') then -%> +Includes<%- end -%> <%- end -%> - <%- unless htpasswd_file.to_s == 'absent' then -%> - AuthType Basic - AuthName "Access fuer <%= servername %>" - AuthUserFile <%= real_htpasswd_path %> - require valid-user - <%- end -%> +<%= scope.function_template('apache/vhosts/partials/authentication.erb') %> <%- end -%> diff --git a/templates/vhosts/php_typo3/php_typo3.erb b/templates/vhosts/php_typo3/php_typo3.erb index 1fd5a1a..1fec8e7 100644 --- a/templates/vhosts/php_typo3/php_typo3.erb +++ b/templates/vhosts/php_typo3/php_typo3.erb @@ -40,12 +40,7 @@ Options <%- unless options.to_s == 'absent' then -%><%= options %><%- end -%><%- if do_includes.to_s == 'true' and not options.include?('+Includes') then -%> +Includes<%- end -%> <%- end -%> - <%- unless htpasswd_file.to_s == 'absent' then -%> - AuthType Basic - AuthName "Access fuer <%= servername %>" - AuthUserFile <%= real_htpasswd_path %> - require valid-user - <%- end -%> +<%= scope.function_template('apache/vhosts/partials/authentication.erb') %> php_admin_flag engine on <%- unless php_default_charset.to_s == 'absent' then -%> php_admin_value default_charset <%= php_default_charset %> @@ -113,12 +108,7 @@ Options <%- unless options.to_s == 'absent' then -%><%= options %><%- end -%><%- if do_includes.to_s == 'true' and not options.include?('+Includes') then -%> +Includes<%- end -%> <%- end -%> - <%- unless htpasswd_file.to_s == 'absent' then -%> - AuthType Basic - AuthName "Access fuer <%= servername %>" - AuthUserFile <%= real_htpasswd_path %> - require valid-user - <%- end -%> +<%= scope.function_template('apache/vhosts/partials/authentication.erb') %> php_admin_flag engine on <%- unless php_default_charset.to_s == 'absent' then -%> php_admin_value default_charset <%= php_default_charset %> @@ -190,12 +180,7 @@ Options <%- unless options.to_s == 'absent' then -%><%= options %><%- end -%><%- if do_includes.to_s == 'true' and not options.include?('+Includes') then -%> +Includes<%- end -%> <%- end -%> - <%- unless htpasswd_file.to_s == 'absent' then -%> - AuthType Basic - AuthName "Access fuer <%= servername %>" - AuthUserFile <%= real_htpasswd_path %> - require valid-user - <%- end -%> +<%= scope.function_template('apache/vhosts/partials/authentication.erb') %> /typo3/"> RewriteEngine on @@ -259,12 +244,7 @@ Options <%- unless options.to_s == 'absent' then -%><%= options %><%- end -%><%- if do_includes.to_s == 'true' and not options.include?('+Includes') then -%> +Includes<%- end -%> <%- end -%> - <%- unless htpasswd_file.to_s == 'absent' then -%> - AuthType Basic - AuthName "Access fuer <%= servername %>" - AuthUserFile <%= real_htpasswd_path %> - require valid-user - <%- end -%> +<%= scope.function_template('apache/vhosts/partials/authentication.erb') %> <%- end -%> diff --git a/templates/vhosts/php_wordpress/php_wordpress.erb b/templates/vhosts/php_wordpress/php_wordpress.erb index 9180d9a..fe713c8 100644 --- a/templates/vhosts/php_wordpress/php_wordpress.erb +++ b/templates/vhosts/php_wordpress/php_wordpress.erb @@ -40,12 +40,7 @@ Options <%- unless options.to_s == 'absent' then -%><%= options %><%- end -%><%- if do_includes.to_s == 'true' and not options.include?('+Includes') then -%> +Includes<%- end -%> <%- end -%> - <%- unless htpasswd_file.to_s == 'absent' then -%> - AuthType Basic - AuthName "Access fuer <%= servername %>" - AuthUserFile <%= real_htpasswd_path %> - require valid-user - <%- end -%> +<%= scope.function_template('apache/vhosts/partials/authentication.erb') %> php_admin_flag engine on <%- unless php_default_charset.to_s == 'absent' then -%> php_admin_value default_charset <%= php_default_charset %> @@ -102,12 +97,7 @@ Options <%- unless options.to_s == 'absent' then -%><%= options %><%- end -%><%- if do_includes.to_s == 'true' and not options.include?('+Includes') then -%> +Includes<%- end -%> <%- end -%> - <%- unless htpasswd_file.to_s == 'absent' then -%> - AuthType Basic - AuthName "Access fuer <%= servername %>" - AuthUserFile <%= real_htpasswd_path %> - require valid-user - <%- end -%> +<%= scope.function_template('apache/vhosts/partials/authentication.erb') %> php_admin_flag engine on <%- unless php_default_charset.to_s == 'absent' then -%> php_admin_value default_charset <%= php_default_charset %> @@ -177,12 +167,7 @@ Options <%- unless options.to_s == 'absent' then -%><%= options %><%- end -%><%- if do_includes.to_s == 'true' and not options.include?('+Includes') then -%> +Includes<%- end -%> <%- end -%> - <%- unless htpasswd_file.to_s == 'absent' then -%> - AuthType Basic - AuthName "Access fuer <%= servername %>" - AuthUserFile <%= real_htpasswd_path %> - require valid-user - <%- end -%> +<%= scope.function_template('apache/vhosts/partials/authentication.erb') %> <%- end -%> <%- end -%> @@ -237,12 +222,7 @@ Options <%- unless options.to_s == 'absent' then -%><%= options %><%- end -%><%- if do_includes.to_s == 'true' and not options.include?('+Includes') then -%> +Includes<%- end -%> <%- end -%> - <%- unless htpasswd_file.to_s == 'absent' then -%> - AuthType Basic - AuthName "Access fuer <%= servername %>" - AuthUserFile <%= real_htpasswd_path %> - require valid-user - <%- end -%> +<%= scope.function_template('apache/vhosts/partials/authentication.erb') %> <%- end -%> diff --git a/templates/vhosts/proxy/proxy.erb b/templates/vhosts/proxy/proxy.erb index bb31b6b..1b1afd0 100644 --- a/templates/vhosts/proxy/proxy.erb +++ b/templates/vhosts/proxy/proxy.erb @@ -19,12 +19,7 @@ Order deny,allow Allow from all - <%- unless htpasswd_file.to_s == 'absent' then -%> - AuthType Basic - AuthName "Access fuer <%= servername %>" - AuthUserFile <%= real_htpasswd_path %> - require valid-user - <%- end -%> +<%= scope.function_template('apache/vhosts/partials/authentication.erb') %> ProxyRequests Off ProxyPass / <%= options %>/ @@ -60,12 +55,7 @@ Order deny,allow Allow from all - <%- unless htpasswd_file.to_s == 'absent' then -%> - AuthType Basic - AuthName "Access fuer <%= servername %>" - AuthUserFile <%= real_htpasswd_path %> - require valid-user - <%- end -%> +<%= scope.function_template('apache/vhosts/partials/authentication.erb') %> ProxyRequests Off ProxyPass / <%= options %>/ diff --git a/templates/vhosts/static/static.erb b/templates/vhosts/static/static.erb index 05760d6..db5f102 100644 --- a/templates/vhosts/static/static.erb +++ b/templates/vhosts/static/static.erb @@ -26,12 +26,7 @@ Options <%- unless options.to_s == 'absent' then -%><%= options %><%- end -%><%- if do_includes.to_s == 'true' and not options.include?('+Includes') then -%> +Includes<%- end -%> <%- end -%> - <%- unless htpasswd_file.to_s == 'absent' then -%> - AuthType Basic - AuthName "Access fuer <%= servername %>" - AuthUserFile <%= real_htpasswd_path %> - require valid-user - <%- end -%> +<%= scope.function_template('apache/vhosts/partials/authentication.erb') %> <%- end -%> @@ -64,21 +59,14 @@ Header add Strict-Transport-Security "max-age=15768000" - <%- if options.to_s != 'absent' or htpasswd_file.to_s != 'absent' then -%> /"> AllowOverride <%= allow_override %> <%- if options.to_s != 'absent' or do_includes.to_s == 'true' then -%> Options <%= options %><%- if do_includes.to_s == 'true' and not options.include?('+Includes') then -%> +Includes<%- end -%> <%- end -%> - <%- unless htpasswd_file.to_s == 'absent' then -%> - AuthType Basic - AuthName "Access fuer <%= servername %>" - AuthUserFile <%= real_htpasswd_path %> - require valid-user - <%- end -%> +<%= scope.function_template('apache/vhosts/partials/authentication.erb') %> - <%- end %> <%= scope.function_template('apache/vhosts/partials/mod_security.erb') %> diff --git a/templates/vhosts/webdav/webdav.erb b/templates/vhosts/webdav/webdav.erb index 30d76e3..eb12e36 100644 --- a/templates/vhosts/webdav/webdav.erb +++ b/templates/vhosts/webdav/webdav.erb @@ -45,12 +45,7 @@ Options Indexes <%- end -%> - <%- unless htpasswd_file.to_s == 'absent' then -%> - AuthType Basic - AuthName "Access fuer <%= servername %>" - AuthUserFile <%= real_htpasswd_path %> - require valid-user - <%- end -%> +<%= scope.function_template('apache/vhosts/partials/authentication.erb') %> <%- if ldap_auth.to_s == 'true' then -%> Include include.d/ldap_auth.inc <%- unless ldap_user.to_s == 'any' -%> @@ -111,12 +106,7 @@ Options Indexes <%- end -%> - <%- unless htpasswd_file.to_s == 'absent' then -%> - AuthType Basic - AuthName "Access fuer <%= servername %>" - AuthUserFile <%= real_htpasswd_path %> - require valid-user - <%- end -%> +<%= scope.function_template('apache/vhosts/partials/authentication.erb') %> <%- if ldap_auth.to_s == 'true' then -%> Include include.d/ldap_auth.inc <%- unless ldap_user.to_s == 'any' -%> -- cgit v1.2.3