Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MathJax Settings page always reports error if pb-mathjax is behind firewall #102

Open
3 of 4 tasks
alexdryden opened this issue Nov 5, 2024 · 2 comments
Open
3 of 4 tasks
Assignees

Comments

@alexdryden
Copy link

Prerequisites

Description

Preamble

My understanding is that the pb-mathjax service is needed for the exports, not the webooks. So, only the Pressbooks IP should be able to access the pb-mathjax service, which it uses when generating images of equations for PDF/EPUB exports. If the pb-mathjax service is set up to accept an open range of requests, then it essentially becomes a public, MathJax image renderer.

The Problem

The MathJax settings page has a de-facto test section, which advertises to the end user if the service is set up correctly or not:

Screenshot 2024-11-05 at 2 40 59 PM(Equation appears when the pb-mathjax service accepts open range requests)

However, this test is implemented by generating an <img> element whose source is a call to the to the configured pb-mathjax service. The problem here is that if the pb-mathjax service is set up correctly behind a firewall, then this request will come from the client's non-approved IP, the image will not appear, and the end-user will be under the impression that the service is malfunctioning.

Steps to Reproduce

  1. Follow instructions to install pb-mathjax to a production server
  2. Set up firewall for service in step one that gives access to the PB applications in use
  3. Navigate to to the MathJax Settings page
  4. Instead of a big integral, user sees markup/encoding for pb-mathjax service

Expected behavior:
As a test page, it would be ideal for the PB server to send some kind of "status" query to the pb-mathjax server, and report back to the user if PB can communicate with its pb-mathjax service.

Actual behavior:
Instead, the test sees if the user can communicate with the service, which they should not be able to.
Screenshot 2024-11-05 at 3 38 59 PM
(Result when IP range is restricted)

@SteelWagstaff
Copy link
Member

Thanks for filing this, @alexdryden. Moving to mathjax repo.

@SteelWagstaff SteelWagstaff transferred this issue from pressbooks/pressbooks Jan 3, 2025
@cmurtagh
Copy link
Contributor

cmurtagh commented Jan 3, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants