mozilla-services / syncserver

Run-Your-Own Firefox Sync Server
Mozilla Public License 2.0
1.87k stars 145 forks source link

Sanity-check public_url on each incoming request. #41

Closed rfk closed 10 years ago

rfk commented 10 years ago

This logs an up-front warning if the public_url setting does not match what the app thinks is its public URL. Such a condition will almost certainly produce a cryptic authentication error so this will give the user a bit more guidance as to the source of the problem.

@callahad r?

callahad commented 10 years ago

r+, merging.

The error is exposed as expected in the console logs when, e.g., attempting to connect to 192.168.1.2 when the server is set to expect 127.0.0.1.

On the other hand, errors are not meaningfully surfaced in the Browser Console:

screen shot 2014-10-21 at 20 20 34

I've seen evidence that some self-hosting users aren't entirely sure where to find their server logs, so a good follow-up to this would be to tweak the response we send when these checks fail, so that the Browser Console is more helpful.

rfk commented 10 years ago

We could morph this into a hard error with appropriately descriptive response body. AFAICT there's pretty much zero chance of things working correctly under such a setup, so a hard error doesn't seem like a problem.