2020-11-30 09:37:17 +00:00
|
|
|
package csconfig
|
|
|
|
|
|
|
|
import log "github.com/sirupsen/logrus"
|
|
|
|
|
|
|
|
type APICfg struct {
|
|
|
|
Client *LocalApiClientCfg `yaml:"client"`
|
|
|
|
Server *LocalApiServerCfg `yaml:"server"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type ApiCredentialsCfg struct {
|
|
|
|
URL string `yaml:"url,omitempty" json:"url,omitempty"`
|
|
|
|
Login string `yaml:"login,omitempty" json:"login,omitempty"`
|
|
|
|
Password string `yaml:"password,omitempty" json:"-"`
|
|
|
|
}
|
|
|
|
|
|
|
|
/*global api config (for lapi->oapi)*/
|
|
|
|
type OnlineApiClientCfg struct {
|
|
|
|
CredentialsFilePath string `yaml:"credentials_path,omitempty"` //credz will be edited by software, store in diff file
|
|
|
|
Credentials *ApiCredentialsCfg `yaml:"-"`
|
|
|
|
}
|
|
|
|
|
|
|
|
/*local api config (for crowdsec/cscli->lapi)*/
|
|
|
|
type LocalApiClientCfg struct {
|
|
|
|
CredentialsFilePath string `yaml:"credentials_path,omitempty"` //credz will be edited by software, store in diff file
|
|
|
|
Credentials *ApiCredentialsCfg `yaml:"-"`
|
|
|
|
InsecureSkipVerify *bool `yaml:"insecure_skip_verify"` // check if api certificate is bad or not
|
|
|
|
}
|
|
|
|
|
|
|
|
/*local api service configuration*/
|
|
|
|
type LocalApiServerCfg struct {
|
2021-02-09 18:10:14 +00:00
|
|
|
ListenURI string `yaml:"listen_uri,omitempty"` //127.0.0.1:8080
|
|
|
|
TLS *TLSCfg `yaml:"tls"`
|
|
|
|
DbConfig *DatabaseCfg `yaml:"-"`
|
|
|
|
LogDir string `yaml:"-"`
|
2021-02-11 17:28:01 +00:00
|
|
|
LogMedia string `yaml:"-"`
|
2021-02-09 18:10:14 +00:00
|
|
|
OnlineClient *OnlineApiClientCfg `yaml:"online_client"`
|
|
|
|
ProfilesPath string `yaml:"profiles_path,omitempty"`
|
|
|
|
Profiles []*ProfileCfg `yaml:"-"`
|
|
|
|
LogLevel *log.Level `yaml:"log_level"`
|
|
|
|
UseForwardedForHeaders bool `yaml:"use_forwarded_for_headers,omitempty"`
|
2020-11-30 09:37:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type TLSCfg struct {
|
|
|
|
CertFilePath string `yaml:"cert_file"`
|
|
|
|
KeyFilePath string `yaml:"key_file"`
|
|
|
|
}
|