From: Peter Palfrader Date: Sun, 19 Mar 2017 08:56:48 +0000 (+0000) Subject: Make scores of webserver related templates compile X-Git-Url: https://git.adam-barratt.org.uk/?a=commitdiff_plain;h=f7b6fdd2d515765d88696ced52fb0e7e4dda06c0;p=mirror%2Fdsa-puppet.git Make scores of webserver related templates compile --- diff --git a/modules/roles/templates/apache-debug.mirrors.debian.org.erb b/modules/roles/templates/apache-debug.mirrors.debian.org.erb index b57df668c..103724733 100644 --- a/modules/roles/templates/apache-debug.mirrors.debian.org.erb +++ b/modules/roles/templates/apache-debug.mirrors.debian.org.erb @@ -3,7 +3,7 @@ ## USE: git clone git+ssh://$USER@puppet.debian.org/srv/puppet.debian.org/git/dsa-puppet.git ## - > + > ServerAdmin debian-admin@debian.org ServerName debug.mirrors.debian.org <% if scope.function_onion_global_service_hostname(['debug.mirrors.debian.org']) -%> diff --git a/modules/roles/templates/apache-ftp.debian.org.erb b/modules/roles/templates/apache-ftp.debian.org.erb index 339f93449..6dda3727a 100644 --- a/modules/roles/templates/apache-ftp.debian.org.erb +++ b/modules/roles/templates/apache-ftp.debian.org.erb @@ -3,7 +3,7 @@ ## USE: git clone git+ssh://$USER@puppet.debian.org/srv/puppet.debian.org/git/dsa-puppet.git ## -> +> ServerAdmin debian-admin@debian.org ServerName ftp.debian.org ServerAlias debian.anycast-test.mirrors.debian.org @@ -14,12 +14,12 @@ ServerAlias *.debian.backend.mirrors.debian.org RedirectMatch "^/$" /debian/ - Alias /debian/ <%= archive_root %>/ + Alias /debian/ <%= @archive_root %>/ ErrorLog /var/log/apache2/ftp.debian.org-error.log CustomLog /var/log/apache2/ftp.debian.org-access.log privacy - Use ftp-archive <%= archive_root %> + Use ftp-archive <%= @archive_root %> UserDir disabled diff --git a/modules/roles/templates/apache-ftp.ports.debian.org.erb b/modules/roles/templates/apache-ftp.ports.debian.org.erb index 458a83e4b..a9d4058e4 100644 --- a/modules/roles/templates/apache-ftp.ports.debian.org.erb +++ b/modules/roles/templates/apache-ftp.ports.debian.org.erb @@ -3,7 +3,7 @@ ## USE: git clone git+ssh://$USER@puppet.debian.org/srv/puppet.debian.org/git/dsa-puppet.git ## - > + > ServerAdmin debian-admin@debian.org ServerName ftp.ports.debian.org <% if scope.function_onion_global_service_hostname(['ftp.ports.debian.org']) -%> diff --git a/modules/roles/templates/apache-www.debian.org.erb b/modules/roles/templates/apache-www.debian.org.erb index 11e0ae4e9..39f6cee0e 100644 --- a/modules/roles/templates/apache-www.debian.org.erb +++ b/modules/roles/templates/apache-www.debian.org.erb @@ -4,7 +4,7 @@ ## # Need to turn on negotiation_module -/> +/> Options +MultiViews +FollowSymLinks +Indexes AddHandler type-map var # Make sure that the srm.conf directive is commented out. @@ -141,7 +141,7 @@ ServerAlias www.debian.de ServerAlias newwww.deb.at - DocumentRoot <%= wwwdo_document_root %>/ + DocumentRoot <%= @wwwdo_document_root %>/ LogFormat "0.0.0.0 - %u %{[%d/%b/%Y:00:00:00 %z]}t \"%r\" %>s %b \"%{Referer}i\" \"-\" %V" privacy+host ErrorLog /var/log/apache2/www-other.debian.org-error.log CustomLog /var/log/apache2/www-other.debian.org-access.log privacy+host @@ -155,7 +155,7 @@ ServerAlias <%= scope.function_onion_global_service_hostname(['www.debian.org']) %> <% end %> - DocumentRoot <%= wwwdo_document_root %>/ + DocumentRoot <%= @wwwdo_document_root %>/ # CacheNegotiatedDocs: By default, Apache sends Pragma: no-cache with each # document that was negotiated on the basis of content. This asks proxy @@ -253,12 +253,12 @@ RewriteRule ^/devel/debian-volatile/.* /volatile/ [R=301] # Offer a Redirect to DSA without knowing year #474730 - RewriteMap dsa txt:<%= wwwdo_document_root %>/security/map-dsa.txt + RewriteMap dsa txt:<%= @wwwdo_document_root %>/security/map-dsa.txt RewriteRule ^/security/dsa-(\d+)(\..*)? /security/${dsa:$1}$2 [R=301] # Compatibility after SGML -> DocBook # Debian Reference #624239 - RewriteMap reference txt:<%= wwwdo_document_root %>/doc/map-reference.txt + RewriteMap reference txt:<%= @wwwdo_document_root %>/doc/map-reference.txt RewriteCond %{DOCUMENT_ROOT}/doc/manuals/debian-reference/ch-support$1 !-f RewriteRule ^/doc/manuals/debian-reference/ch-support(.*) /support$1 [L,R=301] RewriteCond %{DOCUMENT_ROOT}/doc/manuals/debian-reference/${reference:$1}$2 -f @@ -284,13 +284,13 @@ - > + > ErrorLog /var/log/apache2/www.debian.org-error.log CustomLog /var/log/apache2/www.debian.org-access.log privacy Use common-www.d.o - > + > ErrorLog /var/log/apache2/www.debian.org-error.log CustomLog /var/log/apache2/www.debian.org-access.log privacyssl @@ -301,7 +301,7 @@ - > + > Use common-www-other.d.o ErrorLog /var/log/apache2/www-other.debian.org-error.log @@ -309,7 +309,7 @@ Redirect permanent / http://www.debian.org/ - > + > Use common-www-other.d.o CustomLog /var/log/apache2/www-other-access.log privacyssl diff --git a/modules/roles/templates/static-mirroring/static-vhost.conf.erb b/modules/roles/templates/static-mirroring/static-vhost.conf.erb index 5b2eb4db3..9a3e83c19 100644 --- a/modules/roles/templates/static-mirroring/static-vhost.conf.erb +++ b/modules/roles/templates/static-mirroring/static-vhost.conf.erb @@ -1,6 +1,6 @@ # puppet maintained - > + > ServerName $name ServerAdmin debian-admin@lists.debian.org @@ -27,7 +27,7 @@ Require all granted - Header set Surrogate-Key <%= hostname %> + Header set Surrogate-Key <%= @hostname %> AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css @@ -35,7 +35,7 @@ - > + > ServerName $name ErrorLog /var/log/apache2/$name-error.log @@ -46,7 +46,7 @@ - > + > ServerName $onion ErrorLog /var/log/apache2/$name-error.log @@ -57,7 +57,7 @@ - > + > ServerName $name ErrorLog /var/log/apache2/$name-error.log diff --git a/modules/roles/templates/static-mirroring/vhost/planet.debian.org.erb b/modules/roles/templates/static-mirroring/vhost/planet.debian.org.erb index 7d0ab0159..9dca69c6e 100644 --- a/modules/roles/templates/static-mirroring/vhost/planet.debian.org.erb +++ b/modules/roles/templates/static-mirroring/vhost/planet.debian.org.erb @@ -1,6 +1,6 @@ <% if scope.function_has_static_component(['planet.debian.org']) -%> - > + > ServerName planet.debian.org ServerAlias planet.debian.net planeta.debian.net planet-backend.debian.org planet-fastly.debian.org planet-maxcdn.debian.org <% if scope.function_onion_global_service_hostname(['planet.debian.org']) -%> diff --git a/modules/roles/templates/static-mirroring/vhost/static-vhosts-simple.erb b/modules/roles/templates/static-mirroring/vhost/static-vhosts-simple.erb index b035fed58..b9df97509 100644 --- a/modules/roles/templates/static-mirroring/vhost/static-vhosts-simple.erb +++ b/modules/roles/templates/static-mirroring/vhost/static-vhosts-simple.erb @@ -14,7 +14,7 @@ Redirect /debian-security/ http://cdn-fastly.deb.debian.org/debian-security/ - > + > ServerName deb.debian.org ErrorLog /var/log/apache2/deb.debian.org-error.log @@ -36,7 +36,7 @@ Require all granted - Header set Surrogate-Key <%= hostname %> + Header set Surrogate-Key <%= @hostname %> AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css @@ -240,7 +240,7 @@ lines.join("\n") # www.backports.org is the historical place for the backports # website and archive. It is now a CNAME to backports.debian.org: # redirect http requests. - > + > ServerName www.backports.org ServerAlias lists.backports.org ServerAdmin debian-admin@debian.org @@ -248,27 +248,27 @@ lines.join("\n") ###################### - > + > ServerName www.debian-ports.org ServerAlias debian-ports.org ServerAdmin debian-admin@debian.org RedirectPermanent / https://www.ports.debian.org/ - > + > ServerName ports.debian.org ServerAlias ports.debian.net ServerAdmin debian-admin@debian.org RedirectPermanent / https://www.ports.debian.org/ - > + > ServerName incoming.debian-ports.org ServerAdmin debian-admin@debian.org RedirectPermanent / http://incoming.ports.debian.org/ - > + > ServerName ftp.debian-ports.org ServerAdmin debian-admin@debian.org RedirectPermanent /archive http://www.ports.debian.org @@ -277,7 +277,7 @@ lines.join("\n") RedirectPermanent / http://ftp.ports.debian.org/ - > + > ServerName video.debian.net ServerAdmin debian-admin@debian.org Redirect / http://meetings-archive.debian.net/pub/debian-meetings/ @@ -286,7 +286,7 @@ lines.join("\n") # historical sites ################## # now only redirects remain - > + > ServerName women.debian.org ServerAdmin debian-admin@debian.org @@ -303,26 +303,26 @@ lines.join("\n") RedirectPermanent /profiles/ http://www.debian.org/women/profiles/ - > + > ServerName volatile.debian.org ServerAlias volatile-master.debian.org ServerAdmin debian-admin@debian.org RedirectPermanent / http://www.debian.org/volatile/ - > + > ServerName ftp-master.metadata.debian.org ServerAdmin debian-admin@debian.org RedirectPermanent / http://metadata.ftp-master.debian.org/ - > + > ServerName backports-master.debian.org ServerAdmin debian-admin@debian.org RedirectPermanent / https://backports.debian.org/ - > + > ServerName manpages.debian.net ServerAdmin debian-admin@debian.org Redirect / https://manpages.debian.org/ diff --git a/modules/roles/templates/syncproxy/rsyncd.conf.erb b/modules/roles/templates/syncproxy/rsyncd.conf.erb index 101716494..a04eeae7a 100644 --- a/modules/roles/templates/syncproxy/rsyncd.conf.erb +++ b/modules/roles/templates/syncproxy/rsyncd.conf.erb @@ -14,7 +14,7 @@ strict modes = false [debian] path = /srv/mirrors/debian/ -<%- unless has_variable?("has_srv_mirrors_debian") && has_srv_mirrors_debian -%> +<%- unless has_variable?("has_srv_mirrors_debian") && @has_srv_mirrors_debian -%> list = no <%- end -%> comment = Debian archive (contact mirrors@debian.org for access; see https://www.debian.org/mirror/size for size) @@ -23,7 +23,7 @@ strict modes = false [debian-debug] path = /srv/mirrors/debian-debug/ -<%- unless has_variable?("has_srv_mirrors_debian_debug") && has_srv_mirrors_debian_debug -%> +<%- unless has_variable?("has_srv_mirrors_debian_debug") && @has_srv_mirrors_debian_debug -%> list = no <%- end -%> comment = Debug packages for Debian archive (contact mirrors@debian.org for access) @@ -32,7 +32,7 @@ strict modes = false [debian-ports] path = /srv/mirrors/debian-ports/ -<%- unless has_variable?("has_srv_mirrors_debian_debug") && has_srv_mirrors_debian_debug -%> +<%- unless has_variable?("has_srv_mirrors_debian_debug") && @has_srv_mirrors_debian_debug -%> list = no <%- end -%> comment = Debian ports archive (contact mirrors@debian.org for access) @@ -41,7 +41,7 @@ strict modes = false [debian-security] path = /srv/mirrors/debian-security/ -<%- unless has_variable?("has_srv_mirrors_debian_security") && has_srv_mirrors_debian_security -%> +<%- unless has_variable?("has_srv_mirrors_debian_security") && @has_srv_mirrors_debian_security -%> list = no <%- end -%> comment = Debian security archive (contact mirrors@debian.org for access) diff --git a/modules/roles/templates/syncproxy/syncproxy.debian.org-apache.erb b/modules/roles/templates/syncproxy/syncproxy.debian.org-apache.erb index 690ab30cd..e81cbe308 100644 --- a/modules/roles/templates/syncproxy/syncproxy.debian.org-apache.erb +++ b/modules/roles/templates/syncproxy/syncproxy.debian.org-apache.erb @@ -4,25 +4,25 @@ ## <% - vhost_listen = [ (bind != '') ? "#{bind}" : "*", (bind6 != '') ? "#{bind6}" : "*"].uniq - vhost_listen_443 = [ (bind != '') ? "#{bind}:443" : "*:443", (bind6 != '') ? "[#{bind6}]:443" : "*:443"].uniq + vhost_listen = [ (@bind != '') ? "#{@bind}" : "*", (@bind6 != '') ? "#{@bind6}" : "*"].uniq + vhost_listen_443 = [ (@bind != '') ? "#{@bind}:443" : "*:443", (@bind6 != '') ? "[#{@bind6}]:443" : "*:443"].uniq %> <%= lines = [] vhost_listen.each do |bind| - lines << "Use common-debian-service-https-redirect \"#{bind}\" \"#{syncproxy_name}\"" + lines << "Use common-debian-service-https-redirect \"#{bind}\" \"#{@syncproxy_name}\"" end lines.join("\n") %> > - ServerName <%= syncproxy_name %> + ServerName <%= @syncproxy_name %> DocumentRoot /srv/www/syncproxy.debian.org/htdocs - Use common-debian-service-ssl <%= syncproxy_name %> + Use common-debian-service-ssl <%= @syncproxy_name %> Use common-ssl-HSTS - Use http-pkp-<%= syncproxy_name %> + Use http-pkp-<%= @syncproxy_name %> Require all granted @@ -35,7 +35,7 @@ lines.join("\n") lines = [] %w{debian debian-debug debian-ports debian-security}.each do |archive| varname = 'has_srv_mirrors_' + archive.gsub(/[\/-]/,'_') - if has_variable?(varname) and (eval(varname)) + if has_variable?(varname) and (eval("@"+varname)) lines << " Alias /#{archive}/project/trace/ /srv/mirrors/#{archive}/project/trace/" lines << " " lines << " Require all granted" diff --git a/modules/roles/templates/syncproxy/syncproxy.debian.org-index.html.erb b/modules/roles/templates/syncproxy/syncproxy.debian.org-index.html.erb index 876577f2a..ef9fdfcd5 100644 --- a/modules/roles/templates/syncproxy/syncproxy.debian.org-index.html.erb +++ b/modules/roles/templates/syncproxy/syncproxy.debian.org-index.html.erb @@ -1,13 +1,13 @@ - Welcome to <%= syncproxy_name %>! + Welcome to <%= @syncproxy_name %>! -

Welcome to <%= syncproxy_name %>!

+

Welcome to <%= @syncproxy_name %>!

-This is <%= syncproxy_name %>, a syncproxy run by and for the , a syncproxy run by and for the Debian Project to aid in mirroring our software. Consult the mirrors section of the Debian website for more information. @@ -20,7 +20,7 @@ This syncproxy contains copies of the following archives. lines = [] %w{debian debian-debug debian-ports debian-security}.each do |archive| varname = 'has_srv_mirrors_' + archive.gsub(/[\/-]/,'_') - if has_variable?(varname) and (eval(varname)) + if has_variable?(varname) and (eval("@"+varname)) lines << "
  • #{archive} [trace directory]
  • " end end diff --git a/modules/rsync/templates/rsyncd-stunnel.conf.erb b/modules/rsync/templates/rsyncd-stunnel.conf.erb index f57d67aff..ffb7ba862 100644 --- a/modules/rsync/templates/rsyncd-stunnel.conf.erb +++ b/modules/rsync/templates/rsyncd-stunnel.conf.erb @@ -1,5 +1,5 @@ -cert = /etc/ssl/debian/certs/<%= sslname %>.crt-chained -key = /etc/ssl/private/<%= sslname %>.key +cert = /etc/ssl/debian/certs/<%= @sslname %>.crt-chained +key = /etc/ssl/private/<%= @sslname %>.key debug = notice @@ -8,4 +8,4 @@ socket = a:SO_LINGER=1:60 socket = a:SO_KEEPALIVE=1 exec = /usr/bin/rsync -execargs = rsync --daemon --config=/etc/rsyncd-<%= name %>.conf +execargs = rsync --daemon --config=/etc/rsyncd-<%= @name %>.conf