瀏覽代碼

build with nfpm

AlteredCoder 5 年之前
父節點
當前提交
e1048e1173
共有 4 個文件被更改,包括 73 次插入4 次删除
  1. 17 0
      config/config.yaml
  2. 3 4
      config/crowdsec.service
  3. 52 0
      nfpm.yaml
  4. 1 0
      scripts/post_install_deb.sh

+ 17 - 0
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"

+ 3 - 4
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
 

+ 52 - 0
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 <crowdsec@crowdsec.net>"
+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

+ 1 - 0
scripts/post_install_deb.sh

@@ -0,0 +1 @@
+systemctl daemon-reload