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:
- https://github.com/SchemaStore/schemastore/blob/master/src/schemas/json/traefik-v2.json
- https://github.com/SchemaStore/schemastore/blob/master/src/schemas/json/traefik-v2-file-provider.json
- Validate Traefik configuration (
traefik.yml
) - Validate Traefik file provider configuration
- 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
go get github.com/otto-de/traefik-config-validator
or via Docker
docker pull ghcr.io/otto-de/traefik-config-validator:latest
traefik-config-validator -cfg <traefik.yml> -cfgdir <static-file-provider-root>
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.
We use pre-commit for validating commits before pushing them. In addition, you will need go
installed and (optionally) Docker for build an image.
Build via make build
to build via golang build tools or docker build --build-arg VERSION=<myversion>
to build via Docker.
Currently, we are lacking good unit tests. Feel free to add them!
Run make lint
to lint the Golang code.
We use Semantic Versioning. Each git tag should be named according to v{major}.{minor}.{patch}
.
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.
The gopher's logo of Traefik is licensed under the Creative Commons 3.0 Attributions license (see traefik/traefik).