diff --git a/conf_schema.h b/conf_schema.h index 42f58045..a80d9487 100644 --- a/conf_schema.h +++ b/conf_schema.h @@ -333,6 +333,7 @@ STRING(256, interface_path, "", str_nonempty,, "Path of director ATOM(bool_t, respawn_on_crash, 0, boolean,, "If true, server will exec(2) itself on fatal signals, eg SEGV") ATOM(uint32_t, config_reload_interval_ms, 1000, uint32_nonzero,, "Time interval between configuration reload polls, in milliseconds") SUB_STRUCT(watchdog, watchdog,) +STRING(120, motd, "", str_nonempty,, "Message Of The Day displayed on HTTPD root page") END_STRUCT STRUCT(monitor) diff --git a/httpd.c b/httpd.c index 3bc67936..271bb50e 100644 --- a/httpd.c +++ b/httpd.c @@ -437,19 +437,24 @@ static int root_page(httpd_request *r, const char *remainder) char temp[8192]; strbuf b = strbuf_local(temp, sizeof temp); strbuf_sprintf(b, "
" - ""); + strbuf_html_escape(b, config.server.motd, strlen(config.server.motd)); + strbuf_puts(b, "
"); + } + strbuf_puts(b, "Interfaces;