5 Commits

Author SHA1 Message Date
d50d74505c Ignore .env* 2025-05-08 22:57:08 +02:00
8d310e4e59 Bump version to 2.1 2025-05-08 22:53:43 +02:00
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
8 changed files with 24 additions and 17 deletions

2
.gitignore vendored
View File

@@ -3,5 +3,5 @@ srv/
config/
logs/
data/
.env
.env*
vsftpd.pem

View File

@@ -1,7 +1,7 @@
FROM debian:stable
LABEL maintainer="Luca Derderian <luca@wululu.de>"
LABEL version="${VERSION:-2.0}"
LABEL version="${VERSION:-2.1}"
ARG FTP_UID=48
ARG FTP_GID=48

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

@@ -1,11 +1,11 @@
services:
vsftpd:
container_name: vsftpd
image: wululu/vsftpd:${VERSION:-2.0}
image: wululu/vsftpd:${VERSION:-2.1}
build:
context: .
args:
VERSION: ${VERSION:-2.0}
VERSION: ${VERSION:-2.1}
volumes:
- ./data:/srv
- ./config:/etc/vsftpd

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,4 +1,6 @@
VERSION=2.0
COMPOSE_PROJECT_NAME=vsftpd
VERSION=2.1
FTP_USER=
FTP_PASSWORD=

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