{"thread":{"id":"24932","subject":"html page display via cgit","startedAt":"2010-09-01T09:32:23Z","lastAt":"2010-09-02T07:09:14Z","messageCount":9,"participants":["Shivdas Gujare","Ævar Arnfjörð Bjarmason","Joshua Juran","Stefan Naewe","Lars Hjemli"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"149541","messageId":"AANLkTinJx0ZKjCtpq9k6nwigodnu42EvqchpgQtwGp5S@mail.gmail.com","threadId":"24932","inReplyTo":null,"subject":"html page display via cgit","fromName":"Shivdas Gujare","fromEmail":"shivdas.tech@gmail.com","sentAt":"2010-09-01T09:32:23Z","receivedAt":"2010-09-01T09:32:23Z","isPatch":false,"sender":{"key":"shivdas.tech@gmail.com","avatar":null},"body":"Hi All,\n\nI hope, this is the right mailing list for cgit as well.\nI am trying to add some \"html logs\" inside cgit, but I can't open\nthese logs via cgit inside firefox, i.e. cgit open every files in\n\"plain\" format,\nwould like to know if it is possible to open \"html\" pages inside cgit\nso that if I click on html page added into git, it opens in html and\nnot in plain format.\n\nfor example:\nif I click on \"download.html\" from\n\"http://cgit.freedesktop.org/~lb/mesa/tree/docs\" it shows a raw file\nas \"http://cgit.freedesktop.org/~lb/mesa/tree/docs/download.html\"\nand if I click on \"plain\" it opens in firefox like\n\"http://cgit.freedesktop.org/~lb/mesa/plain/docs/download.html\"\nbut here I am trying to open this \"download.html\" inside cgit so that\nI can view it like html web page and not as \"plain\" text file.\n\nThanks for any help or pointers.\n\nThanks and Regards,\nShivdas Gujare\n"},{"id":"149543","messageId":"AANLkTik-02dJZF_0m=xccg4N5Mdaj=b2JzZaMKp=vuww@mail.gmail.com","threadId":"24932","inReplyTo":"AANLkTinJx0ZKjCtpq9k6nwigodnu42EvqchpgQtwGp5S@mail.gmail.com","subject":"Re: html page display via cgit","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-09-01T09:46:31Z","receivedAt":"2010-09-01T09:46:31Z","isPatch":false,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Wed, Sep 1, 2010 at 09:32, Shivdas Gujare <shivdas.tech@gmail.com> wrote:\n\n> I hope, this is the right mailing list for cgit as well.\n> I am trying to add some \"html logs\" inside cgit, but I can't open\n> these logs via cgit inside firefox, i.e. cgit open every files in\n> \"plain\" format,\n> would like to know if it is possible to open \"html\" pages inside cgit\n> so that if I click on html page added into git, it opens in html and\n> not in plain format.\n>\n> for example:\n> if I click on \"download.html\" from\n> \"http://cgit.freedesktop.org/~lb/mesa/tree/docs\" it shows a raw file\n> as \"http://cgit.freedesktop.org/~lb/mesa/tree/docs/download.html\"\n> and if I click on \"plain\" it opens in firefox like\n> \"http://cgit.freedesktop.org/~lb/mesa/plain/docs/download.html\"\n> but here I am trying to open this \"download.html\" inside cgit so that\n> I can view it like html web page and not as \"plain\" text file.\n>\n> Thanks for any help or pointers.\n\nI don't know, but that's probably deliberate. You're viewing a /plain/\nlink, which should be the equivalent of \"git show\".\n\nThere's also XSS security implications to serving things as text/html\non a shared hosting site if the main site serves cookies or otherwise\nhas user logins.\n"},{"id":"149545","messageId":"9D2F75AD-B25E-4730-82FA-E8C5F73FCE1B@gmail.com","threadId":"24932","inReplyTo":"AANLkTik-02dJZF_0m=xccg4N5Mdaj=b2JzZaMKp=vuww@mail.gmail.com","subject":"Re: html page display via cgit","fromName":"Joshua Juran","fromEmail":"jjuran@gmail.com","sentAt":"2010-09-01T10:00:20Z","receivedAt":"2010-09-01T10:00:20Z","isPatch":false,"sender":{"key":"jjuran@gmail.com","avatar":null},"body":"On Sep 1, 2010, at 2:46 AM, Ævar Arnfjörð Bjarmason wrote:\n\n> On Wed, Sep 1, 2010 at 09:32, Shivdas Gujare  \n> <shivdas.tech@gmail.com> wrote:\n>\n>> I hope, this is the right mailing list for cgit as well.\n>> I am trying to add some \"html logs\" inside cgit, but I can't open\n>> these logs via cgit inside firefox, i.e. cgit open every files in\n>> \"plain\" format,\n>> would like to know if it is possible to open \"html\" pages inside cgit\n>> so that if I click on html page added into git, it opens in html and\n>> not in plain format.\n>>\n>> for example:\n>> if I click on \"download.html\" from\n>> \"http://cgit.freedesktop.org/~lb/mesa/tree/docs\" it shows a raw file\n>> as \"http://cgit.freedesktop.org/~lb/mesa/tree/docs/download.html\"\n>> and if I click on \"plain\" it opens in firefox like\n>> \"http://cgit.freedesktop.org/~lb/mesa/plain/docs/download.html\"\n>> but here I am trying to open this \"download.html\" inside cgit so that\n>> I can view it like html web page and not as \"plain\" text file.\n>>\n>> Thanks for any help or pointers.\n>\n> I don't know, but that's probably deliberate. You're viewing a /plain/\n> link, which should be the equivalent of \"git show\".\n>\n> There's also XSS security implications to serving things as text/html\n> on a shared hosting site if the main site serves cookies or otherwise\n> has user logins.\n\nOne solution is parse the content server-side and re-render as  \nsanitized HTML.  In addition to stripping out scripts and frames, this  \nwould avoid sending broken markup produced by someone else under your  \nname, or serving up otherwise well-formed XHTML as text/html.\n\nJosh\n"},{"id":"149546","messageId":"AANLkTinjVPAOJfmiHFOe3Pci_y-KwzGr5LzDryG8oN+A@mail.gmail.com","threadId":"24932","inReplyTo":"9D2F75AD-B25E-4730-82FA-E8C5F73FCE1B@gmail.com","subject":"Re: html page display via cgit","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-09-01T10:06:39Z","receivedAt":"2010-09-01T10:06:39Z","isPatch":false,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Wed, Sep 1, 2010 at 10:00, Joshua Juran <jjuran@gmail.com> wrote:\n> On Sep 1, 2010, at 2:46 AM, Ævar Arnfjörð Bjarmason wrote:\n>\n>> On Wed, Sep 1, 2010 at 09:32, Shivdas Gujare <shivdas.tech@gmail.com>\n>> wrote:\n>>\n>>> I hope, this is the right mailing list for cgit as well.\n>>> I am trying to add some \"html logs\" inside cgit, but I can't open\n>>> these logs via cgit inside firefox, i.e. cgit open every files in\n>>> \"plain\" format,\n>>> would like to know if it is possible to open \"html\" pages inside cgit\n>>> so that if I click on html page added into git, it opens in html and\n>>> not in plain format.\n>>>\n>>> for example:\n>>> if I click on \"download.html\" from\n>>> \"http://cgit.freedesktop.org/~lb/mesa/tree/docs\" it shows a raw file\n>>> as \"http://cgit.freedesktop.org/~lb/mesa/tree/docs/download.html\"\n>>> and if I click on \"plain\" it opens in firefox like\n>>> \"http://cgit.freedesktop.org/~lb/mesa/plain/docs/download.html\"\n>>> but here I am trying to open this \"download.html\" inside cgit so that\n>>> I can view it like html web page and not as \"plain\" text file.\n>>>\n>>> Thanks for any help or pointers.\n>>\n>> I don't know, but that's probably deliberate. You're viewing a /plain/\n>> link, which should be the equivalent of \"git show\".\n>>\n>> There's also XSS security implications to serving things as text/html\n>> on a shared hosting site if the main site serves cookies or otherwise\n>> has user logins.\n>\n> One solution is parse the content server-side and re-render as sanitized\n> HTML.  In addition to stripping out scripts and frames, this would avoid\n> sending broken markup produced by someone else under your name, or serving\n> up otherwise well-formed XHTML as text/html.\n\nYes, but have you seen programs that try to secure arbitrary\nuser-supplied HTML like this? It isn't pretty, and very hard to get\nright.\n"},{"id":"149547","messageId":"4C7E29A1.8020304@atlas-elektronik.com","threadId":"24932","inReplyTo":"AANLkTinJx0ZKjCtpq9k6nwigodnu42EvqchpgQtwGp5S@mail.gmail.com","subject":"Re: html page display via cgit","fromName":"Stefan Naewe","fromEmail":"stefan.naewe@atlas-elektronik.com","sentAt":"2010-09-01T10:23:29Z","receivedAt":"2010-09-01T10:23:29Z","isPatch":false,"sender":{"key":"stefan.naewe@gmail.com","avatar":"https://avatars.githubusercontent.com/u/4468?v=4"},"body":"On 9/1/2010 11:32 AM, Shivdas Gujare wrote:\n> Hi All,\n> \n> I hope, this is the right mailing list for cgit as well.\n> I am trying to add some \"html logs\" inside cgit, but I can't open\n> these logs via cgit inside firefox, i.e. cgit open every files in\n> \"plain\" format,\n> would like to know if it is possible to open \"html\" pages inside cgit\n> so that if I click on html page added into git, it opens in html and\n> not in plain format.\n\nSet this in /etc/cgitrc\n\nmimetype.gif=image/gif\nmimetype.html=text/html\nmimetype.jpg=image/jpeg\nmimetype.jpeg=image/jpeg\nmimetype.pdf=application/pdf\nmimetype.png=image/png\nmimetype.svg=image/svg+xml\n\nHTH\n\nStefan\n-- \n----------------------------------------------------------------\n/dev/random says: Don't stop posting, a good laugh breaks up my day nicely\n"},{"id":"149548","messageId":"EB82F537-FB11-40F2-B6DB-2A7043C819CF@gmail.com","threadId":"24932","inReplyTo":"AANLkTinjVPAOJfmiHFOe3Pci_y-KwzGr5LzDryG8oN+A@mail.gmail.com","subject":"Re: html page display via cgit","fromName":"Joshua Juran","fromEmail":"jjuran@gmail.com","sentAt":"2010-09-01T10:25:24Z","receivedAt":"2010-09-01T10:25:24Z","isPatch":false,"sender":{"key":"jjuran@gmail.com","avatar":null},"body":"On Sep 1, 2010, at 3:06 AM, Ævar Arnfjörð Bjarmason wrote:\n\n> On Wed, Sep 1, 2010 at 10:00, Joshua Juran <jjuran@gmail.com> wrote:\n>> On Sep 1, 2010, at 2:46 AM, Ævar Arnfjörð Bjarmason wrote:\n>>\n>>> On Wed, Sep 1, 2010 at 09:32, Shivdas Gujare  \n>>> <shivdas.tech@gmail.com>\n>>> wrote:\n>>>\n>>>> I hope, this is the right mailing list for cgit as well.\n>>>> I am trying to add some \"html logs\" inside cgit, but I can't open\n>>>> these logs via cgit inside firefox, i.e. cgit open every files in\n>>>> \"plain\" format,\n>>>> would like to know if it is possible to open \"html\" pages inside  \n>>>> cgit\n>>>> so that if I click on html page added into git, it opens in html  \n>>>> and\n>>>> not in plain format.\n>>>>\n>>>> for example:\n>>>> if I click on \"download.html\" from\n>>>> \"http://cgit.freedesktop.org/~lb/mesa/tree/docs\" it shows a raw  \n>>>> file\n>>>> as \"http://cgit.freedesktop.org/~lb/mesa/tree/docs/download.html\"\n>>>> and if I click on \"plain\" it opens in firefox like\n>>>> \"http://cgit.freedesktop.org/~lb/mesa/plain/docs/download.html\"\n>>>> but here I am trying to open this \"download.html\" inside cgit so  \n>>>> that\n>>>> I can view it like html web page and not as \"plain\" text file.\n>>>>\n>>>> Thanks for any help or pointers.\n>>>\n>>> I don't know, but that's probably deliberate. You're viewing a / \n>>> plain/\n>>> link, which should be the equivalent of \"git show\".\n>>>\n>>> There's also XSS security implications to serving things as text/ \n>>> html\n>>> on a shared hosting site if the main site serves cookies or  \n>>> otherwise\n>>> has user logins.\n>>\n>> One solution is parse the content server-side and re-render as  \n>> sanitized\n>> HTML.  In addition to stripping out scripts and frames, this would  \n>> avoid\n>> sending broken markup produced by someone else under your name, or  \n>> serving\n>> up otherwise well-formed XHTML as text/html.\n>\n> Yes, but have you seen programs that try to secure arbitrary\n> user-supplied HTML like this? It isn't pretty, and very hard to get\n> right.\n\nI haven't looked at any.  I'm not suggesting tweaking the HTML, but  \nreplacing it outright.  Use a whitelist of elements and attributes;  \neverything else gets dropped, including comments.  I'm not a security  \nexpert, but my assessment is that this does the job.\n\nJosh\n"},{"id":"149554","messageId":"AANLkTimucGi-7QdxbP5iLs0h5=VWW55GCxug51V584UA@mail.gmail.com","threadId":"24932","inReplyTo":"4C7E29A1.8020304@atlas-elektronik.com","subject":"Re: html page display via cgit","fromName":"Shivdas Gujare","fromEmail":"shivdas.tech@gmail.com","sentAt":"2010-09-01T12:19:05Z","receivedAt":"2010-09-01T12:19:05Z","isPatch":false,"sender":{"key":"shivdas.tech@gmail.com","avatar":null},"body":"Hi Stefan & All,\n\nThanks for your replies.\n\nOn Wed, Sep 1, 2010 at 3:53 PM, Stefan Naewe\n<stefan.naewe@atlas-elektronik.com> wrote:\n> On 9/1/2010 11:32 AM, Shivdas Gujare wrote:\n>> Hi All,\n>>\n>> I hope, this is the right mailing list for cgit as well.\n>> I am trying to add some \"html logs\" inside cgit, but I can't open\n>> these logs via cgit inside firefox, i.e. cgit open every files in\n>> \"plain\" format,\n>> would like to know if it is possible to open \"html\" pages inside cgit\n>> so that if I click on html page added into git, it opens in html and\n>> not in plain format.\n>\n> Set this in /etc/cgitrc\n>\n> mimetype.gif=image/gif\n> mimetype.html=text/html\n> mimetype.jpg=image/jpeg\n> mimetype.jpeg=image/jpeg\n> mimetype.pdf=application/pdf\n> mimetype.png=image/png\n> mimetype.svg=image/svg+xml\n>\n\nI did tried this, but it didn't made any difference on showing html\npages. Does this work like adding a line \"\nmimetype.pdf=application/pdf\" to /etc/cgitrc allows me\nto open a pdf via cgit interface in browser?\n\nThanks and Regards,\nShivdas Gujare\n\n\n\n\n> HTH\n>\n> Stefan\n> --\n> ----------------------------------------------------------------\n> /dev/random says: Don't stop posting, a good laugh breaks up my day nicely\n>\n"},{"id":"149556","messageId":"AANLkTi=yEqrkfiY84qVrvJcaBjcU-_+U7tH5ki3h9J3x@mail.gmail.com","threadId":"24932","inReplyTo":"AANLkTimucGi-7QdxbP5iLs0h5=VWW55GCxug51V584UA@mail.gmail.com","subject":"Re: html page display via cgit","fromName":"Lars Hjemli","fromEmail":"hjemli@gmail.com","sentAt":"2010-09-01T12:45:18Z","receivedAt":"2010-09-01T12:45:18Z","isPatch":false,"sender":{"key":"hjemli@gmail.com","avatar":null},"body":"On Wed, Sep 1, 2010 at 14:19, Shivdas Gujare <shivdas.tech@gmail.com> wrote:\n> On Wed, Sep 1, 2010 at 3:53 PM, Stefan Naewe\n> <stefan.naewe@atlas-elektronik.com> wrote:\n>> Set this in /etc/cgitrc\n>>\n>> mimetype.gif=image/gif\n>> mimetype.html=text/html\n>> mimetype.jpg=image/jpeg\n>> mimetype.jpeg=image/jpeg\n>> mimetype.pdf=application/pdf\n>> mimetype.png=image/png\n>> mimetype.svg=image/svg+xml\n>>\n>\n> I did tried this, but it didn't made any difference on showing html\n> pages.\n\nWhat cgit-version are you running? This option was added in cgit-0.8.3\n(2009-09-13).\n\nIf your cgit has support for mimetype options, you probably have\ncaching enabled, i.e. you're watching the old output (including\nContent-Type header).\n\n> Does this work like adding a line \"\n> mimetype.pdf=application/pdf\" to /etc/cgitrc allows me\n> to open a pdf via cgit interface in browser?\n\nYes, the pdf will be displayed in your browser if your browser supports pdfs.\n\n-- \nlarsh\n"},{"id":"149621","messageId":"4C7F4D9A.1050103@atlas-elektronik.com","threadId":"24932","inReplyTo":"AANLkTimucGi-7QdxbP5iLs0h5=VWW55GCxug51V584UA@mail.gmail.com","subject":"Re: html page display via cgit","fromName":"Stefan Naewe","fromEmail":"stefan.naewe@atlas-elektronik.com","sentAt":"2010-09-02T07:09:14Z","receivedAt":"2010-09-02T07:09:14Z","isPatch":false,"sender":{"key":"stefan.naewe@gmail.com","avatar":"https://avatars.githubusercontent.com/u/4468?v=4"},"body":"On 9/1/2010 2:19 PM, Shivdas Gujare wrote:\n> Hi Stefan & All,\n> \n> Thanks for your replies.\n> \n> On Wed, Sep 1, 2010 at 3:53 PM, Stefan Naewe\n> <stefan.naewe@atlas-elektronik.com> wrote:\n>> On 9/1/2010 11:32 AM, Shivdas Gujare wrote:\n>>> Hi All,\n>>>\n>>> I hope, this is the right mailing list for cgit as well.\n>>> I am trying to add some \"html logs\" inside cgit, but I can't open\n>>> these logs via cgit inside firefox, i.e. cgit open every files in\n>>> \"plain\" format,\n>>> would like to know if it is possible to open \"html\" pages inside cgit\n>>> so that if I click on html page added into git, it opens in html and\n>>> not in plain format.\n>>\n>> Set this in /etc/cgitrc\n>>\n>> mimetype.gif=image/gif\n>> mimetype.html=text/html\n>> mimetype.jpg=image/jpeg\n>> mimetype.jpeg=image/jpeg\n>> mimetype.pdf=application/pdf\n>> mimetype.png=image/png\n>> mimetype.svg=image/svg+xml\n>>\n> \n> I did tried this, but it didn't made any difference on showing html\n> pages. \n\nI use cgit v0.8.3.3-82-gaec9 and it works for me. You still have to use the\n'plain' link in the blob view, i.e. the URL looks like\n\nhttp://host/cgit/repo/plain/file.html?h=branch\n\n\n> Does this work like adding a line \"\n> mimetype.pdf=application/pdf\" to /etc/cgitrc allows me\n> to open a pdf via cgit interface in browser?\n\nWorks for me, too!\n\n\nStefan\n-- \n----------------------------------------------------------------\n/dev/random says: Nobody's ugly after 2 a.m.\n"}]}