fauria / docker-vsftpd

🐳 vsftpd Docker image based on Centos 7. Supports passive mode and virtual users.
https://hub.docker.com/r/fauria/vsftpd/
Apache License 2.0
414 stars 341 forks source link

Enhance vsftpd configs. #45

Closed cannshui closed 4 years ago

cannshui commented 4 years ago

Env: CentOS Linux release 7.6.1810 (Core) / Docker version 18.09.6, build 481bc77156

During use this image, I have encountered two problems.

1. vsftpd login is quite slow

After exposed external network access through router mapping, vsftpd login is quite slow, almost takes 10 seconds every time. I guess it should be a DNS related issue. Googled for a while, found this post vsftpd log in is slow,solved this problem. Don't understand what's deep inside.

2. Duplicate echo operation in run-vsftpd.sh seems unnecessary while restart contanier.

These lines are:

echo "pasv_address=${PASV_ADDRESS}" >> /etc/vsftpd/vsftpd.conf
echo "pasv_max_port=${PASV_MAX_PORT}" >> /etc/vsftpd/vsftpd.conf
echo "pasv_min_port=${PASV_MIN_PORT}" >> /etc/vsftpd/vsftpd.conf
echo "pasv_addr_resolve=${PASV_ADDR_RESOLVE}" >> /etc/vsftpd/vsftpd.conf
echo "pasv_enable=${PASV_ENABLE}" >> /etc/vsftpd/vsftpd.conf
echo "file_open_mode=${FILE_OPEN_MODE}" >> /etc/vsftpd/vsftpd.conf
echo "local_umask=${LOCAL_UMASK}" >> /etc/vsftpd/vsftpd.conf
echo "xferlog_std_format=${XFERLOG_STD_FORMAT}" >> /etc/vsftpd/vsftpd.conf

And because of these echos, manual modification of these options in vsftpd.conf will be overrided while restart.

This pull request.

I forked and made a pull request, hope it's useful.

CHANGES:

  1. Add ENV REVERSE_LOOKUP_ENABLE;
  2. Add checks before echo operations;
  3. Add iproute package in order to use /sbin/ip route?
fauria commented 4 years ago

I'm going to close this PR, since REVERSE_LOOKUP_ENABLE and iproute are now included. Thank you for your contribution! Regards.