Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use <slug>.readthedocs.io for suggested custom domain endpoint #4521

Open
agjohnson opened this issue Aug 14, 2018 · 19 comments
Open

Use <slug>.readthedocs.io for suggested custom domain endpoint #4521

agjohnson opened this issue Aug 14, 2018 · 19 comments
Assignees
Labels
Accepted Accepted issue on our roadmap Improvement Minor improvement to code Needed: documentation Documentation is required
Milestone

Comments

@agjohnson
Copy link
Contributor

agjohnson commented Aug 14, 2018

Our custom domain directions tell people to CNAME to readthedocs.io. One idea that might be nice is to have them CNAME to <slug>.readthedocs.io. This would let us configure DNS for a single domain rather than making large changes.

In order for this to work, we need to tweak our Cloudflare settings to have the "orange cloud" for *.readthedocs.io. Projects that already proxy through cloudflare and have their DNS set to <slug>.readthedocs.io will have issues that can be solved with the directions here. I expect there's no more than a handful of these.

@agjohnson agjohnson added the Needed: design decision A core team decision is required label Aug 14, 2018
@agjohnson agjohnson added this to the 2.9 milestone Aug 14, 2018
@davidfischer
Copy link
Contributor

There is a ticket with solutions for users experiencing issues with Cloudflare #4395.

@davidfischer
Copy link
Contributor

This is a bit of a tricky situation since it's not really easy for us to tell which domains will have problems once we make this change. We don't really know which projects have their custom domains proxying through Cloudflare. Perhaps the right solution here is to make the switch and have a test script where we can uncover these issues quickly and then either put workarounds in place or contact the project authors proactively.

@agjohnson
Copy link
Contributor Author

@davidfischer I forgot where we landed on this. Does the above point still stand? Should we script up something that resolves the custom project domains to detect cloudflare proxying first?

@davidfischer
Copy link
Contributor

I think we should script something and try to detect it. There's probably not too many projects that it will affect. I'd estimate ~5-10 but it's worth figuring it out first.

@davidfischer davidfischer self-assigned this Nov 10, 2018
@agjohnson
Copy link
Contributor Author

Roger. In terms of priorities, this is pretty low and we're a few versions out from making this change. Perhaps this is a v3 change in fact.

@agjohnson agjohnson modified the milestones: 2.11, 3.0 Dec 8, 2018
@agjohnson
Copy link
Contributor Author

@rtfd/core, how do we feel about making this a v3.0 release item EOY?

@davidfischer
Copy link
Contributor

I'm +1.

@humitos humitos added Improvement Minor improvement to code Needed: documentation Documentation is required Accepted Accepted issue on our roadmap and removed Needed: design decision A core team decision is required labels Jan 2, 2019
@davidfischer
Copy link
Contributor

I think we should script something and try to detect it. There's probably not too many projects that it will affect. I'd estimate ~5-10 but it's worth figuring it out first.

There's actually more like 40. I ran a script over our ~3k domains which checked if the custom domain pointed to a CNAME matching *.readthedocs.io (but didn't match "readthedocs.io" exactly). For each matching domain, I checked if the root domain had its nameservers on Cloudflare.

Interestingly, I also found ~7 projects that were pointed to cloudflare-to-cloudflare.readthedocs.io -- meaning they were going to use their own SSL cert per the docs -- but they hadn't setup an SSL cert. I don't know why they would do this but I emailed a couple of them to try to figure this out.

@ericholscher
Copy link
Member

I do wonder if we should CNAME to <slug>.cname.readthedocs.org or similar. That way it will give us even more flexibility over DNS, without having to change how we do DNS for *.readthedocs.io itself. I don't know if that will break the Cloudflare setup, but I think being explicit here for a magic DNS/SSL CNAME is better than trying to piggyback on top of the existing DNS entry used in production.

@davidfischer
Copy link
Contributor

From a Cloudflare perspective, it only has to resolve to a domain we control. We could probably do something like <slug>.cname.readthedocs.io. I think it's best to keep this off .org.

@ericholscher
Copy link
Member

I think it's best to keep this off .org.

Makes sense, but curious what the reasons are. Just to keep it consistent with the domain we're hosting docs on?

@davidfischer
Copy link
Contributor

It is conceivable that in the future .org and .io are not even served by the same servers.

@davidfischer
Copy link
Contributor

I added the relevant DNS entry for *.cname.readthedocs.io. If we want that to be our recommendation, we don't need to notify anyone in advance and we can just change our docs. If we are all on board with that, I'll just submit a PR updating them.

@davidfischer
Copy link
Contributor

I should also mention I verified it by adding a custom domain that resolves to slug.cname.readthedocs.io and the certificate issued successfully.

@davidfischer
Copy link
Contributor

Now that I think about this a little further, there is at least one drawback to using slug.cname.readthedocs.io instead of slug.readthedocs.io and that is that ~250 domains already point to some variation of *.readthedocs.io. By changing our DNS to support that directly, we could issue SSL certs for those domains without requiring 250 users to update DNS. However, the drawback to supporting slug.readthedocs.io is the problems we will have with the ~40 domains.

@ericholscher
Copy link
Member

One of my goal is being able to seperate the operational aspects of DNS around *.readthedocs.io from the actual user DNS entries. It gives us a bit more flexibility around doing something custom for a user, particularly around CDN's for example, without effecting the origin server.

So for example:

pip.cname.readthedocs.io -> Fastly
Fastly -> pip.readthedocs.io
pip.readthedocs.io -> Azure load balancer

This would be really convoluted if we wanted to repoint pip.readthedocs.io to fastly, and then have an alternative origin server. We could always do slug.origin.readthedocs.io as a backing origin for a CDN, but I think having the CNAME DNS record explicit gives us more flexibility.

@agjohnson agjohnson modified the milestones: 3.0, 3.2, 3.3 Jan 25, 2019
@stsewd stsewd modified the milestones: 3.3, 3.4 Mar 6, 2019
@stsewd stsewd modified the milestones: 3.4, 3.5 Mar 27, 2019
@ericholscher
Copy link
Member

ericholscher commented Apr 25, 2020

We should consider this again now that we're fully on CloudFlare for DNS. Do we want to point users to a slug-specific domain again? I see benefits of each approach:

  • Having users point at slug.readthedocs.io got us into this mess, where we can't control the actual serving of docs at *.readthedocs.io without effecting custom domains. I'm -1 on this approach
  • Pointing users at readthedocs.io is useful, because it lets us redirect all custom domains at one time, but doesn't let us resolve issues on a case-by-case basis, as we did with our latest migration. This gives us less flexibility in the future
  • I think a project-specific DNS entry is best, giving us flexibility on what to do, but it shouldn't be the same as our doc-serving DNS entry. I think something like slug.cname.readthedocs.io as I mentioned is the best. It lets us customize DNS on a per-project level, but also leaves us free to adjust our docserving at slug.readthedocs.io as needed.

@humitos
Copy link
Member

humitos commented Feb 21, 2024

@ericholscher @stsewd is this issue still relevant after all the migration you have done regarding custom domains?

@stsewd
Copy link
Member

stsewd commented Feb 21, 2024

On .com we are using a hash for the CNAME to protect users from subdomain hijacking.

@humitos humitos changed the title Use <slug>.readthedocs.io for suggested custom domain endpoint Use <slug>.readthedocs.io for suggested custom domain endpoint Mar 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Accepted Accepted issue on our roadmap Improvement Minor improvement to code Needed: documentation Documentation is required
Projects
None yet
Development

No branches or pull requests

5 participants