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
This commit is contained in:
Thibault "bui" Koechlin 2021-09-09 19:12:44 +02:00 committed by GitHub
parent 055a0f08cb
commit 21dfc784b1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 4 additions and 15 deletions

View file

@ -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

View file

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

View file

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

View file

@ -23,9 +23,10 @@ function clear_backup() {
function modify_config() { function modify_config() {
PLUGINS_DIR=$(find /usr -type d -wholename "*"crowdsec/plugins) PLUGINS_DIR=$(find /usr -type d -wholename "*"crowdsec/plugins)
sed -i "s#/usr/local/lib/crowdsec/plugins#${PLUGINS_DIR}#g" ./config/config.yaml 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/http.yaml | sudo tee /etc/crowdsec/notifications/http.yaml > /dev/null
cat ./config/profiles.yaml | sudo tee /etc/crowdsec/profiles.yaml > /dev/null cat ./config/profiles.yaml | sudo tee /etc/crowdsec/profiles.yaml > /dev/null
${SYSTEMCTL} restart crowdsec ${SYSTEMCTL} restart crowdsec
sleep 5s sleep 5s
} }