From b98dff947d6f899a8980606349616782e628bf11 Mon Sep 17 00:00:00 2001 From: Ruakij Date: Thu, 2 Dec 2021 14:54:32 +0100 Subject: [PATCH 1/3] Refactored packet to use new code-style (for got last time :/) --- src/dto/Packet.js | 48 +++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/src/dto/Packet.js b/src/dto/Packet.js index 712daea..e30a983 100644 --- a/src/dto/Packet.js +++ b/src/dto/Packet.js @@ -1,20 +1,20 @@ const PacketType = { - Beacon: 'Beacon', - ProbeRequest: 'ProbeRequest', - ProbeResponse: 'ProbeResponse', - Data: 'Data', - RequestToSend: 'RequestToSend', - ClearToSend: 'ClearToSend', - Acknowledgment: 'Acknowledgment', - BlockAcknowledgment: 'BlockAcknowledgment', - NoData: 'NoData', - Authentication: 'Authentication', - AssociationRequest: 'AssociationRequest', - AssociationResponse: 'AssociationResponse', - Disassociation: 'Disassociation', - Handshake: 'Handshake', - Unknown: 'Unknown' -} + Beacon: "Beacon", + ProbeRequest: "ProbeRequest", + ProbeResponse: "ProbeResponse", + Data: "Data", + RequestToSend: "RequestToSend", + ClearToSend: "ClearToSend", + Acknowledgment: "Acknowledgment", + BlockAcknowledgment: "BlockAcknowledgment", + NoData: "NoData", + Authentication: "Authentication", + AssociationRequest: "AssociationRequest", + AssociationResponse: "AssociationResponse", + Disassociation: "Disassociation", + Handshake: "Handshake", + Unknown: "Unknown" +}; const FlagType = { MoreFragments: "MoreFragments", @@ -23,7 +23,7 @@ const FlagType = { MoreData: "MoreData", Protected: "Protected", Order: "Order" -} +}; class Packet{ timestampMicros; @@ -58,9 +58,9 @@ class ProbeRequestPacket extends PacketWithSSID{} class ProbeResponsePacket extends PacketWithSSID{} const AuthenticationType = { - OpenSystem_1: 'OpenSystem_1', - OpenSystem_2: 'OpenSystem_2', - Unknown: 'Unknown', + OpenSystem_1: "OpenSystem_1", + OpenSystem_2: "OpenSystem_2", + Unknown: "Unknown", } class AuthenticationPacket extends Packet{ authenticationType; @@ -77,10 +77,10 @@ class DisassociationPacket extends Packet{ const HandshakeStage = { - 1: '1', - 2: '2', - 3: '3', - 4: '4' + 1: "1", + 2: "2", + 3: "3", + 4: "4" } class HandshakePacket extends Packet{ handshakeStage; From 298a96bf168e3090b0f5c29bff7b042dec6b2e70 Mon Sep 17 00:00:00 2001 From: Ruakij Date: Fri, 3 Dec 2021 10:48:28 +0100 Subject: [PATCH 2/3] apk-install on 1 line and delete cache when done --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index d7e4be0..65aee76 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,8 +7,8 @@ WORKDIR /usr/src/app COPY package*.json ./ RUN npm install -RUN apk update -RUN apk add tcpdump +# Install required apk-packages & delete cache +RUN apk update && apk add tcpdump && rm -rf /var/cache/apk/* # Bundle app source COPY ./src/ . From 57cf6fb0a7ae8b106278d843821339502a8a1645 Mon Sep 17 00:00:00 2001 From: Ruakij Date: Fri, 3 Dec 2021 10:50:50 +0100 Subject: [PATCH 3/3] Add npm prune (wont do much here) --- Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Dockerfile b/Dockerfile index 65aee76..c1cf0d0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,6 +7,9 @@ WORKDIR /usr/src/app COPY package*.json ./ RUN npm install +# remove development dependencies +RUN npm prune --production + # Install required apk-packages & delete cache RUN apk update && apk add tcpdump && rm -rf /var/cache/apk/*