moctl — manage domains, credentials, and settings
moctl [-h] [-d] [-H URL | -N NAME]
[-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.
-S SECRET, --root-secret SECRETDefine root admin secret used for authentication.
-T TOKEN, --token TOKENDefine 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 nametoken (t) — manage authentication tokensoption (op) — change settingsThe commands are described in the following sections.
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 how 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 tokens that are used to authenticate as administrator on the node. The token itself is displayed only once — when created. All further operations on the token use token ID to identify the particular token.
token listList all tokens available on the node.
token show IDShow the detailed information about the token with the given ID.
token create [-n NAME] [-p PERMISSIONS] PASSWORDCreate a new token. This operation requires additional authentication with
PASSWORD.
-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 token’s name or permissions.
-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 [-h] 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 require 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.