Dokploy / dokploy

Open Source Alternative to Vercel, Netlify and Heroku.
https://dokploy.com/
Other
9.48k stars 474 forks source link

Feat: UI for Managing Middleware in Traefik #274

Open binaryYuki opened 4 months ago

binaryYuki commented 4 months ago

What problem will this feature address?

I propose an enhancement to the UI to include comprehensive management features for middleware configurations. This functionality will be particularly beneficial for managing and adding middleware, especially in clustered environments where fallback services like error-pages are critical.

Describe the solution you'd like

Key Features

Benefits

Use Cases

Describe alternatives you've considered

I think this could be done using internal apis like the traefik dashboard?

Additional context

No response

binaryYuki commented 4 months ago

I'd like to offer an example we use previously.

  error-pages:
    image: akkk1234/error-pages:latest
    environment:
      SHOW_DETAILS: "true"
      TEMPLATE_NAME: "connection"
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.error-pages-router.rule=HostRegexp(`.+`)"
      - "traefik.http.routers.error-pages-router.priority=10"
      - "traefik.http.routers.error-pages-router.entrypoints=web"
      - "traefik.http.routers.error-pages-router.middlewares=error-pages-middleware"
      - "traefik.http.middlewares.error-pages-middleware.errors.status=400-599"
      - "traefik.http.middlewares.error-pages-middleware.errors.service=error-pages_error-pages"
      - "traefik.http.middlewares.error-pages-middleware.errors.query=/{status}.html"
      - "traefik.http.services.error-pages-service.loadbalancer.server.port=8080"
    networks:
      - traefik-net

It is really useful when something went wrong.

Siumauricio commented 3 months ago

This is a good idea to implement rate limiting, retries, and error pages, let's add this to the roadmap, for now it will be low priority for me, if someone wants to work on this that would be awesome!

@binaryYuki that example cover when a service are down they inmediately shows the error page?

binaryYuki commented 3 months ago

@binaryYuki that example cover when a service are down they inmediately shows the error page?

Hello. Yes you are right. That is a go service defined as a traefik middleware that will show error pages while the service return an error code. You can also see https://github.com/tarampampam/error-pages for further docs.

Looking forward for this feature!

gpproton commented 2 weeks ago

A simple middleware to define a basic auth on domains will be very useful