alarmserver icon indicating copy to clipboard operation
alarmserver copied to clipboard

FTP requires host networking mode in docker

Open s7p opened this issue 2 years ago • 1 comments

First of all, thanks a lot for creating this, this is awesome and is exactly what I needed.

I wasn't able to get alarmserver working using the Docker configs provided in README.md docker run -d -v $PWD/config.yml:/config.yml -v $PWD/ftp:/ftp -p 21:21 -p 15002:15002 toxuin/alarmserver

I can run alarmserver, and FTP can authenticate a user, but no files can be uploaded. It always produces error 425. I looked into this, and found that FTP will run in passive mode in containers and will open random ports for data exchange with client. So only mapping port 21 is not sufficient, the solution is to use host networking, map out a larger port range, or create a bridge.

Using host networking worked for me. Suggest adding a new command docker run -d -v $PWD/config.yml:/config.yml -v $PWD/ftp:/ftp --network host toxuin/alarmserver for others using the FTP method

s7p avatar Dec 25 '22 16:12 s7p

Created PR #25 adding ability to override the passive mode public IP and port range. This allows to pass through the pre-defined range of ports when running the Docker container. Tested with my Hisilicon camera and it uploads the captured frames just fine now.

shprota avatar Jan 03 '23 06:01 shprota