Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ These rules apply to coding agents working in this repository.
## Hygiene

- Always save lessons learned in this file or another persistent repo instruction file. Do not rely on session memory for process corrections.
- For GitHub operations in this repo, prefer `gh` by default, especially for write actions. Do not try the GitHub app first and then fall back to `gh` unless there is a clear reason to use the app.
- When generating or updating npm lockfiles, use the repo-pinned npm version from the root `package.json` so lockfiles stay compatible with CI.
- Do not use stash-based branch juggling as the default workflow.
- Never run mutating git operations in parallel. Serialize `git add`, `git commit`, `git push`, branch moves, stash operations, and any command that writes to `.git`.
Expand Down
5 changes: 0 additions & 5 deletions Dockerfile.lnbits

This file was deleted.

5 changes: 1 addition & 4 deletions docker-compose.lightning.yml
Original file line number Diff line number Diff line change
Expand Up @@ -196,10 +196,7 @@ services:
restart: "no"

lnbits:
build:
context: .
dockerfile: Dockerfile.lnbits
image: ghcr.io/archetech/lnbits
image: ghcr.io/archetech/lnbits:1.5.3-archetech.1
entrypoint: ["/bin/sh", "/scripts/lnbits-entrypoint.sh"]
environment:
- LNBITS_HOST=0.0.0.0
Expand Down
44 changes: 0 additions & 44 deletions patches/lnbits-3817-internal-payment.py

This file was deleted.

22 changes: 18 additions & 4 deletions services/mediators/lightning/src/lightning-mediator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -483,13 +483,27 @@ async function main(): Promise<void> {
return;
}

let invoiceUrl = `${lightningService.serviceEndpoint}?amount=${amount}`;
const publicHost = await getPublicHost();
let invoiceUrl = new URL(lightningService.serviceEndpoint);
invoiceUrl.searchParams.set('amount', String(amount));
if (memo) {
invoiceUrl += `&memo=${encodeURIComponent(memo)}`;
invoiceUrl.searchParams.set('memo', memo);
}

// When the recipient is published on this same stack, avoid
// looping back through our own onion service and use the
// internal Drawbridge route instead.
let useTorProxy = isOnion;
if (publicHost) {
const publicUrl = new URL(publicHost);
if (invoiceUrl.hostname === publicUrl.hostname) {
invoiceUrl = new URL(invoiceUrl.pathname + invoiceUrl.search, `http://drawbridge:${config.drawbridgePort}`);
useTorProxy = false;
}
}

const fetchOptions: any = {};
if (isOnion && config.torProxy) {
if (useTorProxy && config.torProxy) {
const [host, port] = config.torProxy.split(':');
fetchOptions.dispatcher = socksDispatcher({
type: 5,
Expand All @@ -498,7 +512,7 @@ async function main(): Promise<void> {
});
}

const invoiceResponse = await fetch(invoiceUrl, fetchOptions);
const invoiceResponse = await fetch(invoiceUrl.toString(), fetchOptions);
if (!invoiceResponse.ok) {
const error = await invoiceResponse.json().catch(() => ({ error: invoiceResponse.statusText }));
res.status(502).json({ error: `Invoice request failed: ${error.error || invoiceResponse.statusText}` });
Expand Down
Loading