Skip to content

docs: document the Content Security Policy settings the map requires - #94

Merged
TheWitness merged 2 commits into
Cacti:developfrom
somethingwithproof:docs/csp-requirements
Aug 16, 2026
Merged

docs: document the Content Security Policy settings the map requires#94
TheWitness merged 2 commits into
Cacti:developfrom
somethingwithproof:docs/csp-requirements

Conversation

@somethingwithproof

Copy link
Copy Markdown
Member

Three issues report the same failure with the same root cause: Cacti's default CSP is script-src 'self' 'unsafe-inline', the map loads its JavaScript from maps.googleapis.com, the browser blocks it, and the Maps tab renders blank with nothing in the Cacti UI to explain why.

The workaround has been known since at least 2023 (#16), but the README never documented it. This adds it to Installation and points Possible Bugs at the browser console.

Core has provided the two required settings since 1.2.15:

  • Content-Security Alternate Sources -> https://maps.googleapis.com https://maps.gstatic.com
  • Content-Security Script Policy -> Allow both unsafe-eval and Non-Nonced Inline JavaScript

The Google loader calls eval(), so alternate sources alone is not enough.

Closes #12
Closes #15
Closes #16

Docs only, no code change. markdownlint clean against the rules .mdl_style.rb leaves enabled.

A follow-up could detect the missing setting at page load and raise a Cacti message instead of leaving a blank page, but that needs a live install to test and is kept out of this PR.

Cacti's default policy blocks maps.googleapis.com, which presents as a blank
Maps tab with no message in the UI.

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Copilot AI lite review requested due to automatic review settings August 16, 2026 21:36

Copilot AI 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.

Pull request overview

This PR updates the plugin documentation to explain how Cacti’s Content Security Policy (CSP) can block Google Maps JavaScript, resulting in a blank Maps tab, and provides the required configuration to resolve it.

Changes:

  • Adds Installation guidance for required CSP settings to allow Google Maps scripts to load.
  • Updates “Possible Bugs” to direct users to the browser console and identify CSP-related failures.
Suppressed comments (1)

README.md:130

  • This inline code span is also split across a line break (backtick opens on the first line and closes on the next), which can render as stray backticks rather than Refused to load the script. Keep the code span on a single line.
A blank Maps tab is almost always the Content Security Policy rather than a
fault in the plugin.  Open the browser console first: a `Refused to load the
script` entry naming `maps.googleapis.com` means the two settings described
under Installation have not been applied.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread README.md Outdated
Comment thread README.md
Comment thread README.md Outdated
…e policy

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
@TheWitness
TheWitness merged commit 967d702 into Cacti:develop Aug 16, 2026
@somethingwithproof
somethingwithproof deleted the docs/csp-requirements branch August 16, 2026 23:42
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

Successfully merging this pull request may close these issues.

Page:gpsmap.php?headercontent=true Generated a Fatal Error:500 Gpsmap blank page Refused to load the script

3 participants