signature: Rewrite signature handling and move it into a library.

This commit is contained in:
Harshavardhana
2016-02-15 17:42:39 -08:00
parent b531bb31bb
commit 5a9333a67b
30 changed files with 1193 additions and 1215 deletions

View File

@@ -77,6 +77,7 @@ type cloudServerConfig struct {
// Credentials.
AccessKeyID string // Access key id.
SecretAccessKey string // Secret access key.
Region string // Region string.
/// FS options
Path string // Path to export for cloud storage
@@ -299,12 +300,17 @@ func serverMain(c *cli.Context) {
if _, err := os.Stat(path); err != nil {
fatalIf(probe.NewError(err), "Unable to validate the path", nil)
}
region := conf.Credentials.Region
if region == "" {
region = "us-east-1"
}
tls := (certFile != "" && keyFile != "")
serverConfig := cloudServerConfig{
Address: c.GlobalString("address"),
AccessLog: c.GlobalBool("enable-accesslog"),
AccessKeyID: conf.Credentials.AccessKeyID,
SecretAccessKey: conf.Credentials.SecretAccessKey,
Region: region,
Path: path,
MinFreeDisk: minFreeDisk,
TLS: tls,