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

Cdn #477

Closed
wants to merge 5 commits into from
Closed

Cdn #477

wants to merge 5 commits into from

Conversation

coreyreichle
Copy link

Initial start for CDN documentation, re: issue #467

@nightpool
Copy link
Member

what value does this documentation add? Is this a WIP or the finished state?

(From the description I assume it's a work in progress, but on #467 you mentioned it was ready for review)

@coreyreichle
Copy link
Author

coreyreichle commented Dec 10, 2017

The Cloudflare section is complete. I'm sure there are other CDNs that are used, however, I have no experience with them fronting Mastodon. The value it adds is to prevent another admin who uses Cloudflare as a CDN (And possibly SSL termination) to not waste 8 hours on trying to figure out why Mastodon is delivering broken assets when behind the CDN.

So, it's complete for the single section. I was looking for a place in an existing doc, and was told to just create a new doc for this.

Copy link
Member

@nightpool nightpool left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't feel comfortable including this in the documentation without an explanation of the security and privacy problems with using Cloudflare SSL termination. Also, as it is the PR nearly no information on how to set up cloudflare beyond the very obvious (enable SSL termination, expose port 80).

# Using Mastodon Behind A CDN
Mastodon behind a CDN such as Cloudflare or Akamai, allows you to save bandwidth on your host, by offloading processing elsewhere. Other benefits with many CDNs are also available, such as dynamic routing, or SSL termination.

While there are benefits to such a setup, it can be very complex, and make issues difficult to troubleshoot. You will definitley want to have a development/testing instance of Mastodon that is not behind the CDN, in order to test new code deployed to your system.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

spelling.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@@ -0,0 +1,14 @@
# Using Mastodon Behind A CDN
Mastodon behind a CDN such as Cloudflare or Akamai, allows you to save bandwidth on your host, by offloading processing elsewhere. Other benefits with many CDNs are also available, such as dynamic routing, or SSL termination.
Copy link
Member

@nightpool nightpool Dec 10, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure this sentence needs to be in here. it's just fluff.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know if it's fluff, but I fleshed it out for those who might be considering using a CDN.

## Cloudflare
Cloudflare is a service that provides SSL termination, DNS hosting, and additional CDN services. Only the DNS hosting and SSL termination is viable to use with Mastodon.

If you are wanting Cloudflare to terminate your SSL, you will need to open port 80 to the world, and ensure that the CDN option is always on for your domain record. However, you will need to create page rules to turn off the other acceleration features.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We really don't recommend terminating SSL with cloudflare for security and privacy reasons. Also the instructions on how to do so here are very vague, and don't provide any concrete information.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added verbiage explaining security implications.

@nullkal
Copy link

nullkal commented Dec 11, 2017

From what I experienced in mstdn.jp, when you want to use CloudFlare for all Mastodon instance you have to care about:

  • CloudFlare can proxy websocket connections, but maximum number of concurrent connections is limited; CloudFlare support says the limit is determined by plan, but it is unclear how many connections you can use exactly (Yes, this is the reason why mstdn.jp used to separate streaming endpoint to streaming.mstdn.jp).
  • CloudFlare has "Email Address Obfuscation" feature, and it seems that this feature detects "@[email protected]" as an email address. So, you have to disable it.
  • All features which may rewrite CSS/JS automatically (e.g. Auto Minify, etc...) must be disabled.
  • You have to care about caching feature, or your instance will experience serious data breach.

I don't recommend to apply CloudFlare termination for all Mastodon instance. Using CDN to deliver assets and media is enough, almost all of the other data needs to be rendered dynamically and CDN has no merit for them. Regarding to SSL termination, you can use Let's Encrypt, so I highly recommend to use it.

@nightpool
Copy link
Member

I don't think we should recommend users enable cloudflare, and I don't think this pull request does a good enough job for saying why it should be included.

@nightpool nightpool closed this Dec 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants