Serve Lightning Addresses on the request's domain #2

Merged
jk merged 1 commit from any-domain into main 2026-09-28 10:15:15 +00:00
Member

The server now runs on the tailnet only, and each app on the VPS forwards to it from its own domain. Addresses drop the domain setting and take the public domain from the request instead. The server reads X-Forwarded-Host if it's set, otherwise Host. That domain goes into the callback, the metadata identifier and ntfy, so one config works for every domain.

  • The withdraw claim callback uses it too.
  • Withdraw domain stays, because it's only used for the LNURL printed at startup.
  • Old configs with domain: under addresses still load, because the key is ignored.

Apps that proxy with their own HTTP client must send X-Forwarded-Host: <their domain>. Otherwise Host is the upstream address and ends up in the callback. The server trusts both headers, so it must only be reachable over the tailnet.

Tested with go vet ./... and go test ./.... There are new tests for a callback built from Host and one built from X-Forwarded-Host.

🤖 Generated with Claude Code

The server now runs on the tailnet only, and each app on the VPS forwards to it from its own domain. Addresses drop the `domain` setting and take the public domain from the request instead. The server reads `X-Forwarded-Host` if it's set, otherwise `Host`. That domain goes into the callback, the metadata identifier and ntfy, so one config works for every domain. - The withdraw claim callback uses it too. - Withdraw `domain` stays, because it's only used for the LNURL printed at startup. - Old configs with `domain:` under addresses still load, because the key is ignored. Apps that proxy with their own HTTP client must send `X-Forwarded-Host: <their domain>`. Otherwise `Host` is the upstream address and ends up in the callback. The server trusts both headers, so it must only be reachable over the tailnet. Tested with `go vet ./...` and `go test ./...`. There are new tests for a callback built from `Host` and one built from `X-Forwarded-Host`. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Addresses drop the domain setting and use the Host header for the
callback, metadata and notifications, so one config works for every
domain that forwards here. The withdraw callback uses Host too;
withdraw domain stays for the LNURL printed at startup.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
jk merged commit dc39dc38c4 into main 2026-09-28 10:15:15 +00:00
jk deleted branch any-domain 2026-09-28 10:15:15 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
unbeholden/lnurl-server!2
No description provided.