/traefik-http-provider-mapper

A traefik http provider mapping server to edit an existing http provider

Primary LanguageTypeScript

Welcome to traefik-http-provider-mapper 👋

Version Documentation Maintenance Twitter: beaussan

A traefik http provider mapping server to edit an existing http provider, currently focused on integrating Coolify into an existing traefik http provider.

🏠 Homepage

Blog post

Docker compose install

version: '3'

services:
  traefik-http-provider-mapper:
    image: ghcr.io/og-jons/traefik-http-provider-mapper:latest
    restart: unless-stopped
    environment:
      # Required, the address of the coolify server
      - TRAEFIK_MAPPER_BASE_ENDPOINT=http://coolify:3000

      # All the following are optional

      # Replace the web entrypoint with what is provided (eg http here)
      - TRAEFIK_MAPPER_NEW_HTTP_ENTRYPOINT=http
      # Replace the websecure entrypoint with what is provided (eg https here)
      - TRAEFIK_MAPPER_NEW_HTTPS_ENTRYPOINT=https
      # Replace the certificate store (letsencrypt) with what is provided (eg cert here)
      - TRAEFIK_MAPPER_NEW_CERT_RESOLVER=cert

      # Adds this middleware to all routes, ex middlewareName@file for a file base middleware, middlewareName@docker for a docker base middleware
      - TRAEFIK_MAPPER_ADD_MIDDLEWARE_NAME=middlewareName@source

      # Ignore routers for the middlewares. This can be usefull to filter out some domains
      - TRAEFIK_MAPPER_IGNORE_MIDDLEWARE_SITES=some.domain.io;some.other.domain.io

      # Remove coolify itself from the list of services
      - TRAEFIK_MAPPER_FILTER_COOLIFY=true
      # Remove www redirect middleware from the list of middlewares
      - TRAEFIK_MAPPER_FILTER_WWW_MIDDLEWARE=true
      # Remove all http routes from the list of routes
      - TRAEFIK_MAPPER_FILTER_HTTP_ROUTERS=true
      # Remove all www routes from the list of routes
      - TRAEFIK_MAPPER_FILTER_WWW_ROUTERS=true

      # Map the server ip to the server name, this is useful if you are using a reverse proxy, that isn't running inside the same docker network as coolify (default is false)
      # This requires the following environment variables to be set, for it to be able to work and the networks coolify and coolify-infra can be left out
      - TRAEFIK_MAPPER_MAP_TO_SERVER_IP=true
      # Server IP of coolify in the internal network
      - TRAEFIK_MAPPER_SERVER_IP=192.168.1.111
      # Email of an administrator account on coolify
      - TRAEFIK_MAPPER_ADMIN_EMAIL=email@email.tld
      # Password of an administrator account on coolify
      - TRAEFIK_MAPPER_ADMIN_PASSWORD=password

    networks:
      # Hooks itself into the coolify network that your Traefik instance should be running on
      - coolify
      - coolify-infra
networks:
  coolify:
    external: true
  coolify-infra:
    external: true

And then, in your Traefik config, add this url as a http provider

http://traefik-http-provider-mapper:8080/

And then, you should have every Coolify provided routes in your Traefik instance ! 🎉

How to work on it locally

Install

yarn install

Usage

yarn build && yarn start:dotenv

Run tests

yarn run test

Author

👤 Beaussan

🤝 Contributing

Contributions, issues and feature requests are welcome!
Feel free to check issues page.

Show your support

Give a ⭐️ if this project helped you!