Skip to content

otto-de/traefik-config-validator

Traefik Config Validator

Traefik

CI Release

traefik-config-validator is a CLI tool to (syntactically) validate your Traefik configuration files to ensure bad configurations are being captured before hitting your production system or during development. It can be used either as a developer tool on your machine or in CI/CD pipelines and has been used in production at OTTO.

It will be validated against the following JSON schemas hosted on schemastore:

Features

Known Limitations

  • Currently, only YAML configuration is supported while Traefik supports TOML, JSON, environment variables and the CLI for configuration
  • Cannot recursively scan files for file provided configurations

Installation

go get github.com/otto-de/traefik-config-validator

or via Docker

docker pull ghcr.io/otto-de/traefik-config-validator:latest

Usage

traefik-config-validator -cfg <traefik.yml> -cfgdir <static-file-provider-root>

Developer Guide

All steps in development can be performed either through the CI/CD pipeline with GitHub Actions or locally. See below for instructions on how to do it.

Setting Up

We use pre-commit for validating commits before pushing them. In addition, you will need go installed and (optionally) Docker for build an image.

Building

Build via make build to build via golang build tools or docker build --build-arg VERSION=<myversion> to build via Docker.

Testing

Currently, we are lacking good unit tests. Feel free to add them!

Linting

Run make lint to lint the Golang code.

Releasing

We use Semantic Versioning. Each git tag should be named according to v{major}.{minor}.{patch}.

Contributing

If you'd like to contribute to the project, refer to the contributing documentation.

Please note that this project is released with a Contributor Code of Conduct. By participating in this project, you agree to abide by its terms.

Credits

The gopher's logo of Traefik is licensed under the Creative Commons 3.0 Attributions license (see traefik/traefik).