Skip to content

Commit b9c9541

Browse files
author
Gil De Grove
committed
Add environment variable to configure max connection by ip
1 parent 169162d commit b9c9541

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
## -*- docker-image-name: "mauler/simple-ftp-server" -*-
22

33
FROM python:slim
4-
MAINTAINER Paulo <[email protected]>
4+
MAINTAINER EURANOVA <[email protected]>
55

66
ENV FTP_ROOT /ftp-home
77
ENV FTP_USER ftp

image/root/bin/simple-ftp-server

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def main():
2626

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

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

3636
# set a limit for connections
3737
server.max_cons = 256
38-
server.max_cons_per_ip = 5
38+
server.max_cons_per_ip = int(environ.get('FTP_MAX_CONS_PER_IP', '50'))
3939

4040
# start ftp server
4141
server.serve_forever()

0 commit comments

Comments
 (0)