mirror of
https://github.com/matrix-construct/construct
synced 2024-11-29 18:22:50 +01:00
modules/console: Allow manual JSON to be specified after positional args for listener config.
This commit is contained in:
parent
7027264ea2
commit
610862903e
1 changed files with 10 additions and 7 deletions
|
@ -4444,23 +4444,26 @@ console_cmd__net__listen(opt &out, const string_view &line)
|
|||
"private_key_pem_path",
|
||||
"certificate_pem_path",
|
||||
"certificate_chain_path",
|
||||
"tmp_dh_path",
|
||||
"backlog",
|
||||
"max_connections",
|
||||
}};
|
||||
|
||||
const json::members opts
|
||||
const json::members _opts
|
||||
{
|
||||
{ "host", token.at("host", "0.0.0.0"_sv) },
|
||||
{ "port", token.at("port", 8448L) },
|
||||
{ "private_key_pem_path", token.at("private_key_pem_path") },
|
||||
{ "certificate_pem_path", token.at("certificate_pem_path") },
|
||||
{ "certificate_chain_path", token.at("certificate_chain_path", ""_sv) },
|
||||
{ "tmp_dh_path", token.at("tmp_dh_path", ""_sv) },
|
||||
{ "backlog", token.at("backlog", -1L) },
|
||||
{ "max_connections", token.at("max_connections", -1L) },
|
||||
};
|
||||
|
||||
const json::object &addl
|
||||
{
|
||||
tokens_after(line, ' ', token.names.size())
|
||||
};
|
||||
|
||||
json::strung opts{_opts};
|
||||
for(const auto &[name, prop] : addl)
|
||||
opts = insert(opts, json::member(name, prop));
|
||||
|
||||
const auto eid
|
||||
{
|
||||
m::send(m::my_room, m::me, "ircd.listen", token.at("name"), opts)
|
||||
|
|
Loading…
Reference in a new issue