Chapter 14: Controller: /nodeworx/firewall Up Part II: NodeWorx API Spec Chapter 16: Controller: /nodeworx/health 

15 Controller: /nodeworx/ftp

Required Permissions "FTP"
Action: autoRestart
Added in version 4.7.0-339
Description Set the FTP server auto-restart status.
Input Parameters
Name Type Notes Required?
ftp_autorestart integer Help Entry
With this option on you can have FTP restarted automatically if FTP goes down unexpectedly.
Example Values
1, 0
Example Default Value
0
No*
cascade_to_nodes integer Help Entry
Selecting this option causes the action to be replayed on all nodes of the cluster automatically, as if you had logged in to each node manually
Example Values
1
No
* indicates that it’s actually required, but probably already has a valid default value
Action: isRunning
Added in version 4.7.0-339
Description Checks if the service is running or not.
Sample output
array (
’status’ => 0,
’payload’ => true,
)
Action: isRunningOnNode
Added in version 4.7.0-339
Description Checks if the service is running on a specific node (Clustering only).
Input Parameters
Name Type Notes Required?
node_id string No*
* indicates that it’s actually required, but probably already has a valid default value
Action: killSessions
Added in version 4.8.0-393
Description Kill ftp sessions.
Input Parameters
Name Type Notes Required?
sessions struct (integer) No*
* indicates that it’s actually required, but probably already has a valid default value
Action: listFtpSessions
Added in version 4.8.0-393
Description List Ftp Sessions.
Sample output
array (
’status’ => 0,
’payload’ =>
array (
),
)
Action: listGeneralName
Added in version 4.7.0-339
Description Lists the "normal" name - ie "web server" instead of "httpd".
Sample output
array (
’status’ => 0,
’payload’ => ’##LG_FTPSERVER##’,
)
Action: listPortNumbers
Added in version 4.7.0-339
Description Lists a string of the port numbers that this service uses, comma-seperated.
Sample output
array (
’status’ => 0,
’payload’ => ’21’,
)
Action: listPortNumbersArray
Added in version 4.7.0-339
Description Lists array of port numbers and ranges that this service uses.
Sample output
array (
’status’ => 0,
’payload’ =>
array (
0 => 21,
),
)
Action: listRequiredPermissions
Added in version 4.7.0-339
Description Lists an array of permissions required to control the service.
Sample output
array (
’status’ => 0,
’payload’ =>
array (
0 => ’FTP’,
),
)
Action: listServiceInfo
Added in version 4.7.0-339
Description Lists the service name, ports, page, and status.
Sample output
array (
’status’ => 0,
’payload’ =>
array (
’id’ => ’proftpd’,
’name’ => ’##LG_FTPSERVER##’,
’ports’ => ’21’,
’page’ => ’/nodeworx/ftp’,
’ctrl’ => ’/nodeworx/ftp’,
’is_running’ => 1,
),
)
Action: listServiceName
Added in version 4.7.0-339
Description Lists the service name - ie "httpd" instead of "web server".
Sample output
array (
’status’ => 0,
’payload’ => ’proftpd’,
)
Action: listServicePage
Added in version 4.7.0-339
Description Lists the page that controls the service.
Sample output
array (
’status’ => 0,
’payload’ => ’/nodeworx/ftp’,
)
Action: queryAutoRestart
Added in version 5.1.0-838
Description Displays the information available to the action "autoRestart".
Sample output
array (
’status’ => 0,
’payload’ =>
array (
’ftp_autorestart’ => ’0’,
),
)
Action: queryEditConf
Added in version 5.1.0-838
Description Displays the information available to the action "editConf".
Sample output
array (
’status’ => 0,
’payload’ =>
array (
’file’ => ’/etc/proftpd.conf’,
’file_content’ => ’####
## InterWorx-CP Proftpd config
####
##
# Global Environment
##
ServerName "InterWorx-CP :: FTP Server"
ServerType standalone
ServerIdent on "FTP Server Ready"
PassivePorts 50000 51000
ListOptions -a
DefaultServer on
DeferWelcome on
SyslogLevel debug
UseReverseDNS off
UseFtpUsers off
IdentLookups off
WtmpLog off
ScoreboardFile /var/run/proftpd/proftpd-scoreboard
DisplayLogin /etc/motd
SetEnv TZ :/etc/localtime
##
# Basic Defaults
##
Port 21
Umask 022
##
# Timeouts
##
TimeoutLogin 120
TimeoutIdle 600
TimeoutNoTransfer 900
TimeoutStalled 3600
TimeoutSession 0
##
# security stuff
##
MaxInstances 30
RootLogin off
##
# The user/group we run as
##
User proftpd
Group proftpd
##
# Logging formats
##
TransferLog NONE
LogFormat default "%h %l %u %t \\"%m %f\\" %s %b"
LogFormat auth "%v [%P] %h %t \\"%r\\" %s"
LogFormat xfer "%h %l %u %t \\"%m %f\\" %s %b"
LogFormat byte "%u %b"
## system log
SystemLog /var/log/proftpd/auth.log
##
# Global settings
##
<Global>
##
# Basic stuff
##
DisplayLogin welcome.msg
DisplayChdir readme
ShowSymlinks on
AllowOverwrite on
TimesGMT off
AuthOrder mod_sql.c mod_auth_pam.c mod_auth_unix.c
##
# File upload/download resume
##
AllowRetrieveRestart on
AllowStoreRestart on
##
# SQL Authentication
##
SQLAuthenticate users*
SQLConnectInfo iworx_ftp@127.0.0.1:2307 iworx_ftp nwb4iPz9Y5Yg
SQLAuthTypes Crypt
SQLUserWhereClause "1"
SQLMinUserUID 500
SQLMinUserGID 500
SQLDefaultUID 65533
SQLDefaultGID 65533
CreateHome off
SQLUserInfo users username password uid gid homedir shell
SQLGroupInfo groups groupname gid members
##
# Security stuff
##
MaxLoginAttempts 3
RequireValidShell off
MaxClients 25
## chroot everyone
DefaultRoot ~ !wheel
## hide root\’s stuff
<Directory />
HideUser root
HideGroup root
HideGroup wheel
</Directory>
##
# Logging
##
## xfer log
ExtendedLog /var/log/proftpd/xfer.log READ,WRITE xfer
</Global>
<IfModule mod_sftp.c>
<VirtualHost 0.0.0.0>
SFTPEngine on
SFTPLog /var/log/proftpd/sftp.log
ServerIdent off
# Configure the server to listen on the normal SSH2 port, port 22
Port 24
# Configure both the RSA and DSA host keys, using the same host key
# files that OpenSSH uses.
SFTPHostKey /etc/ssh/ssh_host_rsa_key
SFTPHostKey /etc/ssh/ssh_host_dsa_key
# Configure the file used for comparing authorized public keys of users.
SFTPAuthorizedUserKeys file:~/.sftp/authorized_keys
# Enable compression
SFTPCompression delayed
# Allow the same number of authentication attempts as OpenSSH.
#
# It is recommended that you explicitly configure MaxLoginAttempts
# for your SSH2/SFTP instance to be higher than the normal
# MaxLoginAttempts value for FTP, as there are more ways to authenticate
# using SSH2.
MaxLoginAttempts 6
</VirtualHost>
</IfModule>
<IfModule mod_tls.c>
TLSEngine on
TLSLog /var/log/proftpd/tls.log
TLSProtocol SSLv23 # this selects the latest crypt version
TLSOptions NoCertRequest # this is REALLY important for WinClients
# Are clients required to use FTP over TLS when talking to this server?
TLSRequired off
# Server\’s certificate
TLSRSACertificateFile /etc/pki/tls/certs/proftpd.pem
TLSRSACertificateKeyFile /etc/pki/tls/certs/proftpd.pem
# CA the server trusts
# TLSCACertificateFile /usr/share/ssl/cert.pem
# Authenticate clients that want to use FTP over TLS?
TLSVerifyClient off
</IfModule>
maxclientsperuser none
’,
),
)
Action: queryServerOptions
Added in version 5.1.0-838
Description Displays the information available to the action "serverOptions".
Sample output
array (
’status’ => 0,
’payload’ =>
array (
’maxinstances’ => ’30’,
’maxclients’ => ’25’,
’maxclientsperuser’ => ’999999999’,
’timeoutlogin’ => ’120’,
’timeoutidle’ => ’600’,
’timeoutnotransfer’ => ’900’,
’timeoutstalled’ => ’3600’,
’timeoutsession’ => ’0’,
’maxloginattempts’ => ’3’,
’tlsrequired’ => ’0’,
’showsymlinks’ => ’1’,
’allowretrieverestart’ => ’1’,
’allowstorerestart’ => ’1’,
),
)
Action: querySftpOptions
Added in version 5.1.0-838
Description Displays the information available to the action "sftpOptions".
Sample output
array (
’status’ => 0,
’payload’ =>
array (
’port’ => ’24’,
’maxloginattempts’ => ’6’,
’sftpengine’ => ’1’,
),
)
Action: restart
Added in version 4.7.0-339
Description Restarts the service.
Input Parameters
Name Type Notes Required?
cascade_to_nodes integer Help Entry
Selecting this option causes the action to be replayed on all nodes of the cluster automatically, as if you had logged in to each node manually
Example Values
1
No
Action: restartOnNode
Added in version 4.7.0-339
Description Restarts the service on a specific node (Clustering only).
Input Parameters
Name Type Notes Required?
node_id string No*
* indicates that it’s actually required, but probably already has a valid default value
Action: rrdGraph
Added in version 4.7.0-339
Description Set the FTP connections RRD graph display in the web interface.
Input Parameters
Name Type Notes Required?
rrd integer Help Entry
Use the dropdown to turn the FTP server activity graph on or off
Example Values
1, 0
Example Default Value
0
No*
* indicates that it’s actually required, but probably already has a valid default value
Action: serverOptions
Added in version 4.7.0-339
Description Update FTP server settings.
Input Parameters
Name Type Notes Required?
maxinstances integer Help Entry
Sets the maximum number of child processes to be spawned
Example Default Value
30
No*
maxclients integer Help Entry
The total number of FTP clients allowed to connect to the FTP server.
Example Default Value
25
No*
maxclientsperuser integer Help Entry
The total number of FTP clients allowed to connect from a given user id.
Example Default Value
999999999
No*
timeoutlogin integer Help Entry
Sets the login timeout
Example Default Value
120
No*
timeoutidle integer Help Entry
Sets the idle timeout
Example Default Value
600
No*
timeoutnotransfer integer Help Entry
Sets the connection without transfer timeout
Example Default Value
900
No*
timeoutstalled integer Help Entry
Sets the timeout on stalled downloads
Example Default Value
3600
No*
timeoutsession integer Help Entry
Sets a timeout for an entire session
Example Default Value
0
No*
maxloginattempts integer Help Entry
Sets how many password attempts are allowed before disconnection
Example Default Value
3
No*
tlsrequired integer Help Entry
Toggle whether FTPS (secure FTP) is required on this server
Example Values
1, 0
Example Default Value
0
No*
showsymlinks integer Help Entry
Toggle the display of symlinks
Example Values
1, 0
Example Default Value
1
No*
allowretrieverestart integer Help Entry
Allow clients to resume uploads
Example Values
1, 0
Example Default Value
1
No*
allowstorerestart integer Help Entry
Allow clients to resume downloads
Example Values
1, 0
Example Default Value
1
No*
cascade_to_nodes integer Help Entry
Selecting this option causes the action to be replayed on all nodes of the cluster automatically, as if you had logged in to each node manually
Example Values
1
No
* indicates that it’s actually required, but probably already has a valid default value
Action: sftpOptions
Added in version 4.9.0-427
Description Update SFTP server settings.
Input Parameters
Name Type Notes Required?
port integer Help Entry
The port used for the SFTP service.
Example Default Value
24
No*
maxloginattempts integer Help Entry
Sets how many password attempts are allowed before disconnection
Example Default Value
6
No*
sftpengine integer Help Entry
The current status of the SFTP engine.
Example Values
1, 0
Example Default Value
1
No*
cascade_to_nodes integer Help Entry
Selecting this option causes the action to be replayed on all nodes of the cluster automatically, as if you had logged in to each node manually
Example Values
1
No
* indicates that it’s actually required, but probably already has a valid default value
Action: start
Added in version 4.7.0-339
Description Starts the service.
Input Parameters
Name Type Notes Required?
cascade_to_nodes integer Help Entry
Selecting this option causes the action to be replayed on all nodes of the cluster automatically, as if you had logged in to each node manually
Example Values
1
No
Action: startOnBoot
Added in version 4.7.0-339
Description Set the FTP server start-on-boot status.
Input Parameters
Name Type Notes Required?
ftp_startonboot integer Help Entry
If set to ’Yes’, FTP will be automatically started when the server starts up
Example Values
1, 0
Example Default Value
1
No*
cascade_to_nodes integer Help Entry
Selecting this option causes the action to be replayed on all nodes of the cluster automatically, as if you had logged in to each node manually
Example Values
1
No
* indicates that it’s actually required, but probably already has a valid default value
Action: startOnNode
Added in version 4.7.0-339
Description Starts the service on a specific node (Clustering only).
Input Parameters
Name Type Notes Required?
node_id string No*
* indicates that it’s actually required, but probably already has a valid default value
Action: stop
Added in version 4.7.0-339
Description Stops the service.
Input Parameters
Name Type Notes Required?
cascade_to_nodes integer Help Entry
Selecting this option causes the action to be replayed on all nodes of the cluster automatically, as if you had logged in to each node manually
Example Values
1
No
Action: stopOnNode
Added in version 4.7.0-339
Description Stops the service on a specific node (Clustering only).
Input Parameters
Name Type Notes Required?
node_id string No*
* indicates that it’s actually required, but probably already has a valid default value
 Chapter 14: Controller: /nodeworx/firewall Up Part II: NodeWorx API Spec Chapter 16: Controller: /nodeworx/health 

(C) 2017 by InterWorx LLC