/* This file will load all UnrealIRCd modules needed for JSON-RPC,
 * this allows remote (web) endpoints to query and control UnrealIRCd.
 * To actually use it, you would also need one or more rpc-user blocks
 * and one or more special listen blocks, see the documentation at
 * https://www.unrealircd.org/docs/JSON-RPC.
 *
 * You can include this file from your unrealircd.conf, using:
 * include "rpc.modules.default.conf";
 *
 * DO NOT EDIT THIS FILE! IT WILL BE OVERWRITTEN DURING NEXT UPGRADE!!
 * If you want to customize the modules to load you have two options:
 * 1) Keep the include for rpc.modules.default.conf as usual and make use
 *    of blacklist-module "xyz"; to selectively disable modules.
 *    See https://www.unrealircd.org/docs/Blacklist-module_directive
 * 2) OR, make a copy of this file (eg: name it rpc.modules.custom.conf)
 *    and edit it. Then include that file from your unrealircd.conf
 *    instead of this one.
 * The downside of option #2 is that you will need to track changes
 * in the original rpc.modules.default.conf with each new UnrealIRCd
 * release to make sure you don't miss any new functionality (as new
 * important modules may be added you need to add them to your conf).
 * You don't have this problem with option #1.
 */

/* The RPC modules are loaded in modules.default.conf nowadays,
 * so we only need to load the web server and add the default
 * local RPC UNIX socket socket.
 */

/* These are required for RPC to work */
loadmodule "webserver";
loadmodule "websocket_common";

/* And a RPC listen socket */
@if !defined($NO_DEFAULT_RPC_SOCKET)
listen {
	file "rpc.socket";
	options { rpc; }
}
@endif

/* And a memory log block */
@if !defined($NO_DEFAULT_LOG_MEMORY_BLOCK)
log {
	source {
		all;
		!debug;
		!join.LOCAL_CLIENT_JOIN;
		!join.REMOTE_CLIENT_JOIN;
		!part.LOCAL_CLIENT_PART;
		!part.REMOTE_CLIENT_PART;
		!kick.LOCAL_CLIENT_KICK;
		!kick.REMOTE_CLIENT_KICK;
	}
	destination {
		memory {
			max-lines 1000;
			max-time 7d;
		}
	}
}
@endif

/* Also load the default rpc-class { } blocks */
include "rpc-class.default.conf";
