diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2014-03-30 22:07:18 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2014-03-30 22:07:18 +0100 |
commit | b5ad7edb1ebfe9d928747a3636ef9441bb0a9d63 (patch) | |
tree | 243f462a5f575552aa5ef2e9fec8fd8571436158 | |
parent | f23a281012d37b560a3bd152b64970c928d55cbc (diff) | |
download | rspamd-b5ad7edb1ebfe9d928747a3636ef9441bb0a9d63.tar.gz rspamd-b5ad7edb1ebfe9d928747a3636ef9441bb0a9d63.zip |
Allow to handle static files throught webui.
-rw-r--r-- | src/webui.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/webui.c b/src/webui.c index c7441461d..829ea8e61 100644 --- a/src/webui.c +++ b/src/webui.c @@ -110,6 +110,10 @@ struct rspamd_webui_worker_ctx { /* A map of secure IP */ gchar *secure_ip; radix_tree_t *secure_map; + + /* Static files dir */ + gchar *static_files_dir; + /* Worker */ struct rspamd_worker *worker; }; @@ -1774,6 +1778,10 @@ init_webui_worker (struct config_file *cfg) rspamd_rcl_parse_struct_string, ctx, G_STRUCT_OFFSET (struct rspamd_webui_worker_ctx, secure_ip), 0); + rspamd_rcl_register_worker_option (cfg, type, "static_dir", + rspamd_rcl_parse_struct_string, ctx, + G_STRUCT_OFFSET (struct rspamd_webui_worker_ctx, static_files_dir), 0); + return ctx; } @@ -1813,7 +1821,7 @@ start_webui_worker (struct rspamd_worker *worker) /* Accept event */ ctx->http = rspamd_http_router_new (rspamd_webui_error_handler, rspamd_webui_finish_handler, &ctx->io_tv, ctx->ev_base, - NULL); + ctx->static_files_dir); /* Add callbacks for different methods */ rspamd_http_router_add_path (ctx->http, PATH_AUTH, rspamd_webui_handle_auth); |