mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-10-22 00:40:11 +00:00
Add flag to always authenticate when cloning public repositories (#760)
As a developer using an custom git server (e.g. Github Enterprise) I would like to be able to authenticate the user on repositories which are marked as public. See issue: https://github.com/woodpecker-ci/woodpecker/issues/473 Ref: https://github.com/woodpecker-ci/woodpecker/pull/693#issuecomment-1025771162
This commit is contained in:
@@ -91,6 +91,11 @@ var flags = []cli.Flag{
|
||||
Name: "open",
|
||||
Usage: "enable open user registration",
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
EnvVars: []string{"WOODPECKER_AUTHENTICATE_PUBLIC_REPOS"},
|
||||
Name: "authenticate-public-repos",
|
||||
Usage: "Always use authentication to clone repositories even if they are public. Needed if the SCM requires to always authenticate as used by many companies.",
|
||||
},
|
||||
&cli.StringFlag{
|
||||
EnvVars: []string{"WOODPECKER_DOCS"},
|
||||
Name: "docs",
|
||||
|
||||
@@ -271,6 +271,9 @@ func setupEvilGlobals(c *cli.Context, v store.Store, r remote.Remote) {
|
||||
server.Config.Services.Senders = sender.NewRemote(endpoint)
|
||||
}
|
||||
|
||||
// authentication
|
||||
server.Config.Pipeline.AuthenticatePublicRepos = c.Bool("authenticate-public-repos")
|
||||
|
||||
// limits
|
||||
server.Config.Pipeline.Limits.MemSwapLimit = c.Int64("limit-mem-swap")
|
||||
server.Config.Pipeline.Limits.MemLimit = c.Int64("limit-mem")
|
||||
|
||||
Reference in New Issue
Block a user