moctl — administer Moera nodes
moctl [-h] [-d] [-H URL | -N NAME] [-k]
[-s URL] [-S SECRET]
[-P PROVIDER] [-T TOKEN]
[-V] OBJECT COMMAND ...
-h, --helpGet the list of all available options, their meaning, and their short and long forms.
-V, --versionShow the program’s version number and exit.
-d, --devUse the development naming server to resolve node names.
-s URL, --naming-server URLUse the provided naming server to resolve node names.
-H URL, --host URL-N NAME, --name NAMEManage the node designated by the given URL or NAME. These options are
mutually exclusive.
These options define the node to be managed by all commands, except domain creation/deletion commands. For domain creation/deletion commands, these options define the node for sending API requests to.
-k, --insecureDisable SSL certificate verification for HTTPS connections to the naming server and the node.
Use this option only when connecting to a trusted server with a self-signed or otherwise untrusted certificate.
-S SECRET, --root-secret SECRETDefine root admin secret used for authentication.
-T TOKEN, --token TOKENDefine the admin token used for authentication.
-P PROVIDER, --provider PROVIDERUse the provider defined in the configuration file. It is recommended to use the configuration file to store tokens and secrets instead of passing them through the command line. Command-line options override the defaults set in the configuration file.
If the provider is not set explicitly, the program uses the node address passed in
-H/-N options to find the first provider that has domain= defined and
the node is located on one of its subdomains. For example, if the node is
lamed.moera.blog, the provider having domain = moera.blog fits the criteria.
If no provider is found by domain name, the first provider in the configuration file is used.
OBJECTThe object to be managed. Each object has a set of COMMANDs defined for it.
Use -h to get the list of commands for a particular object (moctl domain -h)
and the list of command-specific options for a particular command
(moctl domain create -h).
The available objects are (you can use a full or short name):
domain (dom) — manage domains (nodes located on the same server)credentials (cr) — manage credentialsname (nm) — manage node namemalware (mal) — manage malware hashestoken (t) — manage authentication tokensoption (op) — change settingsThe commands are described in the following sections.
Most commands that modify node state require authentication. Depending on the
operation, use either a root admin secret (-S) or an admin token (-T).
token create is the main exception: it authenticates with the current admin
password passed as a positional argument.
These commands manage domains — nodes located on the same server. Usually they have domain names that are subdomains of the same domain, but this is not required.
domain listList all domains (nodes) defined on the server.
domain showShow the detailed information about the domain. (The domain is defined by
-H/-N options.)
domain create DOMAINCreate a domain with the given domain name.
domain delete DOMAINDelete a domain with the given domain name.
These commands manage credentials used to authenticate the owner (admin) of the node.
credentials checkCheck and display whether admin credentials are set for the node.
credentials set-password PASSWORDSet the admin password for the node. If the node has an admin password defined, this operation fails.
credentials delete-passwordDelete the admin password of the node. Without a password, the node can be taken over by anybody, so a new password should be set as soon as possible.
credentials get-emailDisplay node owner’s e-mail address, if set.
credentials set-email ADDRESSSet node owner’s e-mail address.
These commands manage the node name stored on the node. The commands do not make any changes on the naming server — the node itself updates the naming server when needed.
name showShow the node name.
name statusDisplay the status of the last operation on the name.
name register NAMERegister a new name NAME and assign it to the node. The command outputs the 24
secret words that are needed to control the name.
name assign NAMEAssign an existing name NAME to the node. The 24 secret words are to be passed
to the standard input, one per line. It is allowed to pass them exactly as they
are printed by name register, where each word is prepended with its number.
These numbers are ignored.
name deleteRemove name information from the node.
These commands manage the malware user list on the node. Each hash is stored
in the list as node_name.
malware add HASHAdd HASH to the malware list.
malware delete HASHDelete HASH from the malware list.
malware show HASHShow HASH and its creation timestamp, separated by a tab. If HASH is not
found, print nothing.
These commands manage tokens that are used to authenticate as administrator on the node. The token ID is used to identify the particular token in later commands.
token listList all tokens available on the node. Each line contains the token ID and either the token name or, for unnamed tokens, the token value itself. If the token belongs to a plugin, the plugin name is shown in a third column.
token show IDShow the detailed information about the token with the given ID, including
the token value, permissions, timestamps, and last-use information when
available.
token create [-n NAME] [-p PERMISSIONS] PASSWORDCreate a new token using the current admin PASSWORD. This command
authenticates with the password directly and does not require -T or -S.
-n NAME, --token-name NAMEThe name to be assigned to the token. If not set, the token becomes unnamed.
-p PERMISSIONS, --permissions PERMISSIONSComma-separated list of permissions to be assigned to the token.
token update [-n NAME] [-p PERMISSIONS] IDChange the token’s name or permissions and print the updated token details.
-n NAME, --token-name NAMEAssign a human-readable name to the token.
-p PERMISSIONS, --permissions PERMISSIONSComma-separated list of permissions to be assigned to the token.
token delete IDDelete the token.
These commands are used to display or change node settings (options). The node admin may change regular settings, while changing privileged settings or default values requires root admin authentication.
option show [-d] [--defaults] [-m] [--prefix PREFIX] [-t]List all available settings. Letter P in the first column means that
the setting is privileged (can be changed by the root admin only). * in
the second column means that the setting was modified (i.e., holds a non-default
value).
-d, --descriptionShow descriptions of the settings’ meaning.
--defaultsShow the default values of the settings instead of the current values.
-m, --modifiedShow only the settings that were modified.
--prefix PREFIXShow only the settings having names starting with PREFIX.
-t, --typeShow information about the settings’ type.
option set NAME VALUESet the setting NAME to the given VALUE.
option reset NAMEReset the setting NAME to its default value.
option set-default NAME VALUESet default value of the setting NAME to the given VALUE.
option reset-default NAMEReset default value of the setting NAME to its built-in value.
option set-privileged NAMEMake the setting NAME privileged.
option set-not-privileged NAMEMake the setting NAME not privileged.
option reset-privileged NAMEReset privileged status of the setting NAME to its built-in value.