From 2d824543d192c52a9936d52f71f1d5558a402841 Mon Sep 17 00:00:00 2001 From: Ruakij Date: Mon, 29 Nov 2021 13:09:49 +0100 Subject: [PATCH 1/4] fixed cmd --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 98ec383..5acf3bc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,4 +10,4 @@ RUN npm install # Bundle app source COPY ./src/ . -CMD ["npm", "run"] \ No newline at end of file +CMD ["npm", "run", "start"] \ No newline at end of file From e320d8670beeaaeb1791c396b397a7e14a376020 Mon Sep 17 00:00:00 2001 From: Ruakij Date: Mon, 29 Nov 2021 13:10:05 +0100 Subject: [PATCH 2/4] Add installation of package tcpdump --- Dockerfile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Dockerfile b/Dockerfile index 5acf3bc..ff467e9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,6 +7,10 @@ WORKDIR /usr/src/app COPY package*.json ./ RUN npm install +RUN apt-get update +RUN apt-get -y install \ + tcpdump + # Bundle app source COPY ./src/ . From d9ee804c3b20761f98227802e5b992db90fe4738 Mon Sep 17 00:00:00 2001 From: Ruakij Date: Mon, 29 Nov 2021 13:10:44 +0100 Subject: [PATCH 3/4] Removed src-references as hats the workdir --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 4f3a8dd..309915b 100644 --- a/package.json +++ b/package.json @@ -2,10 +2,10 @@ "name": "rfmon-to-influx", "version": "1.0.0", "description": "Writing (mostly meta-) data received in Wireless-Monitor-Mode into an InfluxDB", - "main": "src/main.js", + "main": "main.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1", - "start": "node src/main.js" + "start": "node main.js" }, "repository": { "type": "git", From a681bbd2d296aae2a08b15a630da147d41f9ad28 Mon Sep 17 00:00:00 2001 From: Ruakij Date: Mon, 29 Nov 2021 13:11:11 +0100 Subject: [PATCH 4/4] Removed sudo as container runs as root anyways --- src/main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.js b/src/main.js index 3726245..9e6fd77 100644 --- a/src/main.js +++ b/src/main.js @@ -56,7 +56,7 @@ if(errorMsg){ logger.info("Starting tcpdump.."); const TCPDUMP_BASECMD = "tcpdump -vvv -e -n -X -s0 -i" - let cmd = `sudo ${TCPDUMP_BASECMD} ${env.WIFI_INTERFACE}`; + let cmd = `${TCPDUMP_BASECMD} ${env.WIFI_INTERFACE}`; let proc = exec(cmd); logger.debug("Creating & Attaching streams..");