tarampampam / error-pages

🚧 Pretty server's error pages in the docker image & git repository (for traefik, k8s, nginx and so on)
https://tarampampam.github.io/error-pages/
MIT License
833 stars 81 forks source link

Add CatchAll functionality #217

Closed rybnico closed 1 year ago

rybnico commented 1 year ago

Description

This pull request is based on the closed PR https://github.com/tarampampam/error-pages/pull/161

With the author's permission, I have incorporated the catch-all functionality into a new PR.

The catch-all functionality can be used especially when using error-pages in a Kubernetes project to - independent of the requested URL - always deliver an error page according to the X-Code HTTP header.

Since this PR has been closed before, please let me know what else is needed for this PR to be merged this time.

Checklist

tarampampam commented 1 year ago

Looks pretty simple and cool! Did you test it on your side well?

codecov[bot] commented 1 year ago

Codecov Report

Merging #217 (bb70ad0) into master (ecf1359) will decrease coverage by 0.27%. The diff coverage is 0.00%.

@@            Coverage Diff             @@
##           master     #217      +/-   ##
==========================================
- Coverage   48.40%   48.13%   -0.27%     
==========================================
  Files          32       32              
  Lines        1250     1257       +7     
==========================================
  Hits          605      605              
- Misses        607      614       +7     
  Partials       38       38              
Files Changed Coverage Δ
internal/cli/serve/command.go 0.00% <0.00%> (ø)
internal/env/env.go 100.00% <ø> (ø)
internal/http/server.go 0.00% <0.00%> (ø)
rybnico commented 1 year ago

Yes, I have tested it successfully. I created a Docker image containing the PR and pushed it to nrybnikar/error-pages:catch-all if you want to test it. I rolled it out to our K8s cluster and also successfully tested the intended use, i.e. as a default-backend in an Ingress object.

tarampampam commented 1 year ago

You've done a tremendous job! Thank you!

rybnico commented 1 year ago

Thank you @tarampampam! The credit should go to @chrisamti since he was the original author and I created this PR based solely on his work.