From 9df7d62b4b6a4c167a3a5f0b3a45d57f1728e3a9 Mon Sep 17 00:00:00 2001 From: Ping Qiu Date: Thu, 29 Oct 2026 01:36:16 -0700 Subject: [PATCH] mount, s3: clarify allowOthers requirement and bucket name error (#12197) * mount, s3: clarify allowOthers requirement and bucket name error `weed mount -allowOthers` defaults to true. On Linux, a non-root user's mount then needs `user_allow_other` in /etc/fuse.conf, but the help text only said "allows other users to access the file system". Say so in the help, and point at -allowOthers=false. Also fix the grammar of the bucket name length error ("must between [3, 63]" -> "must be between 3 and 63"). Help and error text only; no behaviour change. Co-Authored-By: Claude Opus 5.5 * s3: normalize the remaining VerifyS3BucketName error messages The length message was clarified; the rest of the function still had inconsistent phrasing ("name must start", "cannot be ip addresses", "prefix xn-- ... in bucket prefix"). Align them on "bucket name ..." wording matching the AWS bucket naming rules. --------- Co-authored-by: pingqiu Co-authored-by: Claude Opus 5.5 Co-authored-by: user.email --- weed/command/mount.go | 2 +- weed/s3api/s3bucket/s3api_bucket.go | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/weed/command/mount.go b/weed/command/mount.go index 3c81aa8cac..0b2fc929fb 100644 --- a/weed/command/mount.go +++ b/weed/command/mount.go @@ -115,7 +115,7 @@ func init() { mountOptions.cacheMetaTtlSec = cmdMount.Flag.Int("cacheMetaTtlSec", 60, "metadata cache validity seconds") mountOptions.cacheDirMaxEntries = cmdMount.Flag.Int("cacheDirMaxEntries", 100000, "a directory with more children than this is not cached locally but read directly from the filer; 0 caches everything") mountOptions.dataCenter = cmdMount.Flag.String("dataCenter", "", "prefer to write to the data center") - mountOptions.allowOthers = cmdMount.Flag.Bool("allowOthers", true, "allows other users to access the file system") + mountOptions.allowOthers = cmdMount.Flag.Bool("allowOthers", true, "allows other users to access the file system; on Linux, when mounting as a non-root user, this requires 'user_allow_other' in /etc/fuse.conf, so set -allowOthers=false otherwise") mountOptions.defaultPermissions = cmdMount.Flag.Bool("defaultPermissions", true, "enforce permissions by the operating system") mountOptions.umaskString = cmdMount.Flag.String("umask", "022", "octal umask, e.g., 022, 0111") mountOptions.nonempty = cmdMount.Flag.Bool("nonempty", false, "allows the mounting over a non-empty directory") diff --git a/weed/s3api/s3bucket/s3api_bucket.go b/weed/s3api/s3bucket/s3api_bucket.go index 238c49efa4..b3d3da351e 100644 --- a/weed/s3api/s3bucket/s3api_bucket.go +++ b/weed/s3api/s3bucket/s3api_bucket.go @@ -15,14 +15,14 @@ const reservedBucketName = "filemeta" // https://docs.aws.amazon.com/AmazonS3/latest/userguide/bucketnamingrules.html func VerifyS3BucketName(name string) (err error) { if len(name) < 3 || len(name) > 63 { - return fmt.Errorf("bucket name must between [3, 63] characters") + return fmt.Errorf("bucket name must be between 3 and 63 characters") } if name == reservedBucketName { return fmt.Errorf("bucket name %q is reserved", name) } for idx, ch := range name { if !(unicode.IsLower(ch) || ch == '.' || ch == '-' || unicode.IsNumber(ch)) { - return fmt.Errorf("bucket name can only contain lower case characters, numbers, dots, and hyphens") + return fmt.Errorf("bucket name can only contain lowercase letters, numbers, dots, and hyphens") } if idx > 0 && (ch == '.' && name[idx-1] == '.') { return fmt.Errorf("bucket names must not contain two adjacent periods") @@ -30,19 +30,19 @@ func VerifyS3BucketName(name string) (err error) { //TODO buckets with s3 transfer acceleration cannot have . in name } if name[0] == '.' || name[0] == '-' { - return fmt.Errorf("name must start with number or lower case character") + return fmt.Errorf("bucket name must start with a letter or number") } if name[len(name)-1] == '.' || name[len(name)-1] == '-' { - return fmt.Errorf("name must end with number or lower case character") + return fmt.Errorf("bucket name must end with a letter or number") } if strings.HasPrefix(name, "xn--") { - return fmt.Errorf("prefix xn-- is reserved and not allowed in bucket prefix") + return fmt.Errorf("bucket name must not start with 'xn--'") } if strings.HasSuffix(name, "-s3alias") { - return fmt.Errorf("suffix -s3alias is reserved and not allowed in bucket suffix") + return fmt.Errorf("bucket name must not end with '-s3alias'") } if net.ParseIP(name) != nil { - return fmt.Errorf("bucket name cannot be ip addresses") + return fmt.Errorf("bucket name must not be formatted as an IP address") } return nil }