Commit e7a33813 authored by Joe Hoyle's avatar Joe Hoyle
Browse files

Update readme

parent 9e86f3b8
Loading
Loading
Loading
Loading
+40 −0
Original line number Diff line number Diff line
@@ -6,3 +6,43 @@ WordPress plugin to store uploads on S3. S3-Uploads aims to be a lightweight "dr
It's focused on providing a highly robust S3 interface with no "bells and whistles", WP-Admin UI or much otherwise. It comes with some helpful WP-CLI commands for generating IAM users, listing files on S3 and Migrating your existing library to S3.


Getting Set Up
==========

Once you have `git clone`d the repo, or added it as a Git Submodule, add the following constants to your `wp-config.php`:

```PHP
define( 'S3_UPLOADS_BUCKET', 'my-bucket' );
define( 'S3_UPLOADS_KEY', '' );
define( 'S3_UPLOADS_SECRET', '' );
```

You'll want to create a new IAM user for the S3-Uploads plugin, so you are not using admin level access keys on your site. S3-Uploads can create the IAM user for you and asign the correct permissions.

```
wp s3-uploads create-iam-user --admin-key=<key> --admin-secret=<secret>
```

This will provide you with a new Access Key and Secret Key which you can configure S3-Uploads with. Paste the values in the `wp-config.php`. That's it! You're good to go.


Migrating your Media to S3
==========

S3-Uploads can migrate your existing media library to S3. Once you have S3-Uploads up and running, use the following WP-CLI command:

```
wp s3-uploads migrate-attachments [--delete-local]
```

By default, S3-Uploads will keep your files locally just incase something goes wrong, but you can delete with the `--delete-local` flag.


Listing files on S3
==========

S3-Uploads comes with a WP-CLI command for listing files in the S3 bucket for debugging etc.

```
wp s3-uploads [<path>]
```
 No newline at end of file
+2 −2
Original line number Diff line number Diff line
@@ -4,7 +4,7 @@ class S3_Uploads_WP_CLI_Command extends WP_CLI_Command {

	/**
	 * @subcommand migrate-attachments
	 * @synposis [--delete-local]
	 * @synopsis [--delete-local]
	 */
	public function migrate_attachments_to_s3( $args, $args_assoc ) {

@@ -34,7 +34,7 @@ class S3_Uploads_WP_CLI_Command extends WP_CLI_Command {
	 * Migrate a single attachment's files to S3
	 * 
	 * @subcommand migrate-attachment
	 * @synposis <attachment-id> [--delete-local]
	 * @synopsis <attachment-id> [--delete-local]
	 */
	public function migrate_attachment_to_s3( $args, $args_assoc ) {