فهرست منبع

remove config.patch on master (#957)

* remove config.patch on master

* fix functional tests for plugins : replace group by nobody's actual group

* fix mock http server
Thibault "bui" Koechlin 3 سال پیش
والد
کامیت
21dfc784b1

+ 0 - 10
rpm/SOURCES/config.patch

@@ -1,10 +0,0 @@
---- config/config.yaml-orig	2021-05-10 20:52:35.540560498 +0200
-+++ config/config.yaml	2021-05-10 20:54:36.909254007 +0200
-@@ -16,6 +16,7 @@
-   parser_routines: 1
- cscli:
-   output: human
-+  hub_branch: master
- db_config:
-   log_level: info
-   type: sqlite

+ 1 - 3
rpm/SPECS/crowdsec.spec

@@ -10,8 +10,7 @@ Source0:        https://github.com/crowdsecurity/%{name}/archive/v%(echo $VERSIO
 Source1:        80-%{name}.preset
 Patch0:         crowdsec.unit.patch
 Patch1:         fix-wizard.patch
-Patch2:         config.patch
-Patch3:         user.patch
+Patch2:         user.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 BuildRequires:  git
@@ -37,7 +36,6 @@ BuildRequires:  systemd
 %patch0
 %patch1
 %patch2
-%patch3
 
 %build
 BUILD_VERSION=%{local_version} make

+ 1 - 1
scripts/func_tests/mock_http_server.py

@@ -5,7 +5,7 @@ class RequestHandler(BaseHTTPRequestHandler):
     def do_POST(self):
         request_path = self.path
         request_body = self.rfile.read(int(self.headers['Content-Length']))
-        request_body = json.loads(request_body)
+        request_body = json.loads(request_body.decode())
         log = {
             "path": request_path,
             "status": 200, 

+ 2 - 1
scripts/func_tests/tests_post-install_7_plugin.sh

@@ -23,9 +23,10 @@ function clear_backup() {
 function modify_config() {
     PLUGINS_DIR=$(find /usr -type d -wholename "*"crowdsec/plugins)
     sed -i "s#/usr/local/lib/crowdsec/plugins#${PLUGINS_DIR}#g" ./config/config.yaml
-    cat ./config/config.yaml | sudo tee /etc/crowdsec/config.yaml > /dev/null
+    cat ./config/config.yaml | sed 's/group: nogroup/group: '$(groups nobody | cut -d ':' -f2 | tr -d ' ')'/' | sudo tee /etc/crowdsec/config.yaml > /dev/null
     cat ./config/http.yaml | sudo tee /etc/crowdsec/notifications/http.yaml > /dev/null
     cat ./config/profiles.yaml | sudo tee /etc/crowdsec/profiles.yaml > /dev/null
+    
     ${SYSTEMCTL} restart crowdsec
     sleep 5s
 }