Permalink
Browse files

Merge branch 'master' of github.com:bricoleurs/bricolage

  • Loading branch information...
theory committed Aug 6, 2011
2 parents 5e59259 + 631e289 commit d40aab7ba2ee5c22e8ee9881d6f30fce4dfe07f6
View
@@ -51,6 +51,15 @@ There was no Net::SFTP installer from Debian, so proceed with
$ sudo cpan install Net::SFTP
+Amazon S3 Mover
+---------------
+
+If you use the optional Amazon S3 mover, you have to install
+Net::Amazon::S3 by doing the following:
+
+ $ sudo apt-get install libnet-amazon-s3-perl
+
+
Perl module dependencies
------------------------
@@ -150,6 +159,7 @@ Optional, via CPAN:
Devel::Profiler
Net::SFTP
+ Net::Amazon::S3
Math::BigInt::GMP
Text::Aspell
PHP::Interpreter
View
@@ -175,11 +175,12 @@ PASSWD_LENGTH = 5
# Bricolage cannot ascertain the media type. Defaults to "text/html" if not
# specified.
#
-# Set ENABLE_SFTP_MOVER or ENABLE_WEBDAV_MOVER to 'yes' or 'on' or 1, to tell
-# the API that the distribution engine can distribute resources by SFTP or by
-# the WebDAV protocol. Both are disabled by default. Using either the SFTP or
-# the WebDAV mover requires some manual installation; perldoc Bric::Admin for
-# details.
+# Set ENABLE_SFTP_MOVER, ENABLE_S3_MOVER, or ENABLE_WEBDAV_MOVER to
+# 'yes' or 'on' or 1, to tell the API that the distribution engine can
+# distribute resources by SFTP, by Amazon S3, or by the WebDAV
+# protocol. All of those are disabled by default. Using either the SFTP,
+# the Amazon S3, or the WebDAV mover requires some manual installation;
+# perldoc Bric::Admin for details.
#
# Setting SFTP_MOVER_CIPHER will force the SFTP mover to use that cipher when
# distributing resources via SFTP. Consult the Net::SSH2 documentation
@@ -214,6 +215,7 @@ SFTP_MOVER_CIPHER = 0
SFTP_KEY_TYPE = 0
SFTP_PRIVATE_KEY_FILE = 0
SFTP_PUBLIC_KEY_FILE = 0
+ENABLE_S3_MOVER = No
ENABLE_WEBDAV_MOVER = No
QUEUE_PUBLISH_JOBS = No
FTP_UNLINK_BEFORE_MOVE = No
@@ -0,0 +1,19 @@
+#!/usr/bin/perl -w
+
+use strict;
+use FindBin;
+use lib "$FindBin::Bin/../lib";
+use bric_upgrade qw(:all);
+
+exit if fetch_sql(qq{
+ SELECT 1
+ FROM class
+ WHERE id = 82
+});
+
+do_sql(qq{
+ INSERT INTO class (id, key_name, pkg_name, disp_name, plural_name,
+ description, distributor)
+ VALUES (82, 's3', 'Bric::Util::Trans::S3', 'Amazon S3', 'Amazon S3 Transport',
+ 'Class with methods to move files via Amazon S3.', 1)
+});
View
@@ -2102,6 +2102,14 @@ entered in the Bricolage interface when setting up the destination.
=item *
+B<ENABLE_S3_MOVER:> This directive indicates whether the Bricolage
+server may distribute resources using the Amazon S3 mover. Setting
+this to "On" or "Yes" or "1" will enable the Amazon S3 mover. In order
+to use the Amazon S3 mover, you must install the Net::Amazon::S3
+module from the CPAN (and its prerequisites).
+
+=item *
+
B<ENABLE_WEBDAV_MOVER:> Bricolage also supports resource distribution through
the WebDAV protocol. Set this directive to "On" or "Yes" or "1" to enable it.
You need to have installed HTTP::DAV from the CPAN, in order to use WebDAV
View
@@ -16,6 +16,10 @@ This document lists the Changes to Bricolage introduced with each release.
=item *
+Added Amazon S3 mover. [John Durkin and Darren Embry]
+
+=item *
+
Added support for the L<CKeditor WYSIWYG editor|http://ckeditor.com/>.
[Zdravko Balorda]
View
@@ -102,6 +102,7 @@ our @EXPORT_OK = qw(DBD_PACKAGE
MEDIA_URI_ROOT
DEF_MEDIA_TYPE
ENABLE_SFTP_MOVER
+ ENABLE_S3_MOVER
ENABLE_SFTP_V2
SFTP_MOVER_CIPHER
SFTP_KEY_TYPE
@@ -251,6 +252,7 @@ our %EXPORT_TAGS = (all => \@EXPORT_OK,
FTP_UNLINK_BEFORE_MOVE
ENABLE_SFTP_MOVER
ENABLE_SFTP_V2
+ ENABLE_S3_MOVER
SFTP_MOVER_CIPHER
SFTP_KEY_TYPE
SFTP_PRIVATE_KEY_FILE
@@ -472,7 +474,7 @@ require Bric; our $VERSION = Bric->VERSION;
ENABLE_WYSIWYG AUTOGENERATE_SLUG ENABLE_GZIP
MEDIA_UNIQUE_FILENAME LDAP_TLS AUTO_PREVIEW_MEDIA
MASON_STATIC_SOURCE ALLOW_URIS_WITHOUT_CATEGORIES
- EXPIRE_ON_DEACTIVATE SKIP_SSL_REDIRECT))
+ EXPIRE_ON_DEACTIVATE SKIP_SSL_REDIRECT ENABLE_S3_MOVER))
{
my $d = exists $config->{$_} ? lc($config->{$_}) : '0';
$config->{$_} = $d eq 'on' || $d eq 'yes' || $d eq '1' ? 1 : 0;
@@ -588,6 +590,7 @@ require Bric; our $VERSION = Bric->VERSION;
use constant PREVIEW_MASON => $config->{PREVIEW_MASON};
use constant DEF_MEDIA_TYPE => $config->{DEF_MEDIA_TYPE} || 'text/html';
use constant ENABLE_SFTP_MOVER => $config->{ENABLE_SFTP_MOVER};
+ use constant ENABLE_S3_MOVER => $config->{ENABLE_S3_MOVER};
use constant ENABLE_SFTP_V2 => $config->{ENABLE_SFTP_V2};
use constant SFTP_MOVER_CIPHER => $config->{SFTP_MOVER_CIPHER} || 0;
use constant SFTP_KEY_TYPE => $config->{SFTP_KEY_TYPE};
@@ -40,6 +40,10 @@ if (ENABLE_SFTP_MOVER) {
require Bric::Util::Trans::SFTP;
}
+if (ENABLE_S3_MOVER) {
+ require Bric::Util::Trans::S3;
+}
+
if (ENABLE_WEBDAV_MOVER) {
require Bric::Util::Trans::WebDAV;
}
@@ -152,6 +156,11 @@ sub do_it {
"but SFTP Mover is disabled.");
}
+ unless (ENABLE_S3_MOVER or $class !~ /::S3$/) {
+ throw_ap(error => "Output channel is associated with S3 " .
+ "but S3 Mover is disabled.");
+ }
+
unless (ENABLE_WEBDAV_MOVER or $class !~ /::WebDAV$/) {
throw_ap(error => "Output channel is associated with WebDAV" .
"but WebDAV Mover is disabled.");
@@ -561,12 +561,13 @@ B<Notes:> NONE.
=cut
sub list_move_methods {
- my $and_sftp = ENABLE_SFTP_MOVER ? '' : q{AND key_name <> 'sftp'};
- my $and_dav = ENABLE_WEBDAV_MOVER ? '' : q{AND key_name <> 'webdav'};
+ my $and_sftp = ENABLE_SFTP_MOVER ? '' : q{AND key_name <> 'sftp'};
+ my $and_s3 = ENABLE_S3_MOVER ? '' : q{AND key_name <> 's3'};
+ my $and_dav = ENABLE_WEBDAV_MOVER ? '' : q{AND key_name <> 'webdav'};
my $sel = prepare_ca(qq{
SELECT disp_name
FROM class
- WHERE distributor = '1' $and_sftp $and_dav
+ WHERE distributor = '1' $and_sftp $and_s3 $and_dav
ORDER BY disp_name
}, undef);
return wantarray ? @{ col_aref($sel) } : col_aref($sel);
@@ -101,6 +101,7 @@ my $osen = { mac => 'MacOS',
msdos => 'MSDOS',
amiga => 'AmigaOS',
amigaos => 'AmigaOS',
+ awss3 => 'AWSS3',
};
################################################################################
Oops, something went wrong.

0 comments on commit d40aab7

Please sign in to comment.