2017-07-21 00:18:25 +00:00
|
|
|
#!/usr/bin/env groovy
|
|
|
|
/*
|
|
|
|
* Set up the CSRF protection which would normally be defaulted in 2.0 , but
|
|
|
|
* are not in our instances because we're * skipping the setup wizard
|
|
|
|
*/
|
|
|
|
|
|
|
|
import jenkins.model.*
|
|
|
|
import hudson.security.csrf.*
|
|
|
|
|
|
|
|
println "Checking CSRF protection..."
|
2017-07-21 01:35:24 +00:00
|
|
|
if (Jenkins.instance.crumbIssuer == null) {
|
2017-07-21 00:18:25 +00:00
|
|
|
println "Enabling CSRF protection"
|
2017-07-21 01:35:24 +00:00
|
|
|
Jenkins.instance.crumbIssuer = new DefaultCrumbIssuer(true)
|
2017-07-21 00:18:25 +00:00
|
|
|
}
|