Skip to content

Commit

Permalink
Make max number of connections (global and per ip) configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
colinsmetz committed Nov 13, 2018
1 parent 169162d commit 0add4fc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ ENV FTP_ROOT /ftp-home
ENV FTP_USER ftp
ENV FTP_PASS ftp
ENV FTP_PORT 21
ENV FTP_MAX_CONNECTIONS 256
ENV FTP_MAX_CONNECTIONS_PER_IP 5

VOLUME /ftp-home

Expand Down
4 changes: 2 additions & 2 deletions image/root/bin/simple-ftp-server
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ def main():
server = FTPServer(address, handler)

# set a limit for connections
server.max_cons = 256
server.max_cons_per_ip = 5
server.max_cons = int(environ.get('FTP_MAX_CONNECTIONS', 256))
server.max_cons_per_ip = int(environ.get('FTP_MAX_CONNECTIONS_PER_IP', 5))

# start ftp server
server.serve_forever()
Expand Down

0 comments on commit 0add4fc

Please sign in to comment.