Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,39 @@ docker pull ghcr.io/ctfpilot/error-fallback:latest

*For the versions available, please see the [releases page](https://github.com/ctfpilot/error-fallback/releases).*

## Pages

Each page is generated from a file in [`src/content`](./src/content) (see [Development](#development) below) and is served as static HTML behind a reverse proxy. Which page is shown is determined by whichever HTTP status code the proxy maps to this service. Every page automatically polls the original request's host and reloads once it starts responding normally again, so the page updates on its own once the underlying issue is resolved.

| Page | Title | Intended use |
| ----------- | ----------------------- | ------------------------------------------------------------------------------------- |
| `index.html` | Error | Generic fallback page for errors that don't have a more specific page. |
| `401.html` | Unauthorized | Authentication is required to access this resource. |
| `403.html` | Forbidden | The request is authenticated but the caller doesn't have permission. |
| `404.html` | Not found | The requested page could not be found. |
| `405.html` | Method Not Allowed | The HTTP method used is not supported for the requested resource. |
| `500.html` | Error | Same generic message as `index.html`, with an added link back to the home page. |
| `502.html` | Bad gateway | The service did not respond correctly. |
| `503.html` | No service available | The service is temporarily unavailable, e.g. while restarting or under maintenance. |
| `504.html` | Gateway timeout | The service did not respond in time, e.g. while restarting or under maintenance. |

<details>
<summary>Preview of each page</summary>

| Page | Light mode | Dark mode |
| --- | --- | --- |
| **Index** | ![Index page](docs/images/index.png) | ![Index page, dark mode](docs/images/index-dark.png) |
| **401 Unauthorized** | ![401 page](docs/images/401.png) | ![401 page, dark mode](docs/images/401-dark.png) |
| **403 Forbidden** | ![403 page](docs/images/403.png) | ![403 page, dark mode](docs/images/403-dark.png) |
| **404 Not found** | ![404 page](docs/images/404.png) | ![404 page, dark mode](docs/images/404-dark.png) |
| **405 Method Not Allowed** | ![405 page](docs/images/405.png) | ![405 page, dark mode](docs/images/405-dark.png) |
| **500 Error** | ![500 page](docs/images/500.png) | ![500 page, dark mode](docs/images/500-dark.png) |
| **502 Bad gateway** | ![502 page](docs/images/502.png) | ![502 page, dark mode](docs/images/502-dark.png) |
| **503 No service available** | ![503 page](docs/images/503.png) | ![503 page, dark mode](docs/images/503-dark.png) |
| **504 Gateway timeout** | ![504 page](docs/images/504.png) | ![504 page, dark mode](docs/images/504-dark.png) |

</details>
Comment thread
MikkelHebel marked this conversation as resolved.

### Development

In order to generate the pages, run the [`generator.py`](./src/generator.py) script in `src`:
Expand Down
Binary file added docs/images/401-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/401.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/403-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/403.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/404-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/404.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/405-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/405.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/500-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/500.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/502-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/502.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/503-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/503.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/504-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/504.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/index-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/index.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading