aboutsummaryrefslogtreecommitdiffstats
path: root/src/rspamd.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2019-03-27 14:18:22 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2019-03-27 14:18:22 +0000
commit812dfbbd064daf5f60260b5718bbe3ba4173eabf (patch)
treedb7a75acaf64df6e4dc0da8746645f21035346f8 /src/rspamd.c
parent6c98a7447d79fda38e0eb8313d45c6cc23cfc3c9 (diff)
downloadrspamd-812dfbbd064daf5f60260b5718bbe3ba4173eabf.tar.gz
rspamd-812dfbbd064daf5f60260b5718bbe3ba4173eabf.zip
[Feature] Preprocess config files using jinja templates
Diffstat (limited to 'src/rspamd.c')
-rw-r--r--src/rspamd.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/rspamd.c b/src/rspamd.c
index 631759f05..8b12fa48e 100644
--- a/src/rspamd.c
+++ b/src/rspamd.c
@@ -95,6 +95,8 @@ static gboolean is_insecure = FALSE;
static gboolean gen_keypair = FALSE;
static gboolean encrypt_password = FALSE;
static GHashTable *ucl_vars = NULL;
+static gchar **lua_env = NULL;
+static gboolean skip_template = FALSE;
static gint term_attempts = 0;
@@ -146,6 +148,10 @@ static GOptionEntry entries[] =
"Show version and exit", NULL },
{"var", 0, 0, G_OPTION_ARG_CALLBACK, (gpointer)&rspamd_parse_var,
"Redefine/define environment variable", NULL},
+ {"skip-template", 'T', 0, G_OPTION_ARG_NONE, &skip_template,
+ "Do not apply Jinja templates", NULL},
+ {"lua-env", '\0', 0, G_OPTION_ARG_FILENAME_ARRAY, &lua_env,
+ "Load lua environment from the specified files", NULL},
{ NULL, 0, 0, G_OPTION_ARG_NONE, NULL, NULL, NULL }
};
@@ -923,7 +929,8 @@ load_rspamd_config (struct rspamd_main *rspamd_main,
cfg->compiled_modules = modules;
cfg->compiled_workers = workers;
- if (!rspamd_config_read (cfg, cfg->cfg_name, config_logger, rspamd_main, ucl_vars)) {
+ if (!rspamd_config_read (cfg, cfg->cfg_name, config_logger, rspamd_main,
+ ucl_vars, skip_template, lua_env)) {
return FALSE;
}