Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
106 commits
Select commit Hold shift + click to select a range
2809190
Guide updated
bmblb May 12, 2023
fa35180
Merge pull request #12 from bryntum/doc-update
bmblb May 12, 2023
a059e7a
different way to get chromium revision from puppeteer package
rostacik Dec 29, 2023
bb83295
Merge pull request #19 from rostacik/main
bmblb Mar 11, 2024
d5412e1
update readme
bmblb Nov 20, 2024
7641b4c
upgdrade node, puppeteer and muhammara
bmblb Jan 15, 2025
31b5e60
2.0.0
bmblb Jan 16, 2025
676c1e5
upgrade packages
bmblb Jan 16, 2025
4e1de77
cleanup
bmblb Jan 16, 2025
811976d
docker updated
bmblb Jan 16, 2025
e5a0813
disable sandbox
bmblb Jan 16, 2025
88ebc8f
Merge pull request #26 from bryntum/upgrading-packages
bmblb Jan 16, 2025
a95ee2a
compatibility note
bmblb Jan 16, 2025
23d7cc0
Merge pull request #27 from bryntum/upgrading-packages
bmblb Jan 16, 2025
30c2107
upgrade workflow
bmblb Jan 16, 2025
a5aecdf
upgrade workflow
bmblb Jan 16, 2025
48f7641
upgrade workflow
bmblb Jan 16, 2025
74773df
upgrade workflow
bmblb Jan 16, 2025
6220b2e
upgrade workflow
bmblb Jan 16, 2025
35aa8fd
upgrade workflow
bmblb Jan 16, 2025
a424e9f
add supported node versions to readme
bmblb Mar 11, 2025
93e28d9
readme update
bmblb Mar 11, 2025
9259342
WIP
bmblb Apr 17, 2025
c8b6a70
WIP
bmblb Apr 18, 2025
5d2fad7
2.0.1
bmblb Apr 18, 2025
d5d6bb7
WIP
bmblb Apr 18, 2025
f9bbab1
update package-lock
bmblb Apr 18, 2025
603fd34
fixing test
bmblb Apr 18, 2025
0564894
fixing test
bmblb Apr 18, 2025
f842e88
fixing test
bmblb Apr 18, 2025
9fd99f0
Merge pull request #30 from bryntum/feature/websocket
bmblb Apr 22, 2025
3620f1d
support custom paper format
bmblb Jun 3, 2025
568d1e5
Merge pull request #32 from bryntum/feature/custom-paper-size
bmblb Jun 3, 2025
8418533
2.1.0
bmblb Jun 3, 2025
8be5875
Merge pull request #33 from bryntum/feature/custom-paper-size
bmblb Jun 3, 2025
dfc5efe
update dependencies
bmblb Aug 8, 2025
8a9daad
update gitignore
bmblb Aug 8, 2025
e29d8f0
fix relative paths
bmblb Aug 8, 2025
e55a0ab
rename build script
bmblb Aug 8, 2025
c7d82ee
docs
bmblb Aug 10, 2025
cdddbad
fix build script for windows
bmblb Aug 11, 2025
0a85bfa
2.1.1
bmblb Aug 11, 2025
1b02c06
Apply suggestions from code review
bmblb Aug 11, 2025
ee30967
remove unused code
bmblb Aug 11, 2025
2740f59
more log points
bmblb Aug 13, 2025
e00ac8c
update build script
bmblb Aug 13, 2025
a24264f
update doc
bmblb Aug 13, 2025
3b3b37e
review
bmblb Aug 13, 2025
7fe35b1
fix vulnerabilities
bmblb Aug 13, 2025
db3ca56
Merge pull request #35 from bryntum/34-update-buildingmd-guide-to-pro…
bmblb Aug 15, 2025
5765b80
fix websocket file url
bmblb Sep 11, 2025
f91c1c9
2.1.2
bmblb Sep 11, 2025
4c02bfb
review
bmblb Sep 11, 2025
e819fcc
Merge pull request #37 from bryntum/fix-websocket-file-url
bmblb Sep 11, 2025
95800a4
update docker base image
bmblb Oct 1, 2025
46bc195
2.2.0
bmblb Oct 1, 2025
941e2a2
Merge pull request #38 from bryntum/update-docker-base-image
bmblb Oct 1, 2025
2c5046b
fix workflow
bmblb Nov 18, 2025
c937ee3
upgrade packages
bmblb Nov 20, 2025
077a4f8
2.2.1
bmblb Nov 20, 2025
f2348d4
Merge pull request #39 from bryntum/fix-vulnerabilities
bmblb Nov 20, 2025
2c45f8a
update base image
bmblb Jan 28, 2026
5f5bb17
2.3.0
bmblb Jan 28, 2026
0ade983
Merge pull request #41 from bryntum/fix/cve-issues
bmblb Jan 28, 2026
ca57aae
update tar package version to 7.5.7
bmblb Feb 2, 2026
ddcc288
Merge pull request #42 from bryntum/fix/cve
bmblb Feb 2, 2026
d342767
2.3.1
bmblb Feb 2, 2026
925b42c
Merge pull request #44
bmblb Feb 2, 2026
26a8586
update packages
bmblb Feb 6, 2026
7c0eb35
2.3.2
bmblb Feb 6, 2026
11a06a1
Merge pull request #46 from bryntum/fix-cve
bmblb Feb 6, 2026
28d301b
add FAQ section for common questions and answers
bmblb Feb 23, 2026
840443a
Merge pull request #48 from bryntum/faq-section
bmblb Feb 23, 2026
93ccf6c
Bump glob and tar
maartenraes Feb 23, 2026
40b3cb3
2.3.3
maartenraes Feb 23, 2026
9c43ab6
Merge pull request #49 from bryntum/chore/cve-dependencies
bmblb Feb 25, 2026
05ad643
fix cve
bmblb Feb 25, 2026
8e1da29
2.3.4
bmblb Feb 25, 2026
60488ea
Merge pull request #50 from bryntum/fix-cve
bmblb Feb 25, 2026
8a8edc1
fix version
bmblb Feb 25, 2026
f0591bb
Merge pull request #51 from bryntum/fix-cve
bmblb Feb 25, 2026
b6cd46e
fix esmodules error
bmblb Feb 26, 2026
9849e92
cleanup packages
bmblb Feb 26, 2026
c3117ac
websocket connection test
bmblb Feb 26, 2026
cb2e3db
replace websocket with ws
bmblb Feb 26, 2026
b5d13c8
update pdf for smoke test
bmblb Feb 26, 2026
309514a
refactor smoke test
bmblb Feb 26, 2026
3f5dfb8
utility script to send local html file to server for printing
bmblb Feb 26, 2026
0ed18b7
continue test refactoring
bmblb Feb 26, 2026
6e12f47
fix websocket connection
bmblb Feb 26, 2026
fc3983a
fix failing_workers test
bmblb Feb 26, 2026
20c768c
get rid of noisy expected exceptions
bmblb Feb 26, 2026
744eeaa
use port allocator
bmblb Feb 26, 2026
69d652a
refactor tests to e2e and unit
bmblb Feb 26, 2026
5498a4b
add more node versions
bmblb Feb 26, 2026
3feb9e9
skip node 25
bmblb Feb 26, 2026
6c857e8
Merge pull request #52 from bryntum/test-suite-refactor
bmblb Feb 26, 2026
5b22e66
add favicon
bmblb Feb 27, 2026
d463f41
add building docker image to test run
bmblb Feb 27, 2026
e6525b8
update docker file
bmblb Feb 27, 2026
da09e6e
Potential fix for code scanning alert no. 9: Workflow does not contai…
bmblb Feb 27, 2026
6457b1e
update lock file
bmblb Feb 27, 2026
d95c162
Merge pull request #53 from bryntum/use-puppeteer
bmblb Feb 27, 2026
c600bbc
release action
bmblb Feb 27, 2026
fa8acf7
Merge pull request #54 from bryntum/release-action
bmblb Feb 27, 2026
5bf1c70
chore: bump version to 2.3.4
github-actions[bot] Feb 27, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 0 additions & 34 deletions .github/workflows/docker-image.yml

This file was deleted.

37 changes: 37 additions & 0 deletions .github/workflows/docker-test.js.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Build docker image

on:
push:
paths:
- 'src/**'
- '__tests__/**'
- 'package.json'
- 'Dockerfile'
- 'app.config.js'
- 'babel.config.js'
- '.puppeteerrc.cjs'
branches: [ main ]
pull_request:
paths:
- 'src/**'
- '__tests__/**'
- 'package.json'
- 'Dockerfile'
- 'app.config.js'
- 'babel.config.js'
- '.puppeteerrc.cjs'
branches: [ main ]

permissions:
contents: read

jobs:
build-docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build the Docker image
run: docker build . --file Dockerfile
3 changes: 2 additions & 1 deletion .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ jobs:

strategy:
matrix:
node-version: [14.x, 16.x]
# MuhammaraJS does not have pre-built binaries for Node 25, skip this version for now, though docker uses it
node-version: [20.x, 24.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
Expand Down
141 changes: 141 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
name: Release

on:
workflow_dispatch:
inputs:
version_bump:
description: 'Version bump type'
required: true
type: choice
options:
- patch
- minor
- major
prerelease:
description: 'Mark as pre-release'
required: false
type: boolean
default: false

jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Bump version (local only)
id: bump
run: |
# Get current version
CURRENT_VERSION=$(node -p "require('./package.json').version")
echo "Current version: $CURRENT_VERSION"

# Bump version using npm (doesn't create git tag)
npm version ${{ inputs.version_bump }} --no-git-tag-version

# Update package-lock.json
npm install --package-lock-only --ignore-scripts

# Get new version
NEW_VERSION=$(node -p "require('./package.json').version")
echo "New version: $NEW_VERSION"

# Set outputs
echo "current_version=$CURRENT_VERSION" >> $GITHUB_OUTPUT
echo "new_version=$NEW_VERSION" >> $GITHUB_OUTPUT
echo "tag=v$NEW_VERSION" >> $GITHUB_OUTPUT

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push Docker image (includes tests)
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: |
bryntum/pdf-export-server:${{ steps.bump.outputs.new_version }}
bryntum/pdf-export-server:latest
cache-from: type=gha
cache-to: type=gha,mode=max

# Only commit/tag/release if Docker build succeeded
- name: Configure Git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"

- name: Commit version bump
run: |
git add package.json package-lock.json
git commit -m "chore: bump version to ${{ steps.bump.outputs.new_version }}"
git push

- name: Create and push tag
run: |
git tag ${{ steps.bump.outputs.tag }}
git push origin ${{ steps.bump.outputs.tag }}

- name: Generate release notes
id: release_notes
run: |
# Get commits since last tag (exclude the version bump commit)
LAST_TAG=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo "")

if [ -n "$LAST_TAG" ]; then
echo "Generating notes from $LAST_TAG to HEAD^"
COMMITS=$(git log $LAST_TAG..HEAD^ --pretty=format:"- %s (%h)" --no-merges)
else
echo "No previous tag found, using recent commits"
COMMITS=$(git log -20 --pretty=format:"- %s (%h)" --no-merges | grep -v "chore: bump version" || true)
fi

# Create release notes
NOTES="## What's Changed

$COMMITS

**Full Changelog**: https://github.com/${{ github.repository }}/compare/$LAST_TAG...${{ steps.bump.outputs.tag }}"

# Save to file for the release step
echo "$NOTES" > release_notes.md
cat release_notes.md

- name: Create GitHub Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.bump.outputs.tag }}
name: ${{ steps.bump.outputs.tag }}
body_path: release_notes.md
prerelease: ${{ inputs.prerelease }}
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Summary
run: |
echo "## Release Summary" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "- **Previous version:** ${{ steps.bump.outputs.current_version }}" >> $GITHUB_STEP_SUMMARY
echo "- **New version:** ${{ steps.bump.outputs.new_version }}" >> $GITHUB_STEP_SUMMARY
echo "- **Tag:** ${{ steps.bump.outputs.tag }}" >> $GITHUB_STEP_SUMMARY
echo "- **Pre-release:** ${{ inputs.prerelease }}" >> $GITHUB_STEP_SUMMARY
echo "- **Docker image:** bryntum/pdf-export-server:${{ steps.bump.outputs.new_version }}" >> $GITHUB_STEP_SUMMARY
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
.idea
.claude

dist
dist/
cert
cert/
log
log/
tmp
tmp/
bin/linux
bin/win
bin/mac
node_modules/
!log/config.json
!.gitkeep
9 changes: 9 additions & 0 deletions .puppeteerrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/**
* Puppeteer configuration
* @see https://pptr.dev/guides/configuration
*/
module.exports = {
// Use Chrome for Testing (has arm64 macOS builds since Chrome 115+)
// This is the default in puppeteer v21+
defaultProduct: 'chrome'
};
36 changes: 36 additions & 0 deletions .run/Build pdf image amd64.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Build pdf image amd64" type="docker-deploy" factoryName="dockerfile" server-name="Docker">
<deployment type="dockerfile">
<settings>
<option name="imageTag" value="pdf-export-server:test" />
<option name="buildCliOptions" value="--platform=linux/amd64" />
<option name="containerName" value="pdf-export-server" />
<option name="entrypoint" value="node ./src/server.js -H 8081 -r host_resources" />
<option name="portBindings">
<list>
<DockerPortBindingImpl>
<option name="containerPort" value="8080" />
<option name="hostPort" value="8080" />
</DockerPortBindingImpl>
<DockerPortBindingImpl>
<option name="containerPort" value="8081" />
<option name="hostPort" value="8081" />
</DockerPortBindingImpl>
</list>
</option>
<option name="commandLineOptions" value="--platform=linux/amd64 -d" />
<option name="sourceFilePath" value="Dockerfile" />
<option name="volumeBindings">
<list>
<DockerVolumeBindingImpl>
<option name="containerPath" value="/home/pptruser/host_resources" />
<option name="hostPath" value="$PROJECT_DIR$/.." />
<option name="readOnly" value="true" />
</DockerVolumeBindingImpl>
</list>
</option>
</settings>
</deployment>
<method v="2" />
</configuration>
</component>
61 changes: 31 additions & 30 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,34 +1,25 @@
# Based on https://developers.google.com/web/tools/puppeteer/troubleshooting#running_puppeteer_in_docker
# Based on https://pptr.dev/troubleshooting#running-puppeteer-in-docker

FROM node:16.15.0
FROM node:24-slim

# Install system dependencies required for Chromium/Chrome to run
# Puppeteer will download its own browser during npm install
RUN apt-get update \
&& apt-get install -y wget gnupg ca-certificates \
&& wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
&& sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \
&& apt-get update \
# Chrome installation is required to get system dependencies. Puppeteer will download required version on its own.
&& apt-get install -y google-chrome-stable fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst fonts-freefont-ttf --no-install-recommends \
# https://techoverflow.net/2018/06/05/how-to-fix-puppetteer-error-while-loading-shared-libraries-libx11-xcb-so-1-cannot-open-shared-object-file-no-such-file-or-directory/ \
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 \
&& apt-get install -y --no-install-recommends \
# Build tools for native modules
build-essential python3 make gcc g++ \
# Chromium dependencies
ca-certificates fonts-liberation libasound2 libatk-bridge2.0-0 libatk1.0-0 \
libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgbm1 \
libgcc1 libglib2.0-0 libgtk-3-0 libnspr4 libnss3 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 lsb-release xdg-utils wget \
# Fonts for international character support
fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst fonts-freefont-ttf \
&& rm -rf /var/lib/apt/lists/*

# If running Docker >= 1.13.0 use docker run's --init arg to reap zombie processes, otherwise
# uncomment the following lines to have `dumb-init` as PID 1
# ADD https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64 /usr/local/bin/dumb-init
# RUN chmod +x /usr/local/bin/dumb-init
# ENTRYPOINT ["dumb-init", "--"]

# Uncomment to skip the chromium download when installing puppeteer. If you do,
# you'll need to launch puppeteer with:
# browser.launch({executablePath: 'google-chrome-stable'})
# ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true

# Install puppeteer so it's available in the container.
# Add user so we don't need --no-sandbox.
# Add user so we don't need --no-sandbox
RUN groupadd -r pptruser && useradd -r -g pptruser -G audio,video pptruser \
&& mkdir -p /home/pptruser/log \
&& mkdir /home/pptruser/cert \
Expand All @@ -41,15 +32,25 @@ RUN groupadd -r pptruser && useradd -r -g pptruser -G audio,video pptruser \
# Run everything after as non-privileged user.
USER pptruser

COPY --chown=pptruser:pptruser ["src/", "/home/pptruser/src/"]
COPY --chown=pptruser:pptruser ["app.config.js", "package.json", "/home/pptruser/"]
COPY --chown=pptruser:pptruser ["package.json", "/home/pptruser/"]

WORKDIR /home/pptruser

# MuhammaraJS installs fixed dependency to tar 7.5.7 which fails security audit. Can be simplified to `npm i` after
# this issue is fixed: https://github.com/julianhille/MuhammaraJS/issues/500
# Run install to get muhammara
RUN npm i
# Install packages to muhammara submodule to get updated tar package
RUN (cd node_modules/muhammara && rm -rf node_modules package-lock.json && npm i)
# Run install again to update lock file
RUN npm i

COPY --chown=pptruser:pptruser src /home/pptruser/src
COPY --chown=pptruser:pptruser __tests__ /home/pptruser/__tests__
COPY --chown=pptruser:pptruser ["app.config.js", ".puppeteerrc.cjs", "babel.config.js", "/home/pptruser/"]

RUN npm run test

EXPOSE 8080 8081

ENTRYPOINT [ "node", "./src/server.js", "-H", "8081" ]

CMD ["bash"]
Loading