Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d50d74505c | |||
| 8d310e4e59 | |||
| d81f3fe81b | |||
| b85c56d67e | |||
| 846f492187 |
2
.gitignore
vendored
2
.gitignore
vendored
@@ -3,5 +3,5 @@ srv/
|
|||||||
config/
|
config/
|
||||||
logs/
|
logs/
|
||||||
data/
|
data/
|
||||||
.env
|
.env*
|
||||||
vsftpd.pem
|
vsftpd.pem
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
14
README.md
14
README.md
@@ -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`.
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
7
entry.sh
7
entry.sh
@@ -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
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
VERSION=2.0
|
COMPOSE_PROJECT_NAME=vsftpd
|
||||||
|
|
||||||
|
VERSION=2.1
|
||||||
|
|
||||||
FTP_USER=
|
FTP_USER=
|
||||||
FTP_PASSWORD=
|
FTP_PASSWORD=
|
||||||
|
|||||||
@@ -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}
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user