Set hudson.model.DirectoryBrowserSupport.CSP as default

I want to configure the hudson.model.DirectoryBrowserSupport.CSP property so that it’s set by default every time Jenkins starts. I tried doing this by adding the JAVA_ARGS entry in the /etc/default/jenkins file, but it doesn’t seem to be working.

JAVA_ARGS=“-Djava.awt.headless=true -Dhudson.model.DirectoryBrowserSupport.CSP="default-src ‘self’ ‘unsafe-inline’ ‘unsafe-eval’; img-src data:;"”

When Jenkins is installed from the apt, yum, or dnf Linux package managers, it does not use /etc/default/jenkins. Jenkins switched to systemd in March 2022 as announced in the changelog and as documented in “Managing Systemd Services”

Refer to those instructions that will guide you to configure command line arguments.