3 Commits

Author SHA1 Message Date
d81f3fe81b Fix FTP_PASV_ADDRESS setting 2025-05-08 22:52:04 +02:00
b85c56d67e add compose project name 2025-05-06 22:41:34 +02:00
846f492187 update README 2025-05-06 22:30:26 +02:00
5 changed files with 19 additions and 12 deletions

View File

@@ -44,6 +44,18 @@ which is in the _whois_ debian package.
## Usage Example
### Docker Compose
First, setup your .env file by copying the sample file and modifying it to suit your needs.
```
cp env.sample .env
vi .env
```
Then run the stack
```
docker compose up -d
```
### Docker
```
docker run --rm -it -p 21:21 -p 4559-4564:4559-4564 -e FTP_USER=ftp -e FTP_PASSWORD=ftp docker.io/panubo/vsftpd:latest
```
@@ -73,4 +85,4 @@ See [serverfault: vsftp: whu is allow_writable_chroot=YES a bad idea?](https://s
## Logs
To get the FTP logs mount `/var/log` outside of the container. For example add `-v /var/log/ftp:/var/log` to your `docker run ...` command.
To get the FTP logs mount `/var/log` outside of the container. For example add `-v /var/log/ftp:/var/log` to your `docker run ...` command or use `docker compose`.

View File

@@ -36,13 +36,6 @@ if [[ -n "${FTP_USERS_ROOT}" ]]; then
sed -i 's/local_root=.*/local_root=\/srv\/$USER/' /etc/vsftpd*.conf
fi
# Support setting the passive address
if [[ -n "$FTP_PASV_ADDRESS" ]]; then
for f in /etc/vsftpd*.conf; do
echo "pasv_address=${FTP_PASV_ADDRESS}" >> "$f"
done
fi
# Manage /srv permissions
if [[ -n "${FTP_CHOWN_ROOT}" ]]; then
chown ftp:ftp /srv

View File

@@ -1,3 +1,5 @@
COMPOSE_PROJECT_NAME=vsftpd
VERSION=2.0
FTP_USER=

View File

@@ -35,5 +35,5 @@ connect_from_port_20=YES
listen=YES
tcp_wrappers=YES
pasv_address=${FTP_PASV_ADDRESS}
pasv_min_port=${FTP_PASV_MIN_PORT:-4559}
pasv_max_port=${FTP_PASV_MAX_PORT:-4564}
pasv_min_port=${FTP_PASV_MIN_PORT}
pasv_max_port=${FTP_PASV_MAX_PORT}

View File

@@ -35,8 +35,8 @@ connect_from_port_20=YES
listen=YES
tcp_wrappers=YES
pasv_address=${FTP_PASV_ADDRESS}
pasv_min_port=${FTP_PASV_MIN_PORT:-4559}
pasv_max_port=${FTP_PASV_MAX_PORT:-4564}
pasv_min_port=${FTP_PASV_MIN_PORT}
pasv_max_port=${FTP_PASV_MAX_PORT}
# SSL
ssl_enable=Yes