3 # @param listen_addr IP addresses to have apache listen on
4 # @param onion_service provide the onion service from this host
5 class roles::static_mirror_web(
6 Array[Stdlib::IP::Address] $listen_addr = [],
7 Boolean $onion_service = false,
9 $_enclosed_addresses = empty($listen_addr) ? {
11 default => enclose_ipv6($listen_addr),
13 $vhost_listen = $_enclosed_addresses.map |$a| { "${a}:80" } .join(' ')
14 $vhost_listen_443 = $_enclosed_addresses.map |$a| { "${a}:443" } .join(' ')
16 include roles::static_mirror
17 include roles::weblog_provider
19 include apache2::expires
20 include apache2::rewrite
22 package { 'libapache2-mod-geoip': ensure => installed, }
23 package { 'geoip-database': ensure => installed, }
26 apache2::module { 'include': }
27 apache2::module { 'geoip': require => [Package['libapache2-mod-geoip'], Package['geoip-database']]; }
28 apache2::module { 'deflate': }
29 apache2::module { 'filter': }
31 $redirect_vhosts = true
33 apache2::config { 'local-static-vhost.conf':
36 apache2::config { 'local-static-vhost':
37 content => template('roles/static-mirroring/static-vhost.conf.erb'),
40 apache2::site { '010-planet.debian.org':
41 ensure => has_static_component('planet.debian.org') ? { true => 'present', false => 'absent' },
42 site => 'planet.debian.org',
43 content => template('roles/static-mirroring/vhost/planet.debian.org.erb'),
46 apache2::site { '010-lintian.debian.org':
48 site => 'lintian.debian.org',
51 apache2::site { '010-static-vhosts-00-manpages':
52 ensure => has_static_component('manpages.debian.org') ? { true => 'present', false => 'absent' },
53 site => 'static-manpages.debian.org',
54 content => template('roles/static-mirroring/vhost/manpages.debian.org.erb'),
56 apache2::site { '010-static-vhosts-simple':
57 site => 'static-vhosts-simple',
58 content => template('roles/static-mirroring/vhost/static-vhosts-simple.erb'),
61 $wwwdo_server_name = 'www.debian.org'
62 $wwwdo_document_root = '/srv/static.debian.org/mirrors/www.debian.org/cur'
63 apache2::site { '005-www.debian.org':
64 ensure => has_static_component('www.debian.org') ? { true => 'present', false => 'absent' },
65 site => 'www.debian.org',
66 content => template('roles/apache-www.debian.org.erb'),
69 ssl::service { 'www.debian.org' : ensure => 'ifstatic', notify => Exec['service apache2 reload'], key => true, }
70 ssl::service { 'debian.org' :
71 ensure => has_static_component('www.debian.org') ? { true => 'present', false => 'absent' },
72 notify => Exec['service apache2 reload'],
77 ssl::service { 'appstream.debian.org' : ensure => 'ifstatic', notify => Exec['service apache2 reload'], key => true, }
78 ssl::service { 'backports.debian.org' : ensure => 'ifstatic', notify => Exec['service apache2 reload'], key => true, }
79 ssl::service { 'bits.debian.org' : ensure => 'ifstatic', notify => Exec['service apache2 reload'], key => true, }
80 ssl::service { 'blends.debian.org' : ensure => 'ifstatic', notify => Exec['service apache2 reload'], key => true, }
81 ssl::service { 'cdbuilder-logs.debian.org' : ensure => 'ifstatic', notify => Exec['service apache2 reload'], key => true }
82 ssl::service { 'd-i.debian.org' : ensure => 'ifstatic', notify => Exec['service apache2 reload'], key => true }
83 ssl::service { 'deb.debian.org' : ensure => 'ifstatic', notify => Exec['service apache2 reload'], key => true }
84 ssl::service { 'dpl.debian.org' : ensure => 'ifstatic', notify => Exec['service apache2 reload'], key => true }
85 ssl::service { 'dsa.debian.org' : ensure => 'ifstatic', notify => Exec['service apache2 reload'], key => true }
86 ssl::service { 'incoming.debian.org' : ensure => 'ifstatic', notify => Exec['service apache2 reload'], key => true, }
87 ssl::service { 'incoming.ports.debian.org' : ensure => 'ifstatic', notify => Exec['service apache2 reload'], key => true, }
88 ssl::service { 'lintian.debian.org' : ensure => 'ifstatic', notify => Exec['service apache2 reload'], key => true, }
89 ssl::service { 'lists.alioth.debian.org' : ensure => 'present', notify => Exec['service apache2 reload'], key => true, }
90 ssl::service { 'manpages.debian.org' : ensure => 'ifstatic', notify => Exec['service apache2 reload'], key => true, }
91 ssl::service { 'metadata-backend.ftp-master.debian.org':
92 ensure => has_static_component('metadata.ftp-master.debian.org') ? { true => 'present', false => 'absent' },
93 notify => Exec['service apache2 reload'],
96 ssl::service { 'mirror-master.debian.org' : ensure => 'ifstatic', notify => Exec['service apache2 reload'], key => true, }
97 ssl::service { 'onion.debian.org' : ensure => 'ifstatic', notify => Exec['service apache2 reload'], key => true, }
98 ssl::service { 'openpgpkey.debian.org' : ensure => 'ifstatic', notify => Exec['service apache2 reload'], key => true, }
99 ssl::service { 'pkg-ruby-extras.alioth.debian.org' : ensure => 'present', notify => Exec['service apache2 reload'], key => true, }
100 ssl::service { 'planet-backend.debian.org' :
101 ensure => has_static_component('planet.debian.org') ? { true => 'present', false => 'absent' },
102 notify => Exec['service apache2 reload'],
105 ssl::service { 'release.debian.org' : ensure => 'ifstatic', notify => Exec['service apache2 reload'], key => true, }
106 ssl::service { 'rtc.debian.org' : ensure => 'ifstatic', notify => Exec['service apache2 reload'], key => true }
107 ssl::service { 'security-team.debian.org' : ensure => 'ifstatic', notify => Exec['service apache2 reload'], key => true, }
108 ssl::service { 'www.ports.debian.org' : ensure => 'ifstatic', notify => Exec['service apache2 reload'], key => true, }
110 ssl::service { 'bootstrap.debian.net' : ensure => 'ifstatic', notify => Exec['service apache2 reload'], key => true, }
111 ssl::service { 'debaday.debian.net' : ensure => 'ifstatic', notify => Exec['service apache2 reload'], key => true, }
112 ssl::service { 'debdeltas.debian.net' : ensure => 'ifstatic', notify => Exec['service apache2 reload'], key => true, }
113 ssl::service { 'micronews.debian.org' : ensure => 'ifstatic', notify => Exec['service apache2 reload'], key => true, }
114 ssl::service { 'mozilla.debian.net' : ensure => 'ifstatic', notify => Exec['service apache2 reload'], key => true, }
115 ssl::service { 'news.debian.net' : ensure => 'ifstatic', notify => Exec['service apache2 reload'], key => true, }
116 ssl::service { 'sources.debian.net' : ensure => 'present', notify => Exec['service apache2 reload'], key => true, }
117 ssl::service { 'timeline.debian.net' : ensure => 'ifstatic', notify => Exec['service apache2 reload'], key => true, }
118 ssl::service { 'video.debian.net' : ensure => 'present', notify => Exec['service apache2 reload'], key => true, }
119 ssl::service { 'wnpp-by-tags.debian.net' : ensure => 'ifstatic', notify => Exec['service apache2 reload'], key => true, }
121 ssl::service { 'debconf.org' : ensure => 'present', notify => Exec['service apache2 reload'], key => true, }
122 ssl::service { '10years.debconf.org' : ensure => 'ifstatic', notify => Exec['service apache2 reload'], key => true, }
123 ssl::service { 'debconf0.debconf.org' : ensure => 'ifstatic', notify => Exec['service apache2 reload'], key => true, }
124 ssl::service { 'debconf1.debconf.org' : ensure => 'ifstatic', notify => Exec['service apache2 reload'], key => true, }
125 ssl::service { 'debconf16.debconf.org' : ensure => 'ifstatic', notify => Exec['service apache2 reload'], key => true, }
126 ssl::service { 'debconf17.debconf.org' : ensure => 'ifstatic', notify => Exec['service apache2 reload'], key => true, }
127 ssl::service { 'debconf18.debconf.org' : ensure => 'ifstatic', notify => Exec['service apache2 reload'], key => true, }
128 ssl::service { 'debconf19.debconf.org' : ensure => 'ifstatic', notify => Exec['service apache2 reload'], key => true, }
129 ssl::service { 'debconf2.debconf.org' : ensure => 'ifstatic', notify => Exec['service apache2 reload'], key => true, }
130 ssl::service { 'debconf3.debconf.org' : ensure => 'ifstatic', notify => Exec['service apache2 reload'], key => true, }
131 ssl::service { 'debconf4.debconf.org' : ensure => 'ifstatic', notify => Exec['service apache2 reload'], key => true, }
132 ssl::service { 'debconf5.debconf.org' : ensure => 'ifstatic', notify => Exec['service apache2 reload'], key => true, }
133 ssl::service { 'debconf6.debconf.org' : ensure => 'ifstatic', notify => Exec['service apache2 reload'], key => true, }
134 ssl::service { 'debconf7.debconf.org' : ensure => 'ifstatic', notify => Exec['service apache2 reload'], key => true, }
135 ssl::service { 'es.debconf.org' : ensure => 'ifstatic', notify => Exec['service apache2 reload'], key => true, }
136 ssl::service { 'fr.debconf.org' : ensure => 'ifstatic', notify => Exec['service apache2 reload'], key => true, }
137 ssl::service { 'miniconf10.debconf.org' : ensure => 'ifstatic', notify => Exec['service apache2 reload'], key => true, }
138 ssl::service { 'video.debconf.org' : ensure => 'present', notify => Exec['service apache2 reload'], key => true, }
139 ssl::service { 'wiki.debconf.org' : ensure => 'ifstatic', notify => Exec['service apache2 reload'], key => true, }
140 include apache2::proxy_http
141 ssl::service { 'www.debconf.org' : ensure => 'ifstatic', notify => Exec['service apache2 reload'], key => true, }
145 $onion_addr = empty($listen_addr) ? {
146 true => $base::public_address,
147 default => filter_ipv4($listen_addr)[0]
150 fail("Do not have a useable address for the onionservice on ${::hostname}. Is \$listen_addr empty or does it not have an IPv4 address?.")
153 onion::service { 'd-i.debian.org' : ensure => 'ifstatic', port => 80, target_port => 80, target_address => $onion_addr }
154 onion::service { 'dpl.debian.org' : ensure => 'ifstatic', port => 80, target_port => 80, target_address => $onion_addr }
155 onion::service { 'dsa.debian.org' : ensure => 'ifstatic', port => 80, target_port => 80, target_address => $onion_addr }
156 onion::service { 'rtc.debian.org' : ensure => 'ifstatic', port => 80, target_port => 80, target_address => $onion_addr }
157 onion::service { 'www.debian.org' : ensure => 'ifstatic', port => 80, target_port => 80, target_address => $onion_addr }
160 onion::service { 'appstream.debian.org' : ensure => 'ifstatic', port => 80, target_port => 80, target_address => $onion_addr }
161 onion::service { 'backports.debian.org' : ensure => 'ifstatic', port => 80, target_port => 80, target_address => $onion_addr }
162 onion::service { 'bits.debian.org' : ensure => 'ifstatic', port => 80, target_port => 80, target_address => $onion_addr }
163 onion::service { 'blends.debian.org' : ensure => 'ifstatic', port => 80, target_port => 80, target_address => $onion_addr }
164 onion::service { 'cdbuilder-logs.debian.org' : ensure => 'ifstatic', port => 80, target_port => 80, target_address => $onion_addr }
165 onion::service { 'incoming.debian.org' : ensure => 'ifstatic', port => 80, target_port => 80, target_address => $onion_addr }
166 onion::service { 'incoming.ports.debian.org' : ensure => 'ifstatic', port => 80, target_port => 80, target_address => $onion_addr }
167 onion::service { 'lintian.debian.org' : ensure => 'ifstatic', port => 80, target_port => 80, target_address => $onion_addr }
168 onion::service { 'manpages.debian.org' : ensure => 'ifstatic', port => 80, target_port => 80, target_address => $onion_addr }
169 onion::service { 'mirror-master.debian.org' : ensure => 'ifstatic', port => 80, target_port => 80, target_address => $onion_addr }
170 onion::service { 'onion.debian.org' : ensure => 'ifstatic', port => 80, target_port => 80, target_address => $onion_addr }
171 onion::service { 'openpgpkey.debian.org' : ensure => 'ifstatic', port => 80, target_port => 80, target_address => $onion_addr }
172 onion::service { 'release.debian.org' : ensure => 'ifstatic', port => 80, target_port => 80, target_address => $onion_addr }
173 onion::service { 'security-team.debian.org' : ensure => 'ifstatic', port => 80, target_port => 80, target_address => $onion_addr }
174 onion::service { 'www.ports.debian.org' : ensure => 'ifstatic', port => 80, target_port => 80, target_address => $onion_addr }
176 onion::service { 'bootstrap.debian.net' : ensure => 'ifstatic', port => 80, target_port => 80, target_address => $onion_addr }
177 onion::service { 'debaday.debian.net' : ensure => 'ifstatic', port => 80, target_port => 80, target_address => $onion_addr }
178 onion::service { 'debdeltas.debian.net' : ensure => 'ifstatic', port => 80, target_port => 80, target_address => $onion_addr }
179 onion::service { 'micronews.debian.org' : ensure => 'ifstatic', port => 80, target_port => 80, target_address => $onion_addr }
180 onion::service { 'mozilla.debian.net' : ensure => 'ifstatic', port => 80, target_port => 80, target_address => $onion_addr }
181 onion::service { 'news.debian.net' : ensure => 'ifstatic', port => 80, target_port => 80, target_address => $onion_addr }
182 onion::service { 'timeline.debian.net' : ensure => 'ifstatic', port => 80, target_port => 80, target_address => $onion_addr }
183 onion::service { 'wnpp-by-tags.debian.net' : ensure => 'ifstatic', port => 80, target_port => 80, target_address => $onion_addr }
185 onion::service { '10years.debconf.org' : ensure => 'ifstatic', port => 80, target_port => 80, target_address => $onion_addr }
186 onion::service { 'debconf0.debconf.org' : ensure => 'ifstatic', port => 80, target_port => 80, target_address => $onion_addr }
187 onion::service { 'debconf1.debconf.org' : ensure => 'ifstatic', port => 80, target_port => 80, target_address => $onion_addr }
188 onion::service { 'debconf16.debconf.org' : ensure => 'ifstatic', port => 80, target_port => 80, target_address => $onion_addr }
189 onion::service { 'debconf17.debconf.org' : ensure => 'ifstatic', port => 80, target_port => 80, target_address => $onion_addr }
190 onion::service { 'debconf18.debconf.org' : ensure => 'ifstatic', port => 80, target_port => 80, target_address => $onion_addr }
191 onion::service { 'debconf2.debconf.org' : ensure => 'ifstatic', port => 80, target_port => 80, target_address => $onion_addr }
192 onion::service { 'debconf3.debconf.org' : ensure => 'ifstatic', port => 80, target_port => 80, target_address => $onion_addr }
193 onion::service { 'debconf4.debconf.org' : ensure => 'ifstatic', port => 80, target_port => 80, target_address => $onion_addr }
194 onion::service { 'debconf5.debconf.org' : ensure => 'ifstatic', port => 80, target_port => 80, target_address => $onion_addr }
195 onion::service { 'debconf6.debconf.org' : ensure => 'ifstatic', port => 80, target_port => 80, target_address => $onion_addr }
196 onion::service { 'debconf7.debconf.org' : ensure => 'ifstatic', port => 80, target_port => 80, target_address => $onion_addr }
197 onion::service { 'es.debconf.org' : ensure => 'ifstatic', port => 80, target_port => 80, target_address => $onion_addr }
198 onion::service { 'fr.debconf.org' : ensure => 'ifstatic', port => 80, target_port => 80, target_address => $onion_addr }
199 onion::service { 'miniconf10.debconf.org' : ensure => 'ifstatic', port => 80, target_port => 80, target_address => $onion_addr }
202 onion::service { 'metadata.ftp-master.debian.org': ensure => 'ifstatic', port => 80, target_port => 80, target_address => $onion_addr }
203 onion::service { 'planet.debian.org' : ensure => 'ifstatic', port => 80, target_port => 80, target_address => $onion_addr }
206 file { '/srv/static.debian.org/puppet':
210 file { '/srv/static.debian.org/puppet/disabled-service':
214 file { '/srv/static.debian.org/puppet/disabled-service/503.html':
215 source => 'puppet:///modules/roles/static-htdocs/disabled-service/503.html',
218 ssl::service { 'archive.debian.net': ensure => present, notify => Exec['service apache2 reload'], key => true, }
219 file { '/srv/static.debian.org/puppet/archive.debian.net':
222 file { '/srv/static.debian.org/puppet/archive.debian.net/503.html':
226 ssl::service { 'cdimage.debian.org': ensure => present, notify => Exec['service apache2 reload'], key => true, }
227 file { '/srv/static.debian.org/puppet/cdimage.debian.org':
230 file { '/srv/static.debian.org/puppet/cdimage.debian.org/503.html':
231 source => 'puppet:///modules/roles/static-htdocs/cdimage-maintenance.html',