Question: My HTML reports don't render fully when viewed from Jenkins. Why?
...
Additional Jenkins Documentation
- https://www.jenkins.io/doc/book/managing/groovy-hook-scripts/
- https://www.jenkins.io/doc/book/security/configuring-content-security-policy/
Alternative Method for making the change permanently:
edit Edit the jenkins.xml in $JENKINS_HOME (eg. C:\Program Files\Jenkins) and
add Add -Dhudson.model.DirectoryBrowserSupport.CSP="img-src 'self' data:;" to the <service id="jenkins"><arguments> tag aka:
Code Block |
---|
<arguments>-Xrs -Xmx256m -Dhudson.model.DirectoryBrowserSupport.CSP="\"img-src 'self' data:;\"" -Dhudson.lifecycle=hudson.lifecycle.WindowsServiceLifecycle -jar "%BASE%\jenkins.war" --httpPort=8080 --webroot="%BASE%\war"</arguments> |
It seems for
- For RedHat, the file to modify is /etc/sysconfig/jenkins and the property is JENKINS_JAVA_OPTIONS
- , like this:
Code Block |
---|
JENKINS_JAVA_OPTIONS="-Djava.awt.headless=true -Dhudson.model.DirectoryBrowserSupport.CSP=\"img-src 'self' data:;\"" |
the \" are important so that the java parser parses the values correctly.
However this relaxes the security only temporarily ,to make it permanent. To make the change permanently in the system: