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
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.
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 config-tool bash
config-tool ...
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
The CLI tool contains two main commands:
{
"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: ""
})
})
}
$ config-tool validate -c <path-to-config.yaml>
+---------------------+--------------------+-------------------------+--------+
| FIELD GROUP | FIELD | ERROR | STATUS |
+---------------------+--------------------+-------------------------+--------+
| HostSettings | - | - | ๐ข |
| TagExpiration | - | - | ๐ข |
| UserVisibleSettings | BRANDING.Logo | Field enforces tag: url | ๐ด |
| | BRANDING.FooterIMG | Field enforces tag: url | ๐ด |
+---------------------+--------------------+-------------------------+--------+