Do not pass empty region, use stderr for GeeseFS log
This commit is contained in:
parent
bca84a06f4
commit
7c2bcfc4b0
3 changed files with 10 additions and 3 deletions
|
@ -42,8 +42,11 @@ func (geesefs *geesefsMounter) Mount(source string, target string) error {
|
||||||
fullPath := fmt.Sprintf("%s:%s", geesefs.meta.BucketName, geesefs.meta.Prefix)
|
fullPath := fmt.Sprintf("%s:%s", geesefs.meta.BucketName, geesefs.meta.Prefix)
|
||||||
args := []string{
|
args := []string{
|
||||||
"--endpoint", geesefs.endpoint,
|
"--endpoint", geesefs.endpoint,
|
||||||
"--region", geesefs.region,
|
|
||||||
"-o", "allow_other",
|
"-o", "allow_other",
|
||||||
|
"--log-file", "/dev/stderr",
|
||||||
|
}
|
||||||
|
if geesefs.region != "" {
|
||||||
|
args = append(args, "--region", geesefs.region)
|
||||||
}
|
}
|
||||||
args = append(args, geesefs.meta.MountOptions...)
|
args = append(args, geesefs.meta.MountOptions...)
|
||||||
args = append(args, fullPath, target)
|
args = append(args, fullPath, target)
|
||||||
|
|
|
@ -47,11 +47,13 @@ func (rclone *rcloneMounter) Mount(source string, target string) error {
|
||||||
"--daemon",
|
"--daemon",
|
||||||
"--s3-provider=AWS",
|
"--s3-provider=AWS",
|
||||||
"--s3-env-auth=true",
|
"--s3-env-auth=true",
|
||||||
fmt.Sprintf("--s3-region=%s", rclone.region),
|
|
||||||
fmt.Sprintf("--s3-endpoint=%s", rclone.url),
|
fmt.Sprintf("--s3-endpoint=%s", rclone.url),
|
||||||
"--allow-other",
|
"--allow-other",
|
||||||
"--vfs-cache-mode=writes",
|
"--vfs-cache-mode=writes",
|
||||||
}
|
}
|
||||||
|
if rclone.region != "" {
|
||||||
|
args = append(args, fmt.Sprintf("--s3-region=%s", rclone.region))
|
||||||
|
}
|
||||||
args = append(args, rclone.meta.MountOptions...)
|
args = append(args, rclone.meta.MountOptions...)
|
||||||
os.Setenv("AWS_ACCESS_KEY_ID", rclone.accessKeyID)
|
os.Setenv("AWS_ACCESS_KEY_ID", rclone.accessKeyID)
|
||||||
os.Setenv("AWS_SECRET_ACCESS_KEY", rclone.secretAccessKey)
|
os.Setenv("AWS_SECRET_ACCESS_KEY", rclone.secretAccessKey)
|
||||||
|
|
|
@ -45,10 +45,12 @@ func (s3fs *s3fsMounter) Mount(source string, target string) error {
|
||||||
target,
|
target,
|
||||||
"-o", "use_path_request_style",
|
"-o", "use_path_request_style",
|
||||||
"-o", fmt.Sprintf("url=%s", s3fs.url),
|
"-o", fmt.Sprintf("url=%s", s3fs.url),
|
||||||
"-o", fmt.Sprintf("endpoint=%s", s3fs.region),
|
|
||||||
"-o", "allow_other",
|
"-o", "allow_other",
|
||||||
"-o", "mp_umask=000",
|
"-o", "mp_umask=000",
|
||||||
}
|
}
|
||||||
|
if s3fs.region != "" {
|
||||||
|
args = append(args, "-o", fmt.Sprintf("endpoint=%s", s3fs.region))
|
||||||
|
}
|
||||||
args = append(args, s3fs.meta.MountOptions...)
|
args = append(args, s3fs.meta.MountOptions...)
|
||||||
return fuseMount(target, s3fsCmd, args)
|
return fuseMount(target, s3fsCmd, args)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue