HTML publisher plugin in Jenkins does not display results after server restart

Hi team,

Any suggestions how to permanently fix that issue, with the html publisher plugin as after restart of the jenkins server (on a k8s) it does not show the results.
To fix that the following suggestion has to be executed in the script console in order to work:
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'");

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.

However adding the JENKINS_JAVA_OPTIONS in the k8s deployment, does not fix the problem. Any ideas how to make it working after restart happens and without human intervention to that?

Setup:
Jenkins version : 2.319.3 (running on k8s)
HTML publisher version: 1.29

You could try adding that groovy snippet to the groovy hook scripts directory as described in

Please also consider updating your Jenkins controller to a recent release. Jenkins 2.319.3 was released 17 months ago. Multiple security vulnerabilities are reported against that release and resolved in the most recent releases.

Thank you very much Mark. I will try these options and write back once I have a result.