/**
* @classdesc Represents a CompleteFTP site.
*
* @class
* @hideconstructor
*/
Site = function () {
/**
* Is this an admin site?
*
* @type {Boolean}
* @readonly
*/
this.isAdmin = null;
/**
* [FTP/FTPS settings] - If this option is enabled, anonymous access is enabled. This means connections can be made by logging
* in as an anonymous user rather than as a named user with a password. Anonymous users are represented by the
* user called 'anonymous'. By default, the home-folder of this user is /Public, so this is the folder that
* will be publicly accessible if this option is enabled.
*
* Note that this option is not enabled by default.
*
* Related properties: {@link Site#anonymousMaxConnections anonymousMaxConnections}
*
* @type {Boolean}
*/
this.anonymousEnabled = null;
/**
* [HTTP/HTTPS settings] - If this option is enabled (which is the default), unauthenticated users will be able to access any file in the public folder.
* Unauthenticated users are represented by the user called 'anonymous'. By default, the home-folder of this user is /Public, so
* this is the folder that will be publicly accessible if this option is enabled.
*
* @type {Boolean}
*/
this.anonymousHTTPEnabled = null;
/**
* [ZIP-file navigation settings] - When this option is enabled, ZIP-files are presented to clients as though they are
* folders. This means that users can change into folders within the ZIP-file and download specific
* files. This can save a lot of time and bandwidth as it allows users to download only what they
* need from a ZIP-file instead of downloading the whole ZIP-file.
*
* This option is enabled by default.
*
* Related properties: {@link Site#archiveNavSuffix archiveNavSuffix}
*
* @type {Boolean}
*/
this.archiveNavEnabled = null;
/**
* [File-system settings] - Unix-style forward slash separators are used in paths by default. Use this setting to
* enable support for Windows-style backslash separators (while still permitting forward slashes).
*
* This option is not enabled by default.
*
* @type {Boolean}
*/
this.backslashPathSep = null;
/**
* Is this site enabled? If it's not, then the ports used by the site are not open for
* incoming connections. Disabling a site will kill all connections of users already connected to the site.
*
* This option is enabled by default.
*
* @type {Boolean}
*/
this.enabled = null;
/**
* [FTP/FTPS settings] - Is the FTP protocol enabled for this site?
*
* This option is enabled by default.
*
* @type {Boolean}
*/
this.ftpEnabled = null;
/**
* [FTP/FTPS settings] - Is the FTPS protocol (explicit mode) enabled for this site?
*
* This option is enabled by default.
*
* @type {Boolean}
*/
this.ftpsEnabled = null;
/**
* [FTP/FTPS settings] - Is the FTPS protocol (implicit mode) enabled for this site? This is a legacy form of FTPS that is still
* widely used.
*
* This option is enabled by default.
*
* @type {Boolean}
*/
this.ftpsImplicitEnabled = null;
/**
* [FTP/FTPS settings] - This option controls whether or not certificates should be requested from FTPS clients. If they are
* required then the client must send a certificate that may be validated against the Windows certificate store. This means
* that its issuer's certificate must be in the Windows 'Trusted root certificate authorities' store.
*
* This option is not enabled by default.
*
* @type {Boolean}
*/
this.ftpsVerifyClient = null;
/**
* [Messages settings] - If this option is enabled, the product name and version of the server is not displayed in welcome
* messages. This may be required for PCI compliance. Note that the default welcome message should also be changed, as it
* identifies the server.
*
* This option is not enabled by default.
*
* Related properties: {@link Site#welcomeMessage welcomeMessage}
*
* @type {Boolean}
*/
this.hideProductVersion = null;
/**
* [General user settings] - If this option is enabled then the user will see their home directory as the root (i.e. /).
* If it is disabled then the user will see the absolute virtual file-system path, e.g. "/home/javaftp". By default, this
* option is not enabled.
*
* @type {Boolean}
*/
this.homeDirIsRoot = null;
/**
* [HTTP/HTTPS settings] - If this option is enabled then HTTP logins to CompleteFTP will be handled by the browser
* (usually via HTTP basic authentication) rather than by the CompleteFTP login page. This is not generally recommended
* as it can cause problems with logouts. SAML Single Sign-On will not work if this option is enabled.
*
* This option is not enabled by default.
*
* @type {Boolean}
*/
this.httpBasicAuth = null;
/**
* [HTTP/HTTPS settings] - Is the HTTP protocol enabled for this site? If enabling, ensure that other HTTP servers are not running
* on the server machine.
*
* This option is enabled by default.
*
* @type {Boolean}
*/
this.httpEnabled = null;
/**
* [HTTP/HTTPS settings] - Is the HTTPS protocol enabled for this site? If enabling, ensure that other HTTPS servers are not
* running on the server machine.
*
* This option is enabled by default.
*
* @type {String}
*/
this.httpsEnabled = null;
/**
* [HTTP/HTTPS settings] - Is server-side Javascript (JSS) enabled for this site? When enabled, JSS files can be placed
* in user directories and executed as Javascript web applications. JSS must be enabled for the owner of a
* directory for JSS scripts to be executed (see {@link User#jssEnabled User.jssEnabled}).
*
* This option is enabled by default.
*
* @type {Boolean}
*/
this.jssEnabled = null;
/**
* [FTP/FTPS settings] - In passive mode transfers, some routers don't cope with a hard-coded external IP address as
* set in {@link Site#pasvIP External IP address} - they expect to see the local LAN IP address in the PASV reply, and they replace this
* local address with the external IP address themselves. If the local LAN IP address is not found, some routers will
* abruptly terminate the connection. The solution in these situations is to only supply the hard-coded external IP
* address for encrypted (i.e. FTPS) connections, which the router can't inspect (and hence can't know what IP address
* is in the PASV reply). To do this, set this property to true other than false (which is the default).
*
* Related properties: {@link Site#pasvIP pasvIP}, {@link Site#pasvPortMax pasvPortMax}, {@link Site#pasvPortMin pasvPortMin}
*
* @type {Boolean}
*/
this.redirectPassiveIPSecureOnly = null;
/**
* [SFTP/SCP settings] - Is the SCP protocol enabled for this site?
*
* This option is enabled by default.
*
* @type {Boolean}
*/
this.scpEnabled = null;
/**
* [SFTP/SCP settings] - Is the SFTP protocol is enabled for this site?
*
* This option is enabled by default.
*
* @type {Boolean}
*/
this.sftpEnabled = null;
/**
* [File-sharing setting] - Is file-sharing enabled for this site?
*
* This option is enabled by default.
*
* @type {Boolean}
*/
this.sharingEnabled = null;
/**
* [File-system settings] - Files are considered hidden if either (1) the Windows Hidden property is set for that file, or
* (2) the name of the file starts with a dot ('.').
*
* If this option is enabled then hidden files will be shown in listings. Otherwise,
* they will not be shown in listings (which is the default).
*
* IMPORTANT! The fact that a file is hidden from listing does NOT imply that it cannot be accessed
* (i.e. read from, written to, renamed or deleted). To control accessibility please use the
* permissions for each specific folder.
*
* @type {Boolean}
*/
this.showHiddenFiles = null;
/**
* [SFTP/SCP settings] - If this setting is enabled, local SSH TCP/IP forwarding will be enabled for the site.
* This means local (to a client machine) SSH tunnels can be established between a client and CompleteFTP, and
* data will be forwarded on to the host specified when the tunnel was set up. On the client side, the tunnel
* must be set up by an SSH utility such as PuTTY.
*
* This option is not enabled by default.
*
* @type {Boolean}
*/
this.sshForwardingEnabled = this;
/**
* [SFTP/SCP settings] - If this setting is enabled, users may (if permitted) log into the server using an SSH terminal.
*
* This option is not enabled by default.
*
* @type {Boolean}
*/
this.sshTerminalEnabled = null;
/**
* [ZIP-file navigation settings] - By default, both the ZIP-file itself and the folder that corresponds to the
* ZIP-file are shown in listings, the latter having the additional extension '.folder'. The additional extension
* can be changed by modifying this property. If this setting is cleared completely then the ZIP-file won't be
* displayed being replaced by the corresponding folder.
*
* Related properties: {@link Site#archiveNavEnabled archiveNavEnabled}
*
* @type {String}
*/
this.archiveNavSuffix = null;
/**
* [General user settings] - If a default Windows domain is set, it means that Windows users on the default domain
* can login without specifying the domain (instead of using MyDomain\MyUserName they can use MyUserName). This
* can be very convenient for users.
*
* The default Windows domain tells CompleteFTP which domain to authenticate against if (1) a domain-name
* was not given and (2) no exact match was found in CompleteFTP's list of users.
*
* For Windows users that have been explicitly added to CompleteFTP, if the client tries to log in using
* a username without a domain-name then the server will first look for this exact username in the config
* (just like it does now). If a match is not found and a default domain has been set then it tries to
* prefix the default domain to the username and look up the user-list.
*
* If the user is not found in the explicitly added list of users and automatic Windows users are enabled,
* the default domain is again used if the domain name was not specified while logging in. This will result
* in logging in as 'DefaultDomain\MyUserName'. One consequence of this is that if a default Windows domain
* has been set then an attempt to log in without specifying a domain name will never log into the local
* machine. CompleteFTP will always assume the default domain should be used. If the user does want to log
* into the local machine when a default domain has been set they have to log in using ".\MyUserName".
*
* @type {String}
*/
this.defaultDomain = null;
/**
* [FTP/FTPS settings] - Character set that is used for encoding file-names. A list of available character sets can be found
* [here](https://docs.microsoft.com/en-us/dotnet/api/system.text.encodinginfo.name?view=netframework-4.7.2). The default
* is 'utf-8'.
*
* @type {String}
*/
this.encoding = null;
/**
* [File-system settings] - Allows filename blocking filters to be configured for this site.
*
* @type {FileNameFilter}
*/
this.fileNameFilter = null;
/**
* [HTTP/HTTPS settings] - Controls the format in which HTTP errors are displayed to the user. The default
* template uses Javascript to redirect the user to their home folder for 403 errors.
*
* Note that null will be returned if the template is at default.
*
* @type {String}
*/
this.htmlErrorTemplate = null;
/**
* [HTTP/HTTPS settings] - Controls the format in which directory listings are displayed to the user. Directories may
* be listed by users by entering a URL specifying the path of a directory. The listing is rendered using HTML containing
* macros, such as %FileName%.
*
* Note that null will be returned if the template is at default.
*
* @type {String}
*/
this.htmlListingTemplate = null;
/**
* [FTP/FTPS settings] - Format of folder listings being sent back to clients.
* In the FTP protocol folder listings are sent back to the client as plain text. This setting controls the format
* of this plain text. This is particularly significant for non-console client applications, which usually parse
* the directory listings automatically.
*
* Currently, 'Windows', 'Unix' and 'FilenameOnly' are supported. The default is 'Unix'.
*
* @type {String}
*/
this.listingFormat = null;
/**
* The name of the site.
*
* @type {String}
*/
this.name = null;
/**
* [FTP/FTPS settings] - In passive (PASV) mode transfers, the server listens on a random port between the minimum and
* the maximum port numbers specified, waiting for a connection from the client to this port.
*
* The server sends the client a reply to the PASV command that provides the IP address to connect to and the port number.
*
* This setting allows a hard-coded IP address to be set. If not set, the IP address of the interface that the server
* is listening on is provided.
*
* This setting is required in cases where the IP address of the server is not reachable by clients. For example, the
* client may need to connect to another IP address that is accessible externally, and a NAT device may direct the
* connection to the server.
*
* Related properties: {@link Site#redirectPassiveIPSecureOnly redirectPassiveIPSecureOnly}, {@link Site#pasvPortMax pasvPortMax},
* {@link Site#pasvPortMin pasvPortMin}
*
* @type {String}
*/
this.pasvIP = null;
/**
* [File-system settings] - Enabling this setting will make the site read-only meaning that connected users are unable
* to make any changes to the site (e.g. upload, delete, rename). This setting overrides file-system permissions.
*
* This setting is not enabled by default.
*
* @type {Boolean}
*/
this.readOnly = null;
/**
* [Messages settings] - The text that is displayed (i.e. sent to the client) during a login attempt. In SFTP this is
* the banner message, and is often not displayed by SFTP clients.
*
* Related properties: {@link Site#hideProductVersion hideProductVersion}
*
* @type {String}
*/
this.welcomeMessage = null;
/**
* [FTP/FTPS settings] - The maximum number of simultaneous anonymous connections permitted to the server.
*
* Note that there will be no limit if this option is set to zero.
*
* Related properties: {@link Site#anonymousEnabled anonymousEnabled}
* @type {Number}
*/
this.anonymousMaxConnections = null;
/**
* [Auto-banning settings] - The amount of time (in milliseconds) a ban remains in place once an IP address has been autobanned.
* The default is 3,600,000 milliseconds (1 hour).
*
* Note that if this option is set to zero, bans will remain indefinitely (i.e. until next server restart).
*
* Related properties: {@link Site#autoBanTriggerCount autoBanTriggerCount},
* {@link Site#autoBanTriggerPeriod autoBanTriggerPeriod}
*
* @type {Number}
*/
this.autoBanDuration = null;
/**
* [Auto-banning settings] - The number of authentication failures required to trigger an auto-ban of an IP address, within
* the failure counting period. The default is 10.
*
* Related properties: {@link Site#autoBanTriggerPeriod autoBanTriggerPeriod}, {@link Site#autoBanDuration autoBanDuration}
*
* @type {Number}
*/
this.autoBanTriggerCount = null;
/**
* [Auto-banning settings] - The period of time (in milliseconds) during which if the number of permitted authentication failures
* is exceeded (from a certain IP address), the IP address is auto-banned for the set ban duration. The default is 60,000
* milliseconds (1 minute).
*
* Related properties: {@link Site#autoBanTriggerCount autoBanTriggerCount}, {@link Site#autoBanDuration autoBanDuration}
*
* @type {Number}
*/
this.autoBanTriggerPeriod = null;
/**
* [Limits and timeouts settings] - The maximum permitted number of simultaneous connections to the site using protocols
* other than HTTP. If this limit has been reached, any further connection attempts are denied until current connections
* are closed. The default is zero means that there is no limit.
*
* This setting does not apply to HTTP connections since HTTP often requires many more concurrent connections. See the
* separate {@link Site#maxConnectionsHTTP Site.maxConnectionsHTTP} setting.
*
* @type {Number}
*/
this.maxConnections = null;
/**
* [Limits and timeouts settings] - Sets the maximum number of simultaneous HTTP connections permitted. The default is 200.
* If this limit has been reached, any further HTTP connection attempts are denied until current connections are closed.
*
* If this option is set to zero, there is no limit.
*
* @type {Number}
*/
this.maxConnectionsHTTP = null;
/**
* [Limits and timeouts settings] - The maximum permitted number of simultaneous connections for each user (using any protocol).
* If this limit has been reached, any further connection attempts are denied until current connections are closed. The default
* is zero means that there is no limit.
*
* @type {Number}
*/
this.maxConnectionsPerUser = null;
/**
* [Limits and timeouts settings] - Sets the maximum number of login attempts that can be made for a user account. The default is 3.
*
* If this option is set to zero, there is no limit.
*
* @type {Number}
*/
this.maxLoginAttempts = null;
/**
* [FTPS & HTTPS settings] - This option controls the minimum version of SSL/TLS supported for this site.
* Available SSL/TLS versions are:
*
* * 'Ssl3' (SSL 3.0)
* * 'Tls1' (TLS 1.0)
* * 'Tls11' (TLS 1.1)
* * 'Tls12' (TLS 1.2)
*
* The default is 'Tls1', which means that SSL 3.0 is not supported by default. This ensures that the
* server is not vulnerable to the security flaws of SSL 3.0.
*
* Note that this setting is shared between FTPS and HTTPS, both of which use SSL/TLS.
* @type {String}
*/
this.minimumSSLVersion = null;
/**
* [FTP/FTPS settings] - This is the maximum port number used in passive (PASV) mode. In PASV mode transfers, the server
* listens on a random port between the minimum and the maximum port numbers specified, waiting for a connection from
* the client to this port.
*
* Related properties: {@link Site#pasvIP pasvIP}, {@link Site#redirectPassiveIPSecureOnly redirectPassiveIPSecureOnly},
* {@link Site#pasvPortMin pasvPortMin}
*
* @type {Number}
*/
this.pasvPortMax = null;
/**
* [FTP/FTPS settings] - This is the minimum port number used in passive (PASV) mode. In PASV mode transfers, the server
* listens on a random port between the minimum and the maximum port numbers specified, waiting for a connection from the
* client to this port.
*
* Related properties: {@link Site#pasvIP pasvIP}, {@link Site#redirectPassiveIPSecureOnly redirectPassiveIPSecureOnly},
* {@link Site#pasvPortMin pasvPortMin}
*
* @type {Number}
*/
this.pasvPortMin = null;
/**
* [FTP/FTPS settings] - Port that is used for FTP and FTPS in explicit mode. The standard port number for FTP and explicit
* FTPS is port 21.
*
* @type {Number}
*/
this.portFTP = null;
/**
* [FTP/FTPS settings] - Port that is used for FTPS in implicit mode. The standard port number for implicit FTPS is port 990.
*
* @type {Number}
*/
this.portFTPSImplicit = null;
/**
* [HTTP/HTTPS settings] - Port that is used for HTTP. The standard port number for HTTP is port 80.
*
* @type {Number}
*/
this.portHTTP = null;
/**
* [HTTP/HTTPS settings] - Port that is used for HTTPS. The standard port number for HTTP is port 443.
*
* @type {Number}
*/
this.portHTTPS = null;
/**
* [SFTP/SCP settings] - Port that is used for SFTP, SCP and SSH. The standard port number is port 22. All of these
* protocols use the same port number.
*
* @type {Number}
*/
this.portSFTP = null;
/**
* [SFTP/SCP settings] - Methods of user-authentication (listed below) that the server accepts. Note that these methods can also
* be specified at the user level (see {@link User#sshAuthMethods User.sshAuthMethods}). When a user logs in, only
* the authentication methods specified at both levels are available. For example, if the site permits password
* only, and the user permits password and publickey, then only password will be available.
*
* * 'Password' - only a password is required. A password must be set for each user using {@link User#password User.password}
* * 'PublicKey' - public key cryptography is used to authenticate the user. For every user the server must have a public
* key that matches the client's private key. Note that this method of authentication does not work for Windows users,
* since a password is required by Windows to log the user in. Thus Password or PublicKeyAndPassword should be enabled
* if Windows users are to be allowed to connect.
* * 'PublicKeyAndPassword' - both password and public-key authentication are used.
*
* In order to select all authentication methods (which is already the default), set this property to the array, ['All'].
*
* @type {String[]}
*/
this.sshAuthMethods = null;
/**
* [SFTP/SCP settings] - Controls what ciphers (listed below) are available to SSH for encrypting data. The default setting of All
* should generally be used unless some ciphers are required to be disabled.
* * 'TripleDES'
* * 'Blowfish'
* * 'AES128'
* * 'AES192'
* * 'AES256'
* * 'AES_CTR_128'
* * 'AES_CTR_192'
* * 'AES_CTR_256'
*
* In order to select all ciphers (which is already the default), set this property to the array, ['All'].
*
* @type {String[]}
*/
this.sshCipher = null;
/**
* [SFTP/SCP settings] - Permits the compression algorithms (listed below) used in SSH to be selected.
* * 'None'
* * 'Zlib'
*
* For example, if 'Zlib' compression is to be forced, then 'None' would need to be unselected.
*
* In order to select all compression algorithms (which is already the default), set this property to the array, ['All'].
*
* @type {String[]}
*/
this.sshCompression = null;
/**
* [SFTP/SCP settings] - Controls what public key algorithms (listed below) are supported by the server. For example,
* RSA public keys can be forced by disabling DSA.
* * 'DSA'
* * 'RSA'
*
* In order to select all public key algorithms (which is already the default), set this property to the array, ['All'].
* @type {String[]}
*/
this.sshKeyAlgorithm = null;
/**
* [SFTP/SCP settings] - Controls what key exchange methods (listed below) are supported by the server. It is rare that the
* defaults (i.e. all is selected) should be changed. It is possible that an administrator may want to disable weaker key
* exchange methods.
* * 'DiffieHellmanGroup1Sha1'
* * 'DiffieHellmanGroup14Sha1'
* * 'DiffieHellmanGroupExchangeSha1'
* * 'DiffieHellmanGroupExchangeSha256'
*
* In order to select all key exchange methods (which is already the default), set this property to the array, ['All'].
*
* @type {String[]}
*/
this.sshKeyExchange = null;
/**
* [SFTP/SCP settings] - Permits the MAC algorithms (listed below) used in SSH to be selected. The default setting of All should
* generally be used unless some MACs are required to be disabled.
* * 'HMACSHA1'
* * 'HMACMD5'
* * 'HMAC_SHA1_96'
* * 'HMAC_MD5_96'
* * 'HMAC_SHA2_256'
* * 'HMAC_SHA2_512'
*
* In order to select all MAC algorithms (which is already the default), set this property to the array, ['All'].
*
* @type {String[]}
*/
this.sshMAC = null;
/**
* [FTPS & HTTPS settings] - This setting controls the cipher suites that can be used. All available cipher suites are:
* * 'RSA_AES_256_SHA'
* * 'RSA_AES_128_SHA'
* * 'RSA_AES_128_SHA256'
* * 'RSA_AES_256_SHA256'
* * 'RSA_3DES_168_SHA'
* * 'DHE_RSA_3DES_SHA'
* * 'DHE_RSA_AES_128_SHA'
* * 'DHE_RSA_AES_256_SHA'
* * 'DHE_RSA_AES_128_SHA256'
* * 'DHE_RSA_AES_256_SHA256'
* * 'DHE_RSA_DES_SHA'
* * 'RSA_DES_40_SHA'
* * 'RSA_DES_56_SHA'
* * 'RSA_RC2_40_MD5'
* * 'RSA_RC4_128_SHA'
* * 'RSA_RC4_128_MD5'
* * 'RSA_RC4_40_MD5'
* * 'ECDHE_RSA_3DES_SHA'
* * 'ECDHE_RSA_AES_128_SHA'
* * 'ECDHE_RSA_AES_256_SHA'
*
* Generally, the default (listed below) is appropriate unless there are special requirements for a particular algorithm.
* * 'RSA_3DES_168_SHA'
* * 'RSA_AES_128_SHA'
* * 'RSA_AES_256_SHA'
* * 'RSA_AES_128_SHA256'
* * 'RSA_AES_256_SHA256'
* * 'DHE_RSA_3DES_SHA'
* * 'ECDHE_RSA_3DES_SHA'
* * 'DHE_RSA_AES_128_SHA'
* * 'DHE_RSA_AES_256_SHA'
* * 'DHE_RSA_AES_128_SHA256'
* * 'DHE_RSA_AES_256_SHA256'
* * 'ECDHE_RSA_AES_128_SHA'
* * 'ECDHE_RSA_AES_256_SHA'
*
* In order to select all cipher suites, set this property to the array, ['All'].
*
* Note that this setting is shared between FTPS and HTTPS, both of which use SSL/TLS.
*
* @type {String[]}
*/
this.sslCipherSuites = null;
/**
* [Limits and timeouts settings] - The maximum time in milliseconds that a connection is permitted to be idle, i.e. if no
* commands are sent from the client. The default is 300,000 milliseconds (5 minutes).
*
* If the timeout is set to zero, the timeout is infinite, i.e. the connection does
* not time out.
*
* @type {Number}
*/
this.timeoutIdle = null;
/**
* [Limits and timeouts settings] - The maximum time in milliseconds permitted for a login attempt. If a connection is made
* and login is not completed within this period, the connection is closed. The default is 60,000 milliseconds (1 minute).
*
* If the timeout is set to zero, the timeout is infinite, i.e. the connection does not time out.
*
* @type {Number}
*/
this.timeoutLogin = null;
/**
* [Limits and timeouts settings] - In passive mode, the server listens on a socket, waiting for the client to make
* a connection. The client can connect before actually sending the next command (LIST, NLST, RETR or STOR), and the
* server must wait for this next command before it can do anything with the client connection.
*
* By default, the timeout is set to 60,000 milliseconds (1 minute). If the timeout is set to zero, the timeout is
* infinite, i.e. the connection does not time out.
*
* @type {Number}
*/
this.timeoutPassiveWait = null;
/**
* [Limits and timeouts settings] - The maximum time in milliseconds that the underlying sockets wait for while performing
* read operations. The default is 60,000 milliseconds (1 minute).
*
* If the timeout is set to zero, the timeout is infinite, i.e. read operations do not time out.
*
* @type {Number}
*/
this.timeoutStalled = null;
/**
* [Limits and timeouts settings] - The maximum time in milliseconds before HTTP sessions expire. The default is
* 1,800,000 milliseconds (30 minutes).
*
* If the timeout is set to zero, sessions do not expire.
*
* @type {Number}
*/
this.timeoutHTTP = null;
/**
* The date and time that this site was created.
*
* @type {Date}
* @readonly
*/
this.createdTime = null;
/**
* The date and time that this site was last modified.
*
* @type {Date}
* @readonly
*/
this.modifiedTime = null;
/**
* An array of {@link ServerMapping} objects represents a list of CompleteFTP servers on which this site is enabled/disabled.
*
* @type {ServerMapping[]}
*/
this.serverMapping = null;
/**
* [SFTP/SCP settings] - A {@link KeyPair} object that allows the RSA server key to be modified for this site.
*
* @type {KeyPair}
*/
this.sshKeyPairDSA = null;
/**
* [SFTP/SCP settings] - A {@link KeyPair} object that allows the DSA server key to be modified for this site.
*
* @type {KeyPair}
*/
this.sshKeyPairRSA = null;
/**
* [FTPS & HTTPS settings] - The server's SSL certificate set for this site.
* Note that this setting is shared between FTPS and HTTPS, both of which use SSL/TLS.
*
* @type {SSLCertificate}
*/
this.sslCertificate = null;
/**
* [File-system settings] - Controls whether or not stored files are encrypted.
* If this setting is set to 'GlobalEncryption' and the user has the equivalent setting enabled
* (see {@link User#fileEncryptionMode User.fileEncryptionMode}), all files transferred to the server will be encrypted on
* the server (encryption at rest). The only way to decrypt files is by transferring them from the server, or via
* {@link https://enterprisedt.com/products/completeftp/doc/guide/html/admincommands.html an administrator command}.
*
* To turn this setting off, set it to 'EncryptionOff' (which is already the default).
*
* @type {String}
*/
this.fileEncryptionMode = null;
/**
* [IP filtering setting] - Allows IP filtering to be configured for this site.
*
* @type {IPFilter}
*/
this.ipFilter = null;
}
/**
* @classdesc Sometimes it is a requirement to block the upload of certain file types, such as executable files.
* This class allows you to specify the filters used to control what files can be uploaded. Note that
* the filters are also applied to renaming of files - otherwise a user could upload a file with an
* acceptable name and then rename it to a banned name. Administrators can choose to block files that
* match the filters, or to only permit files that match the filters.
*
* Instances of this class should be obtained using {@link Site#fileNameFilter Site.fileNameFilter}.
*
* @class
* @hideconstructor
*/
FileNameFilter = function () {
/**
* If true (which is the default), then files that match the filters will be blocked. Otherwise, only files that
* match the filters will be permitted.
*
* @type {Boolean}
*/
this.matchingFilesBlocked = null;
/**
* An array of strings contains the filters (e.g. ["\*.exe", "\*.bat"]).
*
* @type {String[]}
*/
this.filters = null;
}
/**
* @classdesc Contains information about whether or not the current site is enabled on a CompleteFTP server and
* the listening interfaces for the site for the various protocols on that server.
*
* @class
* @hideconstructor
*/
ServerMapping = function () {
/**
* The name of the server.
*
* @type {String}
* @readonly
*/
this.serverName = null;
/**
* Is the current site enabled on this server?
*
* @type {String}
*/
this.enabled = null;
/**
* The listening IP addresses (interfaces) for the current site for the FTP and FTPS protocols on this server.
* Note that multiple IP addresses should be separated by a comma.
*
* By default, this property returns null means that all network interfaces are selected.
*
* @type {String}
*/
this.ftpInterfaces = null;
/**
* The listening IP addresses (interfaces) for the available sites for the SFTP, SCP and SSH protocols on this server.
* Note that multiple IP addresses should be separated by a comma.
*
* By default, this property returns null means that all network interfaces are selected.
*
* @type {String}
*/
this.sftpInterfaces = null;
/**
* The listening IP addresses (interfaces) for the available sites for the HTTP and HTTPS protocols on this server.
* Note that multiple IP addresses should be separated by a comma.
*
* By default, this property returns null means that all network interfaces are selected.
*
* @type {String}
*/
this.httpInterfaces = null;
}
/**
* @classdesc Provides methods for setting up the server SSH keys (RSA/DSA) for the current site.
* Instances of this class should be obtained using {@link Site#sshKeyPairDSA Site.sshKeyPairDSA} or
* {@link Site#sshKeyPairRSA Site.sshKeyPairRSA}.
*
* @class
* @hideconstructor
*/
KeyPair = function () {
/**
* Returns a string representing the server's public key in OpenSSH format of the current site.
*
* @method
* @return {String}
*/
this.getPublicKey = function () { }
/**
* Set up the server key for the current site.
*
* @method
* @param {String} key The server's private key in OpenSSH, SSH.com or Putty format.
* @param {String} password The password that protects the private key.
*/
this.setPrivateKey = function (key, password) { }
}
/**
* @classdesc Represents the current server certificate of the current site. Instances of this class should be obtained
* using {@link Site#sslCertificate Site.sslCertificate}
*
* @class
* @hideconstructor
*/
SSLCertificate = function () {
/**
* The fully qualified name of the server.
*
* @type {String}
* @readonly
*/
this.commonName = null;
/**
* The name of the company or organization.
*
* @type {String}
* @readonly
*/
this.organization = null;
/**
* The name of the department or organizational unit.
*
* @type {String}
* @readonly
*/
this.organizationalUnit = null;
/**
* The name of the city/town/locality.
*
* @type {String}
* @readonly
*/
this.locality = null;
/**
* The name of the state or province.
*
* @type {String}
* @readonly
*/
this.state = null;
/**
* [Two-letter code of the country](https://www.iso.org/iso-3166-country-codes.html)
*
* @type {String}
* @readonly
*/
this.country = null;
/**
* The subject alternative name that's an extension to the X.509 specification that allows to specify
* additional host names for a single SSL certificate.
*
* @type {String}
* @readonly
*/
this.subjectAltName = null;
/**
* The serial number of this certificate.
*
* @type {String}
* @readonly
*/
this.serialNumber = null;
/**
* The thumbprint of this certificate.
*
* @type {String}
* @readonly
*/
this.thumbprint = null;
/**
* The number of bits in the key.
*
* @type {String}
* @readonly
*/
this.keySize = null;
/**
* The certificate is valid from this date.
*
* @type {Date}
* @readonly
*/
this.validFrom = null;
/**
* The certificate is valid until this date.
*
* @type {Date}
* @readonly
*/
this.validTo = null;
/**
* Deletes this server certificate.
*
* @method
*/
this.remove = null;
}
/**
* @classdesc IP filtering allows rules to be established to prevent certain IP addresses from successfully
* connecting, or to allow only certain IP addresses to connect. Each rule consists of a mask, an action and (optionally)
* a user. The mask specifies which IP addresses the rule pertains to and the action specifies what should be done.
* If a user is defined for a rule then that rule will apply only to that user. Rules with no user defined apply to
* all users.
*
* The mask may be (a) a specific IP address, such as 123.123.123.123, (b) the first one, two or three parts of an
* IP address, such as 192.168, which specifies all the IP addresses that begin with those parts, (c) a specific numeric
* range of IP addresses, such as 192.168.2.100-150, (d) an Internet host-name, or (e) a LAN network name.
*
* There are three possible actions - deny, allow and allow-always. Deny will block access from clients whose IP
* addresses are included in the mask. Allow will permit access, unless the auto-banning system has detected too many
* failed login-attempts. Allow-always is like allow except that auto-banning is disabled.
*
* These rules are combined to filter incoming IP addresses. When a connection attempt is made, the rules are consulted
* to see if the remote IP address matches the rules, and the connection is dropped if it is determined that access should
* be denied.
*
* The precedence of operations is important. By default, the precedence is Deny over allow. This means that if all IP
* addresses are allowed, and there is a deny rule for a specific address or range, then the deny rule takes precedence
* and any IP address matching the deny rule is denied.
*
* Allow over deny is the other option, which means if an IP address matches an allow rule, then it will be permitted
* access even if it is listed in a deny rule.
*
* Instances of this class should be obtained using {@link Site#ipFilter Site.ipFilter}.
*
* @class
* @hideconstructor
*/
IPFilter = function () {
/**
* The precedence of operations (i.e. 'DenyOverAllow' or 'AllowOverDeny').
*
* @type {String}
*/
this.precedence = null;
/**
* Adds an IP filter rule.
*
* @method
* @return {IPFilterRule}
* @param {String} action The action of the rule (i.e. 'Deny', 'Allow' or 'AllowAlways').
* @param {String} [host=All] The mask of the rule. Rules with no mask defined apply to al IP addresses.
* @param {String|User} [user=none] Name or a {@link User} object of the user that the rule applies to. Rules with no user
* defined apply to all users.
*/
this.add = function (action, host, user) { }
/**
* Deletes the given IP filter rule.
*
* @method
* @param {String|IPFilterRule} id ID or an {@link IPFilterRule} object of the rule to be deleted.
*/
this.remove = function (id) { }
/**
* Returns an {@link IPFilterRule} object for the given ID.
*
* @method
* @return {IPFilterRule}
* @param {String} id ID of the IP filter rule.
*/
this.get = function (id) { }
/**
* Returns an array of {@link IPFilterRule} objects representing all existing IP filter rules.
*
* @method
* @return {IPFilterRule[]}
*/
this.toArray = function () { }
}
/**
* @classdesc Represents an IP filter rule. Instances of this class should be obtained using
* {@link IPFilter#get IPFilter.get}.
*
* @class
* @hideconstructor
*/
IPFilterRule = function () {
/**
* The ID of this IP filter rule.
*
* @type {String}
* @readonly
*/
this.id = null;
/**
* The action of this IP filter rule ('Deny', 'Allow' or 'AllowAlways').
*
* 'Deny' will block access from clients whose IP addresses are included in the mask. 'Allow' will permit access, unless
* the auto-banning system has detected too many failed login-attempts. 'AllowAlways' is like allow except that auto-banning
* is disabled.
*
* @type {String}
*/
this.action = null;
/**
* The mask of this IP filter rule that specifies which IP addresses the rule pertains to. The mask may be
* (a) a specific IP address, such as 123.123.123.123, (b) the first one, two or three parts of an IP address, such as
* 192.168, which specifies all the IP addresses that begin with those parts, (c) a specific numeric range of IP addresses,
* such as 192.168.2.100-150, (d) an Internet host-name, or (e) a LAN network name.
*
* @type {String}
*/
this.host = null;
/**
* The name of the user that this IP filter rule applies to.
*
* @type {String}
*/
this.userName = null;
/**
* Deletes this IP filter rule.
*
* @method
*/
this.remove = null;
}