Skip to content

Commit e44e1a7

Browse files
committed
Added --s3.enable-tls flag
1 parent 3588581 commit e44e1a7

File tree

5 files changed

+15
-2
lines changed

5 files changed

+15
-2
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ In order to disperse to the EigenDA network in production, or at high throughput
6262
| `--s3.bucket` | | `$EIGENDA_PROXY_S3_BUCKET` | Bucket name for S3 storage. |
6363
| `--s3.path` | | `$EIGENDA_PROXY_S3_PATH` | Bucket path for S3 storage. |
6464
| `--s3.endpoint` | | `$EIGENDA_PROXY_S3_ENDPOINT` | Endpoint for S3 storage. |
65+
| `--s3.enable-tls` | | `$EIGENDA_PROXY_S3_ENABLE_TLS` | Enable TLS connection to S3 endpoint. |
6566
| `--routing.fallback-targets` | `[]` | `$EIGENDA_PROXY_FALLBACK_TARGETS` | Fall back backend targets. Supports S3. | Backup storage locations to read from in the event of eigenda retrieval failure. |
6667
| `--routing.cache-targets` | `[]` | `$EIGENDA_PROXY_CACHE_TARGETS` | Caching targets. Supports S3. | Caches data to backend targets after dispersing to DA, retrieved from before trying read from EigenDA. |
6768
| `--s3.timeout` | `5s` | `$EIGENDA_PROXY_S3_TIMEOUT` | timeout for S3 storage operations (e.g. get, put) |

e2e/setup.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ func createS3Config(eigendaCfg server.Config) server.CLIConfig {
8181
Bucket: bucketName,
8282
Path: "",
8383
Endpoint: "localhost:4566",
84+
EnableTLS: false,
8485
AccessKeySecret: "minioadmin",
8586
AccessKeyID: "minioadmin",
8687
CredentialType: s3.CredentialTypeStatic,

server/config_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ func validCfg() *Config {
3030
Bucket: "test-bucket",
3131
Path: "",
3232
Endpoint: "http://localhost:9000",
33+
EnableTLS: false,
3334
AccessKeyID: "access-key-id",
3435
AccessKeySecret: "access-key-secret",
3536
},

store/precomputed_key/s3/cli.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88

99
var (
1010
EndpointFlagName = withFlagPrefix("endpoint")
11+
EnableTLSFlagName = withFlagPrefix("enable-tls")
1112
CredentialTypeFlagName = withFlagPrefix("credential-type")
1213
AccessKeyIDFlagName = withFlagPrefix("access-key-id") // #nosec G101
1314
AccessKeySecretFlagName = withFlagPrefix("access-key-secret") // #nosec G101
@@ -35,9 +36,16 @@ func CLIFlags(envPrefix, category string) []cli.Flag {
3536
EnvVars: withEnvPrefix(envPrefix, "S3_ENDPOINT"),
3637
Category: category,
3738
},
39+
&cli.BoolFlag{
40+
Name: EnableTLSFlagName,
41+
Usage: "enable TLS connection to S3 endpoint",
42+
Value: false,
43+
EnvVars: withEnvPrefix(envPrefix, "S3_ENABLE_TLS"),
44+
Category: category,
45+
},
3846
&cli.StringFlag{
3947
Name: CredentialTypeFlagName,
40-
Usage: "The way to authenticate to S3, options are [iam, static]",
48+
Usage: "the way to authenticate to S3, options are [iam, static]",
4149
EnvVars: withEnvPrefix(envPrefix, "CREDENTIAL_TYPE"),
4250
Category: category,
4351
},
@@ -86,6 +94,7 @@ func ReadConfig(ctx *cli.Context) Config {
8694
return Config{
8795
CredentialType: StringToCredentialType(ctx.String(CredentialTypeFlagName)),
8896
Endpoint: ctx.String(EndpointFlagName),
97+
EnableTLS: ctx.Bool(EnableTLSFlagName),
8998
AccessKeyID: ctx.String(AccessKeyIDFlagName),
9099
AccessKeySecret: ctx.String(AccessKeySecretFlagName),
91100
Bucket: ctx.String(BucketFlagName),

store/precomputed_key/s3/s3.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ type CredentialType string
3939
type Config struct {
4040
CredentialType CredentialType
4141
Endpoint string
42+
EnableTLS bool
4243
AccessKeyID string
4344
AccessKeySecret string
4445
Bucket string
@@ -57,7 +58,7 @@ type Store struct {
5758
func NewS3(cfg Config) (*Store, error) {
5859
client, err := minio.New(cfg.Endpoint, &minio.Options{
5960
Creds: creds(cfg),
60-
Secure: false,
61+
Secure: cfg.EnableTLS,
6162
})
6263
if err != nil {
6364
return nil, err

0 commit comments

Comments
 (0)