1 # a mirror of ports.debian.org
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::ports_mirror(
6 Array[Stdlib::IP::Address] $listen_addr = [],
7 Boolean $onion_service = false,
9 include roles::archvsync_base
12 $_enclosed_addresses = empty($listen_addr) ? {
14 default => enclose_ipv6($listen_addr),
16 $vhost_listen = $_enclosed_addresses.map |$a| { "${a}:80" } .join(' ')
18 $mirror_basedir_prefix = hiera('role_config__mirrors.mirror_basedir_prefix')
19 $archive_root = "${mirror_basedir_prefix}debian-ports"
21 apache2::site { '010-ftp.ports.debian.org':
22 site => 'ftp.ports.debian.org',
23 content => template('roles/apache-ftp.ports.debian.org.erb'),
27 $onion_addr = empty($listen_addr) ? {
28 true => $base::public_address,
29 default => filter_ipv4($listen_addr)[0]
32 fail("Do not have a useable address for the onionservice on ${::hostname}. Is \$listen_addr empty or does it not have an IPv4 address?.")
35 onion::service { 'ftp.ports.debian.org':
38 target_address => $onion_addr,
42 Ferm::Rule::Simple <<| tag == 'ssh::server::from::syncproxy' |>>