Setting up unrestricted access to S3 objects so they can easily be used by a static website.
If you attach files in Wiki JS, it stores it in the database. I don't like doing this for some of my large files as it makes the DB huge.
I upload them to S3, make them public, and just link to them from my wiki.
Create a General purpose bucket in S3
Unticking "Block all public access" isn't enough however.
In S3, go into the bucket, then the "Permissions" tab near the top of the screen.
In the field "Bucket Policy", paste in the following, changing XXXXXXX to the bucket name
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "PublicReadGetObject",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::XXXXXXXXX/*"
}
]
}
You can then link to the object in the S3 bucket just like any other resource on a public web server.
To get the public URL of any object, select it from within the bucket, then click on "Copy URL" button.
Setting up access to S3 objects so that a presigned URL is required to access them.