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:
Matt Bostock
2015-01-12 22:59:06 +00:00
parent f79762177c
commit 307aed12bc
14 changed files with 52 additions and 34 deletions

View File

@@ -22,22 +22,11 @@ port=":80"
driver="sqlite3"
datasource="/var/lib/drone/drone.sqlite"
#####################################################################
# Open Registration allows users to self-register for Drone.
# This is recommended if Drone is being hosted behind a
# firewall.
#
# When false, the system admin will need to manually add
# users to Drone through the admin screens.
#
# [registration]
# open=true
# [github]
# client=""
# secret=""
# orgs=[]
# open=false
# [github_enterprise]
# client=""
@@ -46,18 +35,22 @@ datasource="/var/lib/drone/drone.sqlite"
# url=""
# orgs=[]
# private_mode=false
# open=false
# [bitbucket]
# client=""
# secret=""
# open=false
# [gitlab]
# url=""
# skip_verify=false
# open=false
# [gogs]
# url=""
# secret=""
# open=false
#####################################################################
# SMTP configuration for Drone. This is required if you plan