docker-error-pages

module
v0.0.0-...-6b4541e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 18, 2022 License: MIT

README ¶

HTTP's error pages

Release version Project language Build Status Release Status Coverage Image size License GitHub last commit

One day you may want to replace the standard error pages of your HTTP server with something more original and pretty. That's what this repository was created for :) It contains:

  • Simple error pages generator, written on Go
  • Single-page error page templates with different designs (located in the templates directory)
  • Fast and lightweight HTTP server
  • Already generated error pages (sources can be found here, the demonstration is always accessible here)

🔥 Features list

  • HTTP server written on Go, with the extremely fast FastHTTP under the hood
    • Respects the Content-Type HTTP header (and X-Format) value and responds with the corresponding format (supported formats is json and xml)
    • Writes logs in json format
    • Contains healthcheck endpoint (/healthz)
    • Contains metrics endpoint (/metrics) in Prometheus format
  • Lightweight docker image (~4.3Mb compressed size), distroless and uses the unleveled user by default
  • Go-template tags are allowed in the templates
  • Ready for integration with Traefik (error pages customization) and Ingress-nginx
  • Fully configurable (take a look at the configuration file and project Wiki)
  • Distributed using docker image and compiled binary files

🧩 Install

Download the latest binary file for your os/arch from the releases page or use our docker image:

image stats

Registry Image
Docker Hub tarampampam/error-pages
GitHub Container Registry ghcr.io/tarampampam/error-pages

Using the latest tag for the docker image is highly discouraged because of possible backward-incompatible changes during major upgrades. Please, use tags in X.Y.Z format

🛠 Usage

Please, take a look at our Wiki for the common usage stories:

🦾 Performance

Used hardware:

  • Intel® Coreâ„¢ i7-10510U CPU @ 1.80GHz × 8
  • 16 GiB RAM
$ ulimit -aH | grep file
-f: file size (blocks)              unlimited
-c: core file size (blocks)         unlimited
-n: file descriptors                1048576
-x: file locks                      unlimited

$ wrk --version | head -n 1
wrk 4.2.0 [epoll] Copyright (C) 2012 Will Glozer

$ wrk -t12 -c400 -d30s http://127.0.0.1:8080/500.html
Running 30s test @ http://127.0.0.1:8080/500.html
  12 threads and 400 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    50.06ms   61.15ms 655.79ms   85.54%
    Req/Sec     1.07k   363.14     2.40k    69.24%
  383014 requests in 30.08s, 2.14GB read
Requests/sec:  12731.07
Transfer/sec:     72.79MB
FS & memory usage stats during the test

🪂 Templates

Name Preview
ghost ghost
l7-light l7-light
l7-dark l7-dark
shuffle shuffle
noise noise
hacker-terminal hacker-terminal
cats cats

Note: noise template highly uses the CPU, be careful

🦾 Contributors

I want to say a big thank you to everyone who contributed to this project:

contributors

📰 Changes log

Release date Commits since latest release

Changes log can be found here.

👾 Support

Issues Issues

If you find any bugs in the project, please create an issue in the current repository.

📖 License

This is open-sourced software licensed under the MIT License.

Directories ¶

Path Synopsis
cmd
internal
breaker
Package breaker provides OSSignals struct for OS signals handling (with context).
Package breaker provides OSSignals struct for OS signals handling (with context).
cli
Package cli contains CLI command handlers.
Package cli contains CLI command handlers.
cli/healthcheck
Package healthcheck contains CLI `healthcheck` command implementation.
Package healthcheck contains CLI `healthcheck` command implementation.
cli/version
Package version contains CLI `version` command implementation.
Package version contains CLI `version` command implementation.
env
Package env contains all about environment variables, that can be used by current application.
Package env contains all about environment variables, that can be used by current application.
http/handlers/metrics
Package metrics contains HTTP handler for application metrics (prometheus format) generation.
Package metrics contains HTTP handler for application metrics (prometheus format) generation.
logger
Package logger contains functions for a working with application logging.
Package logger contains functions for a working with application logging.
metrics
Package metrics contains custom prometheus metrics and registry factories.
Package metrics contains custom prometheus metrics and registry factories.
tpl
version
Package version is used as a place, where application version defined.
Package version is used as a place, where application version defined.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL