zotregistry.dev/zot@v1.4.4-0.20240314164342-eec277e14d20/pkg/extensions/config/config.go (about)

     1  package config
     2  
     3  import (
     4  	"time"
     5  
     6  	"zotregistry.dev/zot/pkg/extensions/config/sync"
     7  )
     8  
     9  // BaseConfig has params applicable to all extensions.
    10  type BaseConfig struct {
    11  	Enable *bool `mapstructure:",omitempty"`
    12  }
    13  
    14  type ExtensionConfig struct {
    15  	Search  *SearchConfig
    16  	Sync    *sync.Config
    17  	Metrics *MetricsConfig
    18  	Scrub   *ScrubConfig
    19  	Lint    *LintConfig
    20  	UI      *UIConfig
    21  	Mgmt    *MgmtConfig
    22  	APIKey  *APIKeyConfig
    23  	Trust   *ImageTrustConfig
    24  }
    25  
    26  type ImageTrustConfig struct {
    27  	BaseConfig `mapstructure:",squash"`
    28  	Cosign     bool
    29  	Notation   bool
    30  }
    31  
    32  type APIKeyConfig struct {
    33  	BaseConfig `mapstructure:",squash"`
    34  }
    35  
    36  type MgmtConfig struct {
    37  	BaseConfig `mapstructure:",squash"`
    38  }
    39  
    40  type LintConfig struct {
    41  	BaseConfig           `mapstructure:",squash"`
    42  	MandatoryAnnotations []string
    43  }
    44  
    45  type SearchConfig struct {
    46  	BaseConfig `mapstructure:",squash"`
    47  	// CVE search
    48  	CVE *CVEConfig
    49  }
    50  
    51  type CVEConfig struct {
    52  	UpdateInterval time.Duration // should be 2 hours or more, if not specified default be kept as 24 hours
    53  	Trivy          *TrivyConfig
    54  }
    55  
    56  type TrivyConfig struct {
    57  	DBRepository     string // default is "ghcr.io/aquasecurity/trivy-db"
    58  	JavaDBRepository string // default is "ghcr.io/aquasecurity/trivy-java-db"
    59  }
    60  
    61  type MetricsConfig struct {
    62  	BaseConfig `mapstructure:",squash"`
    63  	Prometheus *PrometheusConfig
    64  }
    65  
    66  type PrometheusConfig struct {
    67  	Path string // default is "/metrics"
    68  }
    69  
    70  type ScrubConfig struct {
    71  	BaseConfig `mapstructure:",squash"`
    72  	Interval   time.Duration
    73  }
    74  
    75  type UIConfig struct {
    76  	BaseConfig `mapstructure:",squash"`
    77  }