lightningd: remove clnrest override options.

Changelog-Removed: Config: autodetection for rest-port/rest-protocol/rest-host/rest-certs options to clnrest-* (deprecated v23.11, disabled v25.02).
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2025-06-24 09:58:39 +09:30
parent b3c1728abc
commit 4fc9856cf2
3 changed files with 0 additions and 82 deletions

View File

@@ -1833,48 +1833,8 @@ void handle_early_opts(struct lightningd *ld, int argc, char *argv[])
logging_options_parsed(ld->log_book);
}
/* Free *str, set *str to copy with `cln` prepended */
static void prefix_cln(char **str STEALS)
{
char *newstr = tal_fmt(tal_parent(*str), "cln%s", *str);
tal_free(*str);
*str = newstr;
}
/* Due to a conflict between the widely-deployed clightning-rest plugin and
* our own clnrest plugin, and people wanting to run both, in v23.11 we
* renamed some options. This breaks perfectly working v23.08 deployments who
* don't care about clightning-rest, so we work around it here. */
static void fixup_clnrest_options(struct lightningd *ld)
{
for (size_t i = 0; i < tal_count(ld->configvars); i++) {
struct configvar *cv = ld->configvars[i];
/* These worked for v23.08 */
if (!strstarts(cv->configline, "rest-port=")
&& !strstarts(cv->configline, "rest-protocol=")
&& !strstarts(cv->configline, "rest-host=")
&& !strstarts(cv->configline, "rest-certs="))
continue;
/* Did some (plugin) claim it? */
if (opt_find_long(cv->configline, cast_const2(const char **, &cv->optarg)))
continue;
if (!opt_deprecated_ok(ld,
tal_strndup(tmpctx, cv->configline,
strcspn(cv->configline, "=")),
"clnrest-prefix",
"v23.11", "v24.11"))
continue;
log_unusual(ld->log, "Option %s deprecated in v23.11, renaming to cln%s",
cv->configline, cv->configline);
prefix_cln(&cv->configline);
}
}
void handle_opts(struct lightningd *ld)
{
fixup_clnrest_options(ld);
/* Now we know all the options, finish parsing and finish
* populating ld->configvars with cmdline. */
parse_configvars_final(ld->configvars, true, ld->developer);