Coder Social home page Coder Social logo

otto-de / traefik-config-validator Goto Github PK

View Code? Open in Web Editor NEW
21.0 4.0 4.0 4.63 MB

Validator for your Traefik Proxy (https://doc.traefik.io/traefik/) configuration

License: Apache License 2.0

Dockerfile 9.94% Makefile 13.12% Go 76.94%
cloud-native traefik-v2

traefik-config-validator's Introduction

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).

traefik-config-validator's People

Contributors

dependabot[bot] avatar kunzese avatar thomasklinger1234 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

traefik-config-validator's Issues

[FEATURE] TOML Support

Is there an existing issue for this?

  • I have searched the existing issues

Feature description

I know that the TOML does not supported for now.
But I hope it will be done in future. Just want to leave this feature request to track the state.

Anything else?

No response

[BUG] go install does not work

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

When trying to install the CLI via go install github.com/otto-de/traefik-config-validator, I receive the following error message

go install: github.com/otto-de/[email protected]: module github.com/otto-de/[email protected] found, but does not contain package github.com/otto-de/traefik-config-validator

Expected Behavior

go install ... works

Steps To Reproduce

  1. go install github.com/otto-de/[email protected]

Anything else?

No response

Release 1.0.0

Is there an existing issue for this?

  • I have searched the existing issues

Feature description

Finally, release the initial stable version after the tool is in production for roughly 6 months at OTTO.

To Dos

[FEATURE] Validation of dynamic config using Go templates

Is there an existing issue for this?

  • I have searched the existing issues

Feature description

Traefik dynamic configuration using the File provider supports Go Templating. My sense is that this tool does not currently support validating dynamic configuration that uses template syntax.

Assuming this is correct, perhaps this should be called out in the docs?

Not sure what kind of lift this would take, but just wanted to call it out for discussion. I use go templating in my traefik config, and would definitely like to be able to validate these files before I commit or deploy them. However, I could also see this be more appropriately built into traefik itself, similar to how the apachectl configtest command works with Apache.

Anything else?

No response

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.