2017-02-16 03:27:16 +00:00
|
|
|
/* jslint node: true */
|
|
|
|
/* eslint-disable no-console */
|
|
|
|
'use strict';
|
|
|
|
|
2022-06-05 20:04:25 +00:00
|
|
|
const getDefaultConfigPath = require('./oputil_common.js').getDefaultConfigPath;
|
2017-02-16 03:27:16 +00:00
|
|
|
|
2022-06-05 20:04:25 +00:00
|
|
|
exports.getHelpFor = getHelpFor;
|
2017-02-16 03:27:16 +00:00
|
|
|
|
2022-06-05 20:04:25 +00:00
|
|
|
const usageHelp = (exports.USAGE_HELP = {
|
|
|
|
General: `usage: oputil.js [--version] [--help]
|
2019-05-11 06:21:42 +00:00
|
|
|
<command> [<arguments>]
|
2017-02-16 03:27:16 +00:00
|
|
|
|
2019-05-25 04:27:28 +00:00
|
|
|
Global arguments:
|
|
|
|
-c, --config PATH Specify config path (default is ${getDefaultConfigPath()})
|
2019-05-11 06:21:42 +00:00
|
|
|
-n, --no-prompt Assume defaults (don't prompt for input where possible)
|
2019-08-10 00:16:23 +00:00
|
|
|
--verbose Verbose output, where applicable
|
2017-02-16 03:27:16 +00:00
|
|
|
|
2019-05-25 04:27:28 +00:00
|
|
|
Commands:
|
2019-05-11 06:21:42 +00:00
|
|
|
user User management
|
|
|
|
config Configuration management
|
|
|
|
fb File base management
|
|
|
|
mb Message base management
|
2023-03-18 00:40:54 +00:00
|
|
|
ap ActivityPub management
|
2017-02-16 03:27:16 +00:00
|
|
|
`,
|
2022-06-05 20:04:25 +00:00
|
|
|
User: `usage: oputil.js user <action> [<arguments>]
|
2018-05-22 02:36:34 +00:00
|
|
|
|
2019-05-11 06:21:42 +00:00
|
|
|
Actions:
|
|
|
|
info USERNAME Display information about a user
|
|
|
|
|
|
|
|
pw USERNAME PASSWORD Set a user's password
|
|
|
|
(passwd|password)
|
|
|
|
|
|
|
|
rm USERNAME Permanently removes user from system
|
|
|
|
(del|delete|remove)
|
|
|
|
|
|
|
|
rename USERNAME NEWNAME Rename a user
|
|
|
|
(mv)
|
|
|
|
|
2019-05-25 04:27:28 +00:00
|
|
|
2fa-otp USERNAME SPEC Enable 2FA/OTP for the user
|
2019-05-11 06:21:42 +00:00
|
|
|
(otp)
|
|
|
|
|
2019-05-25 04:27:28 +00:00
|
|
|
The system supports various implementations of Two Factor Authentication (2FA)
|
|
|
|
One Time Password (OTP) authentication.
|
|
|
|
|
2019-05-11 06:21:42 +00:00
|
|
|
Valid specs:
|
2019-05-25 04:27:28 +00:00
|
|
|
disable : Removes 2FA/OTP from the user
|
|
|
|
google : Google Authenticator
|
|
|
|
hotp : HMAC-Based One-Time Password Algorithm (RFC-4266)
|
|
|
|
totp : Time-Based One-Time Password Algorithm (RFC-6238)
|
2019-05-11 06:21:42 +00:00
|
|
|
|
|
|
|
activate USERNAME Set a user's status to "active"
|
|
|
|
|
|
|
|
deactivate USERNAME Set a user's status to "inactive"
|
|
|
|
|
|
|
|
disable USERNAME Set a user's status to "disabled"
|
|
|
|
|
|
|
|
lock USERNAME Set a user's status to "locked"
|
|
|
|
|
2020-11-29 21:43:26 +00:00
|
|
|
group USERNAME [+|~]GROUP Adds (+) or removes (~) user from a group
|
2019-05-11 06:21:42 +00:00
|
|
|
|
2020-05-06 03:18:58 +00:00
|
|
|
list [FILTER] List users with optional FILTER.
|
|
|
|
|
|
|
|
Valid filters:
|
|
|
|
all : All users (default).
|
|
|
|
disabled : Disabled users.
|
|
|
|
inactive : Inactive users.
|
|
|
|
active : Active (regular) users.
|
|
|
|
locked : Locked users.
|
|
|
|
|
2019-05-11 06:21:42 +00:00
|
|
|
info arguments:
|
|
|
|
--security Include security information in output
|
|
|
|
|
2022-08-16 18:19:49 +00:00
|
|
|
list arguments:
|
|
|
|
--sort SORT_BY Specify field to sort by
|
|
|
|
|
|
|
|
Valid SORT_BY values:
|
|
|
|
id : User ID
|
|
|
|
username : Username
|
|
|
|
realname : Real name
|
|
|
|
status : Account status
|
|
|
|
created : Account creation date
|
|
|
|
lastlogin : Last login timestamp
|
|
|
|
logins : Login count
|
|
|
|
|
2019-05-11 06:21:42 +00:00
|
|
|
2fa-otp arguments:
|
|
|
|
--qr-type TYPE Specify QR code type
|
|
|
|
|
|
|
|
Valid QR types:
|
|
|
|
ascii : Plain ASCII (default)
|
|
|
|
data : HTML data URL
|
|
|
|
img : HTML image tag
|
|
|
|
svg : SVG image
|
|
|
|
|
|
|
|
--out PATH Path to write QR code to. defaults to stdout
|
2017-02-16 03:27:16 +00:00
|
|
|
`,
|
|
|
|
|
2022-06-05 20:04:25 +00:00
|
|
|
Config: `usage: oputil.js config <action> [<arguments>]
|
2017-02-16 03:27:16 +00:00
|
|
|
|
2019-05-11 06:21:42 +00:00
|
|
|
Actions:
|
|
|
|
new Generate a new / default configuration
|
2017-02-20 18:46:18 +00:00
|
|
|
|
2019-05-11 06:21:42 +00:00
|
|
|
cat Write current configuration to stdout
|
|
|
|
|
|
|
|
cat arguments:
|
|
|
|
--no-color Disable color
|
|
|
|
--no-comments Strip any comments
|
2017-02-16 03:27:16 +00:00
|
|
|
`,
|
2022-06-05 20:04:25 +00:00
|
|
|
FileBase: `usage: oputil.js fb <action> [<arguments>]
|
2017-02-16 03:27:16 +00:00
|
|
|
|
2019-05-11 06:21:42 +00:00
|
|
|
Actions:
|
|
|
|
scan AREA_TAG[@STORAGE_TAG] Scan specified area
|
|
|
|
|
2020-05-08 02:02:12 +00:00
|
|
|
Tips:
|
|
|
|
- May contain optional GLOB as last parameter.
|
|
|
|
Example: ./oputil.js fb scan d0pew4r3z *.zip
|
|
|
|
|
|
|
|
- AREA_TAG may contain simple wildcards.
|
|
|
|
Example: ./oputil.js fb scan *warez*
|
2019-05-11 06:21:42 +00:00
|
|
|
|
|
|
|
info CRITERIA Display information about areas and/or files
|
|
|
|
|
|
|
|
mv SRC [SRC...] DST Move matching entry(s)
|
|
|
|
(move)
|
|
|
|
|
|
|
|
Source may be any of the following:
|
|
|
|
- Filename including '*' wildcards
|
|
|
|
- SHA-1
|
|
|
|
- File ID
|
|
|
|
- Area tag with optional @storageTag suffix
|
|
|
|
Destination is area tag with optional @storageTag suffix
|
|
|
|
|
|
|
|
rm SRC [SRC...] Remove entry(s) from the system
|
|
|
|
(del|delete|remove)
|
|
|
|
|
|
|
|
Source may be any of the following:
|
|
|
|
- Filename including '*' wildcards
|
|
|
|
- SHA-1
|
|
|
|
- File ID
|
|
|
|
- Area tag with optional @storageTag suffix
|
|
|
|
|
|
|
|
desc CRITERIA Updates an file base entry's description
|
|
|
|
|
|
|
|
Launches an external editor using $VISUAL, $EDITOR, or vim/notepad.
|
|
|
|
|
|
|
|
import-areas FILEGATE.ZXX Import file base areas using FileGate RAID type format
|
|
|
|
|
|
|
|
scan arguments:
|
|
|
|
--tags TAG1,TAG2,... Specify hashtag(s) to assign to discovered entries
|
|
|
|
|
|
|
|
--desc-file [PATH] Prefer file descriptions from supplied input file
|
|
|
|
|
|
|
|
If a file description can be found in the supplied input file, prefer that description
|
|
|
|
over other sources such related FILE_ID.DIZ. Path must point to a valid FILES.BBS or
|
|
|
|
DESCRIPT.ION file.
|
|
|
|
|
|
|
|
--update Attempt to update information for existing entries
|
2019-08-10 00:16:23 +00:00
|
|
|
--full Perform a full scan (default is quick)
|
2019-05-11 06:21:42 +00:00
|
|
|
|
|
|
|
info arguments:
|
|
|
|
--show-desc Display short description, if any
|
|
|
|
|
|
|
|
remove arguments:
|
|
|
|
--phys-file Also remove underlying physical file
|
|
|
|
|
|
|
|
import-areas arguments:
|
|
|
|
--type TYPE Sets import areas type
|
|
|
|
|
|
|
|
Valid types are are "zxx" or "na".
|
|
|
|
|
|
|
|
--create-dirs Also create backing storage directories
|
2017-05-24 03:55:22 +00:00
|
|
|
`,
|
2022-06-05 20:04:25 +00:00
|
|
|
FileOpsInfo: `
|
2019-05-11 06:21:42 +00:00
|
|
|
General Information:
|
|
|
|
Generally an area tag can also include an optional storage tag. For example, the
|
|
|
|
area of 'bbswarez' stored using 'bbswarez_main': bbswarez@bbswarez_main
|
|
|
|
|
2019-08-10 00:16:23 +00:00
|
|
|
When performing an initial import of a large area or storage backing, --full
|
2019-05-11 06:21:42 +00:00
|
|
|
is the best option. If re-scanning an area for updates a standard / quick scan is
|
|
|
|
generally good enough.
|
|
|
|
|
|
|
|
File ID's are those found in file.sqlite3.
|
2018-01-01 00:54:11 +00:00
|
|
|
`,
|
2022-06-05 20:04:25 +00:00
|
|
|
MessageBase: `usage: oputil.js mb <action> [<arguments>]
|
2018-01-01 00:54:11 +00:00
|
|
|
|
2019-06-15 03:43:27 +00:00
|
|
|
Actions:
|
2023-05-11 14:40:53 +00:00
|
|
|
list-confs List conferences and areas
|
|
|
|
|
2023-05-11 18:07:29 +00:00
|
|
|
post PATH Posts a message file specified in PATH.
|
|
|
|
PATH must point to a UTF-8 encoded JSON file
|
|
|
|
containing 'to', 'from', 'subject', 'areaTag', and
|
|
|
|
'body'. If 'timestamp' is present, the system will
|
|
|
|
attempt to use it.
|
|
|
|
|
2019-05-11 06:21:42 +00:00
|
|
|
areafix CMD1 CMD2 ... ADDR Sends an AreaFix NetMail
|
|
|
|
|
|
|
|
NetMail is sent to supplied address with the supplied command(s). Multi-part commands
|
|
|
|
such as "%COMPRESS ZIP" should be quoted.
|
|
|
|
|
|
|
|
import-areas PATH Import areas using FidoNet *.NA or AREAS.BBS file
|
|
|
|
|
2020-05-02 22:48:24 +00:00
|
|
|
qwk-dump PATH Dumps a QWK packet to stdout.
|
|
|
|
qwk-export [AREA_TAGS] PATH Exports one or more configured message area to a QWK
|
|
|
|
packet in the directory specified by PATH. The QWK
|
|
|
|
BBS ID will be obtained by the final component of PATH.
|
|
|
|
|
2023-05-11 14:40:53 +00:00
|
|
|
list-confs arguments:
|
|
|
|
--areas Include areas within each message conference.
|
|
|
|
|
2019-05-11 06:21:42 +00:00
|
|
|
import-areas arguments:
|
|
|
|
--conf CONF_TAG Conference tag in which to import areas
|
|
|
|
--network NETWORK Network name/key to associate FTN areas
|
|
|
|
--uplinks UL1,UL2,... One or more uplinks (comma separated)
|
|
|
|
--type TYPE Area import type
|
|
|
|
|
|
|
|
Valid types are "bbs" and "na".
|
2020-05-02 22:48:24 +00:00
|
|
|
|
|
|
|
qwk-export arguments:
|
|
|
|
--user USER User in which to export for. Defaults to the SysOp.
|
|
|
|
--after TIMESTAMP Export only messages with a timestamp later than
|
|
|
|
TIMESTAMP.
|
2020-05-06 01:01:47 +00:00
|
|
|
--no-qwke Disable QWKE extensions.
|
|
|
|
--no-synchronet Disable Synchronet style extensions.
|
2023-03-18 00:40:54 +00:00
|
|
|
`,
|
|
|
|
ActivityPub: `usage: oputil.js ap <action> [<arguments>]
|
|
|
|
Actions:
|
|
|
|
condition USERNAME Condition user with system ActivityPub defaults
|
|
|
|
|
|
|
|
Instead of an actual USERNAME, the '*' character may be substituted.
|
2023-03-18 20:30:37 +00:00
|
|
|
|
|
|
|
condition arguments:
|
|
|
|
--force Force condition; overrides any existing settings
|
2022-06-05 20:04:25 +00:00
|
|
|
`,
|
|
|
|
});
|
2017-02-16 03:27:16 +00:00
|
|
|
|
|
|
|
function getHelpFor(command) {
|
2018-06-22 05:15:04 +00:00
|
|
|
return usageHelp[command];
|
2018-04-24 00:53:55 +00:00
|
|
|
}
|