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

Run Wasabi in "Portable mode" from USB #763

Closed
wasaw936 opened this issue Oct 29, 2018 · 19 comments
Closed

Run Wasabi in "Portable mode" from USB #763

wasaw936 opened this issue Oct 29, 2018 · 19 comments

Comments

@wasaw936
Copy link

From the .tar.gz simply running ./wassabee on Ubuntu Linux which opened up the wallet perfectly. But it would be great for this to work in portable mode, like to run from a USB.

Current settings in ~/.walletwasabi
Settings option can be implemented to "Change to Portable Mode" and redirects settings folder to USB folder that the user chooses.

Would this really cause permission issues? what kinds of permission issues?

By the way, great work with Wasabi Wallet, keep it up!

@nopara73
Copy link
Contributor

Concept ACK, the implementor must be extremely careful, for the reasons pointed out in our Reddit conversation.

@lontivero
Copy link
Collaborator

For linux the user can implement this by creating a symolic link ~/.walletwasabi-->/mnt/your-portable-device

@nopara73
Copy link
Contributor

What would happen to the wallet file by that? Wouldn't that make it inaccessible or even worse, deleted?

@lontivero
Copy link
Collaborator

lontivero commented Oct 30, 2018

Well, I assume Wasabi users are smart enough to don't delete their wallets. Anyway, my point is we don't need to do anything special to have this "portable mode" thing and users can do it by themselves.

This is what I did in my env:

$ sudo mkdir -p /media/usb
$ sudo mount -t tmpfs -o size=512M tmpfs /media/usb/     <--- this is a RAM disk but it could also be a usb stick
$ ln -s /media/usb ~/.walletwasabi
$ ./wassabee

And that's all what a user needs for having a portable wallets using as many usbs/sd cards as he/she wants.
Of course, please make a backup first.

@wasaw936
Copy link
Author

@lontivero true, which means that is the solution, so no need to implement any setting?

@nopara73
Copy link
Contributor

@wasaw936 It's still a good idea, so I'd leave this issue open.

@lontivero
Copy link
Collaborator

@lontivero true, which means that is the solution, so no need to implement any setting?

It depends. Linux users that feel comfortable with CLI (few people) don't need it by sure. The rest could find useful to have that feature built-in Wasabi Wallet.

@wasaw936
Copy link
Author

I realized that its better to go ahead with this implementation rather than having a link, because say for example you dismount your USB/media, the link is left in the $HOME folder (broken) but shown to link to your USB - this is not good if you don't want to keep any traces on the PC, that's the whole point of "Portable Mode"

As for this method being prone to lost or deleted wallets, user should backup wallets and files no matter the media device it sits on. So that's the user's responsibility at the end of the day.

My question is @nopara73 will there be any permission issues (as you stated in reddit post) in moving the files over to a media device of choice? (i wouldn't think so since settings are usually in the $HOME folder)

@nopara73
Copy link
Contributor

My question is @nopara73 will there be any permission issues...

I don't know how that works, I've just been surprised by Linux permissions too many times to assume everything'll work as expected.

@JuniperTonic
Copy link
Contributor

I have mocked up a potential workflow of backing up and restoring wallets to help further this discussion. This is for the Windows version

Storing Wasabi Wallet Externally
Files that need to be packaged:
Root is WalletWasabi/Client

Transactions/Main/WalletNameTransactions.json
WalletBackups/WalletName.json
Wallets/WalletName.json

Copy these files to an archive w/ directory structure
(Optionally) Lock the archive with a password

Restoring a wallet:
Unload an archive w/ directory structure
Copy the unpacked files to the WalletWasabi/Client/ directory
Be careful not to overwrite existing files (potentially newer files that weren't backed up yet)
Launch Wasabi Wallet, then the wallet should show up in the Load Wallet tab (Wallet Manager)
Do Things inside wasabi...
After Closing, repackage the wallet files and move to a (new/updated) archive in a separate location
Ask the user if they want to delete the local files

Things that could be added:
Ability to specify the wallets folder inside wasabiwallet
Ability to decrypt/verify a wallet container to streamline this process
Ability to specify install location from the installshield. Potentially a setting for "portable" mode
Remind users how easy it is to lose your wallet if some I/O error occurs, or if you lose the "portable" drive. Have backup keys handy!

Things that need research:
What Windows system files are changed or stored locally that may give away the fact that a portable version is used
How will Wasabi handle being offline for some period and needs to get back to the current block height (Think this is already solved)
Dealing with updates in the future

Please leave any comments on this idea, specifically if I correctly found all of the files needed to restore a wallet from a fresh install. Also where can I find the setting for the working directory? (Currently AppData/Roaming/WalletWasabi/)

Thanks!

@JuniperTonic
Copy link
Contributor

JuniperTonic commented Nov 1, 2018

My previous post was more for someone who wants to have wasabi installed, but wants to manually move and restore their wallet from another location. I have tried moving the wasabi install (Program Files...) to a flash drive and it seems to work. Though I cannot find the config setting for the wallet and config files directory. I think all that would be needed to make it portable would be the ability to change your data directory.
It looks like the tor directory and wasabi/client folders are created on the new machine

@nopara73
Copy link
Contributor

nopara73 commented Nov 2, 2018

Thanks @JuniperTonic this will be very helpful. Another issue I have in mind that could be problematic.

Users should specify the data folder in the Config.json file (ultimately through the Tools/Settings tab. However the location of the Config.json file is inside the data folder.
Traditionally in all of my software I saved a config file next to the executable, but that turned out to be problematic due to permission issues in every platform (not only one.)

Maybe the only clean solution would be to maintain and distribute portable versions and have the data folder next to the executable. That's just one line of code. I'm not sure I'd like to maintain such a thing, testing these would add 2-3 hours to the release process.

Or maybe we could maintain a portable branch, that only has that one commit in plus, this could even be maintained by a bot, always pulling the latest master. Hmm... maybe this would be the least invasive/automatized way to go. I think this is the only line that must be changed:

https://github.com/zkSNACKs/WalletWasabi/blob/088fe7a419b3f8c4c989d7d2c3956feb908c10f9/WalletWasabi.Gui/Global.cs#L38

In Windows there are no permission issues, as long as the user doesn't put it into a system directory, which I cannot imagine how would happen. In Linux/OSX we could add an instruction "make sure you make the datadir writeable by the user" or something like that and we're done.

@nopara73
Copy link
Contributor

nopara73 commented Mar 8, 2019

Just a quick summary on the status I recently wrote about this issue for anyone looking at it:

The main problem is that we could specify the data folder in the config file, but the config file is in the data folder and we cannot put the config file next to the exe, because that is usually gets to a place where wasabi doesn't have privileges to write or read, so in order to do this we would have to start providing a portable release, which of course complicates the onrolling process in the expense of 99.9% of the users and it'd make releasing and testing the software to take twice as long, which is already a long process due to me having to test everything in 10+ virtual machines, so I'd say unless we find a less administrative way to do this or we'll end up being a more bureaucratic company we won't go down this road.

@nopara73
Copy link
Contributor

nopara73 commented Apr 19, 2019

I don't see why we couldn't just do ./wassabee --wallet-dir "/someDir".

https://old.reddit.com/r/WasabiWallet/comments/bepivw/custom_wallet_dir_location/

@MaschineBrennt
Copy link

Any news on this?

I really need a portable version on Windows.

I use many portable programs (natively portable' ones, those made with Turbo Studio, those made with WMware Thinapp, etc.) and put them in directories with write permissions (portable: application files and user data are stored together).

Of course natively portable' ones are better (no extra process-launcher in ram), e.g.: Nirsoft's programs and many others.

@nopara73: the --datadir parameter (mentioned by lontivero) It would already be a good step.

Thanks

@nopara73
Copy link
Contributor

PR #1368 was reverted almost immediately because it ruined stuff.

Also I NACK this feature for the reasons described here: #1415 (comment)

Another new issue came to my mind with this: it'd ruin our backward compatibility migrations.
We do expect to know the data folder in backward compatibility migrations. These migrations happen in the library project, however we don't know about our data folder in the library project, because it comes from the Gui project. Thus we'd need refactoring before this PR.

@MaxHillebrand
Copy link
Collaborator

Actually, we do have a step by step instruction + script on how to use Wasabi on Tails, which I think solves your issue, right?
https://docs.wasabiwallet.io/using-wasabi/WasabiSetupTails.html

@MaschineBrennt
Copy link

Unfortunately no, I need it for windows

Best regards.

@molnard
Copy link
Collaborator

molnard commented Oct 30, 2019

With dotnet core 3.0 #2363
There will be a partial solution: Single File Wasabi #1154
However, the data directory will remain at the current place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants