apotdevin / thunderhub

ThunderHub LND Lightning Node Manager in your Browser
https://www.thunderhub.io/
MIT License
412 stars 84 forks source link

Proxy setting ignored #571

Open martinoshub opened 11 months ago

martinoshub commented 11 months ago

Just updated ThunderHub to 0.13.23. Pulled my previous .env file and placed it as .env.local. It has a line similar to this (only different IP).

TOR_PROXY_SERVER=socks://127.0.0.1:9550

Before the update, the swap menu worked as expected. Since the update, I get "Unable to connect to Boltz" with an "ErrorGettingBoltzPairs" popup.

From the console, it becomes clear that the proxy setting is ignored (yikes!). It's a good thing my firewall is blocking outgoing connections and DNS requests. Therefore, the app shows this:

{ error: TypeError: fetch failed at Object.fetch (node:internal/deps/undici/undici:14294:11) at processTicksAndRejections (node:internal/process/task_queues:95:5) at BoltzService.getPairs (/x/thunderhub/src/server/modules/api/boltz/boltz.service.ts:17:24) at BoltzResolver.getBoltzInfo (/x/thunderhub/src/server/modules/api/boltz/boltz.resolver.ts:100:18) at target (/x/thunderhub/node_modules/@nestjs/core/helpers/external-context-creator.js:74:28) at Object.getBoltzInfo (/x/thunderhub/node_modules/@nestjs/core/helpers/external-proxy.js:9:24) { cause: Error: getaddrinfo EAI_AGAIN boltz.exchange at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:107:26) { errno: -3001, code: 'EAI_AGAIN', syscall: 'getaddrinfo', hostname: 'boltz.exchange' } }, level: 'error', message: 'Error getting pairs from Boltz', timestamp: '2023-10-12TX' } { context: 'ExceptionsHandler', stack: [ 'Error: ErrorGettingBoltzPairs\n' + ' at BoltzService.getPairs (/x/thunderhub/src/server/modules/api/boltz/boltz.service.ts:23:13)\n' + ' at processTicksAndRejections (node:internal/process/task_queues:95:5)\n' + ' at BoltzResolver.getBoltzInfo (/x/thunderhub/src/server/modules/api/boltz/boltz.resolver.ts:100:18)\n' + ' at target (/x/thunderhub/node_modules/@nestjs/core/helpers/external-context-creator.js:74:28)\n' + ' at Object.getBoltzInfo (/x/thunderhub/node_modules/@nestjs/core/helpers/external-proxy.js:9:24)' ], level: 'error', message: 'ErrorGettingBoltzPairs', timestamp: '2023-10-12TX' }

I've checked, there is no attempt to contact the proxy server. I can set it to 127.0.0.1:1, listen on port 1 and there is no connection.

I had the exact same config before in a previous version and connecting to boltz.exchange was never an issue. If I configure a TOR proxy for privacy, the app shouldn't attempt to make any DNS requests. And it never did, to my knowledge. Only since the update.

Has something changed? Am I doing something incorrectly? Please advise.

Edit: I've also confirmed that adding the hostname to /etc/hosts results in Thunderhub trying to connect to boltz.exchange through the clearnet. It's not a matter of "wrong proxy type where it first looks up the host but then uses the proxy to make the connection". The proxy setting seems to be ignored completely. Even for price lookups.