Warning: this is currently Work In Progress, we have no garanteed open source solution for the the 'watcher'. Soon to be continued.

FTP Batch Installation

In order to use the MediaMosa bulkupload facility your system should run a FTP Server to allow users to upload their data to your server using FTP.

A watcher-program (watcher) monitors the upload directory and invokes xml-parser, the program responsible for the actual processing of the uploaded data.

These instructions assume that you are using Debian Linux, ProFTPD and a MySQL database to store the relevant user-data.

ProFTPD

To install the required packages issue the following command (with root privileges):

apt-get install proftpd proftpd-mod-mysql

During the ProFTPd configuration, choose 'standalone' is acceptable for most installations.

Create a new file called /etc/proftpd/mediamosa_proftpd.conf (with root) and add the following text;

ServerName                      "Batchupload MediaMosa"

DebugLevel 0

DefaultRoot                     ~

# Users require a valid shell listed in /etc/shells to login.
# Use this directive to release that constrain.
RequireValidShell               off

# Set the user and group that the server normally runs at.
User    www-data
Group   www-data

LoadModule mod_sql.c
LoadModule mod_sql_mysql.c

  SQLBackend                      mysql
  # userid van www-data
  SQLMinID                        33
  SQLDefaultUID                   33
  SQLAuthenticate                 users
  SQLAuthTypes                    OpenSSL

  ## databasename@host database_user user_password

  SQLConnectInfo     <database>@<host> <db_username> <db_password>
  SQLUserInfo        mediamosa_ftp_user userid passwd uid gid homedir shell
  SQLUserWhereClause "active=1"

  ## create a user's home directory on demand if it doesn't exist
  CreateHome      on 777

  SQLLog             PASS updatecount
  SQLNamedQuery      updatecount UPDATE "count=count+1, accessed=now() WHERE userid='%u'" mediamosa_ftp_user

  SQLLog             STOR,DELE modified
  SQLNamedQuery      modified UPDATE "modified=now() WHERE userid='%u'" mediamosa_ftp_user

Make sure you change the SQLConnectInfo with the correct MySQL user connection.

Now edit /etc/proftpd/proftpd.conf and add the following line at the end of the file;

Include /etc/proftpd/mediamosa_proftpd.conf

To make your changes to take effect, you need to restart the FTP server;

/etc/init.d/proftpd restart

XML-parser

The XML-parser is the tool that translates a .vuf file to corresponding REST-calls. It is a fairly basic php-program, deploy the sources and modify xml-parser/settings.php:

define("VPX_HOST",               "localhost");
define("VPX_URL_PREFIX",         "");
define("SAN_NAS_BASE_PATH",      "__HOMEDIR__");

Also replace __HOMEDIR__ with the path to the previously defined upload-directory. The VPX_host in combination with the URL_PREFIX is should be the REST interface. In 1.7 this has to match the /internal (also make sure to protect the /internal for other access), in version 2, the MEDIAMOSA_INTERNAL_PASSWORD has to be set.

Watcher software

Finally you need to install and run the watcher software. This software will detect any changes in the ftp-upload directory and control the the processing of the uploaded files.

..

Attachments