Umbrel: BTCPay Tor onion address not accessible through UI

Created on 3 Mar 2021  路  10Comments  路  Source: getumbrel/umbrel

BTCPay is meant for allowing people to buy/send money to you. So the service should be publicly exposed.

However, publicizing your IP address is not a good idea (assuming Umbrel is primarily set up in your home) so tor is a must.

However, the btcpayserver installed through umbrel does not support tor currently.

The onion address of btcpayserver and other services (ie umbrel dashboard) should be separate.

Most helpful comment

Thanks @NicolasDorier @Kukks, legends!

All 10 comments

btcpayserver has environment variables to manage TOR... maybe it could be configured to point to the running tor service.

I see you have the proxy info:
https://github.com/getumbrel/umbrel/blob/4c6c1c0acb5e95bfd6db2b7da1eaeb133d449487/apps/btcpay-server/docker-compose.yml#L58

But you also need BTCPAY_TORRCFILE which points to the file torrc (meaning BTCPay needs filesystem access to wherever that file is on (I'm assuming) the tor container.

If I run docker exec tor cat /var/lib/tor/app-btcpay-server/hostname on the box with umbrel, I get an onion URL, and that takes me to BTCPay...

So it is accesible from tor, but there's no way to learn of the onion address besides running a command in the umbrel box currently.

If we alert BTCPay of the tor service via passing it read access to torrc, it will show the onion link on all pages returned from BTCPay.

Otherwise, umbrel needs some sort of UI to show the onion URL for each app.

Looking at the TorService in BTCPay, it doesn't seem like it would be able to parse the torrc properly unless we give btcpay a name?

https://github.com/btcpayserver/btcpayserver/blob/9daa424afd8ee0ab06f56b08f01e277b046c55d0/BTCPayServer/Services/TorServices.cs#L25-L81

service.ServiceName.Equals("BTCPayServer", StringComparison.OrdinalIgnoreCase)

Maybe that corresponds to HiddenServiceName (idk if that exists) in a torrc file.

Maybe @NicolasDorier has some idea on how we can point the BTCPAY to torrc file.

So it is accesible from tor, but there's no way to learn of the onion address besides running a command in the umbrel box currently.

If you access the dashboard via Tor, all apps URLs will be onion URLs. So if you click on an app, it will open directly its onion url, and not the local hostname:port.

Otherwise, umbrel needs some sort of UI to show the onion URL for each app.

But I agree on this. So the user can get the onion url without first accessing the dashboard directly via Tor.

Looking at the TorService in BTCPay, it doesn't seem like it would be able to parse the torrc properly unless we give btcpay a name?

Maybe @NicolasDorier has some idea on how we can point the BTCPAY to torrc file.

BTCPay not having access to the torrc file is intended. By mounting the tor data dir in BTCPay container, it can read the whole configuration file and display in the BTCPay settings page a list of all existing hidden services and the associated onion URLs. It is a security issue if a single app can know all the other apps and services hidden services. So when I implemented BTCPay, I removed this from the compose file, so it is no access to the tor data dir (and thus URLs + private keys).

Maybe we can get BTCPay to add an ENV where we can give it the onion address instead of torrc file. That way it can show the tor link of itself and be aware.

@Kukks said on BTCPay chat that he will look into allowing the needed info to be passed via some config rather than torrc file.

:tada::tada::tada::tada::tada::tada::tada:

@Kukks tracking this?

this will be in next version ~1 or 2 week

Thanks @NicolasDorier @Kukks, legends!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jaonoctus picture jaonoctus  路  3Comments

esackbauer picture esackbauer  路  9Comments

hitchcott picture hitchcott  路  7Comments

rstmsn picture rstmsn  路  5Comments

mayankchhabra picture mayankchhabra  路  5Comments