Extension:LocalS3Repo

What can this extension do?
This extension implements the Amazon S3 as a filerepo. The local model was used as a base, and the wiki will use the S3 instead of the local disk drive for the storage of all uploaded files.

Usage
Once installed, it will operate automatically. There are no user interface issues. You have to have an account with Amazon S3, explained here.

Download instructions
Please download LocalS3Repo.zip and unzip it to, with folders. The files should be in the  directory. Note: $IP stands for the root directory of your MediaWiki installation, the same directory that holds LocalSettings.php.


 * If it doesn't work on MediaWiki 1.23+, this fork claims it works for that versions: https://github.com/cariaso/LocalS3Repo
 * I'm the author of that, and can warn you that while it mostly works, it's a bit crashy. Cariaso (talk) 03:26, 3 October 2015 (UTC)

Installation
To install this extension, add the following to LocalSettings.php:

To transfer your files from an existing wiki:
 * Create the bucket and the "folder" (the S3Fox tool for FireFox works well for this)
 * Transfer all the files/folders in your existing wiki's image directory to your "folder".
 * Set the ACL for the folder (and subfolders, etc) to be readable by everyone, if you do not use authentication

I have tested this with Windows 7 and with Linux, with Mediawiki versions 1.15.4 and 1.16.0beta3. I currently have a wiki running on Linux with this extension. I have tested the funcionality of upload, thumbnails, delete, archive, and rollback. There could be some other functions which some other extensions use which I didn't implement or test, watch out!

This extension isn't by any means perfect, because the files are sent first to the wiki server, and from there they are sent to the S3 system on uploads. On file reading, they come directly from the S3 system, which is correct. I am waiting for a new upload screen which has a progress bar, then I will implement sending the files directly to the S3 system on upload. So for now, the file size limit of your PHP server will be the file size limit. I deal with that on my system by doing it manually, because I have few files larger than the limit.

Note that the S3.php file, from Donovan Schönknecht, is included in the zip file, and requires that curl be installed on your PHP server (check your phpinfo).

Configuration parameters

 * $wgUploadS3Bucket --> The name of the bucket you created for the wiki
 * $wgUploadDirectory --> The "folder" under the bucket where you wish the files to be stored
 * $wgUploadS3SSL --> true if SSL should be used
 * $wgPublicS3 --> true if public S3 file access, false if signature authentication should be used
 * 'AWS_ACCESS_KEY' --> Your S3 access key, a long string of characters assigned by Amazon
 * 'AWS_SECRET_KEY' --> -Your S3 secret key, a long string of characters assigned by Amazon