[Mailman-Developers] Adding keys in the configuration file

Barry Warsaw barry at list.org
Thu Sep 13 21:18:38 CEST 2012


On Sep 13, 2012, at 04:53 PM, Aurelien Bompard wrote:

>MM won't depend on Django, only if the HK section in mailman.cfg is enabled.
>I can't just send the message to the store however, since the IArchiver
>interface also has methods to get the list and message's final archive URL,
>and that's dependent on the frontend. The store does not know how the
>frontend is installed (at the root URL, on /hyperkitty, on /archives, etc.).
>Those methods are run before the message is stored in order for their result
>to be added to the message headers, so I can't even get it from the
>archive_message call.

The configuration options for IArchiver.list_url() and IArchive.permalink()
are fairly rough, mostly because we haven't had many examples we can
generalize from.

If you look at the way mhonarc.py is implemented, it expects that the base_url
specified in the config file would have up to three substitution variables:
listname, hostname, and fqdn_listname.  These get filled in with the
appropriate information from the mailing list.  It doesn't really know
anything about private archives, and can't currently make that distinction.

Further, the mhonarc implementation expects that you should be able to append
the X-Message-ID-Hash to the base_url to get the final url that the message
will be archived at.

The HyperKitty IArchiver implementation doesn't live in the trunk yet, though
I think it would be fine if it did.  But the question is, how would the core
know what the base url for the archive is, and how would it calculate the url
for a specific message in the archive.  Note that ideally, it would not have
to contact the archiver to figure out this latter; that's what the whole idea
between our proposed extension to RFC 5064 is all about:

http://wiki.list.org/display/DEV/Stable+URLs

I can't answer this question for HyperKitty because I haven't looked at it
closely enough, but I can think of a few ways this might be implemented.

If the base url is static, perhaps with some placeholders for list-specific
information, then the same approach used for mhonarc could be used for
hyperkitty.

If the base url for a specific list were available in hyperkitty, and say, the
core could issue an HTTP call (e.g. REST+JSON) to get it, then we could
implement this in much the same way that notification templates are
implemented (i.e. we do the query and cache the results for a little while).
You wouldn't want to do this for every message being archived, because I think
it would be too slow, but if you could make archive_message() and permalink()
agree to their answers, then there's no technical reason why you couldn't
implement it that way.  In that case, [archiver.hyperkitty]base_url might be a
bit of a misnomer, but so be it.

Ultimately, the HyperKitty implementation of IArchiver could do whatever is
necessary to provide accurate answers to that interface's methods.

-Barry


More information about the Mailman-Developers mailing list