Publish structured data listing our ML archives

In order to collect historical statistics on usage of our mailing
lists, we need an index of not only the current lists (which we
could get from Mailman) but also retired lists (which could only be
found by knowing the URL to their archives). Ultimately we should
publish hyperlinks to these so they'll continue to be indexed by
search engines, but for now start with structured YAML, which we
could later use to build that too.

Because the only way to determine the names of retired lists is from
the listserv's filesystem, we'll run a simple script once daily to
refresh the index and keep it in the Web root alongside the
robots.txt file. In the future, this could be triggered instead by
addition of new mailing lists, though while we're still managing
them with Puppet it's not clear how to go about doing that.

Of course restrict this to only indexing public list archives, as
privately-archived lists won't be accessible to the general public
by design.

Change-Id: Ibe3175a56831b7a43698d6fe454d70e93fcd0bc7
This commit is contained in:
Jeremy Stanley 2020-09-11 00:39:10 +00:00
parent 8c599a5bd0
commit c147dc4b5b
2 changed files with 29 additions and 0 deletions

View File

@ -0,0 +1,9 @@
#!/bin/sh
for site in `cut -d: -f1 /etc/mailman/sites | sort`; do
echo "$site:"
dir=`grep ^${site}: /etc/mailman/sites | cut -d' ' -f2`
for ml in `ls ${dir}/archives/public/ | sort`; do
echo " - $ml"
done
done

View File

@ -17,6 +17,26 @@ class openstack_project::lists(
mode => '0444',
}
file { '/usr/local/sbin/mk-archives-index':
ensure => present,
source => 'puppet:///modules/openstack_project/mailman/mk-archives-index',
owner => 'root',
group => 'root',
replace => true,
mode => '0744',
}
cron { 'mk-archives-index':
user => root,
hour => '0',
minute => '0',
command => 'mk-archives-index > /var/www/archives.yaml',
environment => 'PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin',
require => File['/usr/local/sbin/mk-archives-index',
],
}
# Disable inactive admins
user::virtual::disable { 'oubiwann': }
user::virtual::disable { 'rockstar': }