Add www-staging vhost
authorPaul Wise <pabs@debian.org>
Wed, 25 Jul 2018 03:26:34 +0000 (11:26 +0800)
committerPaul Wise <pabs@debian.org>
Wed, 25 Jul 2018 03:26:34 +0000 (11:26 +0800)
It was broken when the website moved to the static.d.o CDN

modules/roles/manifests/static_mirror.pp
modules/roles/manifests/www_master.pp
modules/roles/templates/apache-www.debian.org.erb

index 537c79d..c150637 100644 (file)
@@ -78,6 +78,7 @@ class roles::static_mirror {
                content => template('roles/static-mirroring/vhost/static-vhosts-simple.erb'),
        }
 
+       $wwwdo_server_name = 'www.debian.org'
        $wwwdo_document_root = '/srv/static.debian.org/mirrors/www.debian.org/cur'
        apache2::site { '005-www.debian.org':
                site   => 'www.debian.org',
index aabe5f2..bc37aa8 100644 (file)
@@ -3,4 +3,16 @@ class roles::www_master {
                notify  => Exec['service apache2 reload'],
                key => true,
        }
+
+       $wwwdo_server_name = 'www-staging.debian.org'
+       $wwwdo_document_root = '/srv/www.debian.org/www'
+       apache2::site { '005-www-staging.debian.org':
+               site    => 'www-staging.debian.org',
+               content => template('roles/apache-www.debian.org.erb'),
+       }
+
+       ssl::service { 'www-staging.debian.org' :
+               notify => Exec['service apache2 reload'],
+               key    => true,
+       }
 }
index ed50778..afcd63d 100644 (file)
 </Macro>
 
 <Macro common-www.d.o>
-   ServerName www.debian.org
-   ServerAlias www-*.debian.org
+   ServerName <%= @wwwdo_server_name %>
 
    Use common-www.d.o-inner
 </Macro>
    ErrorLog /var/log/apache2/www.debian.org-error.log
    CustomLog /var/log/apache2/www.debian.org-access.log privacy
 
-   ServerName www.debian.org
-   Redirect / https://www.debian.org/
+   ServerName <%= @wwwdo_server_name %>
+   Redirect / https://<%= @wwwdo_server_name %>/
 </VirtualHost>
 <VirtualHost <%= @vhost_listen_443 %> >
    ErrorLog /var/log/apache2/www.debian.org-error.log
 
    Use common-www.d.o
 
-   Use common-debian-service-ssl www.debian.org
+   Use common-debian-service-ssl <%= @wwwdo_server_name %>
    Use common-ssl-HSTS
 </VirtualHost>
-
-<% if scope.function_onion_global_service_hostname(['www.debian.org']) -%>
+<% if scope.function_onion_global_service_hostname([@wwwdo_server_name]) -%>
 <VirtualHost <%= @vhost_listen %> >
    ErrorLog /var/log/apache2/www.debian.org-error.log
    CustomLog /var/log/apache2/www.debian.org-access.log privacy
 
-   ServerName <%= scope.function_onion_global_service_hostname(['www.debian.org']) %>
+   ServerName <%= scope.function_onion_global_service_hostname([@wwwdo_server_name]) %>
 
    Use common-www.d.o-inner
 </VirtualHost>