Skip to content

Commit

Permalink
Add environment variable to configure max connection by ip
Browse files Browse the repository at this point in the history
  • Loading branch information
GDegrove committed Sep 24, 2019
1 parent 169162d commit 4da2372
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## -*- docker-image-name: "mauler/simple-ftp-server" -*-

FROM python:slim
MAINTAINER Paulo <[email protected]>
MAINTAINER EURANOVA <[email protected]>

ENV FTP_ROOT /ftp-home
ENV FTP_USER ftp
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 @@ -26,7 +26,7 @@ def main():

# Specify a masquerade address and the range of ports to use for
# passive connections. Decomment in case you're behind a NAT.
# handler.masquerade_address = '151.25.42.11'
handler.masquerade_address = environ.get('FTP_MASQUERADE_ADDRESS', None)
# handler.passive_ports = range(60000, 65535)

# Instantiate FTP server class and listen on 0.0.0.0:2121
Expand All @@ -35,7 +35,7 @@ def main():

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

# start ftp server
server.serve_forever()
Expand Down

0 comments on commit 4da2372

Please sign in to comment.