From 38d756e08f59fc4bee491f7f53b736fed9102439 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Wed, 25 Mar 2026 22:19:03 -0700 Subject: [PATCH] doc: add s3.bucket.access command documentation Document the new weed shell command for configuring anonymous bucket access. Add to S3 Bucket Policies page and shell command listing. --- S3-Bucket-Policies.md | 27 +++++++++++++++++++++++++++ weed-shell.md | 5 +++-- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/S3-Bucket-Policies.md b/S3-Bucket-Policies.md index 148f736..ec76192 100644 --- a/S3-Bucket-Policies.md +++ b/S3-Bucket-Policies.md @@ -6,6 +6,33 @@ SeaweedFS supports AWS S3-compatible bucket policies for controlling access to b Bucket policies allow you to grant or deny permissions for S3 operations on a bucket and its objects. They are resource-based policies that complement user-level IAM policies. +## Quick Setup with Weed Shell + +The `s3.bucket.access` shell command provides a simple way to configure anonymous access without external tools. + +```bash +# View current anonymous access policy +> s3.bucket.access -name my-bucket + +# Grant anonymous read and list access (public download) +> s3.bucket.access -name my-bucket -access read,list + +# Grant full anonymous access +> s3.bucket.access -name my-bucket -access read,write,list + +# Remove all anonymous access (make private) +> s3.bucket.access -name my-bucket -access none +``` + +Supported permissions: `read` (GetObject), `write` (PutObject, DeleteObject, multipart), `list` (ListBucket). + +The command writes a standard bucket policy with `Principal: "*"`. Other (non-anonymous) policy statements are preserved when changing access. + +**Note:** Anonymous access also requires an `anonymous` identity in IAM. Create one via the admin UI or: +```bash +> s3.configure -user=anonymous -actions=Read,List -apply +``` + ## AWS CLI Setup First, configure the AWS CLI to connect to your SeaweedFS S3 endpoint: diff --git a/weed-shell.md b/weed-shell.md index df34198..641971a 100644 --- a/weed-shell.md +++ b/weed-shell.md @@ -52,8 +52,9 @@ Type: "help " for help on . Most commands support " - remote.mount.buckets # mount all buckets in remote storage and pull its metadata remote.uncache # keep the metadata but remote cache the file content for mounted directories or files remote.unmount # unmount remote storage - s3.bucket.create # create a bucket with a given name - s3.bucket.delete # delete a bucket by a given name + s3.bucket.access # view or change the anonymous access policy of an S3 bucket + s3.bucket.create # create a bucket with a given name + s3.bucket.delete # delete a bucket by a given name s3.bucket.list # list all buckets s3.bucket.lock # view or enable Object Lock for an S3 bucket s3.bucket.owner # view or change the owner of an S3 bucket