|
@@ -9,6 +9,7 @@ type CscliCfg struct {
|
|
Output string `yaml:"output,omitempty"`
|
|
Output string `yaml:"output,omitempty"`
|
|
Color string `yaml:"color,omitempty"`
|
|
Color string `yaml:"color,omitempty"`
|
|
HubBranch string `yaml:"hub_branch"`
|
|
HubBranch string `yaml:"hub_branch"`
|
|
|
|
+ HubURLTemplate string `yaml:"__hub_url_template__,omitempty"`
|
|
SimulationConfig *SimulationConfig `yaml:"-"`
|
|
SimulationConfig *SimulationConfig `yaml:"-"`
|
|
DbConfig *DatabaseCfg `yaml:"-"`
|
|
DbConfig *DatabaseCfg `yaml:"-"`
|
|
|
|
|
|
@@ -16,6 +17,8 @@ type CscliCfg struct {
|
|
PrometheusUrl string `yaml:"prometheus_uri"`
|
|
PrometheusUrl string `yaml:"prometheus_uri"`
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+const defaultHubURLTemplate = "https://hub-cdn.crowdsec.net/%s/%s"
|
|
|
|
+
|
|
func (c *Config) loadCSCLI() error {
|
|
func (c *Config) loadCSCLI() error {
|
|
if c.Cscli == nil {
|
|
if c.Cscli == nil {
|
|
c.Cscli = &CscliCfg{}
|
|
c.Cscli = &CscliCfg{}
|
|
@@ -25,5 +28,9 @@ func (c *Config) loadCSCLI() error {
|
|
c.Cscli.PrometheusUrl = fmt.Sprintf("http://%s:%d/metrics", c.Prometheus.ListenAddr, c.Prometheus.ListenPort)
|
|
c.Cscli.PrometheusUrl = fmt.Sprintf("http://%s:%d/metrics", c.Prometheus.ListenAddr, c.Prometheus.ListenPort)
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ if c.Cscli.HubURLTemplate == "" {
|
|
|
|
+ c.Cscli.HubURLTemplate = defaultHubURLTemplate
|
|
|
|
+ }
|
|
|
|
+
|
|
return nil
|
|
return nil
|
|
}
|
|
}
|