About

Supporting the site

App Repository‎ > ‎

proftpd-1.3.4b

Overview

This is a statically compiled version of ProFTPD, which will make it much easier to deploy. Despite being statically linked, it uses some compilation flags that bring its final size to almost the same as the previous version.

This is a more polished release of ProFTPD than a simple cross-compile. This version is preconfigured with two accounts: "ftpuser" and "anonymous". The "ftpuser" account has full read/write access to all shares on the DroboFS, and "anonymous" can only read from the "Public" share. This version also has a (very simple) configuration web page to change the password of the "ftpuser" account, and to enable/disable the "anonymous" account.

ProFTPD requires zlib and openssl (for FTPS).

Preparation

Make sure you have a cross-compiling virtual machine properly setup.

Compilation

The compilation of ProFTPD requires an executable that is generated during the compilation itself. Therefore we do a first pass to compile it natively, save the binary we need, then restart the procedure as cross-compilation.

export DEST=/mnt/DroboFS/Shares/DroboApps/proftpd
cd ~/code/

wget -O zlib-1.2.7.tar.gz http://zlib.net/zlib-1.2.7.tar.gz
tar zxf zlib-1.2.7.tar.gz
cd zlib-1.2.7
CFLAGS="$CFLAGS -Os -mthumb -ffunction-sections -fdata-sections" LDFLAGS="$LDFLAGS -Wl,--gc-sections" ./configure --prefix=$DEST --static
make clean && make
ZLIB=`pwd`
cd ..

wget -O openssl-1.0.1c.tar.gz http://www.openssl.org/source/openssl-1.0.1c.tar.gz
tar zxf openssl-1.0.1c.tar.gz
cd openssl-1.0.1c
./Configure linux-generic32 -DL_ENDIAN --prefix=$DEST --openssldir=$DEST/etc/ssl no-shared no-zlib-dynamic --with-zlib-include=$ZLIB --with-zlib-lib=$ZLIB
sed -i -e "s/\-O3/${CFLAGS} -Os -mthumb -ffunction-sections -fdata-sections/g" Makefile
make clean && LDFLAGS="$LDFLAGS -Wl,--gc-sections" make && make install_sw
rm -fr $DEST/include $DEST/lib $DEST/bin
OPENSSL=`pwd`
cd ..

wget -O proftpd-1.3.4b.tar.gz ftp://ftp.proftpd.org/distrib/source/proftpd-1.3.4b.tar.gz
tar zxf proftpd-1.3.4b.tar.gz 
cd proftpd-1.3.4b/
. ~/uncrosscompile.sh
./configure
make clean && pushd lib/libcap && make && popd
cp lib/libcap/_makenames lib/libcap/_makenames_host
sed -i -e "s|./_makenames |./_makenames_host |g" lib/libcap/Makefile

. ~/crosscompile.sh
CFLAGS="$CFLAGS -Os -mthumb -ffunction-sections -fdata-sections -I$OPENSSL/include -I$ZLIB" LDFLAGS="$LDFLAGS -Wl,--gc-sections -L$OPENSSL -L$ZLIB" install_user=$USER install_group=$USER ac_cv_func_setpgrp_void=yes ac_cv_func_setgrent_void=yes ./configure --host=arm-none-linux-gnueabi --prefix=$DEST --disable-strip --with-modules=mod_tls:mod_sftp
make clean && make && make install
$STRIP -s -R .comment -R .note -R .note.ABI-tag $DEST/bin/*
$STRIP -s -R .comment -R .note -R .note.ABI-tag $DEST/sbin/*

Packaging

cd $DEST
mkdir -p var/empty var/run var/log www
wget -O admin.url.default http://www.droboports.com/app-repository/proftpd-1-3-4b/admin.url.default
wget -O service.sh http://www.droboports.com/app-repository/proftpd-1-3-4b/service.sh
wget -O etc/proftpd.conf.default http://www.droboports.com/app-repository/proftpd-1-3-4b/proftpd.conf.default
wget -O etc/passwd.default http://www.droboports.com/app-repository/proftpd-1-3-4b/passwd.default
wget -O etc/group.default http://www.droboports.com/app-repository/proftpd-1-3-4b/group.default
wget -O etc/proftpd_www.conf.default http://www.droboports.com/app-repository/proftpd-1-3-4b/proftpd_www.conf.default
wget -O etc/proftpd.service.default http://www.droboports.com/app-repository/proftpd-1-3-4b/proftpd.service.default
wget -O www/index.php.default http://www.droboports.com/app-repository/proftpd-1-3-4b/index.php.default
chmod a+x service.sh
chmod -R g+w etc var www
~/bin/package.sh

Installing

Download the TGZ file below and place it in you DroboApps share. If you do not have SSH access, reboot your Drobo. Otherwise, SSH in and type:

/usr/bin/DroboApps.sh install

Final remarks

The full read/write access account is "ftpuser". The default password for that account is "ftpuser". It is highly recommended to change that password using the web configuration page. Anonymous access is also enable by default, and has full read access over the "Public" share. The web configuration requires PHP and lighttpd. Make sure both are installed and running properly before accessing the web configuration. This DroboApp will automatically detect the presence of lighttpd and configure itself.

If ProFTPD is not starting, check if the log file var/log/proftpd.log contains this line:

- warning: unable to determine IP address of 'DROBOFS_NAME_HERE'"

If this is the case, then you have to SSH to the DroboFS and edit the file /etc/hosts so that the first line looks like this:

127.0.0.1 localhost DROBOFS_NAME_HERE

In other words, add whatever name ProFTPD is not able to resolve as an alias of localhost.

Although this version ships with only two preconfigured accounts, it is possible to edit the passwd file in the etc folder to add more users. Access rights for those users need to be defined in proftpd.conf.

ProFTPD is configured to run as "nobody", but the web configuration interface is not password protected. This may be addressed in a future release, but right now make sure you take necessary precautions before exposing this service to the internet. If you want to protect the web configuration, edit etc/proftpd_www.conf and add the authentication configuration following the model from droboadmin.conf.

Upgrading should be no problem. All the files that end by ".default" will not replace their respective counterparts if they already exist. For example, an upgrade will not replace your passwd and group files.

Please visit the DroboSpace forums to leave your comments, suggestions and feedback.

ċ
admin.url.default
Download
  1k v. 1 Oct 4, 2012, 6:18 AM Ricardo Padilha
ċ
group.default
Download
  1k v. 1 Oct 4, 2012, 6:18 AM Ricardo Padilha
ċ
index.php.default
Download
  2k v. 1 Oct 4, 2012, 6:18 AM Ricardo Padilha
ċ
passwd.default
Download
  1k v. 1 Oct 4, 2012, 6:18 AM Ricardo Padilha
ċ
proftpd.conf.default
Download
  1k v. 1 Oct 4, 2012, 6:19 AM Ricardo Padilha
ċ
proftpd.service.default
Download
  1k v. 1 Oct 4, 2012, 6:19 AM Ricardo Padilha
ċ
proftpd.tgz
Download
  4231k v. 1 Oct 4, 2012, 9:00 AM Ricardo Padilha
ċ
proftpd_www.conf.default
Download
  1k v. 1 Oct 4, 2012, 6:18 AM Ricardo Padilha
ċ
service.sh
Download
  2k v. 1 Oct 4, 2012, 8:57 AM Ricardo Padilha
Comments