NAME

WE_Frontend::Publish::FTP_MD5Sync - publish with FTP using MD5 fingerprints

SYNOPSIS

use WE_Frontend::Main2;
use WEsiteinfo qw($c);
$c->staging->transport("ftp-md5sync");
$main->publish;

or

use WE_Frontend::Main;
use WEsiteinfo;
$WEsiteinfo::livetransport = "ftp-md5sync";
$main->publish;

DESCRIPTION

WESITEINFO CONFIGURATION

This refers to the old format (first name) or the new format (second name).

$livetransport or $c->staging->transport

The transport protocol should be set to "ftp-md5sync".

$liveuser or $c->staging->user

The remote FTP user.

$livepassword or $c->staging->password

The remote FTP password.

$livedirectory or $c->staging->directory

The remote FTP directory. This is not the real filesystem path on the remote host, but the virtual FTP path. For example: the real filesystem path may be somthing like /home/users/company, but if you login to the server as company, you will see / as the FTP root path.

If the FTP root is /, the value of $livedirectory should be an empty string.

$livehost or $c->staging->host

The remove host.

$pubhtmldir or $c->paths->pubhtmldir

The local htdocs directory.

$livecgidirectory or $c->staging->cgidirectory

If there are CGI programs to be published, the remote cgi directory have to be specified. The same rules as in $livedirectory apply.

@stagingextracgi or $c->project->stagingextracgi

An array reference with additional cgi scripts to be published.

$livestagingext or $c->staging->stagingext

A hash reference with additional attributes:

dryrun

If set to a true value, then do not execute the FTP commands, just show them.

md5listcgi

The remote CGI script to create the MD5 list. The script is included in the WE_Framework as cgi-scripts/get_md5_list.cgi.

topdirectory

The top directory of the remote server. Here the real filesystem path should be used. In the example above, this would be /home/users/company.

deleteold

If true, then outdated remote files (not existing on the local side) are deleted.

movetotrash

If true, then outdated remote files will be moved to the trashdirectory. Cannot be used together with deleteold.

trashdirectory

The FTP directory name of a trash directory. Have to be defined if movetotrash is set.

GETMD5LIST.CGI CONFIGURATION

The CGI script get_md5_list.cgi is configured by creating a perl file called get_md5_list.cgi.config which should reside in the same directory as the CGI script. The following perl variables may be set as configuration variables:

@directories

A list of directories for which the MD5 fingerprints should be collected. Normally these are livedirectory and livecgidirectory from the WEsiteinfo configuration.

@digest_method

Specify a list with the preferred methods to get the MD5 digest. This does not need to be set; get_md5_list.cgi is smart enough to get a supported method automatically. Permitted values are:

'perl:Digest::MD5'

Use the perl module Digest::MD5.

'perl:MD5'

Use the (old) perl module MD5.

'cmd:md5'

Use the OS command md5 (BSD systems).

'cmd:md5sum'

Use the OS command md5sum (Linux and Solaris systems).

'perl:Digest::Perl::MD5'

Use the pure perl module Digest::Perl::MD5.

'cmd:cksum'

Use the obsolete chksum command.

'stat:modtime'

Just stat the file and use the modification time of the file.

@exclude

A list of files to be excluded. The check will be done against the partial filename, beginning at the paths as in @directories.

%exclude

Per-directory (as in @directories) exclude list. For example, if

@directories = ("/home/htdocs", "/home/htdocs/cgi-bin");

is specified, then %exclude may be

%exclude = ("/home/htdocs" => ['.htaccess', 'cgi-bin/.*'],
            "/home/htdocs/cgi-bin" => ['mails.*']);

Note that it is generally problematic to have subdirs specified in @directories --- in such a case the %exclude variable should be set cleverly.

$verbose

Be verbose if set to a true value. The messages are printed to STDERR. Note that some servers do not like output to STDERR --- it will get mixed up with STDOUT output.

CAVEAT

There are still some problems with this module. Be especially careful if using the deleteold feature.

AUTHOR

Slaven Rezic - slaven@rezic.de

SEE ALSO