forked from openstf/stf
-
Notifications
You must be signed in to change notification settings - Fork 507
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrading STF for security reasons (#813)
* Upgrading STF for security reasons Signed-off-by: Denis barbaron <[email protected]> * update semaphore files Signed-off-by: Denis barbaron <[email protected]> * upgrading STF for security reasons v2 Signed-off-by: Denis barbaron <[email protected]> * update yarn.lock file Signed-off-by: Denis barbaron <[email protected]> --------- Signed-off-by: Denis barbaron <[email protected]>
- Loading branch information
1 parent
e204b03
commit 2f54e40
Showing
48 changed files
with
2,437 additions
and
1,161 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
17.9.0 | ||
v22.11.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
nodejs 17.9.0 | ||
nodejs 22.11.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,34 @@ | ||
# | ||
# Copyright © 2020,2022 code initially contributed by Orange SA, authors: Denis Barbaron - Licensed under the Apache license 2.0 | ||
# Copyright © 2020-2024 code initially contributed by Orange SA, authors: Denis Barbaron - Licensed under the Apache license 2.0 | ||
# | ||
|
||
FROM arm64v8/debian:buster-slim | ||
FROM arm64v8/debian:bookworm-slim | ||
|
||
LABEL Maintainer="Denis Barbaron <[email protected]>" | ||
LABEL Name="STF" | ||
LABEL Url="https://github.com/devicefarmer/stf/" | ||
LABEL Description="STF docker image for arm64 architecture" | ||
|
||
# Sneak the stf executable into $PATH. | ||
ENV PATH /app/bin:$PATH | ||
ENV PATH=/app/bin:$PATH | ||
|
||
# Work in app dir by default. | ||
WORKDIR /app | ||
|
||
# Copy app source. | ||
COPY . /tmp/build/ | ||
|
||
# Install app requirement | ||
# Install app requirements | ||
RUN export DEBIAN_FRONTEND=noninteractive && \ | ||
echo '--- Updating repositories' && \ | ||
apt-get update && \ | ||
echo '--- Upgrading repositories' && \ | ||
apt-get -y dist-upgrade && \ | ||
echo '--- Building node' && \ | ||
apt-get -y install wget python3 build-essential cmake && \ | ||
apt-get -y install pkg-config curl zip unzip wget python3 build-essential cmake ninja-build && \ | ||
cd /tmp && \ | ||
wget --progress=dot:mega \ | ||
https://nodejs.org/dist/v17.9.0/node-v17.9.0-linux-arm64.tar.xz && \ | ||
https://nodejs.org/dist/v22.11.0/node-v22.11.0-linux-arm64.tar.xz && \ | ||
tar -xJf node-v*.tar.xz --strip-components 1 -C /usr/local && \ | ||
rm node-v*.tar.xz && \ | ||
useradd --system \ | ||
|
@@ -42,26 +44,32 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ | |
cd /tmp/build && \ | ||
export PATH=$PWD/node_modules/.bin:$PATH && \ | ||
sed -i'' -e '/phantomjs/d' package.json && \ | ||
echo 'npm install --python="/usr/bin/python3" --no-optional --loglevel http' | su stf -s /bin/bash && \ | ||
export VCPKG_FORCE_SYSTEM_BINARIES="arm" && \ | ||
echo 'npm install --save-dev pnpm' | su stf -s /bin/bash && \ | ||
echo 'npm install --python="/usr/bin/python3" --omit=optional --loglevel http' | su stf -s /bin/bash && \ | ||
echo '--- Assembling app' && \ | ||
echo 'npm pack' | su stf -s /bin/bash && \ | ||
tar xzf devicefarmer-stf-*.tgz --strip-components 1 -C /app && \ | ||
echo '/tmp/build/node_modules/.bin/bower cache clean' | su stf -s /bin/bash && \ | ||
echo 'npm prune --production' | su stf -s /bin/bash && \ | ||
echo 'npm prune --omit=dev' | su stf -s /bin/bash && \ | ||
mv node_modules /app && \ | ||
chown -R root:root /app && \ | ||
echo '--- Cleaning up' && \ | ||
echo 'npm cache clean --force' | su stf -s /bin/bash && \ | ||
rm -rf ~/.node-gyp && \ | ||
apt-get -y purge wget python3 build-essential && \ | ||
apt-get -y purge pkg-config curl zip unzip wget python3 build-essential cmake ninja-build && \ | ||
apt-get -y clean && \ | ||
apt-get -y autoremove && \ | ||
cd /home/stf && \ | ||
rm -rf vcpkg .npm .cache .cmake-ts .config .local && \ | ||
rm -rf /var/cache/apt/* /var/lib/apt/lists/* && \ | ||
cd /app && \ | ||
rm -rf doc .github .tx .semaphore *.md *.yaml LICENSE Dockerfile* \ | ||
.eslintrc .nvmrc .tool-versions res/.eslintrc && \ | ||
rm -rf /tmp/* | ||
|
||
# Switch to the app user. | ||
USER stf | ||
|
||
# Show help by default. | ||
CMD stf --help | ||
CMD ["stf", "--help"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,67 +1,75 @@ | ||
# | ||
# Copyright © 2020,2022 code initially contributed by Orange SA, authors: Denis Barbaron - Licensed under the Apache license 2.0 | ||
# Copyright © 2020-2024 code initially contributed by Orange SA, authors: Denis Barbaron - Licensed under the Apache license 2.0 | ||
# | ||
|
||
FROM arm32v7/debian:buster-slim | ||
FROM arm32v7/debian:bookworm-slim | ||
|
||
LABEL Maintainer="Denis Barbaron <[email protected]>" | ||
LABEL Name="STF" | ||
LABEL Url="https://github.com/devicefarmer/stf/" | ||
LABEL Description="STF docker image for armhf architecture" | ||
|
||
# Sneak the stf executable into $PATH. | ||
ENV PATH /app/bin:$PATH | ||
ENV PATH=/app/bin:$PATH | ||
|
||
# Work in app dir by default. | ||
WORKDIR /app | ||
|
||
# Copy app source. | ||
COPY . /tmp/build/ | ||
|
||
# Install app requirement | ||
# Install app requirements | ||
RUN export DEBIAN_FRONTEND=noninteractive && \ | ||
echo '--- Updating repositories' && \ | ||
apt-get update && \ | ||
echo '--- Upgrading repositories' && \ | ||
apt-get -y dist-upgrade && \ | ||
echo '--- Building node' && \ | ||
apt-get -y install wget python3 build-essential cmake && \ | ||
apt-get -y install pkg-config curl zip unzip wget python3 build-essential cmake ninja-build && \ | ||
cd /tmp && \ | ||
wget --progress=dot:mega \ | ||
https://nodejs.org/dist/v17.9.0/node-v17.9.0-linux-armv7l.tar.xz && \ | ||
https://nodejs.org/dist/v22.11.0/node-v22.11.0-linux-armv7l.tar.xz && \ | ||
tar -xJf node-v*.tar.xz --strip-components 1 -C /usr/local && \ | ||
rm node-v*.tar.xz && \ | ||
useradd --system \ | ||
--create-home \ | ||
--shell /usr/sbin/nologin \ | ||
stf && \ | ||
su stf -s /bin/bash -c '/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js install' && \ | ||
apt-get -y install --no-install-recommends libzmq3-dev libprotobuf-dev git graphicsmagick yasm && \ | ||
apt-get -y install --no-install-recommends libatomic1 libzmq3-dev libprotobuf-dev git graphicsmagick yasm && \ | ||
echo '--- Building app' && \ | ||
mkdir -p /app && \ | ||
chown -R stf:stf /tmp/build && \ | ||
set -x && \ | ||
cd /tmp/build && \ | ||
export PATH=$PWD/node_modules/.bin:$PATH && \ | ||
sed -i'' -e '/phantomjs/d' package.json && \ | ||
echo 'npm install --python="/usr/bin/python3" --no-optional --loglevel http' | su stf -s /bin/bash && \ | ||
export VCPKG_FORCE_SYSTEM_BINARIES="arm" && \ | ||
echo 'npm install --save-dev pnpm' | su stf -s /bin/bash && \ | ||
echo 'npm install --python="/usr/bin/python3" --omit=optional --loglevel http' | su stf -s /bin/bash && \ | ||
echo '--- Assembling app' && \ | ||
echo 'npm pack' | su stf -s /bin/bash && \ | ||
tar xzf devicefarmer-stf-*.tgz --strip-components 1 -C /app && \ | ||
echo '/tmp/build/node_modules/.bin/bower cache clean' | su stf -s /bin/bash && \ | ||
echo 'npm prune --production' | su stf -s /bin/bash && \ | ||
echo 'npm prune --omit=dev' | su stf -s /bin/bash && \ | ||
mv node_modules /app && \ | ||
chown -R root:root /app && \ | ||
echo '--- Cleaning up' && \ | ||
echo 'npm cache clean --force' | su stf -s /bin/bash && \ | ||
rm -rf ~/.node-gyp && \ | ||
apt-get -y purge wget python3 build-essential && \ | ||
apt-get -y purge pkg-config curl zip unzip wget python3 build-essential cmake ninja-build && \ | ||
apt-get -y clean && \ | ||
apt-get -y autoremove && \ | ||
cd /home/stf && \ | ||
rm -rf vcpkg .npm .cache .cmake-ts .config .local && \ | ||
rm -rf /var/cache/apt/* /var/lib/apt/lists/* && \ | ||
cd /app && \ | ||
rm -rf doc .github .tx .semaphore *.md *.yaml LICENSE Dockerfile* \ | ||
.eslintrc .nvmrc .tool-versions res/.eslintrc && \ | ||
rm -rf /tmp/* | ||
|
||
# Switch to the app user. | ||
USER stf | ||
|
||
# Show help by default. | ||
CMD stf --help | ||
CMD ["stf", "--help"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
# | ||
# Copyright © 2020,2022 code initially contributed by Orange SA, authors: Denis Barbaron - Licensed under the Apache license 2.0 | ||
# Copyright © 2020-2024 code initially contributed by Orange SA, authors: Denis Barbaron - Licensed under the Apache license 2.0 | ||
# | ||
|
||
FROM debian:buster-slim | ||
FROM debian:bookworm-slim | ||
|
||
LABEL Maintainer="Denis Barbaron <[email protected]>" | ||
LABEL Name="STF" | ||
LABEL Url="https://github.com/devicefarmer/stf/" | ||
LABEL Description="STF docker image for x86_64 architecture" | ||
|
||
# Sneak the stf executable into $PATH. | ||
ENV PATH /app/bin:$PATH | ||
ENV PATH=/app/bin:$PATH | ||
|
||
# Work in app dir by default. | ||
WORKDIR /app | ||
|
@@ -22,11 +22,13 @@ COPY . /tmp/build/ | |
RUN export DEBIAN_FRONTEND=noninteractive && \ | ||
echo '--- Updating repositories' && \ | ||
apt-get update && \ | ||
echo '--- Upgrading repositories' && \ | ||
apt-get -y dist-upgrade && \ | ||
echo '--- Building node' && \ | ||
apt-get -y install wget python3 build-essential && \ | ||
cd /tmp && \ | ||
wget --progress=dot:mega \ | ||
https://nodejs.org/dist/v17.9.0/node-v17.9.0-linux-x64.tar.xz && \ | ||
https://nodejs.org/dist/v22.11.0/node-v22.11.0-linux-x64.tar.xz && \ | ||
tar -xJf node-v*.tar.xz --strip-components 1 -C /usr/local && \ | ||
rm node-v*.tar.xz && \ | ||
useradd --system \ | ||
|
@@ -42,12 +44,12 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ | |
cd /tmp/build && \ | ||
export PATH=$PWD/node_modules/.bin:$PATH && \ | ||
sed -i'' -e '/phantomjs/d' package.json && \ | ||
echo 'npm install --python="/usr/bin/python3" --no-optional --loglevel http' | su stf -s /bin/bash && \ | ||
echo 'npm install --python="/usr/bin/python3" --omit=optional --loglevel http' | su stf -s /bin/bash && \ | ||
echo '--- Assembling app' && \ | ||
echo 'npm pack' | su stf -s /bin/bash && \ | ||
tar xzf devicefarmer-stf-*.tgz --strip-components 1 -C /app && \ | ||
echo '/tmp/build/node_modules/.bin/bower cache clean' | su stf -s /bin/bash && \ | ||
echo 'npm prune --production' | su stf -s /bin/bash && \ | ||
echo 'npm prune --omit=dev' | su stf -s /bin/bash && \ | ||
mv node_modules /app && \ | ||
chown -R root:root /app && \ | ||
echo '--- Cleaning up' && \ | ||
|
@@ -56,12 +58,16 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ | |
apt-get -y purge wget python3 build-essential && \ | ||
apt-get -y clean && \ | ||
apt-get -y autoremove && \ | ||
cd /home/stf && \ | ||
rm -rf .npm .cache .config .local && \ | ||
rm -rf /var/cache/apt/* /var/lib/apt/lists/* && \ | ||
cd /app && \ | ||
rm -rf doc .github .tx .semaphore *.md *.yaml LICENSE Dockerfile* \ | ||
.eslintrc .nvmrc .tool-versions res/.eslintrc && \ | ||
rm -rf /tmp/* | ||
|
||
# Switch to the app user. | ||
USER stf | ||
|
||
# Show help by default. | ||
CMD stf --help | ||
CMD ["stf", "--help"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
#!/usr/bin/env node | ||
#!/usr/bin/env -S node --no-deprecation | ||
require('../lib/cli/please') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.