Open jankeromnes opened 7 years ago
Seems like you've fixed this.
No I didn't, as you can see by trying to access port 8080 of a Janitor container where no server is running: I expect an easy to understand error page, however instead I get a blank page, and I have to open the devtools to notice that the status is 503.
This is a great place for new UI that doesn't use any existing framework (proxy server doesn't serve any web pages directly yet).
Hmm, I was convinced your proxy PR added this. Perhaps it was for some error codes only. I'll look at this then.
Ah, I see that if you access port 8088888, it shows a blank page :)
The web app https://janitor.technology already has a very basic 404 page, e.g. https://janitor.technology/no/such/page.html
However, proxy servers (i.e. Docker container hosts) like https://moz1.janitor.technology use a variety of error codes, but currently send empty HTML responses (using
request.end()
) along with them. This makes error cases hard to understand for users (because they only see a blank page, and the error code is only visible in the browser's devtools), e.g. https://moz1.janitor.technology/0000000000000000/0000/oops.htmlInstead, it would be nice to show explicit error pages (beautiful but very simple, with helpful explanations of what the problem might be, but without leaking internal errors). The following error cases need pages:
500: Internal Server Error
due to problems while retrieving a session500: Internal Server Error
due to problems while generating a new OAuth2 state parameter (should never happen)500: Internal Server Error
due to problems while computing an OAuth2 authorization URL (should never happen)500: Internal Server Error
due to routing a request to an invalid path (should never happen)500: Internal Server Error
due to a container port using an unsupported proxy type (should never happen, unless we add a new proxy type in Janitor, and Docker hosts have not been updated yet)403: Forbidden
due to problems with oauth2 state mismatch or problems requesting an oauth2 access token400: Bad Request
due to no container or port being explicitely requested(now400: Bad Request
404: Not Found
) due to an non-existent container, or a non-exposed port, or an unauthorized access (actually, this error should probably be aThe error code was fixed in fc1dddef61f8206ab9b46f314f71849189f7b480)404: Not Found
instead. Please drive-by fix it.Replying with actual web content can be done by adding new HTML template routes to
/lib/routes.js
.@nt1m would you be interested in taking on this issue?
Note: This could be an opportunity to add new web pages that don't use Bootstrap, see also #113.