diff --git a/plugins/filter/seaweedfs.py b/plugins/filter/seaweedfs.py index 1fb11df952..f1029c6ece 100644 --- a/plugins/filter/seaweedfs.py +++ b/plugins/filter/seaweedfs.py @@ -83,7 +83,9 @@ def seaweedfs_sidecar_script(bucket, s3_port, access_key, secret_key): The ``s3.configure`` grant is required since SeaweedFS 4.39: a server started without an ``-s3.config`` has zero identities, and ListBuckets then returns an empty list to the consumer's access key, so the consumer - reads the bucket as missing even though it exists. + reads the bucket as missing even though it exists. ``WriteAcp`` is + required since SeaweedFS 4.49: a PutObject carrying ``x-amz-acl`` is + also authorized as s3:PutObjectAcl and answers AccessDenied without it. Args: bucket: consumer bucket name created idempotently at startup. @@ -95,7 +97,7 @@ def seaweedfs_sidecar_script(bucket, s3_port, access_key, secret_key): grant = ( f"s3.configure -user {bucket} -access_key {access_key} " f"-secret_key {secret_key} -buckets {bucket} " - f"-actions Read,Write,List,Tagging -apply" + f"-actions Read,Write,WriteAcp,List,Tagging -apply" ) return ( f"(until wget -q -O /dev/null http://127.0.0.1:{s3_port}/status; do sleep 2; done; " diff --git a/roles/web-app-seaweedfs/README.md b/roles/web-app-seaweedfs/README.md index ba0d9269d6..ae9a7ff926 100644 --- a/roles/web-app-seaweedfs/README.md +++ b/roles/web-app-seaweedfs/README.md @@ -16,7 +16,7 @@ This role adds only the human-facing half: an nginx sidecar that routes two cano The sidecar reaches the engine over the shared object-store network, so the console can be deployed, removed or left out of a node without touching the store. A node that does not run this role keeps its object store and its S3 endpoint; it simply has no browser console. -Per-consumer S3 identities are rendered into `s3.json`: each consuming role receives an access key and bucket-scoped `Read`, `Write`, `List`, and `Tagging` actions, and consumers marked `public` additionally receive anonymous read on their bucket. +Per-consumer S3 identities are rendered into `s3.json`: each consuming role receives an access key and bucket-scoped `Read`, `Write`, `WriteAcp`, `List`, and `Tagging` actions, and consumers marked `public` additionally receive anonymous read on their bucket. Consumer buckets are created through `weed shell` when a consumer role requests provisioning. In embedded mode (`shared: false`) a consumer's compose stack receives a storage-only SeaweedFS container without UI or published ports. diff --git a/roles/web-svc-seaweedfs/README.md b/roles/web-svc-seaweedfs/README.md index 77023ebbf7..ddd02354f7 100644 --- a/roles/web-svc-seaweedfs/README.md +++ b/roles/web-svc-seaweedfs/README.md @@ -17,7 +17,7 @@ The role serves one canonical domain: The browser interfaces for the filer and master are served by [web-app-seaweedfs](../web-app-seaweedfs/), which reaches this role over the shared object-store network. A node running this role without the console keeps its object store and its S3 endpoint; it simply has no browser console. -Per-consumer S3 identities are rendered into `s3.json`: each consuming role receives an access key and bucket-scoped `Read`, `Write`, `List`, and `Tagging` actions, and consumers marked `public` additionally receive anonymous read on their bucket. +Per-consumer S3 identities are rendered into `s3.json`: each consuming role receives an access key and bucket-scoped `Read`, `Write`, `WriteAcp`, `List`, and `Tagging` actions, and consumers marked `public` additionally receive anonymous read on their bucket. Consumer buckets are created through `weed shell` when a consumer role requests provisioning. In embedded mode (`shared: false`) a consumer's compose stack receives a storage-only SeaweedFS container without UI or published ports. diff --git a/roles/web-svc-seaweedfs/templates/s3.json.j2 b/roles/web-svc-seaweedfs/templates/s3.json.j2 index 7fbfaccbf0..4027d5044c 100644 --- a/roles/web-svc-seaweedfs/templates/s3.json.j2 +++ b/roles/web-svc-seaweedfs/templates/s3.json.j2 @@ -13,6 +13,7 @@ "actions": [ "Read:" ~ objstore.bucket, "Write:" ~ objstore.bucket, + "WriteAcp:" ~ objstore.bucket, "List:" ~ objstore.bucket, "Tagging:" ~ objstore.bucket ] diff --git a/tests/unit/python/plugins/filter/test_seaweedfs.py b/tests/unit/python/plugins/filter/test_seaweedfs.py index 2291b8856e..0d4511b33a 100644 --- a/tests/unit/python/plugins/filter/test_seaweedfs.py +++ b/tests/unit/python/plugins/filter/test_seaweedfs.py @@ -81,7 +81,7 @@ class TestSeaweedfsSidecarScriptFilter(unittest.TestCase): self.assertLess(create, grant) self.assertIn("-access_key AKID", script) self.assertIn("-secret_key SEC", script) - self.assertIn("-actions Read,Write,List,Tagging", script) + self.assertIn("-actions Read,Write,WriteAcp,List,Tagging", script) def test_keeps_server_in_foreground(self): script = seaweedfs_sidecar_script("app", 8333, "AK", "SK")