Git Product home page Git Product logo

config-tool's Introduction

Config Tool

The Quay Config Tool implements several features to capture and validate configuration data based on a predefined schema.

This tool includes the following features:

  • Validate Quay configuration using CLI tool
  • Generate code for custom field group definitions (includes structs, constructors, defaults)
  • Validation tag support from Validator
  • Built-in validator tags for OAuth and JWT structs

Installation

Build from Source

Install using the Go tool:

go get -u github.com/quay/config-tool/...

This will generate files for the Quay validator executable and install the config-tool CLI tool.

Build from Dockerfile

Clone this repo and build an image:

$ git clone https://github.com/quay/config-tool.git
$ cd config-tool
$ sudo podman build -t config-tool .

Start the container and execute command:

$ sudo podman run -it -v ${CONFIG_MOUNT}:/conf config-tool ...

Note that you must mount in your config directory in order for the config-tool to see it.

Note: By default, this tool will generate an executable from a pre-built Config definition. For usage on writing a custom Config definition see here

Usage

The CLI tool contains two main commands:

The print command is used to output the entire configuration with defaults specified

{
        "HostSettings": (*fieldgroups.HostSettingsFieldGroup)({
                ServerHostname: "quay:8081",
                PreferredURLScheme: "https",
                ExternalTLSTermination: false
        }),
        "TagExpiration": (*fieldgroups.TagExpirationFieldGroup)({
                FeatureChangeTagExpiration: false,
                DefaultTagExpiration: "2w",
                TagExpirationOptions: {
                        "0s",
                        "1d",
                        "1w",
                        "2w",
                        "4w"
                }
        }),
        "UserVisibleSettings": (*fieldgroups.UserVisibleSettingsFieldGroup)({
                RegistryTitle: "Project Quay",
                RegistryTitleShort: "Project Quay",
                SearchResultsPerPage: 10,
                SearchMaxResultPageCount: 10,
                ContactInfo: {
                },
                AvatarKind: "local",
                Branding: (*fieldgroups.BrandingStruct)({
                        Logo: "not_a_url",
                        FooterIMG: "also_not_a_url",
                        FooterURL: ""
                })
        })
}

The validate command is used to show while field groups have been validated succesully

$ config-tool validate -c <path-to-config-dir>
+---------------------+--------------------+-------------------------+--------+
|     FIELD GROUP     |       FIELD        |          ERROR          | STATUS |
+---------------------+--------------------+-------------------------+--------+
| HostSettings        | -                  | -                       | ๐ŸŸข     |
| TagExpiration       | -                  | -                       | ๐ŸŸข     |
| UserVisibleSettings | BRANDING.Logo      | Field enforces tag: url | ๐Ÿ”ด     |
|                     | BRANDING.FooterIMG | Field enforces tag: url | ๐Ÿ”ด     |
+---------------------+--------------------+-------------------------+--------+

The editor command will bring up an interactive UI to reconfigure and validate a config bundle.

$ config-tool editor -c <path-to-config-dir> -p <editor-password> -e <operator-endpoint>

This command will bring up an interactive UI in which a user can modify, validate, and download a config. In addition, Swagger documentation can be reached by going to {{host}}/swagger/index.html

config-tool's People

Contributors

alecmerdler avatar bcaton85 avatar billdett avatar crozzy avatar harishsurf avatar jonathankingfc avatar josephschorr avatar kleesc avatar kurtismullins avatar ricardomaraschini avatar syed avatar thomasmckay avatar

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.