示例#1
0
func newServer(tug *tugboat.Tugboat, c *cli.Context) http.Handler {
	config := server.Config{}
	config.GitHub.Secret = c.String("github.secret")
	config.GitHub.ClientID = c.String("github.client_id")
	config.GitHub.ClientSecret = c.String("github.client_secret")
	config.GitHub.Organization = c.String("github.organization")
	config.CookieSecret = readKey(c.String("cookie.secret"))

	cd, err := tugboat.ParsePusherCredentials(c.String("pusher.url"))
	if err != nil {
		log.Fatal(err)
	}
	config.Pusher.Key = cd.Key
	config.Pusher.Secret = cd.Secret

	return server.New(tug, config)
}
示例#2
0
文件: test.go 项目: tomzhang/tugboat
func NewServer(tug *tugboat.Tugboat) http.Handler {
	config := server.Config{}
	config.GitHub.Secret = GitHubSecret
	return server.New(tug, config)
}