fauria/docker-vsftpd

Don't overwrite etc/vsftpd/virtual_users.txt on startup

Opened this issue · 3 comments

tl;dr Change
echo -e "${FTP_USER}\n${FTP_PASS}" > /etc/vsftpd/virtual_users.txt
to
echo -e "${FTP_USER}\n${FTP_PASS}" >> /etc/vsftpd/virtual_users.txt

echo -e "${FTP_USER}\n${FTP_PASS}" > /etc/vsftpd/virtual_users.txt

It would be nice to be able to use this image as base image, and add an existing list of users when the we build the new image.

Example Docker File:

FROM fauria/vsftpd
COPY my-users.txt /etc/vsftpd/virtual_users.txt

Example my-users.txt.

myuser1
mypass1
myuser2
mypass2

Thank you,
Lance

Agreed. It seems like an inconsistent behaviour.

This script would have been better

if ! grep -Fxq "${FTP_USER}" /etc/vsftpd/virtual_users.txt
then
    echo -e "${FTP_USER}\n${FTP_PASS}" >> /etc/vsftpd/virtual_users.txt
fi

To avoid specifying duplicate entries, especially when someone decides to mount virtual_users.txt to host.

virtual_users 文件不应该和vsftpd.conf 在相同的目录。当容器被删掉后,virtual_users将不会被保留。如果将/etc/vsftpd/挂载出来,将导致默认配置丢失。virtual_users的目录应该是独立的。