diff --git a/config/config.yaml b/config/config.yaml new file mode 100644 index 000000000..5cc650970 --- /dev/null +++ b/config/config.yaml @@ -0,0 +1,17 @@ +working_dir: /tmp/ +data_dir: /var/lib/crowdsec/data +config_dir: /etc/crowdsec/config/ +pid_dir: /var/run/ +log_dir: /var/log/crowdsec/ +cscli_dir: /etc/crowdsec/config/cscli +log_mode: file +log_level: info +profiling: false +sqlite_path: /var/lib/crowdsec/data/crowdsec.db +apimode: true +daemon: true +prometheus: true +#for prometheus agent / golang debugging +http_listen: 127.0.0.1:6060 +plugin: + backend: "/etc/crowdsec/plugins/backend" diff --git a/config/crowdsec.service b/config/crowdsec.service index 6a12bc6f3..d6c07785d 100644 --- a/config/crowdsec.service +++ b/config/crowdsec.service @@ -1,12 +1,11 @@ [Unit] -Description=Crowdwatch agent +Description=CrowdSec agent After=syslog.target network.target remote-fs.target nss-lookup.target [Service] Type=forking -PIDFile=${PID}/crowdsec.pid -#ExecStartPre=${BIN} -c ${CFG}/default.yaml -t -ExecStart=${BIN} -c ${CFG}/default.yaml +PIDFile=/var/run/crowdsec.pid +ExecStart=/usr/local/bin/crowdsec -c /etc/crowdsec/config/config.yaml ExecStartPost=/bin/sleep 0.1 ExecReload=/bin/kill -HUP $MAINPID diff --git a/nfpm.yaml b/nfpm.yaml new file mode 100644 index 000000000..ed028a246 --- /dev/null +++ b/nfpm.yaml @@ -0,0 +1,52 @@ +# nfpm example config file +name: "crowdsec" +arch: "amd64" +platform: "linux" +version: "v0.2.0" +section: "default" +priority: "extra" +#replaces: +#- foobar +#provides: +#- bar +#depends: +#- foo +#- bar +# recommends on rpm packages requires rpmbuild >= 4.13 +#recommends: +#- whatever +# suggests on rpm packages requires rpmbuild >= 4.13 +#suggests: +#- something-else +#conflicts: +#- not-foo +#- not-bar +maintainer: "Crowdsec " +description: | + Crowdsec - An open source, lightweight agent + to detect and respond to bad behaviors +vendor: "CrowdSec" +homepage: "https://www.github.com/crowdsecurity/crowdsec" +license: "MIT" +files: + ./cmd/crowdsec-cli/cscli: "/usr/local/bin/cscli" + ./cmd/crowdsec/crowdsec: "/usr/local/bin/crowdsec" + ./wizard.sh: "/usr/local/bin/cswizard" + ./config/api.yaml: "/etc/crowdsec/config/api.yaml" + ./config/crowdsec_pull: "/etc/cron.d/crowdsec_pull" + ./config/crowdsec.service: "/etc/systemd/system/crowdsec.service" + ./config/config.yaml: "/etc/crowdsec/config/config.yaml" + ./config/profiles.yaml: "/etc/crowdsec/config/profiles.yaml" + ./config/user.yaml: "/etc/crowdsec/config/user.yaml" + ./config/patterns/* : "/etc/crowdsec/config/patterns/" + +empty_folders: + - /var/log/crowdsec/ +overrides: +# rpm: +# scripts: +# preinstall: ./scripts/preinstall.sh +# postremove: ./scripts/postremove.sh + deb: + scripts: + postinstall: ./scripts/post_install_deb.sh diff --git a/scripts/post_install_deb.sh b/scripts/post_install_deb.sh new file mode 100644 index 000000000..83866781f --- /dev/null +++ b/scripts/post_install_deb.sh @@ -0,0 +1 @@ +systemctl daemon-reload \ No newline at end of file