-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathDockerfile.integration
More file actions
28 lines (21 loc) · 989 Bytes
/
Dockerfile.integration
File metadata and controls
28 lines (21 loc) · 989 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# Image to run integration tests with real system commands (chpasswd, nmcli stub)
# Verifies that password change and WiFi connect use spawn/argv (no shell injection)
FROM node:21-bookworm-slim
WORKDIR /app
# Build tools + sudo (for chpasswd and nmcli stub in integration tests)
RUN apt-get update && apt-get install -y --no-install-recommends \
python3 make g++ sudo \
&& rm -rf /var/lib/apt/lists/*
# User futurebit (same as production) so chpasswd can be tested
RUN useradd -m -s /bin/bash futurebit
# Stub nmcli: log each argv on its own line (printf preserves args with quotes/semicolons)
RUN echo '#!/bin/sh' > /usr/local/bin/nmcli && \
echo 'printf "%s\n" "$@" > /tmp/nmcli-args; exit 1' >> /usr/local/bin/nmcli && \
chmod +x /usr/local/bin/nmcli
# Install app deps and copy app
COPY package.json ./
RUN npm install
COPY . .
# Run integration tests (real chpasswd + nmcli argv check)
ENV NODE_ENV=production
CMD ["node", "scripts/integration-test-runner.js"]