Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backup, restore and create a new onion address via GUI #3044

Closed
wants to merge 24 commits into from

Conversation

freimair
Copy link
Member

@freimair freimair commented Aug 1, 2019

This PR adds features that allow the user to

  • backup her current onion address,
  • restore a previously onion address backup
  • and even create a completely new onion address

all from within the GUI.

How do you make sure that there are no more open offers or even ongoing trades before you import/renew the address?
I don't. I have reworked the P2P backend so that a single client can have multiple hidden services up and running at any time. If the user renews/imports an onion address, a new hidden service is started. Hidden services are only removed once no more open offers or ongoing trades are there (checked for after every completed trade).

All during runtime?
No. A restart is required for the import and renew features.

Contains DE translations as well.

Here are some impressions:
Screenshot from 2019-08-01 13-28-50
Screenshot from 2019-08-01 13-29-57
Screenshot from 2019-07-30 12-09-40

Expected behaviour (for testers)

  • after renew/import onion address and an application restart, there should be one more hidden service alive (except when you import an address that you already had)
  • the hidden services will only be removed when no more trades and offers use an address. The decision which hidden service to remove is made when a trade completes (successful or not). If an address is not used anymore it is marked for removal and will not show up after an application restart.

closes #1055, closes #1056, subsequently closes #909 and does take care of a lot of preparation work for #2873.

@ManfredKarrer
Copy link
Member

If I make a backup of first HS and later restore that I have 3 HS where first and third are the same but have diff. dir names (fist is '0'). Leads to a timeout then... I think very first HS should also use timestamp as directory name. And seems handling of the original in case of restore is not correct.

@ManfredKarrer
Copy link
Member

On OSX there is a .DS_Store file and caused an exception:
Aug-14 20:39:07.081 [JavaFX Application Thread] ERROR b.n.p2p.network.TorNetworkNode: Hidden service creation failed: java.io.IOException: Not a directory

Copy link
Member

@ManfredKarrer ManfredKarrer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NACK

@freimair
Copy link
Member Author

If I make a backup of first HS and later restore that I have 3 HS where first and third are the same but have diff. dir names (fist is '0'). Leads to a timeout then...

is fixed in b4818d8

On OSX there is a .DS_Store file and caused an exception:

that is a bug. onto it...

@ripcurlx
Copy link
Contributor

@freimair The build of your last commit failed on travis.

@freimair
Copy link
Member Author

freimair commented Aug 20, 2019

@ripcurlx yes I know and I have not figured out why suddenly, the desktop app tests start to fail. I am on to adding tests and get to the ground of that.

Update: Travis tests the merge (that is what surprised me). Recently, the test failing was introduced in master -> that is why it only recently showed up. The code works fine but the test fails as soon as something concerned about the TradeManager is at stake. Looking into resolving that circular dependency...

@freimair freimair changed the title Backup, restore and create a new onion address via GUI [WIP] Backup, restore and create a new onion address via GUI Aug 20, 2019
@freimair freimair changed the title [WIP] Backup, restore and create a new onion address via GUI Backup, restore and create a new onion address via GUI Aug 20, 2019
@freimair
Copy link
Member Author

do you want me to change something?

@ripcurlx
Copy link
Contributor

do you want me to change something?

No, I'll review the PR asap.

@ManfredKarrer
Copy link
Member

@freimair Can you add the code part for correctly filtering the users node address I sent you in the patch? It is same code as used in arbitration and it maked the list containing only the correct addresses even if wrong addressed would not have any effect in your use case.

@ripcurlx
Copy link
Contributor

ripcurlx commented Sep 2, 2019

@freimair Can you add the code part for correctly filtering the users node address I sent you in the patch? It is same code as used in arbitration and it maked the list containing only the correct addresses even if wrong addressed would not have any effect in your use case.

@ManfredKarrer Is there something still open after the last commit from @freimair?

@ManfredKarrer
Copy link
Member

I don't have time for reviewing again and testing. Also I think @freimair did not implemented the suggestions I made yet. Maybe better to keep it for later as it carries high risk.

@freimair freimair force-pushed the export_import_renew_id branch 2 times, most recently from efa257d to 0ffe563 Compare September 5, 2019 15:00
@battleofwizards
Copy link
Contributor

Sorry for being very late to the party :( This is very loosely related to the PR but maybe will be helpful for the future.

IMO all secret keys should be derived from the Bitcoin seed. This includes the private key behind the onion address (or many of them if we want to support that).

This would entirely mitigate the need for multiple separate backups we now expect from the user. It would also make Bisq inline with what Bitcoin users expect from wallets software.

To large extent the standards for this are ready as BIP-39 (+family) and SLIP-s.

@freimair
Copy link
Member Author

freimair commented Sep 8, 2019

is there still something I should change?

@chimp1984
Copy link
Contributor

The filed inside the zip are executable, original files not.
Files in zip:

-rwxr-xr-x   1 user  staff   22 Sep  8 22:40 hostname
-rwxr-xr-x   1 user  staff  874 Sep  8 22:40 private_key

Original:

-rw-r--r--  1 user  staff   22 Sep  4 10:26 hostname
-rw-r--r--  1 user  staff  874 Sep  4 10:26 private_key

@chimp1984
Copy link
Contributor

Tested again backup and restore with app with no offers or trades open.

7jkfjawas3o3vu7k was original address. Backed it up, the renewed it. trkdvguyptjajozb was the new one. The I restored 7jkfjawas3o3vu7k.
Expected behaviour: I have only 7jkfjawas3o3vu7k as HS.
Result: I have both HS....

################################################################
Tor hidden service published after 31505 ms. Socked=HiddenServiceSocket[addr=7jkfjawas3o3vu7k.onion,port=9999]
.....

################################################################
Tor hidden service published after 33176 ms. Socked=HiddenServiceSocket[addr=trkdvguyptjajozb.onion,port=9999]

@chimp1984
Copy link
Contributor

NACK

@freimair
Copy link
Member Author

freimair commented Sep 9, 2019

ad backup and restore: that is expected. unused hidden services are cleaned up once a trade is complete and only after a restart of the application.

as for the executable flags: I do not see this behavior on my linux machine... onto it.

EDIT: zip by itself only stores files, no attributes. There are additional headers for storing such things but whether they are used and read properly strongly depends on the creator/reader software. I have seen different zip file viewers show different file mods on the same zip file. Hence, there is not a whole lot one can do against that.

Besides, it really does not matter here, as the files in the zip-file are text only.

@freimair
Copy link
Member Author

is there anything else I should change?

Copy link
Member

@devinbileck devinbileck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NACK.
Based on my prior comment requiring validation during restore.

@@ -1073,6 +1073,15 @@ setting.preferences.dao.fullNodeInfo.cancel=No, I stick with lite node mode
settings.net.btcHeader=Bitcoin network
settings.net.p2pHeader=Bisq network
settings.net.onionAddressLabel=My onion address
settings.net.renewAddressButton=Create new address
settings.net.renewAddress=Please be aware that you will loose your reputation when you create and use a new onion address. Furthermore, you need to restart the application to set your new onion address active.\n\nProceed?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
settings.net.renewAddress=Please be aware that you will loose your reputation when you create and use a new onion address. Furthermore, you need to restart the application to set your new onion address active.\n\nProceed?
settings.net.renewAddress=Please be aware that you will lose your reputation when you create and use a new onion address. Furthermore, you need to restart the application to set your new onion address active.\n\nProceed?

settings.net.exportAddressFileEnding=Bisq Onion Address Backup (*.bisq)
settings.net.importAddressButton=Restore address
settings.net.importAddressFileDialog=Select the backup file
settings.net.importAddress=Please be aware that you will loose your reputation when you restore a previous onion address (but restore your reputation connected to the restored onion address). Furthermore, you need to restart the application to set your new onion address active.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
settings.net.importAddress=Please be aware that you will loose your reputation when you restore a previous onion address (but restore your reputation connected to the restored onion address). Furthermore, you need to restart the application to set your new onion address active.
settings.net.importAddress=Please be aware that you will lose your reputation when you restore a previous onion address (but restore your reputation connected to the restored onion address). Furthermore, you need to restart the application to set your new onion address active.

@@ -1073,6 +1073,15 @@ setting.preferences.dao.fullNodeInfo.cancel=No, I stick with lite node mode
settings.net.btcHeader=Bitcoin network
settings.net.p2pHeader=Bisq network
settings.net.onionAddressLabel=My onion address
settings.net.renewAddressButton=Create new address
settings.net.renewAddress=Please be aware that you will loose your reputation when you create and use a new onion address. Furthermore, you need to restart the application to set your new onion address active.\n\nProceed?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps we should emphasize the significance of this action. Although it wont remove the old address immediately if there are open offers/trades, they will not be able to back up the old address after creating a new address. So perhaps highly recommend that they backup prior to creating a new address if there are open trades/offers or perhaps even if there are closed trades (just in case).

settings.net.exportAddressFileEnding=Bisq Onion Address Backup (*.bisq)
settings.net.importAddressButton=Restore address
settings.net.importAddressFileDialog=Select the backup file
settings.net.importAddress=Please be aware that you will loose your reputation when you restore a previous onion address (but restore your reputation connected to the restored onion address). Furthermore, you need to restart the application to set your new onion address active.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As mentioned with renew address, perhaps we should emphasize the significance of this action as well.

Copy link
Contributor

@ripcurlx ripcurlx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NACK - Could you please address #3044 (review)? Thanks!

@ripcurlx
Copy link
Contributor

@freimair I activated yesterday codacy's PR Quality Review for the Bisq repository. It found for your PR a couple of issues which you can view in the Details link next to the PR check. Please review and push fixes for this issues to trigger a re-review by codacy. Thanks!

@stale
Copy link

stale bot commented Feb 16, 2020

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the was:dropped label Feb 16, 2020
@stale
Copy link

stale bot commented Feb 23, 2020

This issue has been automatically closed because of inactivity. Feel free to reopen it if you think it is still relevant.

@stale stale bot closed this Feb 23, 2020
@cbeams cbeams added this to In progress in Migrate to Tor v3 onion service protocol via automation Feb 28, 2020
@freimair
Copy link
Member Author

freimair commented Feb 28, 2020

this PR is postponed. it might be reactivated later. see bisq-network/projects#23

@stale
Copy link

stale bot commented Oct 11, 2020

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the was:dropped label Oct 11, 2020
@stale
Copy link

stale bot commented Oct 18, 2020

This issue has been automatically closed because of inactivity. Feel free to reopen it if you think it is still relevant.

@stale stale bot closed this Oct 18, 2020
Migrate to Tor v3 onion service protocol automation moved this from In progress to Done Oct 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
7 participants