From 8b7a82cd3009a270a551837c9070efdb018b8823 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Fri, 17 Oct 2025 18:15:12 +0200 Subject: [PATCH] MEDIUM: config: warn when expose-experimental-directives is used for no reason If users start to enable expose-experimental-directives for the purpose of testing one specific feature, there are chances that the option remains forever and hides the experimental status of other options. Let's emit a warning if the option appears and is not used. This will remind users that they can now drop it, and help keep configs safe for future upgrades. --- doc/configuration.txt | 5 ++++- src/cfgparse.c | 8 ++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/doc/configuration.txt b/doc/configuration.txt index 2d169fd27..c06458484 100644 --- a/doc/configuration.txt +++ b/doc/configuration.txt @@ -2464,7 +2464,10 @@ expose-experimental-directives breaking them but with no guarantee. For these reasons, these features are not expected to be supported beyond the release of the next LTS release. Users who want to try experimental features are expected to upgrade quickly - to benefit from the improvements made to that feature. + to benefit from the improvements made to that feature. In order to know if + this directive is still needed, it's easy: if it is enabled without being + used by any such feature, a warning will be emitted suggesting to turn it + off. So without any warning, it means it's still needed. external-check [preserve-env] Allows the use of an external agent to perform health checks. This is diff --git a/src/cfgparse.c b/src/cfgparse.c index 288502b61..a36e88983 100644 --- a/src/cfgparse.c +++ b/src/cfgparse.c @@ -4609,6 +4609,14 @@ init_proxies_list_stage2: cfgerr += postparser->func(); } + if (experimental_directives_allowed && + !(get_tainted() & TAINTED_CONFIG_EXP_KW_DECLARED)) { + ha_warning("Option 'expose-experimental-directives' is set in the global section but is " + "no longer used. It is strongly recommended to remove it in order to avoid " + "using an experimental directive by accident in the future.\n"); + err_code |= ERR_WARN; + } + if (cfgerr > 0) err_code |= ERR_ALERT | ERR_FATAL; out: