|
|
@ -39,13 +39,12 @@ var flags = []cli.Flag{ |
|
|
|
Value: ":9000", |
|
|
|
Value: ":9000", |
|
|
|
Usage: "ADDRESS:PORT for object storage access", |
|
|
|
Usage: "ADDRESS:PORT for object storage access", |
|
|
|
}, |
|
|
|
}, |
|
|
|
/* |
|
|
|
cli.StringFlag{ |
|
|
|
cli.StringFlag{ |
|
|
|
Name: "address-mgmt", |
|
|
|
Name: "address-mgmt", |
|
|
|
Hide: true, |
|
|
|
Value: ":9001", |
|
|
|
Value: ":9001", |
|
|
|
Usage: "ADDRESS:PORT for management console access", |
|
|
|
Usage: "ADDRESS:PORT for management console access", |
|
|
|
}, |
|
|
|
}, |
|
|
|
*/ |
|
|
|
|
|
|
|
cli.IntFlag{ |
|
|
|
cli.IntFlag{ |
|
|
|
Name: "ratelimit", |
|
|
|
Name: "ratelimit", |
|
|
|
Value: 16, |
|
|
|
Value: 16, |
|
|
@ -53,15 +52,11 @@ var flags = []cli.Flag{ |
|
|
|
}, |
|
|
|
}, |
|
|
|
cli.StringFlag{ |
|
|
|
cli.StringFlag{ |
|
|
|
Name: "cert", |
|
|
|
Name: "cert", |
|
|
|
Hide: true, |
|
|
|
Usage: "Provide your domain certificate", |
|
|
|
Value: "", |
|
|
|
|
|
|
|
Usage: "cert.pem", |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
cli.StringFlag{ |
|
|
|
cli.StringFlag{ |
|
|
|
Name: "key", |
|
|
|
Name: "key", |
|
|
|
Hide: true, |
|
|
|
Usage: "Provide your domain private key", |
|
|
|
Value: "", |
|
|
|
|
|
|
|
Usage: "key.pem", |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
cli.BoolFlag{ |
|
|
|
cli.BoolFlag{ |
|
|
|
Name: "debug", |
|
|
|
Name: "debug", |
|
|
@ -78,8 +73,8 @@ func init() { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func getAPIServerConfig(c *cli.Context) httpserver.Config { |
|
|
|
func getAPIServerConfig(c *cli.Context) httpserver.Config { |
|
|
|
certFile := c.String("cert") |
|
|
|
certFile := c.GlobalString("cert") |
|
|
|
keyFile := c.String("key") |
|
|
|
keyFile := c.GlobalString("key") |
|
|
|
if (certFile != "" && keyFile == "") || (certFile == "" && keyFile != "") { |
|
|
|
if (certFile != "" && keyFile == "") || (certFile == "" && keyFile != "") { |
|
|
|
Fatalln("Both certificate and key are required to enable https.") |
|
|
|
Fatalln("Both certificate and key are required to enable https.") |
|
|
|
} |
|
|
|
} |
|
|
|