Jenkins HTML Publisher Plugin : allowscript permission issue

后端 未结 2 1600
心在旅途
心在旅途 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.

    0 讨论(0)
  • 2021-02-03 12:14

    Can you have a try with a blank CSP option?

    /usr/bin/java -Djava.awt.headless=true -Dhudson.model.DirectoryBrowserSupport.CSP= -jar /usr/share/jenkins/jenkins.war --webroot=/var/cache/jenkins/war --httpPort=8080 --ajp13Port=-1
    

    On my Jenkins instance, it solved my reporting issues.

    I know it's not a safe option, but I didn't find another solution :(

    0 讨论(0)
提交回复
热议问题