Skip to content

Commit 694d217

Browse files
Merge pull request #5775 from Countly/SER-2124
[SER-2124] Bump puppeteer version
2 parents 3859fd6 + 0fb532c commit 694d217

File tree

7 files changed

+743
-147
lines changed

7 files changed

+743
-147
lines changed

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
Fixes:
33
- [dashboards] Fixing issue where dashboard widgets go into single column
44

5+
Security:
6+
- Bumped puppeteer from "17.1.3" to "23.8.0"
7+
58
## Version 24.05.18
69
Fixes:
710
- [core] Fixed bug where changing passwords results in the loss of the "Global Admin" role

Dockerfile-api

+5-4
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@ ENV COUNTLY_CONTAINER="api" \
1717
COUNTLY_CONFIG_API_API_WORKERS="1" \
1818
COUNTLY_CONFIG_API_API_HOST="0.0.0.0" \
1919
NODE_OPTIONS="--max-old-space-size=2048" \
20-
TINI_VERSION="0.18.0"
21-
20+
TINI_VERSION="0.18.0"\
21+
PUPPETEER_CACHE_DIR=/opt/countly/.cache/puppeteer
22+
2223
WORKDIR /opt/countly
2324
COPY . .
2425

@@ -58,7 +59,7 @@ RUN curl -s -L -o /tmp/tini.deb "https://github.com/krallin/tini/releases/downlo
5859
# cleanup & chown
5960
npm remove -y --no-save mocha nyc should supertest && \
6061
apt-get remove -y git gcc g++ make automake autoconf libtool pkg-config unzip sqlite3 && \
61-
apt-get install -y libgbm-dev libgbm1 gconf-service libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils && \
62+
apt-get install -y libgbm-dev libgbm1 gconf-service libasound2 libatk1.0-0 libatk-bridge2.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils && \
6263
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \
6364
rm -rf test /tmp/* /tmp/.??* /var/tmp/* /var/tmp/.??* /var/log/* /root/.npm && \
6465
\
@@ -75,4 +76,4 @@ USER 1001:0
7576

7677
ENTRYPOINT ["/usr/bin/tini", "-v", "--"]
7778

78-
CMD ["/opt/countly/bin/docker/cmd.sh"]
79+
CMD ["/opt/countly/bin/docker/cmd.sh"]

api/utils/render.js

+10-2
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,11 @@ exports.renderView = function(options, cb) {
6262

6363
var settings = {
6464
headless: true,
65+
env: {
66+
//https://github.com/hardkoded/puppeteer-sharp/issues/2633
67+
XDG_CONFIG_HOME: pathModule.resolve(__dirname, "../../.cache/chrome/tmp/.chromium"),
68+
XDG_CACHE_HOME: pathModule.resolve(__dirname, "../../.cache/chrome/tmp/.chromium")
69+
},
6570
args: ['--no-sandbox', '--disable-setuid-sandbox'],
6671
ignoreHTTPSErrors: true,
6772
userDataDir: pathModule.resolve(__dirname, "../../dump/chrome")
@@ -118,8 +123,11 @@ exports.renderView = function(options, cb) {
118123
};
119124

120125
page.setDefaultNavigationTimeout(updatedTimeout);
121-
122-
await page.goto(host + '/login/token/' + token + '?ssr=true');
126+
const resp = await page.goto(host + '/login/token/' + token + '?ssr=true');
127+
const status = resp?.status();
128+
if (status !== 200) {
129+
throw new Error(`Failed to open login page. Status: ${status}`);
130+
}
123131

124132
await page.waitForSelector('countly', {timeout: updatedTimeout});
125133

bin/countly.install_rhel.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ else
5555
fi
5656

5757
#Install dependancies required by the puppeteer
58-
sudo dnf install -y alsa-lib.x86_64 atk.x86_64 cups-libs.x86_64 gtk3.x86_64 libXcomposite.x86_64 libXcursor.x86_64 libXdamage.x86_64 libXext.x86_64 libXi.x86_64 libXrandr.x86_64 GConf2.x86_64 libXScrnSaver.x86_64 libXtst.x86_64 pango.x86_64 xorg-x11-fonts-100dpi xorg-x11-fonts-75dpi xorg-x11-fonts-cyrillic xorg-x11-fonts-misc xorg-x11-fonts-Type1 xorg-x11-utils
58+
sudo dnf install -y alsa-lib.x86_64 atk.x86_64 cups-libs.x86_64 gtk3.x86_64 libXcomposite.x86_64 libXcursor.x86_64 libXdamage.x86_64 libXext.x86_64 libXi.x86_64 libXrandr.x86_64 GConf2.x86_64 libXScrnSaver.x86_64 libXtst.x86_64 pango.x86_64 xorg-x11-fonts-100dpi xorg-x11-fonts-75dpi xorg-x11-fonts-cyrillic xorg-x11-fonts-misc xorg-x11-fonts-Type1 xorg-x11-utils libdrm libgbm at-spi2-atk libxkbcommon
5959
#Install nss after installing above dependencies
6060
sudo dnf update -y nss
6161

0 commit comments

Comments
 (0)