aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-02-01 22:44:20 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-02-01 22:44:20 +0000
commit5a5fae4692f022bafc1b63e4f5747326a05ae636 (patch)
tree788502a715d1b9d92a41c882bfaefa7aca72f341
parent88f13a02d8b53132a0c49b0120d48f845d9ad3a2 (diff)
downloadrspamd-5a5fae4692f022bafc1b63e4f5747326a05ae636.tar.gz
rspamd-5a5fae4692f022bafc1b63e4f5747326a05ae636.zip
Load controller's keypair from configuration.
-rw-r--r--src/controller.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/controller.c b/src/controller.c
index f54d0be03..e54aae0f6 100644
--- a/src/controller.c
+++ b/src/controller.c
@@ -116,6 +116,9 @@ struct rspamd_controller_worker_ctx {
/* Worker */
struct rspamd_worker *worker;
+
+ /* Local keypair */
+ gpointer key;
};
struct rspamd_controller_session {
@@ -1565,6 +1568,11 @@ init_controller_worker (struct rspamd_config *cfg)
G_STRUCT_OFFSET (struct rspamd_controller_worker_ctx,
static_files_dir), 0);
+ rspamd_rcl_register_worker_option (cfg, type, "keypair",
+ rspamd_rcl_parse_struct_keypair, ctx,
+ G_STRUCT_OFFSET (struct rspamd_controller_worker_ctx,
+ key), 0);
+
return ctx;
}
@@ -1662,6 +1670,10 @@ start_controller_worker (struct rspamd_worker *worker)
PATH_COUNTERS,
rspamd_controller_handle_counters);
+ if (ctx->key) {
+ rspamd_http_router_set_key (ctx->http, ctx->key);
+ }
+
/* Attach plugins */
cur = g_list_first (ctx->cfg->filters);
while (cur) {