#readthedocs

/

      • begriffs_ has quit
      • jogriffin has quit
      • adambrenecki_ joined the channel
      • adambrenecki_ has quit
      • adambrenecki joined the channel
      • adambrenecki is now known as adambrenecki_
      • adambrenecki_ is now known as adambrenecki__
      • adambrenecki__ is now known as adambrenecki
      • Len_ has left the channel
      • adambrenecki has quit
      • xafer joined the channel
      • zzzeek has quit
      • zzzeek joined the channel
      • fasaxc joined the channel
      • FinalAngel joined the channel
      • d0ugal has quit
      • d0ugal joined the channel
      • d0ugal has quit
      • fasaxc has quit
      • d0ugal joined the channel
      • fasaxc joined the channel
      • robb_nl joined the channel
      • kushal joined the channel
      • fasaxc has quit
      • fasaxc joined the channel
      • fasaxc has quit
      • fasaxc joined the channel
      • fasaxc has quit
      • fasaxc joined the channel
      • fasaxc_ joined the channel
      • fasaxc has quit
      • FinalAngel has quit
      • robb_nl has quit
      • d0ugal has quit
      • hrybacki is now known as hrybacki|food
      • d0ugal joined the channel
      • dan-- joined the channel
      • dan-- joined the channel
      • fasaxc_ has quit
      • hrybacki|food is now known as hrybacki
      • xafer has quit
      • begriffs joined the channel
      • begriffs
        It seems like after I build a version of my docs the search returns worse results. Is there a way to trigger it to build a new full text index right away?
      • reaperhulk has left the channel
      • untitaker
        begriffs: regarding your previous question, that's exactly the behavior of tags?
      • if you tag HEAD, and advance HEAD...
      • (i.e. commit something on top of HEAD)
      • begriffs
        untitaker: thanks for getting back to me about that. I discovered that I under Admin -> Advanced Settings there is a field to configure the version that latest points at. We're using long-lived branches for each version and don't work on master directly.
      • So that part worked fine.
      • untitaker
        oh, you mean for each x.y-release, not each concrete x.y.z version?
      • begriffs
        But the poor search performance is strange. I remember it was pretty bad at one point but then improved over time like it was being index. Now it's bad again.
      • untitaker
        I have no idea about the search index (not affiliated with RTD)
      • begriffs: note that "default version" only defines what / will redirect to
      • begriffs
        Actually what we're doing now is exposing two versions v5.0 and v5.1 and hiding stable and latest. Then using cloudflare to do a 302 redirect from latest to v5.1 for SEO.
      • Actually discovered another interesting thing about search: it works well unless we access the page behind a custom subdomain. Same RTD server, just different domain in the url and search differs.
      • untitaker
        could you share a link?
      • begriffs
        Yeah just a sec, verifying the behavior again
      • agj
        begriffs: there's an issue with custom subdomain usage and search, the api endpoints aren't exposed on the subdomain and we disallow the queries from unknown domains
      • begriffs
        agj: is there a setting I need to change? Is it a CORS thing?
      • agj
        CORS on our end, yup
      • begriffs
        Is there a way to whitelist our particular RTD instance and its CNAME?
      • untitaker
        wait, but this seems to work (judging from the dev console): https://vdirsyncer.pimutils.org/en/stable/searc...
      • agj
        untitaker: i get the expected warning about the origin being denied
      • untitaker
        oh, nvm
      • begriffs
        untitaker: I think it falls back to a front-end search, and you get fewer results than the index. I also see the telltale raw markup in the results
      • untitaker
        since the search JS hits the custom domain before the redirect, you might be able to intercept the request and edit the CORS headers yourself.
      • unless you're pointing your CNAME directly to RTD
      • begriffs
        Cool, our domain is behind cloudflare...I wonder what kind of rule we'll need to implement to change CORS.
      • untitaker
        or no, it actually *does* just hit readthedocs.org directly.
      • weird, I thought I saw something else before
      • agj
        correct, search js will fall back to sphinx search on failure, explaining the poor results
      • ultimately, we need to serve the same search on the custom domain to get around this in a secure way
      • untitaker
        you could also only whitelist the primary hostname of each project.
      • If I call search?project=vdirsyncer, vdirsyncer.pimutils.org is the primary hostname, therefore Access-Control-Allow-Origin should be set to that.
      • or check if the Origin request header matches a known hostname for the given project.
      • begriffs has quit
      • agj
        untitaker: this is a very good point
      • untitaker
        that said I don't see the security risk in allowing all hosts.
      • at least for search
      • begriffs joined the channel
      • begriffs has quit
      • begriffs joined the channel
      • begriffs
        Looks like the API CORS problem is documented here https://github.com/rtfd/readthedocs.org/issues/...
      • agj
        untitaker: points of our api have side effects, and so we blanket limit access to the api to protect against csrf attacks
      • more security is better than less, and all that
      • ultimately, we'd rather the api endpoints are hosted on the project domains, but that will take a little of operational change on the community site, and a large amount on the commerical site
      • begriffs
        It doesn't look like an insurmountable problem though. Inside Admin -> Domains it knows which domains are legit for my docs page, so it could use that value for the Access-Control-Allow-Origin response header.
      • agj
        yup, i think that's a great idea that does solve a few problems around api usage from docs on both
      • we didn't use to have the domain mappings, rtd only tried to make an intelligent guess about the domain
      • so that was never added to that api
      • but now we do have explicit domains to map to projects, so that makes this all possible
      • untitaker joined the channel
      • chrisw joined the channel
      • begriffs
        agj: is the relevant API code open source?
      • (Also one workaround might be to allow all hosts to access certain safe routes but keep the strict cors on other more dangerous routes)
      • agj
        begriffs: i can outline the work in an issue, but the bulk of the work will be addings the cors headers on OPTIONS, via the cors middleware
      • raydeo joined the channel
      • raydeo has left the channel
      • begriffs_ joined the channel
      • begriffs has quit
      • kushal has quit
      • RTDGitHubBot joined the channel
      • NOTICE: [readthedocs.org] ericholscher pushed 1 new commit to version-sorting: https://git.io/voYfW
      • NOTICE: readthedocs.org/version-sorting eff97e0 Eric Holscher: Fix docstring
      • RTDGitHubBot has left the channel
      • RTDGitHubBot joined the channel
      • NOTICE: [readthedocs.org] agjohnson pushed 1 new commit to master: https://git.io/voYJM
      • NOTICE: readthedocs.org/master 013c818 Eric Holscher: Fix version sort order and add build_version block (#2253)...
      • RTDGitHubBot has left the channel
      • RTDGitHubBot joined the channel
      • NOTICE: [readthedocs.org] ericholscher pushed 2 new commits to master: https://git.io/voYUt
      • NOTICE: readthedocs.org/master 264f5e7 Chad Whitacre: fix typo in issue template
      • NOTICE: readthedocs.org/master d19080f Eric Holscher: Merge pull request #2259 from whit537/patch-1...
      • RTDGitHubBot has left the channel