Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Passive mode configuration #41

Closed
nitnelave opened this issue May 23, 2017 · 8 comments
Closed

Passive mode configuration #41

nitnelave opened this issue May 23, 2017 · 8 comments

Comments

@nitnelave
Copy link

Hello,

I'm trying to setup this docker on my server so that I can serve a folder via FTP.

I have forwarded the port 10021 -> docker 21, as well as a range of ports for the passive connection (11000-11100)
I set the /etc/pure-ftpd/conf/PassivePortRange to "11000 11100" and .../ForcePassiveIP to my (host) server IP.

Connecting from the host with the host external IP is fine, but connecting from the host to localhost gives me "I won't open a connection to 127.0.0.1, only to <container_IP>".
Connecting from outside to the host:10021 checks the credentials alright, but when doing an ls, it hangs on "Entering passive mode".

Any idea how I can make it work?

Thanks

@nitnelave
Copy link
Author

Nevermind, I found out the problem: The passive ports range is hardcoded in the command in the Dockerfile, so I extended it to replace the run command with my own ports.

@troptop
Copy link

troptop commented Nov 7, 2017

Hi nitnelave,

I want to use the /etc/pure-ftpd/conf/PassivePortRange file to setup the port range.
As you said the port range is harcoded in the command in the Dockerfile.
But even if i delete the hardcoded part (-P $PUBLICHOST -p 3000:30009) the docker container does not use the parameters setup in /etc/pure-ftpd/conf/PassivePortRange and /etc/pure-ftpd/conf/ForcePassiveIP

Can you help me?

@nitnelave
Copy link
Author

Yeah, I had trouble with the passive ports, so I stuck to the hardcoded method, it was enough for my use case. Sorry I can't help :/

@troptop
Copy link

troptop commented Nov 7, 2017

I just found out. but I will create a new dockerfile.
When you are in the docker container and you do /etc/init.d/pure-ftpd start, the command take the configuration files as parameter (see pure-ftpd-wrapper)
I am going to change the dockerfile to have the possibility to start pure-ftpd with the /run.sh or by the init script.
I will share it later if you need it, or I will upload it in docker hub

@stilliard
Copy link
Owner

Hey @troptop ,

Yes that's correct, this container only uses the flags passed to pure-ftpd rather than the conf directory due to not calling the wrapper script. The wrapper script actually just parses these conf files and passes them as flags to the pure-ftpd command anyway so we have not implemented a way to run the wrapper currently.

If you find a simple way to do so that doesn't affect live uses cases, you can submit me a pull request and i'd be happy to take a look and merge it into the project 👍

@troptop
Copy link

troptop commented Nov 8, 2017

Hey @stilliard ,
What i did is very different from yours.
I only use the wrapper.
I did a run script with every possible parameters as Docker ENV , and write the value down in the related config file in /etc/pure-ftpd/conf
I just test it and works well.
The user can launch the container to have :

  • the default pureftpd configuration. :
    #docker run -d --name=ftpserver -p21:21 troptop-ftps
    #ls /etc/pure-ftpd/conf/ AltLog FSCharset MinUID NoAnonymous PAMAuthentication PureDB TLSCipherSuite UnixAuthentication

  • His own config file by adding a volume to the docker command :
    #docker run -d --name=ftpserver -p21:21 -v /my/path/volume:/etc/pure-ftpd/ troptop-ftps
    #ls /etc/pure-ftpd/conf/ NoAnonymous CreateHomeDir PureDB TLSCipherSuite UnixAuthentication

  • His own config file by adding the ENV variable to the docker command :
    #docker run -d --name=ftpserver -p21:21 -e CHROOTEVERYONE=yes -e CREATEHOMEDIR=yes -e NOANONYMOUS=yes -e NOCHMOD=yes -e PAMAUTHENTICATION=no -e UNIXAUTHENTICATION=no -e VERBOSELOG=yes troptop-ftps
    #ls /etc/pure-ftpd/conf/ ChrootEveryone CreateHomeDir NoAnonymous NoChmod PAMAuthentication TLSCipherSuite UnixAuthentication VerboseLog

I control the input for the boolean and integer parameters to be sure that the user does not use bad parameter. I wont do it for the other kind of parameter right now (string , 2 interger, charset, ip value .... info here https://www.linuxcertif.com/man/8/pure-ftpd-wrapper/)

I have to change the script to handle the puredb symbolic link.

Let you know when done

@troptop
Copy link

troptop commented Nov 8, 2017

I just finish the docker container.
https://github.com/troptop/docker-pure-ftpd
I am pushing it to docker hub
https://hub.docker.com/r/troptop/docker-pure-ftpd/
I did not take a lot of time for the readme but i hope it will be understanding.

@stilliard
Copy link
Owner

Hey @troptop , awesome work 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants