From 15c49c2ae641ef1155e51f5c8ce5c266c2cae5c2 Mon Sep 17 00:00:00 2001 From: Fortune Ngwenya Date: Thu, 28 Sep 2023 10:04:04 +0200 Subject: [PATCH 1/7] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index c90ee6e..26cb01b 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,7 @@ The application can be configured with the following environment variables: - `SECRET_ACCESS_KEY`: Your S3 secret access key (required) (works only if `USE_IAM` is `false`) - `USE_SSL`: Whether your S3 server uses SSL or not (defaults to `true`) - `SKIP_SSL_VERIFICATION`: Whether the HTTP client should skip SSL verification (defaults to `false`) +- `SKIP_SIGNATURE_AUTHORIZATION`: Whether the signature authorization should be skipped (defaults to `false`) - `PORT`: The port the s3manager app should listen on (defaults to `8080`) - `ALLOW_DELETE`: Enable buttons to delete objects (defaults to `true`) - `FORCE_DOWNLOAD`: Add response headers for object downloading instead of opening in a new tab (defaults to `true`) From 3e70e7d83e37a3b22a0953262ac4e2651bdcd228 Mon Sep 17 00:00:00 2001 From: Fortune Ngwenya Date: Thu, 28 Sep 2023 10:05:23 +0200 Subject: [PATCH 2/7] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 26cb01b..1f0b234 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ The application can be configured with the following environment variables: - `SECRET_ACCESS_KEY`: Your S3 secret access key (required) (works only if `USE_IAM` is `false`) - `USE_SSL`: Whether your S3 server uses SSL or not (defaults to `true`) - `SKIP_SSL_VERIFICATION`: Whether the HTTP client should skip SSL verification (defaults to `false`) -- `SKIP_SIGNATURE_AUTHORIZATION`: Whether the signature authorization should be skipped (defaults to `false`) +- `SKIP_SIGNATURE_AUTHORIZATION`: Whether signature authorization against S3 server should be skipped (defaults to `false`) - `PORT`: The port the s3manager app should listen on (defaults to `8080`) - `ALLOW_DELETE`: Enable buttons to delete objects (defaults to `true`) - `FORCE_DOWNLOAD`: Add response headers for object downloading instead of opening in a new tab (defaults to `true`) From e6aacad30f7d22583e09df2505a00a65d689f1ae Mon Sep 17 00:00:00 2001 From: Fortune Ngwenya Date: Thu, 28 Sep 2023 10:08:49 +0200 Subject: [PATCH 3/7] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1f0b234..2ede9be 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ The application can be configured with the following environment variables: - `SECRET_ACCESS_KEY`: Your S3 secret access key (required) (works only if `USE_IAM` is `false`) - `USE_SSL`: Whether your S3 server uses SSL or not (defaults to `true`) - `SKIP_SSL_VERIFICATION`: Whether the HTTP client should skip SSL verification (defaults to `false`) -- `SKIP_SIGNATURE_AUTHORIZATION`: Whether signature authorization against S3 server should be skipped (defaults to `false`) +- `SKIP_SIGNATURE_AUTHORIZATION`: Whether signature authorization should be skipped (defaults to `false`) - `PORT`: The port the s3manager app should listen on (defaults to `8080`) - `ALLOW_DELETE`: Enable buttons to delete objects (defaults to `true`) - `FORCE_DOWNLOAD`: Add response headers for object downloading instead of opening in a new tab (defaults to `true`) From 5cf6c696cfb6d3c3927b18689b0ed63d65a3419b Mon Sep 17 00:00:00 2001 From: Fortune Ngwenya Date: Thu, 28 Sep 2023 10:16:34 +0200 Subject: [PATCH 4/7] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2ede9be..4e94577 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ The application can be configured with the following environment variables: - `SECRET_ACCESS_KEY`: Your S3 secret access key (required) (works only if `USE_IAM` is `false`) - `USE_SSL`: Whether your S3 server uses SSL or not (defaults to `true`) - `SKIP_SSL_VERIFICATION`: Whether the HTTP client should skip SSL verification (defaults to `false`) -- `SKIP_SIGNATURE_AUTHORIZATION`: Whether signature authorization should be skipped (defaults to `false`) +- `SKIP_SIGNATURE`: Whether signature should be skipped (defaults to `false`) - `PORT`: The port the s3manager app should listen on (defaults to `8080`) - `ALLOW_DELETE`: Enable buttons to delete objects (defaults to `true`) - `FORCE_DOWNLOAD`: Add response headers for object downloading instead of opening in a new tab (defaults to `true`) From 33ed1b83b23cd82ea6f74d30706d4164cbba4f2a Mon Sep 17 00:00:00 2001 From: Fortune Ngwenya Date: Thu, 28 Sep 2023 10:21:28 +0200 Subject: [PATCH 5/7] Update main.go --- main.go | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index c5c75da..4767b1f 100644 --- a/main.go +++ b/main.go @@ -35,6 +35,7 @@ type configuration struct { ForceDownload bool UseSSL bool SkipSSLVerification bool + SkipSignature bool ListRecursive bool Port string Timeout int32 @@ -80,6 +81,9 @@ func parseConfiguration() configuration { viper.SetDefault("SKIP_SSL_VERIFICATION", false) skipSSLVerification := viper.GetBool("SKIP_SSL_VERIFICATION") + viper.SetDefault("SKIP_SIGNATURE", false) + skipSignature := viper.GetBool("SKIP_SIGNATURE") + listRecursive := viper.GetBool("LIST_RECURSIVE") viper.SetDefault("PORT", "8080") @@ -90,6 +94,7 @@ func parseConfiguration() configuration { viper.SetDefault("SSE_TYPE", "") sseType := viper.GetString("SSE_TYPE") + viper.SetDefault("SSE_KEY", "") sseKey := viper.GetString("SSE_KEY") @@ -104,6 +109,7 @@ func parseConfiguration() configuration { ForceDownload: forceDownload, UseSSL: useSSL, SkipSSLVerification: skipSSLVerification, + SkipSignature: skipSignature, ListRecursive: listRecursive, Port: port, Timeout: timeout, @@ -136,7 +142,11 @@ func main() { if configuration.UseIam { opts.Creds = credentials.NewIAM(configuration.IamEndpoint) } else { - opts.Creds = credentials.NewStaticV4(configuration.AccessKeyID, configuration.SecretAccessKey, "") + if (configuration.SkipSignature) { + opts.Creds = credentials.NewStatic(configuration.AccessKeyID, configuration.SecretAccessKey, "", SignatureType.SignatureAnonymous) + } else { + opts.Creds = credentials.NewStaticV4(configuration.AccessKeyID, configuration.SecretAccessKey, "") + } } if configuration.Region != "" { From 406e608b7d4f8e36de75ec3784dcaf27418332c4 Mon Sep 17 00:00:00 2001 From: Fortune Ngwenya Date: Thu, 28 Sep 2023 10:32:34 +0200 Subject: [PATCH 6/7] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4e94577..e1ebbed 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ The application can be configured with the following environment variables: - `SECRET_ACCESS_KEY`: Your S3 secret access key (required) (works only if `USE_IAM` is `false`) - `USE_SSL`: Whether your S3 server uses SSL or not (defaults to `true`) - `SKIP_SSL_VERIFICATION`: Whether the HTTP client should skip SSL verification (defaults to `false`) -- `SKIP_SIGNATURE`: Whether signature should be skipped (defaults to `false`) +- `SKIP_SIGNATURE`: Whether authorization signature should be skipped or not (defaults to `false`) - `PORT`: The port the s3manager app should listen on (defaults to `8080`) - `ALLOW_DELETE`: Enable buttons to delete objects (defaults to `true`) - `FORCE_DOWNLOAD`: Add response headers for object downloading instead of opening in a new tab (defaults to `true`) From decff5515cd79c458e8e076ffaebe1f10e0fcdce Mon Sep 17 00:00:00 2001 From: Fortune Ngwenya Date: Thu, 28 Sep 2023 10:53:17 +0200 Subject: [PATCH 7/7] Update main.go --- main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.go b/main.go index 4767b1f..2fda3ab 100644 --- a/main.go +++ b/main.go @@ -143,7 +143,7 @@ func main() { opts.Creds = credentials.NewIAM(configuration.IamEndpoint) } else { if (configuration.SkipSignature) { - opts.Creds = credentials.NewStatic(configuration.AccessKeyID, configuration.SecretAccessKey, "", SignatureType.SignatureAnonymous) + opts.Creds = credentials.NewStatic(configuration.AccessKeyID, configuration.SecretAccessKey, "", credentials.SignatureAnonymous) } else { opts.Creds = credentials.NewStaticV4(configuration.AccessKeyID, configuration.SecretAccessKey, "") }