Giter Site home page Giter Site logo

Comments (5)

yajo avatar yajo commented on May 21, 2024 1

Beautiful! Of course, thank you!

from error-pages.

tarampampam avatar tarampampam commented on May 21, 2024

What is the use case for this? Why do not use the ready templates?

from error-pages.

yajo avatar yajo commented on May 21, 2024

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.

from error-pages.

modem7 avatar modem7 commented on May 21, 2024

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.

from error-pages.

tarampampam avatar tarampampam commented on May 21, 2024

@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 ghost template content on your choice:

- path: ./templates/ghost.html
name: ghost # name is optional, if path is defined
content: ${GHOST_TEMPLATE_CONTENT}

# 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

111

This issue can be closed now? :)

from error-pages.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.