Difference between revisions of "Seon Enterprise - Fetch files from (S)FTP server"

From Seon
Jump to: navigation, search
Line 40: Line 40:
 
This file must have permissions to be readable only by root, so you might change the permissions after creating / modifying the file:
 
This file must have permissions to be readable only by root, so you might change the permissions after creating / modifying the file:
 
  chmod 600 /root/.netrc
 
  chmod 600 /root/.netrc
 +
 +
== Add FTP server mount for bootup ==
 +
In addition to let the FTP server be mounted at bootup (which is the most common way), you have to add a line to the filesystem table file:
 +
/etc/fstab
 +
The line to be added has the following syntax:
 +
curlftpfs#192.168.20.71 /mnt/ftp/server1 fuse auto,allow_other,disable_eprt,_netdev 0 0
 +
You have to change the IP address and mount point accordingly. The options are required to that the mount point will be available after reboot.

Revision as of 09:57, 27 May 2014

Under construction!!!

Seon offers an easy way to create Seon Enterprise receive jobs from FTP server content. This solution is based on two mechanisms:

  • Mount remote server directory as a local directory
  • Configure the Seon Directory Scanner to that mounted directory

This documentation covers all technical aspects to implement a functionality to automatically fetch new files from an (S)FTP server.

Assumption

All details explained here are based on the freely available pre-installed Seon VMware virtualized image, which is also available for other virtualization solutions via OVA. In general, all solutions explained here can be used in any modern Linux environment. All steps explained here must be executed as user "root" unless any other documentation states to switch user context.

In this example, the following attributes are used:

  • User running Seon: "www-data", group "www-data".
  • Target mount point for FTP directory: /mnt/ftp/server1
  • Target FTP server: 192.168.20.71, username "seon", password "seon"

Install required packages

You need to install the following packages for (S)FTP mounting:

apt-get -y install sshfs curlftpfs

Change user group membership

The user running Seon (configured in "Configuration" -> "Daemon" -> "Run Seon programs as user") must be added in the user group "fuse":

adduser www-data fuse

Change permissions of /dev/fuse

By default, the required device file "/dev/fuse" is only writable by user "root". We need to extend the permissions:

chgrp fuse /dev/fuse
chmod g+rw /dev/fuse

Create target mountpoint

The FTP target directory must be mounted somewhere into the local filesystem to be readable by Seon. You may use any (in best case empty) directory. We need this directory name later for the configuration of the Seon directory scanner. The owner of the target directory must be the configured user running Seon):

mkdir -p /mnt/ftp/server1
chown www-data.www-data /mnt/ftp/server1

Save credentials securely

In order to automatically connect to the (S)FTP server, save the credentials in a single line in the following file:

/root/.netrc

The syntax of the file is simple: per line, one server can be given by its name (hostname or IP), followed by keywords for username and password, with their values. Example:

machine 192.168.20.71 login seon password seon

This file must have permissions to be readable only by root, so you might change the permissions after creating / modifying the file:

chmod 600 /root/.netrc

Add FTP server mount for bootup

In addition to let the FTP server be mounted at bootup (which is the most common way), you have to add a line to the filesystem table file:

/etc/fstab

The line to be added has the following syntax:

curlftpfs#192.168.20.71 /mnt/ftp/server1 fuse auto,allow_other,disable_eprt,_netdev 0 0

You have to change the IP address and mount point accordingly. The options are required to that the mount point will be available after reboot.