Skip to content

[DOCS]: Pin MathJax npm install with commit hash. - #889

Merged
MacOS merged 3 commits into
SKaiNET-developers:developfrom
MacOS:docs/Dockerfile/pin-mathjax-with-commit-hash
Jul 27, 2026
Merged

[DOCS]: Pin MathJax npm install with commit hash.#889
MacOS merged 3 commits into
SKaiNET-developers:developfrom
MacOS:docs/Dockerfile/pin-mathjax-with-commit-hash

Conversation

@MacOS

@MacOS MacOS commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator

This PR pins the npm package installations of MathJax in the Dockerfile used in the docs directory with their commit hash to increase security (#847).

The OpenSSF Score should increase after this PR has been merged.

@MacOS
MacOS requested review from Copilot and michalharakal July 27, 2026 08:38
@MacOS MacOS self-assigned this Jul 27, 2026
@MacOS MacOS added documentation Improvements or additions to documentation enhancement New feature or request labels Jul 27, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Pins the MathJax asset pre-download in the docs Antora Docker image to a specific Git commit, aiming to improve supply-chain security and OpenSSF scoring as described in #847.

Changes:

  • Replace npm pack mathjax@3 with npm pack git+https://github.com/mathjax/MathJax.git#<commit> to pin the download to a specific commit.
  • Document the pinned MathJax commit in the Dockerfile comments.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread docs/.docker/Dockerfile Outdated
Comment on lines +86 to +88
# MathJax 0bfa580685ca72e4a3a37657ccd754a65c1a42c6: v4.1.3
RUN mkdir -p /opt/mathjax \
&& npm pack mathjax@3 --pack-destination /tmp \
&& npm pack git+https://github.com/mathjax/MathJax.git#0bfa580685ca72e4a3a37657ccd754a65c1a42c6 --pack-destination /tmp \

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, addressed with 5efe666

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

Comment thread docs/.docker/Dockerfile
Comment on lines 87 to 89
RUN mkdir -p /opt/mathjax \
&& npm pack mathjax@3 --pack-destination /tmp \
&& npm pack git+https://github.com/mathjax/MathJax.git#600692ad9d3552cc25f85510d5797bc942ecc9f7 --pack-destination /tmp \
&& tar -xzf /tmp/mathjax-*.tgz -C /tmp \

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@michalharakal Should we addresse this?

@MacOS

MacOS commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator Author

I switched from the long commit hash to the short form because the long commit form caused the error npm error GitFetcher requires an Arborist constructor to pack a tarball. See run https://github.com/SKaiNET-developers/SKaiNET/actions/runs/30253624459/job/89937067552?pr=889, and issue npm/cli#6723 where the fix was proposed.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (1)

docs/.docker/Dockerfile:89

  • npm pack is pinned only by a 7‑char short SHA (#600692a), which can become ambiguous over time, and the subsequent tar -xzf /tmp/mathjax-*.tgz still relies on a wildcard that can match multiple files and break the build. Use the full commit hash in the git URL and capture the exact tarball filename emitted by npm pack so extraction is deterministic and robust.
    && npm pack git+https://github.com/mathjax/MathJax.git#600692a --pack-destination /tmp \
    && tar -xzf /tmp/mathjax-*.tgz -C /tmp \

@michalharakal michalharakal left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @MacOS

@MacOS
MacOS merged commit a4cf0c7 into SKaiNET-developers:develop Jul 27, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants