Skip to content

Commit fd11279

Browse files
committed
RHAIENG-1023: fix(rstudio): update the esbuild inside of rstudio's installation as it was done in the poc (#2513)
1 parent dd06914 commit fd11279

File tree

8 files changed

+542
-4
lines changed

8 files changed

+542
-4
lines changed

rstudio/c9s-python-3.11/Dockerfile.cpu

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ RUN chmod -R a+w ${LIBLOC} && \
7878
chmod -R a+w ${R_LIBS_USER}
7979

8080
WORKDIR /tmp/
81+
COPY /rstudio/utils /tmp/utils
8182

8283
# Install RStudio
8384
ARG RSTUDIO_RPM=rstudio-server-rhel-2024.12.1-563-x86_64.rpm
@@ -92,7 +93,8 @@ RUN wget --progress=dot:giga https://download2.rstudio.org/server/rhel8/x86_64/$
9293
# install necessary texlive-framed package to make Knit R markup to PDF rendering possible
9394
dnf install -y libsodium-devel.x86_64 libgit2-devel.x86_64 libcurl-devel harfbuzz-devel.x86_64 fribidi-devel.x86_64 cmake "flexiblas-*" texlive-framed && \
9495
dnf clean all && \
95-
rm -rf /var/cache/yum
96+
rm -rf /var/cache/yum && \
97+
(cd /tmp/utils && ./cve_remediation.sh)
9698

9799
COPY ${RSTUDIO_SOURCE_CODE}/rsession.conf /etc/rstudio/rsession.conf
98100

rstudio/c9s-python-3.11/Dockerfile.cuda

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ RUN chmod -R a+w ${LIBLOC} && \
8080
chmod -R a+w ${R_LIBS_USER}
8181

8282
WORKDIR /tmp/
83+
COPY /rstudio/utils /tmp/utils
8384

8485
# Install RStudio
8586
ARG RSTUDIO_RPM=rstudio-server-rhel-2024.12.1-563-x86_64.rpm
@@ -94,7 +95,8 @@ RUN wget --progress=dot:giga https://download2.rstudio.org/server/rhel8/x86_64/$
9495
# install necessary texlive-framed package to make Knit R markup to PDF rendering possible
9596
dnf install -y libsodium-devel.x86_64 libgit2-devel.x86_64 libcurl-devel harfbuzz-devel.x86_64 fribidi-devel.x86_64 cmake "flexiblas-*" texlive-framed && \
9697
dnf clean all && \
97-
rm -rf /var/cache/yum
98+
rm -rf /var/cache/yum && \
99+
(cd /tmp/utils && ./cve_remediation.sh)
98100

99101
COPY ${RSTUDIO_SOURCE_CODE}/rsession.conf /etc/rstudio/rsession.conf
100102

rstudio/rhel9-python-3.11/Dockerfile.cpu

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ RUN chmod -R a+w ${LIBLOC} && \
9393
chmod -R a+w ${R_LIBS_USER}
9494

9595
WORKDIR /tmp/
96+
COPY /rstudio/utils /tmp/utils
9697

9798
# Install RStudio
9899
ARG RSTUDIO_RPM=rstudio-server-rhel-2024.12.1-563-x86_64.rpm
@@ -107,7 +108,8 @@ RUN wget --progress=dot:giga https://download2.rstudio.org/server/rhel9/x86_64/$
107108
# install necessary texlive-framed package to make Knit R markup to PDF rendering possible \
108109
dnf install -y libsodium-devel.x86_64 libgit2-devel.x86_64 libcurl-devel harfbuzz-devel.x86_64 fribidi-devel.x86_64 cmake "flexiblas-*" texlive-framed && \
109110
dnf clean all && \
110-
rm -rf /var/cache/yum
111+
rm -rf /var/cache/yum && \
112+
(cd /tmp/utils && ./cve_remediation.sh)
111113

112114
COPY ${RSTUDIO_SOURCE_CODE}/rsession.conf /etc/rstudio/rsession.conf
113115

rstudio/rhel9-python-3.11/Dockerfile.cuda

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@ RUN chmod -R a+w ${LIBLOC} && \
223223
chmod -R a+w ${R_LIBS_USER}
224224

225225
WORKDIR /tmp/
226+
COPY /rstudio/utils /tmp/utils
226227

227228
# Install RStudio
228229
ARG RSTUDIO_RPM=rstudio-server-rhel-2024.12.1-563-x86_64.rpm
@@ -237,7 +238,8 @@ RUN wget --progress=dot:giga https://download2.rstudio.org/server/rhel9/x86_64/$
237238
# install necessary texlive-framed package to make Knit R markup to PDF rendering possible \
238239
dnf install -y libsodium-devel.x86_64 libgit2-devel.x86_64 libcurl-devel harfbuzz-devel.x86_64 fribidi-devel.x86_64 cmake "flexiblas-*" texlive-framed && \
239240
dnf clean all && \
240-
rm -rf /var/cache/yum
241+
rm -rf /var/cache/yum && \
242+
(cd /tmp/utils && ./cve_remediation.sh)
241243

242244
COPY ${RSTUDIO_SOURCE_CODE}/rsession.conf /etc/rstudio/rsession.conf
243245

rstudio/utils/README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
## package.json
2+
3+
Used to manage the esbuild version that we inject into installed RStudio.
4+
5+
```shell
6+
# install dependencies from a lock file
7+
npm ci
8+
9+
# update the lock file
10+
npm install --package-lock-only
11+
```

rstudio/utils/cve_remediation.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/usr/bin/env bash
2+
set -Eeuxo pipefail
3+
4+
# CVE remediation
5+
# remediate CVEs introduced through older embedded version of esbuild
6+
rm "/usr/lib/rstudio-server/bin/quarto/bin/tools/$(uname -m)/esbuild"
7+
npm ci
8+
mv node_modules/esbuild/bin/esbuild "/usr/lib/rstudio-server/bin/quarto/bin/tools/$(uname -m)/"
9+
# clean up
10+
rm -r node_modules package.json package-lock.json
11+
npm cache clean --force

0 commit comments

Comments
 (0)