Description
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.html
Instead, 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 session -
500: 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 token -
400: 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 fc1ddde)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.