public inbox for overseers@sourceware.org
 help / color / mirror / Atom feed
From: Eric Wong <e@80x24.org>
To: Mark Wielaard <mark@klomp.org>
Cc: meta@public-inbox.org, overseers@sourceware.org
Subject: Re: Using plus (+) in list name
Date: Sun, 21 Aug 2022 20:53:38 +0000	[thread overview]
Message-ID: <20220821205338.M316466@dcvr> (raw)
In-Reply-To: <YwKPUv5IbIOYt2SO@wildebeest.org>

Mark Wielaard <mark@klomp.org> wrote:
> Hi,
> 
> We are setting up a public-inbox instance for cygwin/gcc/sourceware
> lists at https://inbox.sourceware.org/ and it seems to work pretty
> nicely. Thanks. Except for lists which have a + in their name like
> libstdc++.
> 
> I assume this needs some escaping somewhere, but I cannot figure out
> where. The .public-inbox/config snippet looks like:

I seem to remember '+' is OK as-is in the path component of HTTP URLs,
but is escaping for ' ' (SP) in query strings.

At least it's OK for a git-config section name:

> [publicinbox "libstdc++"]
>         address = libstdc++@gcc.gnu.org
>         url = https://inbox.sourceware.org/libstdc++
>         inboxdir = /home/inbox/lists/libstdc++
>         indexlevel = full
>         newsgroup = inbox.gcc.libstdc++
>         listid = libstdc++.gcc.gnu.org
> 
> This seems to work fine for nntp and imap, but not https.

Interesting that NNTP and IMAP work (I wasn't expecting it :x).

I can't remember off the top of my head, but is '+' allowed by
the relevant NNTP and List-Id RFCs?

Anyways, good to see public-inbox getting more adoption :>

> It does work when replacing the ++ with pp in the list name and
> url. But that looks somewhat odd imho. And the name with ++ can be
> used with e.g. mailman:
> https://gcc.gnu.org/mailman/listinfo/libstdc++
> 
> Is there some way to configure public-inbox-http to be able to use ++
> in list names and urls?
> 
> We are using the EPEL public-inbox package public-inbox-1.7.0-2.el8.noarch

Totally untested, but perhaps changing $INBOX_RE in
PublicInbox/WWW.pm will work:

diff --git a/lib/PublicInbox/WWW.pm b/lib/PublicInbox/WWW.pm
index b9b68382..77f463d3 100644
--- a/lib/PublicInbox/WWW.pm
+++ b/lib/PublicInbox/WWW.pm
@@ -23,7 +23,7 @@ use PublicInbox::WwwStatic qw(r path_info_raw);
 use PublicInbox::Eml;
 
 # TODO: consider a routing tree now that we have more endpoints:
-our $INBOX_RE = qr!\A/([\w\-][\w\.\-]*)!;
+our $INBOX_RE = qr!\A/([\w\-][\w\.\-\+]*)!;
 our $MID_RE = qr!([^/]+)!;
 our $END_RE = qr!(T/|t/|t\.mbox(?:\.gz)?|t\.atom|raw|)!;
 our $ATTACH_RE = qr!([0-9][0-9\.]*)-($PublicInbox::Hval::FN)!;

  reply	other threads:[~2022-08-21 20:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-21 20:02 Mark Wielaard
2022-08-21 20:53 ` Eric Wong [this message]
2022-08-21 21:43   ` Mark Wielaard
2022-08-21 22:11     ` Eric Wong
2022-08-21 22:21       ` [PATCH] www: support `+' in inbox names Eric Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220821205338.M316466@dcvr \
    --to=e@80x24.org \
    --cc=mark@klomp.org \
    --cc=meta@public-inbox.org \
    --cc=overseers@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).