Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions pkg/mounter/geesefs.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ type geesefsMounter struct {
region string
accessKeyID string
secretAccessKey string
insecure bool
}

func newGeeseFSMounter(meta *s3.FSMeta, cfg *s3.Config) (Mounter, error) {
Expand All @@ -33,6 +34,7 @@ func newGeeseFSMounter(meta *s3.FSMeta, cfg *s3.Config) (Mounter, error) {
region: cfg.Region,
accessKeyID: cfg.AccessKeyID,
secretAccessKey: cfg.SecretAccessKey,
insecure: cfg.Insecure,
}, nil
}

Expand Down Expand Up @@ -94,6 +96,9 @@ func (geesefs *geesefsMounter) Mount(target, volumeID string) error {
if geesefs.region != "" {
args = append(args, "--region", geesefs.region)
}
if geesefs.insecure {
args = append(args, "--no-verify-ssl")
}
args = append(
args,
"--setuid", "65534", // nobody. drop root privileges
Expand Down
5 changes: 5 additions & 0 deletions pkg/mounter/rclone.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ type rcloneMounter struct {
region string
accessKeyID string
secretAccessKey string
insecure bool
}

const (
Expand All @@ -27,6 +28,7 @@ func newRcloneMounter(meta *s3.FSMeta, cfg *s3.Config) (Mounter, error) {
region: cfg.Region,
accessKeyID: cfg.AccessKeyID,
secretAccessKey: cfg.SecretAccessKey,
insecure: cfg.Insecure,
}, nil
}

Expand All @@ -45,6 +47,9 @@ func (rclone *rcloneMounter) Mount(target, volumeID string) error {
if rclone.region != "" {
args = append(args, fmt.Sprintf("--s3-region=%s", rclone.region))
}
if rclone.insecure {
args = append(args, "--no-check-certificate")
}
args = append(args, rclone.meta.MountOptions...)
envs := []string{
"AWS_ACCESS_KEY_ID=" + rclone.accessKeyID,
Expand Down
5 changes: 5 additions & 0 deletions pkg/mounter/s3fs.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ type s3fsMounter struct {
url string
region string
pwFileContent string
insecure bool
}

const (
Expand All @@ -25,6 +26,7 @@ func newS3fsMounter(meta *s3.FSMeta, cfg *s3.Config) (Mounter, error) {
url: cfg.Endpoint,
region: cfg.Region,
pwFileContent: cfg.AccessKeyID + ":" + cfg.SecretAccessKey,
insecure: cfg.Insecure,
}, nil
}

Expand All @@ -43,6 +45,9 @@ func (s3fs *s3fsMounter) Mount(target, volumeID string) error {
if s3fs.region != "" {
args = append(args, "-o", fmt.Sprintf("endpoint=%s", s3fs.region))
}
if s3fs.insecure {
args = append(args, "-o", "no_check_certificate")
}
args = append(args, s3fs.meta.MountOptions...)
return fuseMount(target, s3fsCmd, args, nil)
}
Expand Down