X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=modules%2Froles%2Fmanifests%2Fsnapshot_web.pp;h=6a6414f8168f9cc86706500fadc6c6a9179c11f7;hb=0b90b9722d512bc8e6bc0a90995b3ace1b1b68ed;hp=be217144b3285bd69762ea1834630db4e46a2f5c;hpb=4e8859da2c042d6a41d5eebf39c0c65cd17eebcb;p=mirror%2Fdsa-puppet.git diff --git a/modules/roles/manifests/snapshot_web.pp b/modules/roles/manifests/snapshot_web.pp index be217144b..6a6414f81 100644 --- a/modules/roles/manifests/snapshot_web.pp +++ b/modules/roles/manifests/snapshot_web.pp @@ -2,6 +2,13 @@ class roles::snapshot_web { include apache2 include apache2::rewrite + # snapshot abusers + # 61.69.254.110 - 20180705, mirroring with wget + @ferm::rule { 'dsa-nat-snapshot-varnish-v4': + prio => "000", + rule => "saddr (61.69.254.110) DROP", + } + ensure_packages ( [ "libapache2-mod-wsgi", ], { @@ -29,9 +36,8 @@ class roles::snapshot_web { } } - @ferm::rule { 'dsa-snapshot-varnish-v4': - rule => '&SERVICE(tcp, 6081)', - } + # varnish cache + ############### @ferm::rule { 'dsa-nat-snapshot-varnish-v4': table => 'nat', chain => 'PREROUTING', @@ -47,6 +53,7 @@ class roles::snapshot_web { content => template('roles/snapshot/snapshot.debian.org.vcl.erb'), } + # the ipv6 port 80 is owned by varnish file { '/etc/apache2/ports.conf': content => @("EOF"), Listen 0.0.0.0:80 @@ -55,4 +62,17 @@ class roles::snapshot_web { require => Package['apache2'], notify => Service['apache2'], } + + # haproxy ssl termination + ######################### + include haproxy + file { '/etc/haproxy/haproxy.cfg': + content => template('roles/snapshot/haproxy.cfg.erb'), + require => Package['haproxy'], + notify => Service['haproxy'], + } + ssl::service { 'snapshot.debian.org': + notify => Service['haproxy'], + key => true, + } }