alby-hub/api
Roland 5f9a88843c
fix: validate LND and CLN credential files during setup (#2528)
The setup API accepts file paths for the LND certificate and macaroon
and for the CLN lightning directory. Previously the raw file contents
were read and stored without any validation.

Validate these inputs before persisting them:

- LND cert: parse the PEM and store only the re-encoded certificate(s),
  discarding any other PEM blocks (e.g. a bundled private key).
- LND macaroon: unmarshal and store the re-marshalled macaroon.
- CLN lightning directory: verify it contains the TLS credentials
  (ca.pem, client.pem, client-key.pem) that CLN loads at connect time,
  including the hold subdirectory when configured.

On failure, return a generic error to the client and log the detail
server-side. File paths remain supported for Umbrel-style installs.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-11 15:05:56 +07:00
..
api.go fix: validate LND and CLN credential files during setup (#2528) 2026-08-11 15:05:56 +07:00
api_test.go feat: proposal: custom node commands (#1007) 2025-01-30 18:20:17 +07:00
apps_test.go fix: validate return_to redirect URLs (#2532) 2026-08-11 14:57:51 +07:00
backup.go fix: prevent backup restore from writing outside the restore directory (#2529) 2026-08-10 23:42:45 +07:00
backup_test.go fix: prevent backup restore from writing outside the restore directory (#2529) 2026-08-10 23:42:45 +07:00
esplora.go Adding checks for ok status code in responses (#2178) 2026-03-31 23:21:26 +05:30
lsp.go chore: update to use sat/msat suffixes everywhere (#2271) 2026-05-01 15:41:56 +05:30
models.go fix: keep showing migration success page after creating migration file (#2527) 2026-08-10 15:37:26 +07:00
rebalance.go chore: bump rebalance fees to ensure payment succeeds (#2470) 2026-07-29 14:31:18 +07:00
setup_test.go fix: validate LND and CLN credential files during setup (#2528) 2026-08-11 15:05:56 +07:00
transactions.go feat: filter transactions (#2464) 2026-08-07 10:52:14 +07:00
transactions_test.go feat: filter transactions (#2464) 2026-08-07 10:52:14 +07:00