From 5ef40cdc6f33d58f2cff3b68cc7a83cb4adaa25c Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Thu, 7 May 2015 18:40:50 +0100 Subject: [PATCH] Add some human readable aliases for rspamd configuration options. --- src/libserver/cfg_rcl.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/libserver/cfg_rcl.c b/src/libserver/cfg_rcl.c index 5869bd6fb..7c898431f 100644 --- a/src/libserver/cfg_rcl.c +++ b/src/libserver/cfg_rcl.c @@ -631,6 +631,10 @@ rspamd_rcl_worker_handler (rspamd_mempool_t *pool, const ucl_object_t *obj, } val = ucl_object_find_key (obj, "bind_socket"); + /* This name is more logical */ + if (val == NULL) { + val = ucl_object_find_key (obj, "listen"); + } if (val != NULL) { it = ucl_object_iterate_new (val); while ((cur = ucl_object_iterate_safe (it, true)) != NULL) { @@ -1270,6 +1274,11 @@ rspamd_rcl_config_init (void) rspamd_rcl_parse_struct_string_list, G_STRUCT_OFFSET (struct rspamd_config, nameservers), 0); + rspamd_rcl_add_default_handler (ssub, + "server", + rspamd_rcl_parse_struct_string_list, + G_STRUCT_OFFSET (struct rspamd_config, nameservers), + 0); rspamd_rcl_add_default_handler (ssub, "timeout", rspamd_rcl_parse_struct_time, @@ -1285,6 +1294,11 @@ rspamd_rcl_config_init (void) rspamd_rcl_parse_struct_integer, G_STRUCT_OFFSET (struct rspamd_config, dns_io_per_server), RSPAMD_CL_FLAG_INT_32); + rspamd_rcl_add_default_handler (ssub, + "connections", + rspamd_rcl_parse_struct_integer, + G_STRUCT_OFFSET (struct rspamd_config, dns_io_per_server), + RSPAMD_CL_FLAG_INT_32); /* New upstreams configuration */ ssub = rspamd_rcl_add_section (&sub->subsections, "upstream", NULL, @@ -1373,6 +1387,11 @@ rspamd_rcl_config_init (void) rspamd_rcl_parse_struct_boolean, G_STRUCT_OFFSET (struct rspamd_config, check_all_filters), 0); + rspamd_rcl_add_default_handler (sub, + "all_filters", + rspamd_rcl_parse_struct_boolean, + G_STRUCT_OFFSET (struct rspamd_config, check_all_filters), + 0); rspamd_rcl_add_default_handler (sub, "min_word_len", rspamd_rcl_parse_struct_integer, @@ -1383,6 +1402,11 @@ rspamd_rcl_config_init (void) rspamd_rcl_parse_struct_string, G_STRUCT_OFFSET (struct rspamd_config, tld_file), RSPAMD_CL_FLAG_STRING_PATH); + rspamd_rcl_add_default_handler (sub, + "tld", + rspamd_rcl_parse_struct_string, + G_STRUCT_OFFSET (struct rspamd_config, tld_file), + RSPAMD_CL_FLAG_STRING_PATH); /** * Metric section -- 2.39.5