From b4d8e0e0216528ec2bafede80c9fa9e0888079ca Mon Sep 17 00:00:00 2001 From: kev Date: Tue, 8 Oct 2019 17:50:31 +0800 Subject: [PATCH] update pure-ftpd --- pure-ftpd/Dockerfile | 5 +++-- pure-ftpd/README.md | 14 ++++++-------- pure-ftpd/data/ftpuser/.gitkeep | 0 pure-ftpd/data/pure-ftpd/pure-ftpd.conf | 7 +++++++ pure-ftpd/docker-compose.yml | 3 +-- 5 files changed, 17 insertions(+), 12 deletions(-) create mode 100644 pure-ftpd/data/ftpuser/.gitkeep create mode 100644 pure-ftpd/data/pure-ftpd/pure-ftpd.conf diff --git a/pure-ftpd/Dockerfile b/pure-ftpd/Dockerfile index 2660844..c88e8b6 100644 --- a/pure-ftpd/Dockerfile +++ b/pure-ftpd/Dockerfile @@ -2,7 +2,7 @@ # Dockerfile for pure-ftpd # -FROM debian:jessie +FROM debian:buster MAINTAINER kev RUN set -xe \ @@ -15,4 +15,5 @@ RUN set -xe \ EXPOSE 21 VOLUME /home/ftpuser /etc/pure-ftpd -CMD ["pure-ftpd", "--login", "puredb:/etc/pure-ftpd/pureftpd.pdb", "--createhomedir"] +ENTRYPOINT ["pure-ftpd"] +CMD ["/etc/pure-ftpd/pureftpd.conf"] diff --git a/pure-ftpd/README.md b/pure-ftpd/README.md index 0050129..d5dbee9 100644 --- a/pure-ftpd/README.md +++ b/pure-ftpd/README.md @@ -12,10 +12,9 @@ unique useful features for personal users as well as hosting providers. ## ~/fig/pureftpd/docker-compose.yml ```yaml -pureftpd: +pure-ftpd: image: vimagick/pure-ftpd - ports: - - "21:21" + net: host volumes: - ./data/ftpuser:/home/ftpuser - ./data/pure-ftpd:/etc/pure-ftpd @@ -23,16 +22,14 @@ pureftpd: restart: always ``` -> We only need to expose port `21` to accept client ftp connection. -> Pure-FTPd will open random port to accept client ftp-data connection. -> At this time, host machine is a router for DNAT. +> Please config firewall according to `PassivePortRange`. ## server ```bash -$ cd ~/fig/pureftpd/ +$ cd ~/fig/pure-ftpd/ $ docker-compose up -d -$ docker-compose exec pureftpd bash +$ docker-compose exec pure-ftpd bash >>> pure-pw useradd kev -u ftpuser -d /home/ftpuser/kev -t 1024 -T 1024 -y 1 -m >>> pure-pw list >>> pure-pw show kev @@ -48,6 +45,7 @@ $ tree -F │   └── kev/ │   └── file.txt └── pure-ftpd/ + ├── pure-ftpd.conf ├── pureftpd.passwd └── pureftpd.pdb ``` diff --git a/pure-ftpd/data/ftpuser/.gitkeep b/pure-ftpd/data/ftpuser/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/pure-ftpd/data/pure-ftpd/pure-ftpd.conf b/pure-ftpd/data/pure-ftpd/pure-ftpd.conf new file mode 100644 index 0000000..b4ef8f8 --- /dev/null +++ b/pure-ftpd/data/pure-ftpd/pure-ftpd.conf @@ -0,0 +1,7 @@ +ChrootEveryone yes +CreateHomeDir yes +MaxClientsNumber 100 +MaxClientsPerIP 10 +NoAnonymous yes +PassivePortRange 50000 50099 +PureDB /etc/pure-ftpd/pureftpd.pdb diff --git a/pure-ftpd/docker-compose.yml b/pure-ftpd/docker-compose.yml index c17beb9..71de884 100644 --- a/pure-ftpd/docker-compose.yml +++ b/pure-ftpd/docker-compose.yml @@ -1,7 +1,6 @@ pure-ftpd: image: vimagick/pure-ftpd - ports: - - "21:21" + net: host volumes: - ./data/ftpuser:/home/ftpuser - ./data/pure-ftpd:/etc/pure-ftpd