Changing mailing list URLs
Is there a way to change mailing list URLs from
...something.../<verb>/<list>
to
...something.../<list>/<verb>
?
Hopefully also with making `listinfo' be the default verb so that ...something.../<list> is just that page.
(I can obviously do that in the apache configuration, but the generated urls are still what mailman wants and in addition it seems that it messes up the authentication somehow.)
-- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://barzilay.org/ Maze is Life!
Eli Barzilay wrote:
Is there a way to change mailing list URLs from
...something.../<verb>/<list>
to
...something.../<list>/<verb>
?
Hopefully also with making `listinfo' be the default verb so that ...something.../<list> is just that page.
(I can obviously do that in the apache configuration, but the generated urls are still what mailman wants and in addition it seems that it messes up the authentication somehow.)
There are several issues involved. First, there is for example a
ScriptAlias /mailman/ "/usr/local/mailman/cgi-bin/"
in the Apache config. This says that for a URL like http://www.example.com/mailman/xxx/yyy/zzz..., run the CGI /usr/local/mailman/cgi-bin/xxx, and put the remainder of the URL path (yyy/zzz...) in the environment in PATH_INFO.
Thus, Apache will invoke Mailman's xxx wrapper which checks the appropriate calling group and invokes Mailman's scrips/driver with its name (xxx) as the first argument.
The driver in turn imports Mailman/Cgi/xxx.py and calls its main() function which then looks at PATH_INFO in the environment to determine what list (yyy) was and additional information (zzz...) was provided.
If you could figure out a way within Apache to redirect URLs of the form
...something.../<list>/<verb>
to
...something.../<verb>/<list>
without then turning around and redirecting the second back to the first in an endless loop, it would still only partially work because posting of forms would not work because the form data would get lost in the redirect. Perhaps this is what you meant by "in addition it seems that it messes up the authentication somehow"
So I don't think that there is a way to do this without making significant modifications to Mailman and having a CGI wrapper per list instead of the current 11 wrappers corresponding to the 11 possible "verbs".
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
On Jun 3, Mark Sapiro wrote:
Eli Barzilay wrote:
Is there a way to change mailing list URLs from ...something.../<verb>/<list> to ...something.../<list>/<verb> ?
[...]
If you could figure out a way within Apache to redirect URLs of the form
...something.../<list>/<verb>
to
...something.../<verb>/<list>
without then turning around and redirecting the second back to the first in an endless loop,
That's easy:
ScriptAliasMatch "^/([a-z-]+/)([a-z]+)(/?.*)$"
"/usr/lib/mailman/cgi-bin/$2/$1$3"
Or replace that "[a-z]+" with "admin|admindb|confirm|...".
it would still only partially work because posting of forms would not work because the form data would get lost in the redirect. Perhaps this is what you meant by "in addition it seems that it messes up the authentication somehow"
I *think* that the main thing that gets lost in the process is mailman making its own assumptions about the shape of the URLs: that it basically gives me a cookie that is valid for for http://<server>/admindb/<list> so when I refresh the page at the different URL, it asks me again to authenticate since I don't have the cookie. This is, of course, related to the fact that generated pages still have the wrong URLs on them. If there was some single function somewhere that constructs these URLs I think that I could make it work -- but I don't want to risk changes for code that I have no clue about...
So I don't think that there is a way to do this without making significant modifications to Mailman and having a CGI wrapper per list instead of the current 11 wrappers corresponding to the 11 possible "verbs".
(Specifically, it definitely won't require that.)
[
BTW, it just happens (really by accident) that someone pointed me at http://www.w3.org/Provider/Style/URI today -- it's a good summary of what bugs me with the default mailman url scheme: "pipermail" is related to the implementation of the archiver, and the <verb>/<list> thing is something that after 5 years of moderating about 10 lists I still can't remember. It's especially bad with links like:
http://<host>/admin/<list>/members?letter=a
where the verb is on one side of the list name, and the arguments are on the other side. It seems much better to me to think about the interfaces as being part of the list. It would even work better with URL completion...
]
-- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://barzilay.org/ Maze is Life!
Eli Barzilay wrote:
On Jun 3, Mark Sapiro wrote:
Eli Barzilay wrote:
Is there a way to change mailing list URLs from ...something.../<verb>/<list> to ...something.../<list>/<verb> ?
[...]
If you could figure out a way within Apache to redirect URLs of the form
...something.../<list>/<verb>
to
...something.../<verb>/<list>
without then turning around and redirecting the second back to the first in an endless loop,
That's easy:
ScriptAliasMatch "^/([a-z-]+/)([a-z]+)(/?.*)$"
"/usr/lib/mailman/cgi-bin/$2/$1$3"Or replace that "[a-z]+" with "admin|admindb|confirm|...".
Yes, although I think that
ScriptAliasMatch "^/mailman/([a-z-]+/)([a-z]+)(/?.*)$"
"/usr/lib/mailman/cgi-bin/$2/$1$3"
is probably a bit closer.
it would still only partially work because posting of forms would not work because the form data would get lost in the redirect. Perhaps this is what you meant by "in addition it seems that it messes up the authentication somehow"
I *think* that the main thing that gets lost in the process is mailman making its own assumptions about the shape of the URLs: that it basically gives me a cookie that is valid for for http://<server>/admindb/<list> so when I refresh the page at the different URL, it asks me again to authenticate since I don't have the cookie. This is, of course, related to the fact that generated pages still have the wrong URLs on them. If there was some single function somewhere that constructs these URLs I think that I could make it work -- but I don't want to risk changes for code that I have no clue about...
You are touching on the problem. The generated URLs including the POST action URLs are generated as mailman/cgi_name/list_name... which doesn't work because it gets mapped to /usr/lib/mailman/cgi-bin/list_name/cgi_name... by the ScriptAliasMatch.
Changing the GetScriptURL method in Mailman/MailList.py to the following
def GetScriptURL(self, scriptname, absolute=0):
return re.sub('/([^/]*$)', '/' + self.internal_name() + r'/\1',
Utils.ScriptURL(scriptname, self.web_page_url, absolute))
Seems to work for the admin interface, and will work for more but I won't guarantee it will work for everything.
[...]
[
BTW, it just happens (really by accident) that someone pointed me at http://www.w3.org/Provider/Style/URI today -- it's a good summary of what bugs me with the default mailman url scheme: "pipermail" is related to the implementation of the archiver,
"pipermail" in public archive URLs exists only in the web server
Alias /pipermail/ /usr/local/mailman/archives/public/
and the Defaults.py setting
PUBLIC_ARCHIVE_URL = 'http://%(hostname)s/pipermail/%(listname)s'
It's easily changed to anything you like.
and the <verb>/<list> thing is something that after 5 years of moderating about 10 lists I still can't remember. It's especially bad with links like:
http://<host>/admin/<list>/members?letter=a
where the verb is on one side of the list name, and the arguments are on the other side. It seems much better to me to think about the interfaces as being part of the list. It would even work better with URL completion...
]
Join the mailman-developers@python.org list; see the thread at <http://mail.python.org/pipermail/mailman-developers/2010-June/021093.html>, and join the discussion.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
On Jun 3, Mark Sapiro wrote:
Eli Barzilay wrote:
That's easy:
ScriptAliasMatch "^/([a-z-]+/)([a-z]+)(/?.*)$"
"/usr/lib/mailman/cgi-bin/$2/$1$3"Or replace that "[a-z]+" with "admin|admindb|confirm|...".
Yes, although I think that
ScriptAliasMatch "^/mailman/([a-z-]+/)([a-z]+)(/?.*)$"
"/usr/lib/mailman/cgi-bin/$2/$1$3"is probably a bit closer.
(Well, I also don't use a "mailman" in the url -- it's on a lists.* domain name, so there's no need for another element in the url that says that it's a mailing list...)
In any case, this:
Changing the GetScriptURL method in Mailman/MailList.py to the following
def GetScriptURL(self, scriptname, absolute=0): return re.sub('/([^/]*$)', '/' + self.internal_name() + r'/\1', Utils.ScriptURL(scriptname, self.web_page_url, absolute))
Seems to work for the admin interface, and will work for more but I won't guarantee it will work for everything.
was the missing bit -- I've actually looked at this function, but couldn't figure out whether it should change, or maybe it's Utils.ScrintURL that should change. Now it's clear -- that this one adds the list name, and your regexp hacks it into the right place ("right" wrt what I want...). Thanks!
BTW, it just happens (really by accident) that someone pointed me at http://www.w3.org/Provider/Style/URI today -- it's a good summary of what bugs me with the default mailman url scheme: "pipermail" is related to the implementation of the archiver,
"pipermail" in public archive URLs exists only in the web server
Alias /pipermail/ /usr/local/mailman/archives/public/
and the Defaults.py setting
PUBLIC_ARCHIVE_URL = 'http://%(hostname)s/pipermail/%(listname)s'
It's easily changed to anything you like.
Yeah -- and that was the first thing I did... Only then I became greedy. (But regardless, I think that it's a bad convention to use when "pipermail" doesn't really mean anything to the end users -- unless I'm missing some expression (I'm not a native English speaker).)
and the <verb>/<list> thing is something that after 5 years of moderating about 10 lists I still can't remember. It's especially bad with links like:
http://<host>/admin/<list>/members?letter=a
where the verb is on one side of the list name, and the arguments are on the other side. It seems much better to me to think about the interfaces as being part of the list. It would even work better with URL completion...
Join the mailman-developers@python.org list; see the thread at <http://mail.python.org/pipermail/mailman-developers/2010-June/021093.html>, and join the discussion.
(Unfortunately my plate is so full it's not even funny...)
-- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://barzilay.org/ Maze is Life!
participants (2)
-
Eli Barzilay
-
Mark Sapiro