-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support customization through env variables #16
Comments
What is the use case for this? Why do not use the ready templates? |
For instance I prefer to have a more human-friendly maintenance message for 502 and 503. Also, somebody might prefer corporate templates which wouldn't fit a generic project. |
Tbf, all you'd need to do there is modify the config.json file and build the project, and you could have the custom message of your choice. The HTML files are built during the dockerfile build stage, so not quite sure how @tarampampam would be able to put env variables in. Only way I can think of is via Nginx's http_sub_module - but that's massively processor intensive if not careful. It makes more sense to simplify it and edit the config.json and have several images depending on your use case. Or if you really need variables, just put in some build_args. It takes about 20 seconds to build a new image. |
@yajo Hi there again! Sorry for the late response - I needed time to rewrite the whole application on go :) Since v2.0.0 you can override the content of the templates. For example, now you can override the Lines 5 to 7 in 29f024e
# docker-compose.yml
version: '3.2'
services:
error-pages:
image: ghcr.io/tarampampam/error-pages:2.0.0
environment:
TEMPLATE_NAME: ghost
GHOST_TEMPLATE_CONTENT: >
<html>
<body>{{ code }} - {{ message }}</body>
</html>
ports:
- "8080:8080/tcp" $ docker-compose up This issue can be closed now? :) |
Beautiful! Of course, thank you! |
It would be awesome to be able to define error pages content by env variables.
It'd be sooo nice to be able to do something like:
The text was updated successfully, but these errors were encountered: