BenWestgate / Bails

Bails is a Bitcoin solution protecting against surveillance, censorship, and confiscation. It installs Bitcoin Core on the encrypted Persistent Storage of Tails, creates and recovers Bitcoin Core wallets from Codex32 (BIP93) seed backups, and creates backup Bails USB sticks and shareable blank Bails USB sticks. Learn more in README.md.
MIT License
38 stars 7 forks source link

Install Sparrow persistently #175

Closed BenWestgate closed 3 weeks ago

BenWestgate commented 3 weeks ago

bitcoin-qt-wrapper became wrapped and works on any bin now install-sparrow script was added bails-wallet was also wrapped for no particular reason

This is draft and only creates the command line option to run install-sparrow and I haven't decided how to present it graphically yet.

The new install script is fully tested and works great the rest of the changes are tested working.

Closes #174

BigBossRabbit commented 3 weeks ago

Hope this is the correct spot for this:

Just for your info, the Bitcoin Core App under "Applications" shows up both under Internet alongside Bails but also under Office.image image

BenWestgate commented 3 weeks ago

Your desired solution was to remove it from Office and Favorites and leave it under Internet: image

https://github.com/BenWestgate/Bails/pull/175/commits/06ce960f2dd46c4fb525d0edc25ecd95ce0a9eab resolves these issues.

@BigBossRabbit: Have you tested the install-sparrow script?

BigBossRabbit commented 3 weeks ago

I've tried the script but believe I'm still entering it wrong because it keeps giving me a command not found error so I'm definitely doing it wrong.

Would the command be ~./profile install-sparrow?

BenWestgate commented 3 weeks ago

Would the command be ~./profile install-sparrow?

Nope! Mind the locations of the dots and spaces, and you need to terminate the first command with ; . ~/.profile; install-sparrow if that's confusing you can also do source ~/.profile hit enter then install-sparrow hit enter

BigBossRabbit commented 3 weeks ago

After trying both methods it now gives me a Permission denied error image

BenWestgate commented 3 weeks ago

bash install-sparrow

BenWestgate commented 3 weeks ago

@BigBossRabbit I forgot to set the execute permissions on the new files https://github.com/BenWestgate/Bails/pull/175/commits/bf292d44dcd688b72dbb880e74eb4093a18bb2eb fixes, but running bash install-sparrow should do the same thing.

BigBossRabbit commented 3 weeks ago

That's working now image

BigBossRabbit commented 3 weeks ago

@BigBossRabbit I forgot to set the execute permissions on the new files

https://github.com/BenWestgate/Bails/pull/175/commits/bf292d44dcd688b72dbb880e74eb4093a18bb2eb

fixes, but running bash install-sparrow should do the same thing.

That bash command works like a charm. It's busy chugging away now

BigBossRabbit commented 3 weeks ago

Everything was going fine, it got to downloading the manifest & checking the key fingerprint of Craig Raw but then it failed. Not sure if this is expected behaviour so thought to share while I restart Tails & see if everything shows up properly. image

BigBossRabbit commented 3 weeks ago

In case you can't make out the full text on the picture here it is:

FINISHED --2024-06-10 17:00:59--
Total wall clock time: 9m 41s
Downloaded: 5 files, 99M in 9m 14s (183 KB/s)
gpg: assuming signed data in './sparrow-1.9.1-manifest.txt' gpg: Signature made Mon 13 May 2024 02:10:11 PM UTC
gpg:
using RSA key D4D0D3202FC06849A257B38DE94618334C674B40
gpg: Good signature from "Craig Raw ‹craig@sparrowwallet.com>" [unknown] gpg: WARNING: This key is not certified with a trusted signature! gpg:
There is no indication that the signature belongs to the owner.
Primary key fingerprint: D4D D320 2FCO 6849 A257
B38D E946 1833 4067 4B40
sparrow_1.9.1-1_amd64. deb: 0K
/home/amnesia/.local/bin/install-sparrow: line 62: /home/amnesia/.local/bin/link-dotfiles: Permission denied
(zenity: 19891): GLib-GObject-CRITICAL **: 17:02:23.193: g_object_unref: assertion 'G_IS_OBJECT (object) ' failed (zenity:19891): Gtk-WARNING **: 17:02:23.230: Could not load a pixbuf from /org/gtk/libgtk/icons/16x16/status/window-close-symbolic.symbolic.png.
This may indicate that pixbuf loaders or
the mime database could not be found.
*大
Gtk: ERROR:../../../gtk/gtkiconhelper. c: 495: ensure_surface_for_gicon: assertion failed (error == NULL): Failed to load /org/gtk/libgtk/icons/16x16/stat us/image-missing.png: Unrecognized image file format (gdk-pixbuf-error-quark, 3)
Bail out! Gtk: ERROR:..I.../../gtk/gtkiconhelper. c: 495: ensure_surface_for_gicon: assertion failed (error == NULL): Failed to load /org/gtk/libgtk/icons/ 16x16/status/image-missing.png: Unrecognized image file format (gdk-pixbuf-error-quark, 3)
/home/amnesia/.local/bin/install-sparrow: line 108: 19891 Aborted ext="Installation was successful." --icon-name=Sparrow $ICON
zenity --info --title="Sparrow Sversion successfully installed." --t
/live/persistence/TailsData_unlocked/dotfiles/.local/bin/wrapped: line 31: /live/persistence/TailsData_unlocked/dotfiles/.local/bin/link-dotfiles: Per
mission denied
amnesia@amnesia: ~$ In: failed to create symbolic link ' /home/amnesia/.bitcoin': File exists In: failed to create symbolic link '/home/amnesia/ sparrow': File exists
No schemas installed
/live/persistence/TailsData_unlocked/dotfiles/ local/bin/wrapped: line 85: Sparrow: command not found
BigBossRabbit commented 3 weeks ago

The script works!

I'm not sure why those errors present themselves as after a restart Sparrow is present & works perfectly along with the instance of Bitcoin Core. image image

BenWestgate commented 3 weeks ago

I'm not sure why those errors present themselves as after a restart Sparrow is present & works perfectly along with the instance of Bitcoin Core.

It not being seen until after a restart was because the link-dotfiles command did not have execute permissions. Same reason install-sparrow didn't work.

You might delete the ~/Persistent/.sparrow folder and ~/.sparrow folder and Update your Bails to the latest git clone -b 174-install-sparrow https://github.com/benwestgate/bails; */b and try the install-sparrow command again to see if all the errors are fixed.

BigBossRabbit commented 3 weeks ago

This time round I still got some errors but Sparrow installed & even got added to the Applications drop-down under Favorites & Internet. Here's what I get just before Sparrow pops open:


gpg:
assuming signed data in ' ./sparrow-1.9.1-manifest.txt'
gpg: Signature made Mon 13 May 2024 02:10:11 PM UTC
gpg:
using RSA key D4D0D3202FC06849A257B38DE94618334C674B40
gpg: Good signature from "Craig Raw ‹craig@sparrowwallet.com>" [unknown] gpg: WARNING: This key is not certified with a trusted signature! gpg :
There is no indication that the signature belongs to the owner.
Primary key fingerprint: D4D0 D320 2FCO 6849 A257 B38D E946 1833 4C67 4B40 sparrow_1.9.1-1_amd64. deb: 0K
mv: '/home/amnesia/.local/share/applications/defaults.list and '/live/persistence/TailsData_unlocked/dotfiles/.local/share/applications/defaults. list
are the same file
/home/amnesia/.local/bin/install-sparrow: line 63: /home/amnesia/.local/bin/link-dotfiles: Permission denied
(zenity:25003): GLib-GObject-CRITICAL **: 17:49:37.430: g_object_unref: assertion 'G_IS_OBJECT (object) ' failed
(zenity: 25003): Gtk-WARNING **: 17:49:37.465: Could not load a pixbuf from /org/gtk/libgtk/icons/16x16/status/window-close-symbolic.symbolic.png.
This may indicate that pixbuf loaders or the mime database could not be found.
*ォ
Gtk: ERROR:../../../gtk/gtkiconhelper.c:495:ensure_surface_for_gicon: assertion failed (error == NULL): Failed to load /org/gtk/libgtk/icons/16x16/stat us/image-missing.png: Unrecognized image file format (gdk-pixbuf-error-quark, 3)
Bail out! Gtk: ERROR:../../../gtk/gtkiconhelper. c: 495: ensure_surface_for_gicon: assertion failed (error == NULL): Failed to load /org/gtk/libgtk/icons/ 16x16/status/image-missing.png: Unrecognized image file format (gak-pixbuf-error-quark, 3)
/home/ amnesia/.local/bin/install-sparrow: line 109: 25003 Aborted
zenity --info --title="Sparrow $version successfully installed." --t
ext="Installation was successful."
--icon-name=Sparrow $ICON
/live/persistence/TailsData_unlocked/dotfiles/.local/bin/wrapped: line 31: /live/persistence/TailsData_unlocked/dotfiles/.local/bin/link-dotfiles: Per
mission denied
amnesia@amnesia: ~$ In: failed to create symbolic link /home/amnesia/ bitcoin': File exists In: failed to create symbolic link /home/amnesial sparrow: File exists
No schemas
installed
(Sparrow: 25121): Gdk-WARNING **: 17:49:43.102: XSetErrorHandler() called with a GDK error trap pushed. Don't do that.

Here are pictures of the success though: image image image

BenWestgate commented 3 weeks ago

/home/amnesia/.local/bin/install-sparrow: line 63: /home/amnesia/.local/bin/link-dotfiles: Permission denied

This is good info to know. The rsync command that installs Bails didn't replace link-dotfiles because it was identical in content so it, but it needed to update the permissions (to fix the original bug) and didn't. I'll

BigBossRabbit commented 3 weeks ago

/home/amnesia/.local/bin/install-sparrow: line 63: /home/amnesia/.local/bin/link-dotfiles: Permission denied

This is good info to know. The rsync command that installs Bails didn't replace link-dotfiles because it was identical in content so it, but it needed to update the permissions (to fix the original bug) and didn't.

I'll

  • [ ] Update the rsync commands to update the permissions of dest files even if their content is the same.

Glad to have been able to help 🦾 Thanks for going through the trouble to create the script.

BenWestgate commented 3 weeks ago

I think there should be a way to launch the script from the "Bails" menu app. (I may just do that rather than make it something everyone who installs Bails has to see during the install process, since only ~10% of my testers have told me they are using sparrow.) Do you have any expected location or button where you'd think to look for it if you were told "Sparrow is in the Bails menu". Keep in mind we want to add Elements and Join Market in the future. So maybe under an "Additional Software", which can show the other useful software, but if you like that, what page should I add that button to?

BigBossRabbit commented 3 weeks ago

Yes, I think the Bails Menu would be the perfect place & as you're adding more functionalities, as you mentioned, having a separate button would work for sure.

I'm just not sure where exactly would be the best place to let them know to look there. As in, which dialogue box would be best to inform them.

BenWestgate commented 3 weeks ago

Putting "Additional Software" on the landing window is already a little crowded: image

image

So under Settings? image

BigBossRabbit commented 3 weeks ago

Agreed. I was thinking that might happen & you can always put the information that "Sparrow is under the Settings Tab" within the Bails Menu to let them know.

Less clutter & doesn't confuse people with too many buttons.

BenWestgate commented 3 weeks ago

Does this message work for the "Settings" window of bails-menu that now presents Install/Update Sparrow (the verb dynamically changes)

Configure Bitcoin Core on Tails

Only install or update software with a retained good reputation.

Bails can not protect you from security issues due to installing or updating software that has become untrustworthy." 

This message is to Warn users from casually updating or installing software without thinking whether they still trust the project.

For example if Bails, Sparrow or Bitcoin Core became evil in the future, updating/installing them would install the now malicious version which could result in LOSS OF FUNDS."

This is partly one thing Offline signers protect against, they never go back online for "Updates" each of which is a new trust event for a user not reviewing all the source code and able to detect vulnerabilities themselves.

BigBossRabbit commented 3 weeks ago

This Definitely works & is a great way to help them think through future updates for sure.

Great idea to have it say to be careful of all software moving forward from that point onwards.

BenWestgate commented 3 weeks ago

image

Menus created to support this branch.

image

It will say "Install Sparrow" if it is currently not installed.

BigBossRabbit commented 3 weeks ago

Going to test this on my end just to make sure. I'll do a completely new install from the beginning.

BenWestgate commented 3 weeks ago

Going to test this on my end just to make sure. I'll do a completely new install from the beginning.

You really do not have to keep starting over. Just delete the .sparrow folders (in ~ and ~/Persistent and ~/.local/bin/Sparrow

Here's how to uninstall sparrow:

rm -rf ~/.local/{bin/Sparrow,share/applications/sparrow-Sparrow.desktop}

BenWestgate commented 3 weeks ago

Going to test this on my end just to make sure. I'll do a completely new install from the beginning.

You really do not have to keep starting over. Just delete the .sparrow folders (in ~ and ~/Persistent and ~/.local/bin/Sparrow

Here's how to uninstall sparrow:

rm -rf ~/.local/{bin/Sparrow,share/applications/sparrow-Sparrow.desktop}

This will also save you the very long wait of downloading it again. Test smarter, not harder!

BigBossRabbit commented 3 weeks ago

I was legit just thinking that while starting up Tails again 😅

BenWestgate commented 3 weeks ago

Going to test this on my end just to make sure. I'll do a completely new install from the beginning.

You really do not have to keep starting over. Just delete the .sparrow folders (in ~ and ~/Persistent and ~/.local/bin/Sparrow Here's how to uninstall sparrow: rm -rf ~/.local/{bin/Sparrow,share/applications/sparrow-Sparrow.desktop}

This will also save you the very long wait of downloading it again. Test smarter, not harder!

If you try that command, it will work except to make it say 'Install Sparrow' again, need to also rm -rf /live/persistence/TailsData_unlocked/dotfiles/.local/{bin/,share/applications/sparrow-}Sparrow*

BigBossRabbit commented 3 weeks ago

That one-click Install Sparrow button is truly magical. Neatly just makes it a whole lot easier than the manual installation. lol

BigBossRabbit commented 3 weeks ago

Something in the back of my head is telling me to do a completely new install since the alpha is out.

So will do one in a few hours when back in studio & report back on that as well.

BenWestgate commented 3 weeks ago

Something in the back of my head is telling me to do a completely new install since the alpha is out.

So will do one in a few hours when back in studio & report back on that as well.

the alpha has been out since last summer.

All I did was bump the version number from 0.6.1 to 0.7.0 since this branch added a new feature.

BigBossRabbit commented 3 weeks ago

Something in the back of my head is telling me to do a completely new install since the alpha is out.

So will do one in a few hours when back in studio & report back on that as well.

the alpha has been out since last summer.

All I did was bump the version number from 0.6.1 to 0.7.0 since this branch added a new feature.

Ahhh, understood.