addHubStartOptions function
void
addHubStartOptions(})
Adds the hub start options to parser.
includeShellPath and includeDataDir exist for the merged service
parser, which accepts either role's options and so must register the names
both roles declare exactly once. See service_commands.dart.
Implementation
void addHubStartOptions(
ArgParser parser, {
bool includeShellPath = true,
bool includeDataDir = true,
}) {
parser
..addOption('host', defaultsTo: '0.0.0.0', help: 'TLS bind host.')
..addOption('port', defaultsTo: '8443', help: 'TLS bind port.')
..addOption(
'cert',
help: 'TLS certificate chain (PEM). Required unless --tls-dir is set.',
)
..addOption(
'key',
help: 'TLS private key (PEM). Required unless --tls-dir is set.',
)
..addOption(
'tls-dir',
help:
'Directory holding the listener certificate (fullchain.pem + '
'privkey.pem, LetsEncrypt layout), as an alternative to '
'--cert/--key. Re-checked periodically and reloaded automatically '
'when the files change (e.g. on renewal).',
)
..addOption(
'node-path',
defaultsTo: '/node',
help: 'Path the node control channel is mounted at.',
)
..addFlag(
'shell',
negatable: false,
help: 'Also serve OmnyShell nodes (same port, same certificate).',
);
if (includeShellPath) {
parser.addOption(
'shell-path',
defaultsTo: '/shell',
help: 'Path the OmnyShell broker is mounted at.',
);
}
parser
..addOption('api-token', help: 'Bearer token required by the HTTP API.')
..addMultiOption(
'grant',
help: 'Token grant "principal:token:role1,role2" (repeatable).',
)
..addMultiOption(
'alert',
help:
'A condition worth being told about (repeatable): "disk>90", '
'"cpu>95 for 5m", "offline for 2m". None by default — a tool that '
'invents its own thresholds is a tool that pages you at 3am.',
);
if (includeDataDir) {
parser.addOption('data-dir', help: hubDataDirHelp);
}
parser
..addFlag('ephemeral', negatable: false, help: ephemeralHelp)
..addMultiOption(
'cors-origin',
help:
'Browser origin allowed to call the HTTP API, e.g. '
'https://dashboard.example.com (repeatable). Required for a web '
'dashboard — a browser is always a different origin than the Hub. '
'Pass "*" to allow any origin: callers still need a token (the Hub '
'sends no allow-credentials), but any page may then ask.',
);
}