diff --git a/app/cmd/center_start.go b/app/cmd/center_start.go index c531d7b8..687c1fe0 100644 --- a/app/cmd/center_start.go +++ b/app/cmd/center_start.go @@ -27,6 +27,7 @@ type CenterStartOption struct { SetupWizard bool AdminCanGenerateNewTokens bool CleanHome bool + CrumbExcludeSessionID bool // comes from folder plugin ConcurrentIndexing int @@ -75,6 +76,8 @@ func init() { i18n.T("System property key-value")) flags.BoolVarP(¢erStartOption.SetupWizard, "setup-wizard", "", true, i18n.T("If you want to show the setup wizard at first start")) + flags.BoolVarP(¢erStartOption.CrumbExcludeSessionID, "crumb-exclude-sessionId", "", false, + i18n.T(`Add system properties with 'hudson.security.csrf.DefaultCrumbIssuer.EXCLUDE_SESSION_ID=true'`)) flags.BoolVarP(¢erStartOption.AdminCanGenerateNewTokens, "admin-can-generate-new-tokens", "", false, i18n.T("If enabled, the users with administer permissions can generate new tokens for other users")) flags.BoolVarP(¢erStartOption.CleanHome, "clean-home", "", false, @@ -317,6 +320,10 @@ func (c *CenterStartOption) setSystemProperty(jenkinsWarArgs []string) []string c.System = append(c.System, fmt.Sprintf("com.cloudbees.hudson.plugins.folder.computed.ThrottleComputationQueueTaskDispatcher.LIMIT=%d", c.ConcurrentIndexing)) } + if c.CrumbExcludeSessionID { + c.System = append(c.System, "hudson.security.csrf.DefaultCrumbIssuer.EXCLUDE_SESSION_ID=true") + } + for _, item := range centerStartOption.System { jenkinsWarArgs = append(jenkinsWarArgs, fmt.Sprintf("-D%s", item)) }