19 Commits

Author SHA1 Message Date
09e86de93d Merge branch 'release-2.1' 2022-11-21 19:42:17 +01:00
4bdaae0c70 Merge branch 'dev' into release-2.1 2022-11-21 19:42:06 +01:00
41302b9f9f Set bash args as extra-args 2022-11-14 23:02:47 +01:00
ad8d546b78 Utilize Multi-stage building to reduce Image-size 2022-11-14 22:39:57 +01:00
d5a727c3df Make executeable 2022-11-14 21:19:37 +01:00
d5c7f0a580 Make apk package install more elegant 2022-11-14 19:13:32 +01:00
7469565f52 Merge branch 'dev' 2021-12-19 17:26:19 +01:00
6c848c0e42 Merge branch 'release-2.1' 2021-12-10 22:39:33 +01:00
918306647d Fixed chunk-error not being stopped after handling 2021-12-10 22:39:21 +01:00
1bc52b0a37 Merge branch 'release-2.1' 2021-12-10 20:09:29 +01:00
3b10aca352 Added chunk-check against undefined 2021-12-10 20:09:05 +01:00
b1942b89cb Merge branch 'release-2.1' 2021-12-09 18:18:22 +01:00
5303b31bd7 Merge branch 'release-2.0' 2021-12-06 13:32:34 +01:00
c3cd6393d4 Merge branch 'release-2.0' 2021-12-06 13:01:31 +01:00
c97137f4a7 Merge branch 'release-2' 2021-12-06 12:47:14 +01:00
a13d81e9c0 Merge branch 'release-1.1' 2021-12-03 10:53:35 +01:00
059c02e243 Merge branch 'dev' into release-1.1 2021-12-03 10:53:13 +01:00
a610f209d5 Merge branch 'release-1.1' 2021-12-02 14:08:54 +01:00
6e05a0b45c Merge branch 'release-1.0' 2021-11-29 15:55:27 +01:00
4 changed files with 28 additions and 11 deletions

View File

@@ -1,19 +1,29 @@
FROM node:16-alpine
# ---- Base ----
FROM alpine:3 AS base
# Create app directory
WORKDIR /usr/src/app
# Copy project file
COPY package.json .
# Install required apk-packages
RUN apk add --no-cache nodejs npm tcpdump
# ---- Dependencies ----
FROM base AS dependencies
# Install app dependencies
COPY package*.json ./
RUN npm install
RUN npm install --only=production
# remove development dependencies
RUN npm prune --production
# Install required apk-packages & delete cache
RUN apk update && apk add tcpdump && rm -rf /var/cache/apk/*
# ---- Release ----
FROM base AS release
# copy from build image
COPY --from=dependencies /usr/src/app/ ./
# Bundle app source
COPY ./src/ .
CMD ["npm", "run", "start"]
CMD ["npm", "run", "start"]

View File

@@ -1,6 +1,6 @@
TAG="ruakij/rfmon-to-influx"
PLATFORM="linux/amd64,linux/arm64/v8,linux/arm/v7"
EXTRA_ARGS=""
EXTRA_ARGS="$@"
docker buildx build \
--platform $PLATFORM \

2
build/docker-ownarch.sh Normal file → Executable file
View File

@@ -1,5 +1,5 @@
TAG="ruakij/rfmon-to-influx"
EXTRA_ARGS=""
EXTRA_ARGS="$@"
docker build \
--tag $TAG \

View File

@@ -47,8 +47,15 @@ class PacketStreamFactory extends Transform{
}
_transform(chunk, encoding, next){
let packet = new Packet();
if(!chunk){
const err = "Chunk was invalid!";
logger.error(err);
next(err);
return;
}
let packet = new Packet();
const lines = chunk.split("\n");
const header = lines.splice(0, 1)[0]; // Grab first line, "lines" is now the payload
packet = this._handleHeader(packet, header);