Example #1
0
package gogs

import (
	"github.com/armab/drone/plugin/remote"
	"github.com/drone/config"
)

var (
	gogsUrl    = config.String("gogs-url", "")
	gogsSecret = config.String("gogs-secret", "")
	gogsOpen   = config.Bool("gogs-open", false)
)

// Registers the Gogs plugin using the default
// settings from the config file or environment
// variables.
func Register() {
	if len(*gogsUrl) == 0 {
		return
	}
	remote.Register(
		New(*gogsUrl, *gogsSecret, *gogsOpen),
	)
}
Example #2
0
)

var (
	// Database driver configuration. Defaults to sqlite
	// when no database configuration specified.
	datasource = config.String("database-datasource", "drone.sqlite")
	driver     = config.String("database-driver", "sqlite3")

	// HTTP Server settings.
	port   = config.String("server-port", ":8000")
	sslcrt = config.String("server-ssl-cert", "")
	sslkey = config.String("server-ssl-key", "")

	// Enable self-registration. When false, the system admin
	// must grant user access.
	open = config.Bool("registration-open", false)

	workers *pool.Pool
	worker  *director.Director
	pub     *pubsub.PubSub

	// Docker configuration details.
	dockercert = config.String("docker-cert", "")
	dockerkey  = config.String("docker-key", "")
	nodes      StringArr

	db *sql.DB

	caps map[string]bool
)
Example #3
0
import (
	"github.com/drone/config"
	"github.com/drone/drone/plugin/remote"
)

var (
	// GitHub cloud configuration details
	githubClient = config.String("github-client", "")
	githubSecret = config.String("github-secret", "")

	// GitHub Enterprise configuration details
	githubEnterpriseURL     = config.String("github-enterprise-url", "")
	githubEnterpriseAPI     = config.String("github-enterprise-api", "")
	githubEnterpriseClient  = config.String("github-enterprise-client", "")
	githubEnterpriseSecret  = config.String("github-enterprise-secret", "")
	githubEnterprisePrivate = config.Bool("github-enterprise-private-mode", true)
)

// Registers the GitHub plugins using the default
// settings from the config file or environment
// variables.
func Register() {
	registerGitHub()
	registerGitHubEnterprise()
}

// registers the GitHub (github.com) plugin
func registerGitHub() {
	if len(*githubClient) == 0 || len(*githubSecret) == 0 {
		return
	}
Example #4
0
package bitbucket

import (
	"github.com/drone/config"
	"github.com/quartethealth/drone/plugin/remote"
)

var (
	// Bitbucket cloud configuration details
	bitbucketClient = config.String("bitbucket-client", "")
	bitbucketSecret = config.String("bitbucket-secret", "")
	bitbucketOpen   = config.Bool("bitbucket-open", false)
)

// Registers the Bitbucket plugin using the default
// settings from the config file or environment
// variables.
func Register() {
	if len(*bitbucketClient) == 0 || len(*bitbucketSecret) == 0 {
		return
	}
	remote.Register(
		NewDefault(*bitbucketClient, *bitbucketSecret, *bitbucketOpen),
	)
}
Example #5
0
package gitlab

import (
	"github.com/drone/config"
	"github.com/drone/drone/plugin/remote"
)

var (
	gitlabURL        = config.String("gitlab-url", "")
	gitlabSkipVerify = config.Bool("gitlab-skip-verify", false)
)

// Registers the Gitlab plugin using the default
// settings from the config file or environment
// variables.
func Register() {
	if len(*gitlabURL) == 0 {
		return
	}
	remote.Register(
		New(
			*gitlabURL,
			*gitlabSkipVerify,
		),
	)
}
Example #6
0
package github

import (
	"github.com/drone/config"
	"github.com/quartethealth/drone/plugin/remote"
)

var (
	// GitHub cloud configuration details
	githubClient = config.String("github-client", "")
	githubSecret = config.String("github-secret", "")
	githubOrgs   = config.Strings("github-orgs")
	githubOpen   = config.Bool("github-open", false)

	// GitHub Enterprise configuration details
	githubEnterpriseURL        = config.String("github-enterprise-url", "")
	githubEnterpriseAPI        = config.String("github-enterprise-api", "")
	githubEnterpriseClient     = config.String("github-enterprise-client", "")
	githubEnterpriseSecret     = config.String("github-enterprise-secret", "")
	githubEnterprisePrivate    = config.Bool("github-enterprise-private-mode", true)
	githubEnterpriseSkipVerify = config.Bool("github-enterprise-skip-verify", false)
	githubEnterpriseOrgs       = config.Strings("github-enterprise-orgs")
	githubEnterpriseOpen       = config.Bool("github-enterprise-open", false)
)

// Registers the GitHub plugins using the default
// settings from the config file or environment
// variables.
func Register() {
	registerGitHub()
	registerGitHubEnterprise()
Example #7
0
package gitlab

import (
	"github.com/drone/config"
	"github.com/drone/drone/plugin/remote"
)

var (
	gitlabURL        = config.String("gitlab-url", "")
	gitlabSkipVerify = config.Bool("gitlab-skip-verify", false)
	gitlabOpen       = config.Bool("gitlab-open", false)

	gitlabClient = config.String("gitlab-client", "")
	gitlabSecret = config.String("gitlab-secret", "")
)

// Registers the Gitlab plugin using the default
// settings from the config file or environment
// variables.
func Register() {
	if len(*gitlabURL) == 0 {
		return
	}
	remote.Register(
		New(
			*gitlabURL,
			*gitlabSkipVerify,
			*gitlabOpen,
			*gitlabClient,
			*gitlabSecret,
		),
Example #8
0
import (
	"fmt"
	"log"
	"net/http"
	"net/url"
	"strings"
	"time"

	"github.com/crowdmob/goamz/sts"
	"github.com/dgrijalva/jwt-go"
	"github.com/drone/config"
	"golang.org/x/oauth2"
)

var trustXForwarded = config.Bool("trust-x-forwarded", false)

var loginTimeout = config.Duration("google-login-timeout", time.Second*120)

// We reuse the Google client secret as the web secret.
var secret = googleClientSecret

// getOriginUrl returns the HTTP origin string (i.e.
// https://alice.example.com, or http://localhost:8000)
func getOriginURL(r *http.Request) string {
	scheme := "https"
	if r.TLS == nil {
		scheme = "http"
	}
	if *trustXForwarded {
		scheme = r.Header.Get("X-Forwarded-Proto")
Example #9
0
package stash

import (
	"github.com/drone/config"
	"github.com/drone/drone/plugin/remote"
)

var (
	// Stash configuration details
	stashURL        = config.String("stash-url", "")
	stashAPI        = config.String("stash-api", "")
	stashSecret     = config.String("stash-secret", "")
	stashPrivateKey = config.String("stash-private-key", "")
	stashHook       = config.String("stash-hook", "")
	stashOpen       = config.Bool("stash-open", false)
)

// Registers the Stash plugin using the default
// settings from the config file or environment
// variables
func Register() {
	if len(*stashURL) == 0 ||
		len(*stashAPI) == 0 ||
		len(*stashSecret) == 0 ||
		len(*stashPrivateKey) == 0 ||
		len(*stashHook) == 0 {
		return
	}
	remote.Register(
		New(
			*stashURL,