]> source.dussan.org Git - rspamd.git/commitdiff
Load controller's keypair from configuration.
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Sun, 1 Feb 2015 22:44:20 +0000 (22:44 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Sun, 1 Feb 2015 22:44:20 +0000 (22:44 +0000)
src/controller.c

index f54d0be03ee8e2fcf5f34a2db3acf845c23170c3..e54aae0f67351ecc0c8c190b704682052855ddb9 100644 (file)
@@ -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) {