Uploads dumped static site by StaticPress into S3.
StaticPress2019-S3 transforms your WordPress into static websites and blogs.
This plugin is a revival of StaticPress-S3 by CI / CD pipeline and TDD, and maintained by volunteers instead of the original no longer maintained.
- Sign into your WordPress admin dashboard.
- Click [Plugins] -> [Add New].
- Search by keyword:
staticpress2019
. - Click [Install Now] button for
StaticPress2019
andStaticPress2019-S3
. - Click [Activate] button for
StaticPress2019
andStaticPress2019-S3
.
Create IAM User for deploy and issue its access key. Then, attach following IAM policy:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:ListAllMyBuckets"
],
"Resource": "*"
},
{
"Effect": "Allow",
"Action": [
"s3:ListBucket"
],
"Resource": "arn:aws:s3:::<your-bucket-name>"
},
{
"Effect": "Allow",
"Action": [
"s3:PutObject"
],
"Resource": "arn:aws:s3:::<your-bucket-name>/*"
}
]
}
Create S3 bucket for hosting, set bucket object ownership control as BucketOwnerEnforced
, and set bucket policy as following:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::<your-aws-account-id>:user/<your-iam-user-name>"
},
"Action": "s3:ListBucket",
"Resource": "arn:aws:s3:::<your-bucket-name>"
},
{
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::<your-aws-account-id>:user/<your-iam-user-name>"
},
"Action": "s3:PutObject",
"Resource": "arn:aws:s3:::<your-bucket-name>/*"
}
]
}
Note: Blocking all public access doesn't reject upload.
- Sign into your WordPress admin dashboard.
- Click [StaticPress2019] -> [StaticPress2019 Options].
- Set [Static URL] as URL to publish in S3.
- Set [Save DIR (Document root)] as appropriate directory to dump static files.
- Click [Save Changes].
- Set [AWS Access Key], [AWS Secret Key], [AWS Region] in [StaticPress S3 Option].
- Click [Save Changes].
- Choose [S3 Bucket].
- Click [Save Changes].
- Click [StaticPress2019] -> [StaticPress2019].
- Click [Rebuild].
This plugin uses magic file to detect mime type.
If mime type is not correct, you can specify different magic file from default by using environment variable MAGIC
.
It's just for backward compatibility. New user shouldn't use it:
Disabling ACLs for all new buckets and enforcing Object Ownership - Amazon Simple Storage Service
Updated user may need to use it. According to the old specifications, StaticPress2019-S3 put object ACL when upload static file to S3.