From c147dc4b5b8cad935131b44cb78fd1181b036e56 Mon Sep 17 00:00:00 2001 From: Jeremy Stanley Date: Fri, 11 Sep 2020 00:39:10 +0000 Subject: [PATCH] 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 --- .../files/mailman/mk-archives-index | 9 +++++++++ modules/openstack_project/manifests/lists.pp | 20 +++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100755 modules/openstack_project/files/mailman/mk-archives-index diff --git a/modules/openstack_project/files/mailman/mk-archives-index b/modules/openstack_project/files/mailman/mk-archives-index new file mode 100755 index 0000000000..a814ad8a0c --- /dev/null +++ b/modules/openstack_project/files/mailman/mk-archives-index @@ -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 diff --git a/modules/openstack_project/manifests/lists.pp b/modules/openstack_project/manifests/lists.pp index 2bf246600a..7a126741bd 100644 --- a/modules/openstack_project/manifests/lists.pp +++ b/modules/openstack_project/manifests/lists.pp @@ -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': }