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/ config/
logs/ logs/
data/ data/
.env .env*
vsftpd.pem vsftpd.pem

View File

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

View File

@@ -44,6 +44,18 @@ which is in the _whois_ debian package.
## Usage Example ## 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 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 ## 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: services:
vsftpd: vsftpd:
container_name: vsftpd container_name: vsftpd
image: wululu/vsftpd:${VERSION:-2.0} image: wululu/vsftpd:${VERSION:-2.1}
build: build:
context: . context: .
args: args:
VERSION: ${VERSION:-2.0} VERSION: ${VERSION:-2.1}
volumes: volumes:
- ./data:/srv - ./data:/srv
- ./config:/etc/vsftpd - ./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 sed -i 's/local_root=.*/local_root=\/srv\/$USER/' /etc/vsftpd*.conf
fi 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 # Manage /srv permissions
if [[ -n "${FTP_CHOWN_ROOT}" ]]; then if [[ -n "${FTP_CHOWN_ROOT}" ]]; then
chown ftp:ftp /srv chown ftp:ftp /srv

View File

@@ -1,4 +1,6 @@
VERSION=2.0 COMPOSE_PROJECT_NAME=vsftpd
VERSION=2.1
FTP_USER= FTP_USER=
FTP_PASSWORD= FTP_PASSWORD=

View File

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

View File

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