-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit ecc0816
Showing
4 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import jenkins.model.Jenkins | ||
import hudson.security.csrf.DefaultCrumbIssuer | ||
|
||
def j = Jenkins.instance; | ||
j.setCrumbIssuer(null); // I've also tried setting a new crumb issuer here as well. | ||
j.save(); | ||
|
||
System.setProperty("hudson.security.csrf.CrumbFilter", "false"); | ||
System.setProperty("hudson.security.csrf", "false"); | ||
System.setProperty("hudson.security.csrf.GlobalCrumbIssuerConfiguration", "false"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import jenkins.model.* | ||
import hudson.security.* | ||
|
||
println "--> creating admin user" | ||
|
||
def adminUsername = System.getenv("ADMIN_USERNAME") | ||
def adminPassword = System.getenv("ADMIN_PASSWORD") | ||
assert adminPassword != null : "No ADMIN_USERNAME env var provided, but required" | ||
assert adminPassword != null : "No ADMIN_PASSWORD env var provided, but required" | ||
|
||
def hudsonRealm = new HudsonPrivateSecurityRealm(false) | ||
hudsonRealm.createAccount(adminUsername, adminPassword) | ||
Jenkins.instance.setSecurityRealm(hudsonRealm) | ||
def strategy = new FullControlOnceLoggedInAuthorizationStrategy() | ||
strategy.setAllowAnonymousRead(false) | ||
Jenkins.instance.setAuthorizationStrategy(strategy) | ||
|
||
Jenkins.instance.save() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
FROM jenkins/jenkins:2.165-alpine | ||
|
||
ENV JAVA_OPTS="-Djenkins.install.runSetupWizard=false" | ||
|
||
COPY *.groovy /usr/share/jenkins/ref/init.groovy.d/ | ||
COPY plugins.txt /usr/share/jenkins/ref/plugins.txt | ||
|
||
RUN /usr/local/bin/install-plugins.sh < /usr/share/jenkins/ref/plugins.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
kubernetes |