Skip to content

Commit

Permalink
...
Browse files Browse the repository at this point in the history
  • Loading branch information
phith0n committed Apr 16, 2019
1 parent 3ee153d commit 9ae5c6e
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions base/jenkins/2.46.1/init.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!groovy

import jenkins.model.*
import hudson.security.*
import jenkins.security.s2m.AdminWhitelistRule

def instance = Jenkins.getInstance()

def hudsonRealm = new HudsonPrivateSecurityRealm(false)
hudsonRealm.createAccount("admin", "admin")
instance.setSecurityRealm(hudsonRealm)

def strategy = new FullControlOnceLoggedInAuthorizationStrategy()
instance.setAuthorizationStrategy(strategy)
instance.save()

Jenkins.instance.getInjector().getInstance(AdminWhitelistRule.class).setMasterKillSwitch(false)

0 comments on commit 9ae5c6e

Please sign in to comment.