2021-07-10 14:33:32 +00:00
|
|
|
from typing import Type
|
2015-12-21 17:01:36 +00:00
|
|
|
|
2021-07-10 14:33:32 +00:00
|
|
|
from .base_hybrid import BaseHybridController
|
2015-12-21 17:01:36 +00:00
|
|
|
|
|
|
|
TEMPLATE_CONFIG = """
|
|
|
|
serverinfo {{
|
|
|
|
name = "My.Little.Server";
|
|
|
|
sid = "42X";
|
|
|
|
description = "test server";
|
2015-12-25 14:45:06 +00:00
|
|
|
{ssl_config}
|
2015-12-21 17:01:36 +00:00
|
|
|
}};
|
2021-06-27 14:48:21 +00:00
|
|
|
|
|
|
|
general {{
|
|
|
|
throttle_count = 100; # We need to connect lots of clients quickly
|
|
|
|
sasl_service = "SaslServ";
|
|
|
|
}};
|
|
|
|
|
|
|
|
class "server" {{
|
|
|
|
ping_time = 5 minutes;
|
|
|
|
connectfreq = 5 minutes;
|
|
|
|
}};
|
|
|
|
|
2015-12-21 17:01:36 +00:00
|
|
|
listen {{
|
|
|
|
defer_accept = yes;
|
|
|
|
|
|
|
|
host = "{hostname}";
|
|
|
|
port = {port};
|
2021-08-08 18:46:33 +00:00
|
|
|
port = {services_port};
|
2015-12-21 17:01:36 +00:00
|
|
|
}};
|
2021-06-27 14:48:21 +00:00
|
|
|
|
2015-12-21 17:01:36 +00:00
|
|
|
auth {{
|
|
|
|
user = "*";
|
2015-12-21 19:12:22 +00:00
|
|
|
flags = exceed_limit;
|
2015-12-21 17:01:36 +00:00
|
|
|
{password_field}
|
|
|
|
}};
|
2021-06-27 14:48:21 +00:00
|
|
|
|
2015-12-21 17:01:36 +00:00
|
|
|
channel {{
|
|
|
|
disable_local_channels = no;
|
|
|
|
no_create_on_split = no;
|
|
|
|
no_join_on_split = no;
|
2015-12-27 09:24:29 +00:00
|
|
|
displayed_usercount = 0;
|
2015-12-21 17:01:36 +00:00
|
|
|
}};
|
2021-06-27 14:48:21 +00:00
|
|
|
|
|
|
|
connect "services.example.org" {{
|
|
|
|
host = "localhost"; # Used to validate incoming connection
|
2021-07-10 14:33:32 +00:00
|
|
|
port = 0; # We don't need servers to connect to services
|
2021-06-27 14:48:21 +00:00
|
|
|
send_password = "password";
|
|
|
|
accept_password = "password";
|
|
|
|
class = "server";
|
|
|
|
flags = topicburst;
|
|
|
|
}};
|
|
|
|
service {{
|
|
|
|
name = "services.example.org";
|
|
|
|
}};
|
2021-08-29 14:38:38 +00:00
|
|
|
|
|
|
|
privset "omnioper" {{
|
|
|
|
privs = oper:general, oper:privs, oper:testline, oper:kill, oper:operwall, oper:message,
|
|
|
|
oper:routing, oper:kline, oper:unkline, oper:xline,
|
|
|
|
oper:resv, oper:cmodes, oper:mass_notice, oper:wallops,
|
|
|
|
oper:remoteban,
|
|
|
|
usermode:servnotice, auspex:oper, auspex:hostname, auspex:umodes, auspex:cmodes,
|
|
|
|
oper:admin, oper:die, oper:rehash, oper:spy, oper:grant;
|
|
|
|
}};
|
|
|
|
operator "operuser" {{
|
|
|
|
user = "*@*";
|
|
|
|
password = "operpassword";
|
|
|
|
privset = "omnioper";
|
|
|
|
flags = ~encrypted;
|
|
|
|
}};
|
2015-12-21 17:01:36 +00:00
|
|
|
"""
|
2015-12-25 14:45:06 +00:00
|
|
|
|
|
|
|
|
2021-07-10 14:33:32 +00:00
|
|
|
class CharybdisController(BaseHybridController):
|
2021-02-22 18:02:13 +00:00
|
|
|
software_name = "Charybdis"
|
2021-02-27 13:43:52 +00:00
|
|
|
binary_name = "charybdis"
|
2021-07-10 14:33:32 +00:00
|
|
|
services_protocol = "charybdis"
|
2021-02-22 18:02:13 +00:00
|
|
|
|
2021-07-10 14:33:32 +00:00
|
|
|
supported_sasl_mechanisms = {"PLAIN"}
|
2015-12-21 17:01:36 +00:00
|
|
|
|
2021-07-10 14:33:32 +00:00
|
|
|
template_config = TEMPLATE_CONFIG
|
2021-06-27 14:48:21 +00:00
|
|
|
|
2015-12-21 19:12:22 +00:00
|
|
|
|
2021-02-28 16:08:27 +00:00
|
|
|
def get_irctest_controller_class() -> Type[CharybdisController]:
|
2015-12-21 17:01:36 +00:00
|
|
|
return CharybdisController
|