Merge pull request #24 from crowdsecurity/fix_package_name
Fix package name
This commit is contained in:
commit
4bb1e69b40
|
@ -10,7 +10,7 @@ import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/crowdsecurity/crowdsec/pkg/acquisition"
|
"github.com/crowdsecurity/crowdsec/pkg/acquisition"
|
||||||
config "github.com/crowdsecurity/crowdsec/pkg/config/crowdsec"
|
"github.com/crowdsecurity/crowdsec/pkg/csconfig"
|
||||||
"github.com/crowdsecurity/crowdsec/pkg/cwversion"
|
"github.com/crowdsecurity/crowdsec/pkg/cwversion"
|
||||||
leaky "github.com/crowdsecurity/crowdsec/pkg/leakybucket"
|
leaky "github.com/crowdsecurity/crowdsec/pkg/leakybucket"
|
||||||
"github.com/crowdsecurity/crowdsec/pkg/outputs"
|
"github.com/crowdsecurity/crowdsec/pkg/outputs"
|
||||||
|
@ -33,7 +33,7 @@ var (
|
||||||
|
|
||||||
holders []leaky.BucketFactory
|
holders []leaky.BucketFactory
|
||||||
buckets *leaky.Buckets
|
buckets *leaky.Buckets
|
||||||
cConfig *config.Crowdwatch
|
cConfig *csconfig.CrowdSec
|
||||||
|
|
||||||
/*settings*/
|
/*settings*/
|
||||||
lastProcessedItem time.Time /*keep track of last item timestamp in time-machine. it is used to GC buckets when we dump them.*/
|
lastProcessedItem time.Time /*keep track of last item timestamp in time-machine. it is used to GC buckets when we dump them.*/
|
||||||
|
@ -85,7 +85,7 @@ func main() {
|
||||||
inputLineChan := make(chan types.Event)
|
inputLineChan := make(chan types.Event)
|
||||||
inputEventChan := make(chan types.Event)
|
inputEventChan := make(chan types.Event)
|
||||||
|
|
||||||
cConfig = config.NewCrowdwatchConfig()
|
cConfig = csconfig.NewCrowdSecConfig()
|
||||||
|
|
||||||
// Handle command line arguments
|
// Handle command line arguments
|
||||||
if err := cConfig.GetOPT(); err != nil {
|
if err := cConfig.GetOPT(); err != nil {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package config
|
package csconfig
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"flag"
|
"flag"
|
||||||
|
@ -15,8 +15,8 @@ import (
|
||||||
"gopkg.in/yaml.v2"
|
"gopkg.in/yaml.v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Crowdwatch is the structure of the crowdsec configuration
|
// CrowdSec is the structure of the crowdsec configuration
|
||||||
type Crowdwatch struct {
|
type CrowdSec struct {
|
||||||
WorkingFolder string `yaml:"working_dir,omitempty"`
|
WorkingFolder string `yaml:"working_dir,omitempty"`
|
||||||
DataFolder string `yaml:"data_dir,omitempty"`
|
DataFolder string `yaml:"data_dir,omitempty"`
|
||||||
ConfigFolder string `yaml:"config_dir,omitempty"`
|
ConfigFolder string `yaml:"config_dir,omitempty"`
|
||||||
|
@ -40,9 +40,9 @@ type Crowdwatch struct {
|
||||||
OutputConfig *outputs.OutputFactory `yaml:"plugin"`
|
OutputConfig *outputs.OutputFactory `yaml:"plugin"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewCrowdwatchConfig create a new crowdsec configuration with default configuration
|
// NewCrowdSecConfig create a new crowdsec configuration with default configuration
|
||||||
func NewCrowdwatchConfig() *Crowdwatch {
|
func NewCrowdSecConfig() *CrowdSec {
|
||||||
return &Crowdwatch{
|
return &CrowdSec{
|
||||||
LogLevel: log.InfoLevel,
|
LogLevel: log.InfoLevel,
|
||||||
Daemonize: false,
|
Daemonize: false,
|
||||||
Profiling: false,
|
Profiling: false,
|
||||||
|
@ -60,7 +60,7 @@ func NewCrowdwatchConfig() *Crowdwatch {
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetOPT return flags parsed from command line
|
// GetOPT return flags parsed from command line
|
||||||
func (c *Crowdwatch) GetOPT() error {
|
func (c *CrowdSec) GetOPT() error {
|
||||||
|
|
||||||
AcquisitionFile := flag.String("acquis", "", "path to acquis.yaml")
|
AcquisitionFile := flag.String("acquis", "", "path to acquis.yaml")
|
||||||
configFile := flag.String("c", "", "configuration file")
|
configFile := flag.String("c", "", "configuration file")
|
Loading…
Reference in a new issue