mirror of https://github.com/docker/docs.git
Proppy code review feedback.
Signed-off-by: Dan Lorenc <lorenc.d@gmail.com>
This commit is contained in:
parent
17d8b16a37
commit
5525cf9f6f
|
@ -17,6 +17,8 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
AuthURL = "https://accounts.google.com/o/oauth2/auth"
|
||||||
|
TokenURL = "https://accounts.google.com/o/oauth2/token"
|
||||||
ClientId = "22738965389-8arp8bah3uln9eoenproamovfjj1ac33.apps.googleusercontent.com"
|
ClientId = "22738965389-8arp8bah3uln9eoenproamovfjj1ac33.apps.googleusercontent.com"
|
||||||
ClientSecret = "qApc3amTyr5wI74vVrRWAfC_"
|
ClientSecret = "qApc3amTyr5wI74vVrRWAfC_"
|
||||||
)
|
)
|
||||||
|
@ -32,8 +34,8 @@ func newOauthClient(storePath string) *http.Client {
|
||||||
ClientId: ClientId,
|
ClientId: ClientId,
|
||||||
ClientSecret: ClientSecret,
|
ClientSecret: ClientSecret,
|
||||||
Scope: raw.ComputeScope,
|
Scope: raw.ComputeScope,
|
||||||
AuthURL: "https://accounts.google.com/o/oauth2/auth",
|
AuthURL: AuthURL,
|
||||||
TokenURL: "https://accounts.google.com/o/oauth2/token",
|
TokenURL: TokenURL,
|
||||||
}
|
}
|
||||||
token := token(storePath, config)
|
token := token(storePath, config)
|
||||||
t := oauth.Transport{
|
t := oauth.Transport{
|
||||||
|
@ -91,8 +93,9 @@ func tokenFromWeb(config *oauth.Config) *oauth.Token {
|
||||||
config.RedirectURL = ts.URL
|
config.RedirectURL = ts.URL
|
||||||
authURL := config.AuthCodeURL(randState)
|
authURL := config.AuthCodeURL(randState)
|
||||||
|
|
||||||
log.Infof("Opening auth URL in browser. If the URL doesn't open, please open it manually and copy the code here.")
|
log.Info("Opening auth URL in browser.")
|
||||||
log.Info(authURL)
|
log.Info(authURL)
|
||||||
|
log.Info("If the URL doesn't open, please open it manually and copy the code here.")
|
||||||
go openURL(authURL)
|
go openURL(authURL)
|
||||||
go getCodeFromStdin(ch)
|
go getCodeFromStdin(ch)
|
||||||
|
|
||||||
|
|
|
@ -28,6 +28,8 @@ const (
|
||||||
imageName = "https://www.googleapis.com/compute/v1/projects/google-containers/global/images/container-vm-v20141016"
|
imageName = "https://www.googleapis.com/compute/v1/projects/google-containers/global/images/container-vm-v20141016"
|
||||||
dockerUrl = "https://bfirsh.s3.amazonaws.com/docker/docker-1.3.1-dev-identity-auth"
|
dockerUrl = "https://bfirsh.s3.amazonaws.com/docker/docker-1.3.1-dev-identity-auth"
|
||||||
firewallRule = "docker-machines"
|
firewallRule = "docker-machines"
|
||||||
|
port = "2376"
|
||||||
|
firewallTargetTag = "docker-machine"
|
||||||
)
|
)
|
||||||
|
|
||||||
// NewComputeUtil creates and initializes a ComputeUtil.
|
// NewComputeUtil creates and initializes a ComputeUtil.
|
||||||
|
@ -79,7 +81,7 @@ func (c *ComputeUtil) createFirewallRule() error {
|
||||||
{
|
{
|
||||||
IPProtocol: "tcp",
|
IPProtocol: "tcp",
|
||||||
Ports: []string{
|
Ports: []string{
|
||||||
"2376",
|
port,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -87,7 +89,7 @@ func (c *ComputeUtil) createFirewallRule() error {
|
||||||
"0.0.0.0/0",
|
"0.0.0.0/0",
|
||||||
},
|
},
|
||||||
TargetTags: []string{
|
TargetTags: []string{
|
||||||
"docker-machine",
|
firewallTargetTag,
|
||||||
},
|
},
|
||||||
Name: firewallRule,
|
Name: firewallRule,
|
||||||
}
|
}
|
||||||
|
@ -135,7 +137,7 @@ func (c *ComputeUtil) createInstance(d *Driver) error {
|
||||||
},
|
},
|
||||||
Tags: &raw.Tags{
|
Tags: &raw.Tags{
|
||||||
Items: []string{
|
Items: []string{
|
||||||
"docker-machine",
|
firewallTargetTag,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue