Jenkins HTML Publisher Plugin : allowscript permission issue

后端 未结 2 1599
心在旅途
心在旅途 2021-02-03 11:23

I\'m trying to report my .html file with HTML publisher plugin in Jenkins however,since HTML publisher is updated to version 1.10, can\'t publish HTML.

2条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-02-03 11:52

    I faced similar issue I found and applied following solution:

    Steps:

    1. Go to the Jenkins Admin page (login as admin).
    2. Go to Manage Jenkins -> Script Console
    3. Then in the script console copy paste following it made it work

    Snippet: System.setProperty("hudson.model.DirectoryBrowserSupport.CSP", "sandbox allow-scripts; default-src *; style-src * http://* 'unsafe-inline' 'unsafe-eval'; script-src 'self' http://* 'unsafe-inline' 'unsafe-eval'");

    This link provides more details on each of the parameters that we have set in the above code line.

    Note for Persistency in jenkins configuration: @RayKim mentioned this is not a sustainable change. If you want to keep this change permanently then in that case you should set this property values up in the JENKINS_JAVA_OPTIONS="-Djava.awt.headless=true -Dhudson.remoting.Launcher.pingIntervalSec=0"

    After setting this variable you have to restart your Jenkins to load the new configuration.

提交回复
热议问题