BookStack: v23.06.2 Upload images to s3 doesn't work

Describe the Bug

The error is "File path /updates/images/gallery/{image_name} could nto be uploaded to. like https://github.com/BookStackApp/BookStack/issues/2739

Steps to Reproduce

my poilicy

{
	"Version": "2012-10-17",
	"Statement": [
		{
			"Sid": "Stmt1420044805001",
			"Effect": "Allow",
			"Action": [
				"s3:ListBucket",
				"s3:GetObject",
				"s3:GetObjectAcl",
				"s3:PutObject",
				"s3:PutObjectAcl",
				"s3:ReplicateObject",
				"s3:DeleteObject"
			],
			"Resource": [
				"arn:aws:s3:::my-bookstack",
				"arn:aws:s3:::my-bookstack/*"
			]
		}
	]
}
  1. Go to any document
  2. Edit the document
  3. Click on “insert an image” and drag and drop an image to upload it
  4. See error
  5. Check s3 bucket
  6. But the image already uploaded to s3

image

Expected Behaviour

it shouldn’t error

Screenshots or Additional Context

image

Browser Details

No response

Exact BookStack Version

v23.06.2

PHP Version

8.2

Hosting Environment

Docker

About this issue

  • Original URL
  • State: open
  • Created a year ago
  • Reactions: 2
  • Comments: 17 (5 by maintainers)

Most upvoted comments

Try this hack to avoid that line.

STORAGE_S3_ENDPOINT=https://s3.amazonaws.com

Yeah, STORAGE_S3_ENDPOINT will be region dependent, if setting manually for AWS.

From my view, this should work though. Happy to hear from anyone more experienced with AWS what might be required here, and why this appears to work for me but not others (Specifically this is the action of setting ACLs to make images public), especially as from the above it has been shown to be failing for those with PutObjectAcl permissions.

@oxismailxo Need to add the region aswell - “https://s3.eu-west-2.amazonaws.com” works for me