alanshaw / david-www

:eyeglasses: David helps keep your Node.js project dependencies up to date.
https://david-dm.org
MIT License
729 stars 131 forks source link

badges for private repos #176

Open troyastorino opened 9 years ago

troyastorino commented 9 years ago

Love that support was added for private repos on david-dm.com, but I couldn't find a way to have badges for private repos. Is there any way to do this currently?

joestump commented 9 years ago

You need to basically hack the URL near as I can tell. If you go to https://david-dm.org/myorganization/secret-repo, you'll find your private repo's dependency status and badge. There's also a place to snag the badge on that page:

2015-03-13 at 9 04 am

Sadly, it doesn't appear to be working for private repos when you put it into your README. It appears GitHub is proxying images through their CDN and the resulting images are broken:

2015-03-13 at 9 05 am

Looking into it further, it appears there's some session tracking going on on David's side. If you go to my badge's URL in an incognito window you get:

2015-03-13 at 9 06 am

It appears this endpoint returns a 404, which breaks the GitHub CDN proxy stuff. Here's the headers when you curl a private repo's badge URL on David:

HTTP/1.1 404 Not Found
Date: Fri, 13 Mar 2015 09:07:33 GMT
X-Powered-By: Express
Cache-Control: no-cache
Accept-Ranges: bytes
Last-Modified: Fri, 26 Dec 2014 20:03:28 GMT
ETag: W/"57a-1505044835"
Content-Type: image/png
Content-Length: 1402

So in short, you can go to David and see your badge for your private repo, but you cannot use your badge on your private repo.

joestump commented 9 years ago

Appears this bug was filed in #165. I'll cross post my comment over there.