lib/ftpd/session_config.rb in ftpd-1.1.1 vs lib/ftpd/session_config.rb in ftpd-2.0.0
- old
+ new
@@ -1,5 +1,7 @@
+# frozen_string_literal: true
+
module Ftpd
# All of the configuration needed by a session
class SessionConfig
@@ -21,12 +23,12 @@
#
# @return [Integer] The authentication level
attr_accessor :auth_level
- # @return driver A driver for the server's dynamic behavior such
- # as authentication and file system access.
+ # A driver for the server's dynamic behavior such as
+ # authentication and file system access.
#
# The driver should expose these public methods:
# * {Example::Driver#authenticate authenticate}
# * {Example::Driver#file_system file_system}
@@ -63,9 +65,31 @@
# Defaults to 0 (no delay).
#
# @return [Numeric]
attr_accessor :response_delay
+
+ # The advertised public IP for passive mode connections. This is
+ # the IP that the client must use to make a connection back to the
+ # server. If nil, the IP of the bound interface is used. When
+ # the FTP server is behind a firewall, set this to firewall's
+ # public IP and add the appropriate rule to the firewall to
+ # forward that IP to the machine that ftpd is running on.
+ #
+ # Set this before calling #start.
+ #
+ # @return [nil, String]
+
+ attr_accessor :nat_ip
+
+ # The range of ports for passive mode connections. If nil, then a
+ # random etherial port is used. Otherwise, a random port from
+ # this range is used.
+ #
+ # Set this before calling #start.
+ #
+ # @return [nil, Range]
+ attr_accessor :passive_ports
# The server's name, sent in a STAT reply. Defaults to
# {Ftpd::FtpServer::DEFAULT_SERVER_NAME}.
#
# @return [String]