mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2026-03-29 13:14:46 +02:00
Move open registration setting into remote plugins
...so that it's possible to enable or disable open registration on a per-remote basis. For example, the `DRONE_REGISTRATION_OPEN` environment variable now becomes `DRONE_GITHUB_OPEN` when using GitHub as a remote. The default for open registration in this commit is `false` (disabled), which matches the existing behaviour. This is useful if you need to support both public and private remotes, e.g. GitHub.com and GitHub Enterprise, where you trust all of the private users and want to allow open registration for those but would not want all GitHub.com users to run builds on your server. Tested with GitHub and GitLab.
This commit is contained in:
@@ -32,6 +32,9 @@ type Remote interface {
|
||||
// ParseHook parses the post-commit hook from the Request body
|
||||
// and returns the required data in a standard format.
|
||||
ParseHook(r *http.Request) (*model.Hook, error)
|
||||
|
||||
// Registration returns true if open registration is allowed
|
||||
OpenRegistration() bool
|
||||
}
|
||||
|
||||
// List of registered plugins.
|
||||
|
||||
Reference in New Issue
Block a user