Skip to content

clightning-rest: remove unmaintained service - #113

Merged
seberm merged 2 commits into
masterfrom
clightning-rest-remove
Oct 22, 2026
Merged

seberm merged 2 commits into
masterfrom
clightning-rest-remove

Conversation

@prusnak

@prusnak prusnak commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

Remove the module, package, connection helpers and associated Tor, WireGuard, network namespace, nodeinfo and backup integrations. Core Lightning REST access continues through clnrest.

Reject removed options and document the config version 0.1.1 migration, including API compatibility, shared isolation and retained data backups. Fix clnrest connection URLs to export server.pem and add a regression check against the certificate served during the TLS handshake.

Validation: flake checks for both supported systems, shellcheck, mdBook, affected scenario and migration evaluations, and a local TLS regression that rejects the former client.pem behavior. Full Linux VM execution is pending because the configured builder is unreachable.

Assisted-by: OpenAI Codex (GPT-6)

@github-actions github-actions Bot added area: ci .github/, test/, dev/ area: docs docs/, README, examples/, SECURITY.md, book.toml, assets area: modules modules/ and pkgs/lib.nix area: packages pkgs/ and flake pins type: removal Module, package or option dropped (implies breaking) labels Oct 20, 2026
@prusnak
prusnak requested a review from seberm October 21, 2026 09:00
@prusnak
prusnak force-pushed the clightning-rest-remove branch 2 times, most recently from 108479d to 45b984d Compare October 21, 2026 20:38

@seberm seberm left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, the removal looks complete. There are no leftover references, and the migration messages work for clightning-rest and rtl.cl-rest at configVersion 0.1.0 and 0.1.1. Beyond CI, I also ran regtest and full. regtest runs lnconnect-clnrest-cert without netns, against 127.0.0.1. Both pass.

Two requests:

1. The versioning condition hits every backups user

Because of || config.services.backups.enable, every backups user sees this entry, including ones who never ran c-lightning-REST. This config fails to evaluate:

{
  nix-bitcoin.configVersion = "0.1.0";
  services.bitcoind.enable = true;
  services.backups.enable = true;
}

The error tells the user to remove services.clightning-rest, which they never set. Suggest splitting it into two entries:

    {
      version = "0.1.1";
      condition = clightningRestUsed;
      message = ''
        <current message unchanged>
      '';
    }
    {
      version = "0.1.1";
      condition = !clightningRestUsed
        && config.services.backups.enable && config.services.clightning.enable;
      message = ''
        c-lightning-REST has been removed. If you previously ran it, the backups service
        no longer includes its data directory (default: /var/lib/clightning-rest).
        See docs/configuration.md, "Upgrading to config version 0.1.1".
      '';
    }
  ];

  clightningRestUsed = options.services.clightning-rest.isDefined
    || options.services.rtl.cl-rest.isDefined;

c-lightning-REST always enabled clightning, so the second entry still covers everyone affected. I checked that this evaluates as intended:

  • backups without CLN: no message
  • backups + CLN: only the backups note
  • clightning-rest set: only the removal message
  • backups + CLN at 0.1.1: evaluates

2. Please move the client.pem → server.pem fix into its own commit

It's an independent, user-visible fix, not part of the removal. clnrest serves server.pem and doesn't request client certificates. client.pem is the mutual-TLS client cert (gRPC uses that layout), so the old cert= in direct-connection URLs never matched the certificate the server presents. Onion and WireGuard URLs use --nocert and weren't affected. As its own commit, it's visible in history and gets its own release-note line. The lnconnect-clnrest-cert regression test can go with it.

Remove the module, package, connection helpers and associated Tor,
WireGuard, network namespace, nodeinfo and backup integrations. Core
Lightning REST access continues through clnrest.

Reject removed options and document the config version 0.1.1 migration,
including API compatibility, shared isolation and retained data backups.
Keep the removal notice specific to configurations using removed options.
Show a separate backup notice only when backups and Core Lightning are
enabled, so Bitcoin-only backup users can still evaluate older configs.

Assisted-by: OpenAI Codex (GPT-6)
Direct connection URLs embedded client.pem, so cert= did not match the
certificate presented by clnrest. Export server.pem instead. Tor and
WireGuard URLs use --nocert and are unaffected.

Add a regression check comparing the URL's decoded certificate with the
live TLS handshake and document the fix in the 0.1.1 upgrade notes.

Assisted-by: OpenAI Codex (GPT-6)
@prusnak
prusnak force-pushed the clightning-rest-remove branch from 45b984d to 69feb92 Compare October 22, 2026 10:08
@prusnak

prusnak commented Oct 22, 2026

Copy link
Copy Markdown
Contributor Author

Two requests:

@seberm Addressed in the current force-push. Please review and merge if you are OK with the current PR.

@seberm seberm left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both requests addressed; CI green and regtest passes on a test host. Thanks!

@seberm
seberm merged commit d929f90 into master Oct 22, 2026
12 checks passed
@seberm
seberm deleted the clightning-rest-remove branch October 22, 2026 11:37
@seberm seberm added the breaking Changes existing user config; needs a versioning.nix entry label Oct 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: ci .github/, test/, dev/ area: docs docs/, README, examples/, SECURITY.md, book.toml, assets area: modules modules/ and pkgs/lib.nix area: packages pkgs/ and flake pins breaking Changes existing user config; needs a versioning.nix entry type: removal Module, package or option dropped (implies breaking)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove c-lightning-rest in favour of clnrest clightning-rest: run under its own user and warn when the ports are reachable

2 participants