RSS feeds for private projects work now

January 15, 2008

Assuming your reader can do basic auth, follow redirects, and store cookies… they should work. Besides some of the simple aesthetic changes done recently (and you might notice new free accounts have text ads), I spent a big chunk of today trying to get RSS feeds and iCal for private projects working. The problem was that Trac would not properly tell feed readers to send authentication credentials, so trying to add the URL would fail because of permissions.

Turns out a long while back a patch was made to help solve the issue by allowing any URL to be prepended with /login (for example /timeline would become /login/timeline) and this would prompt you to enter authentication credentials, log you in and redirect you to the appropriate URL.

This works, and should work for you with most readers. Unfortunately Google Reader and Calendar don’t seem to work with anything that requires authentication, but I tried with Netvibes and iCal.app and they work just fine. Let me know how it works with other readers.

-Jeff

6 Responses to “RSS feeds for private projects work now”

  1. Matt Says:

    Thought this might be useful if you’re trying to track down why this trick won’t work for Google Reader:

    macbooq:~/Documents/git/chalq matt$ curl -v –location-trusted “http://ittigson%40chalq.com:XXX@chalq.ey.devjavu.net/login/timeline?milestone=on&ticket=on&changeset=on&wiki=on&max=50&daysback=90&format=rss”
    * About to connect() to chalq.ey.devjavu.net port 80 (#0)
    * Trying 65.74.171.27… connected
    * Connected to chalq.ey.devjavu.net (65.74.171.27) port 80 (#0)
    * Server auth using Basic with user ‘ittigson@chalq.com’
    > GET /login/timeline?milestone=on&ticket=on&changeset=on&wiki=on&max=50&daysback=90&format=rss HTTP/1.1
    > Authorization: Basic aXR0aWdzb25AY2hhbHEuY29tOmNoYWxxc3ZucGFzcw==
    > User-Agent: curl/7.16.1 (i386-apple-darwin8.8.2) libcurl/7.16.1 OpenSSL/0.9.8e zlib/1.2.3
    > Host: chalq.ey.devjavu.net
    > Accept: */*
    >
    < HTTP/1.1 302 Found
    < Date: Thu, 24 Jan 2008 05:09:34 GMT
    < Server: Apache
    < X-Ninja: ey00-s00046
    < Location: http://chalq.ey.devjavu.net/timeline?wiki=on&changeset=on&format=rss&max=50&daysback=90&milestone=on&ticket=on
    < Pragma: no-cache
    < Cache-control: no-cache
    < Expires: Fri, 01 Jan 1999 00:00:00 GMT
    < Set-Cookie: trac_auth=90bad4896b03090f5a6e1737f6f6eea5; expires=Sat, 23-Feb-2008 05:09:34 GMT; Path=/
    < Set-Cookie: trac_form_token=1de106a82e6dc7b078fe2968; Path=/
    < Vary: Accept-Encoding
    < Transfer-Encoding: chunked
    GET /timeline?wiki=on&changeset=on&format=rss&max=50&daysback=90&milestone=on&ticket=on HTTP/1.1
    > Authorization: Basic aXR0aWdzb25AY2hhbHEuY29tOmNoYWxxc3ZucGFzcw==
    > User-Agent: curl/7.16.1 (i386-apple-darwin8.8.2) libcurl/7.16.1 OpenSSL/0.9.8e zlib/1.2.3
    > Host: chalq.ey.devjavu.net
    > Accept: */*
    >
    < HTTP/1.1 200 Ok
    < Date: Thu, 24 Jan 2008 05:09:35 GMT
    < Server: Apache
    < X-Ninja: ey00-s00046
    < Cache-control: must-revalidate
    < Expires: Fri, 01 Jan 1999 00:00:00 GMT
    < Content-Length: 28891
    < Set-Cookie: trac_form_token=978233c200afc1891be566e6; Path=/
    < Content-Type: application/rss+xml;charset=utf-8

  2. Matt Says:

    Would http://trac-hacks.org/wiki/AccountManagerPlugin do the same job, but better? Perhaps you wouldn’t need a redirect if you could just use HTTP AUTH to login to the pages directly.

  3. Jeff Lindsay Says:

    We use the AccountManager plugin, but that’s actually what you use to have a web form instead of HTTP auth. While you can use HTTP auth now with any page, it doesn’t send the headers to tell the client/browser to collect HTTP auth credentials.

    So for example, if you use CURL, you can tell it to use basic HTTP auth on any page in Trac and use a valid account and it will work. But otherwise, most clients won’t send credentials unless they were requested, hence the explicit /login URL.

  4. Matt Says:

    Hrm … sorry for the confusion.

    What about XML-RPC. Could you use that to essentially make your own atom feed (perhaps using Yahoo Pipes)?

  5. Jeff Lindsay Says:

    I don’t think XML-RPC exposes the timeline events, though it probably should…

  6. Hannes Says:

    Cool!.. Nice work…


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: