From 06e6ac775701dd72b08985ac39784075eb6ed18e Mon Sep 17 00:00:00 2001 From: AlteredCoder Date: Thu, 25 Jun 2020 18:37:49 +0200 Subject: [PATCH] update --- cmd/crowdsec-cli/backup-restore.go | 6 +++--- cmd/crowdsec-cli/main.go | 2 +- config/config.yaml | 2 +- nfpm.yaml | 5 ++++- scripts/post_install_deb.sh | 6 +++++- 5 files changed, 14 insertions(+), 7 deletions(-) diff --git a/cmd/crowdsec-cli/backup-restore.go b/cmd/crowdsec-cli/backup-restore.go index 747de7124..079351d45 100644 --- a/cmd/crowdsec-cli/backup-restore.go +++ b/cmd/crowdsec-cli/backup-restore.go @@ -339,10 +339,10 @@ func backupToDirectory(target string) error { } log.Infof("Saved acquis to %s", bac) /* - Backup default.yaml + Backup config.yaml */ - defyaml := fmt.Sprintf("%s/default.yaml", config.InstallFolder) - bac = fmt.Sprintf("%s/default.yaml", target) + defyaml := fmt.Sprintf("%s/config.yaml", config.InstallFolder) + bac = fmt.Sprintf("%s/config.yaml", target) if err = copyFile(defyaml, bac); err != nil { return fmt.Errorf("failed copy %s to %s : %s", yamlAcquisFile, bac, err) } diff --git a/cmd/crowdsec-cli/main.go b/cmd/crowdsec-cli/main.go index aa86a6f20..d3d54e4d7 100644 --- a/cmd/crowdsec-cli/main.go +++ b/cmd/crowdsec-cli/main.go @@ -113,7 +113,7 @@ API interaction: rootCmd.AddCommand(cmdVersion) //rootCmd.PersistentFlags().BoolVarP(&config.simulation, "simulate", "s", false, "No action; perform a simulation of events that would occur based on the current arguments.") - rootCmd.PersistentFlags().StringVarP(&config.ConfigFilePath, "config", "c", "/etc/crowdsec/config/default.yaml", "path to crowdsec config file (default: /etc/crowdsec/config/default.yaml)") + rootCmd.PersistentFlags().StringVarP(&config.ConfigFilePath, "config", "c", "/etc/crowdsec/config/config.yaml", "path to crowdsec config file (default: /etc/crowdsec/config/config.yaml)") rootCmd.PersistentFlags().StringVarP(&config.output, "output", "o", "human", "Output format : human, json, raw.") rootCmd.PersistentFlags().BoolVar(&dbg_lvl, "debug", false, "Set logging to debug.") diff --git a/config/config.yaml b/config/config.yaml index 5cc650970..b66fc9126 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -2,7 +2,7 @@ working_dir: /tmp/ data_dir: /var/lib/crowdsec/data config_dir: /etc/crowdsec/config/ pid_dir: /var/run/ -log_dir: /var/log/crowdsec/ +log_dir: /var/log/ cscli_dir: /etc/crowdsec/config/cscli log_mode: file log_level: info diff --git a/nfpm.yaml b/nfpm.yaml index ed028a246..1406852f7 100644 --- a/nfpm.yaml +++ b/nfpm.yaml @@ -39,9 +39,12 @@ files: ./config/profiles.yaml: "/etc/crowdsec/config/profiles.yaml" ./config/user.yaml: "/etc/crowdsec/config/user.yaml" ./config/patterns/* : "/etc/crowdsec/config/patterns/" + ./plugins/backend/*.so: "/usr/local/lib/crowdsec/plugins/backend" + ./config/plugins/backend/*.yaml: "/etc/crowdsec/plugins/backend" empty_folders: - - /var/log/crowdsec/ + - /etc/crowdsec/config/cscli + - /var/lib/crowdsec/data/ overrides: # rpm: # scripts: diff --git a/scripts/post_install_deb.sh b/scripts/post_install_deb.sh index 83866781f..7eb662111 100644 --- a/scripts/post_install_deb.sh +++ b/scripts/post_install_deb.sh @@ -1 +1,5 @@ -systemctl daemon-reload \ No newline at end of file +systemctl daemon-reload +cscli update +cscli install collection crowdsecurity/linux +cscli install scenario crowdsecurity/ssh-bf +systemctl start crowdsec \ No newline at end of file