breezmobile icon indicating copy to clipboard operation
breezmobile copied to clipboard

Tor

Open nochiel opened this issue 3 years ago • 5 comments

This PR depends on https://github.com/breez/breez/pull/139.

It adds a "Tor" switch to Network Settings.

  • [x] 20210908 Integrate guardianproject/tor-android.
  • [x] 20210922 Integrate iCepa/Tor.Framework.
  • [ ] Cleanup:
    • [x] Incorporate previous code review from @yaslama.
    • [x] Make sure that I'm not using an extraneous imports in Tor.java.
    • [x] Clean up comments: TODO and FIXME

UI

  • [x] If Tor is enabled but fails to start, we disable Tor and show an error at app.Start.
  • [ ] When Tor is enabled, should we show a Tor status icon on the main screen?
  • ~Store TorConfig in SharedPreferences if BreezMobile uses them persistently. We don't need this setting in breez library.~
    • Unnecesary because TorConfig is needed by the server and not really used anywhere in the client.
  • [x] Error handling:
    • If Tor is enabled but throws an error while starting or can't start at all, show the user an error with options to restart Breez with Tor disabled.
    • [x] Add option to unexpected_error_dialog.dart to disable Tor.

Fix

  • [x] Bug: Tor network setting doesn't correctly show that Tor is active/inactive.
  • [x] Save Tor enabled/disabled state to user's settings.
  • [x] Fixed: ~When using WebDav over Tor the backup is successful but the following occurs. I need to bisect to find out what changed in master because I have never encountered this error before.~
I/GoLog   (29739): sendWebDavRequest: proxying request using tor with config {state:{NoUnkeyedLiterals:{} DoNotCompare:[] DoNotCopy:[] atomicMessageInfo:<nil>} sizeCache:0 unknownFields:[] Control:54598 Http:8118 Socks:9050}.
I/GoLog   (29739): 2021-09-08 14:27:52.696 [INF] CHANNELDB: creating shared channeldb service.
I/GoLog   (29739): 2021-09-08 14:27:52.704 [INF] CHDB: Checking for schema update: latest_version=20, db_version=20
I/GoLog   (29739): 2021-09-08 14:27:52.705 [INF] CHANNELDB: os.Remove(/data/user/0/com.breez.client/app_flutter/data/graph/mainnet/channel.db.old): remove /data/user/0/com.breez.client/app_flutter/data/graph/mainnet/channel.db.old: no such file or directory
I/GoLog   (29739): 2021-09-08 14:27:52.705 [INF] CHANNELDB: os.RemoveAll(/data/user/0/com.breez.client/app_flutter/bootstrap): <nil>
I/GoLog   (29739): 2021-09-08 14:27:52.705 [INF] CHANNELDB: channeldb was opened successfuly
I/GoLog   (29739): 2021-09-08 14:27:52.714 [INF] CHAIN: creating shared chain service.
I/GoLog   (29739): 2021-09-08 14:27:52.714 [ERR] CHAIN: peers error: database not open
I/GoLog   (29739): 2021-09-08 14:27:52.714 [ERR] DAEM: failed to create chainservice%!(EXTRA *errors.errorString=database not open)
I/GoLog   (29739): 2021-09-08 14:27:52.715 [INF] DAEM: Daemon.stop() called, stopping breez daemon alive=false
I/GoLog   (29739): 2021-09-08 14:27:52.715 [INF] DAEM: Daemon sent down event
  • [x] Fixed: ~Regression: Verify that disabling Tor works consistently.~
    • ~An unexpected error screen appears after disabling Tor and restarting Breez.~

nochiel avatar Jul 31 '21 13:07 nochiel

When Tor is enabled, should we show a Tor status icon on the main screen? yes, please.

tlindi avatar Jan 26 '22 16:01 tlindi

Any priority for this issue? Would enable to use ones own nodes running Umbrel, which is very popular.

tlindi avatar Mar 03 '22 13:03 tlindi

Pending Tor v3 support in Neutrino

kingonly avatar Mar 03 '22 13:03 kingonly

ie This one?

https://github.com/lightningnetwork/lnd/issues/4973

tlindi avatar Mar 03 '22 14:03 tlindi

Yes. You can monitor the PR in Breez (not breezmobile).

kingonly avatar Mar 03 '22 14:03 kingonly

@ubbabeck @kingonly I'll merge this PR later today unless there are changes you'd like me to make.

nochiel avatar Nov 09 '22 00:11 nochiel

@ubbabeck @roeierez I've merged https://github.com/breez/breez/pull/139 and merged this PR against master.

So I think this PR is okay to merge with master now as the code hasn't changed since last year's review except to keep it up to date with master.

nochiel avatar Nov 09 '22 06:11 nochiel

@nochiel Hold on with the merge as @ubbabeck reported issues with routing yesterday.

erdemyerebasmaz avatar Nov 09 '22 06:11 erdemyerebasmaz

@nochiel Hold on with the merge as @ubbabeck reported issues with routing yesterday.

Is there any update? Or details on what errors there were with routing? Is it an LND bug or …?

Also, wouldn't it be better for this to be merged so that the functionality can be kept in sync upstream instead of in a PR, seeing as the Tor functionality has been working since a year ago? 🙏🏾

nochiel avatar Nov 21 '22 21:11 nochiel