https://github.com/otto-de/traefik-config-validator
Validator for your Traefik Proxy (https://doc.traefik.io/traefik/) configuration
https://github.com/otto-de/traefik-config-validator
cloud-native traefik-v2
Last synced: 2 months ago
JSON representation
Validator for your Traefik Proxy (https://doc.traefik.io/traefik/) configuration
- Host: GitHub
- URL: https://github.com/otto-de/traefik-config-validator
- Owner: otto-de
- License: apache-2.0
- Created: 2021-12-20T09:31:44.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2025-03-03T13:04:50.000Z (7 months ago)
- Last Synced: 2025-03-13T01:36:52.502Z (7 months ago)
- Topics: cloud-native, traefik-v2
- Language: Go
- Homepage:
- Size: 4.52 MB
- Stars: 24
- Watchers: 3
- Forks: 5
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Codeowners: .github/CODEOWNERS
- Security: SECURITY.md
Awesome Lists containing this project
README
# Traefik Config Validator

![]()
[](https://github.com/otto-de/traefik-config-validator/actions/workflows/My_CI.yml)
[](https://github.com/otto-de/traefik-config-validator/actions/workflows/My_Release.yml)`traefik-config-validator` is a CLI tool to (syntactically) validate your [Traefik](https://doc.traefik.io/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## Features
- Validate Traefik configuration (`traefik.yml`)
- Validate Traefik [file provider configuration](https://doc.traefik.io/traefik/providers/file/)## 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 -cfgdir
```## 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](https://pre-commit.com/) 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=` 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](https://semver.org/). 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](CONTRIBUTING.md).
Please note that this project is released with a [Contributor Code of Conduct](CODE_OF_CONDUCT.md).
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](https://github.com/traefik/traefik)).