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

Improve Verification #161

Merged
merged 71 commits into from
May 26, 2024
Merged
Show file tree
Hide file tree
Changes from 70 commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
daffae6
Merge pull request #160 from BenWestgate/master
BenWestgate May 21, 2024
2552221
add 5 trusted-keys to the repository
BenWestgate May 21, 2024
5386c3c
use verify.py and trusted-keys crosschecked against guix.sigs
BenWestgate May 21, 2024
5be3159
Merge branch 'master' into 44-trust-individuals
BenWestgate May 21, 2024
cf4e4d7
close unclosed if statement
BenWestgate May 21, 2024
e090ea7
quote VER variables to appease shellcheck
BenWestgate May 21, 2024
d25a90b
fix wrong variables in new fg commands
BenWestgate May 21, 2024
0af91ee
fix url to verification tool.
BenWestgate May 21, 2024
e1bfa6b
Add TODO comments about what to do with verify.py after PR merges
BenWestgate May 21, 2024
0fba49f
fix wrong cut command to set $OLD_VER & $NEW_VER in install-core
BenWestgate May 21, 2024
77414bf
fix link_stat no such file in rsync bitcoin.conf command
BenWestgate May 21, 2024
40aae56
Fix $HOME directory not resetting properly. Change short-lived notifi…
BenWestgate May 21, 2024
eceff81
Make verify.py part of a loop to do allow extra verification.
BenWestgate May 21, 2024
39551a6
fix sed not editing Bitcoin-Qt.conf for the Welcome prompt to reset t…
BenWestgate May 21, 2024
fda2431
gui: fix weak passphrase detected dialog formatting.
BenWestgate May 21, 2024
1b5b4e6
removed unneeded link_dotfiles command, quoted variables
BenWestgate May 23, 2024
45cdf12
quote variable
BenWestgate May 23, 2024
6e7292c
simplify check_sigs, no error message if bitcoin-core- missing, comme…
BenWestgate May 23, 2024
f13a667
check for /state/installed and refresh-keys, delay waiting on downloa…
BenWestgate May 24, 2024
1a6a54f
re-launch persistent setup if dotfiles turn off, double quote some va…
BenWestgate May 24, 2024
f70a1cf
add placeholders to keep these directories in vc
BenWestgate May 24, 2024
14b2864
make sure good_sig gets assigned before use
BenWestgate May 24, 2024
aa6712c
source ~/.profile to fix bails-wallet not running
BenWestgate May 24, 2024
3ec951d
tar must happen before moving download
BenWestgate May 24, 2024
f312067
delete everything in download folder before retrying.
BenWestgate May 24, 2024
05012e3
opt out of retrying download to 'X'
BenWestgate May 24, 2024
4f0ef0e
add opt out by pressing 'X' to the other two failure messages.
BenWestgate May 24, 2024
83b9b6e
add file back to verify.py to avoid MISSING printing
BenWestgate May 24, 2024
5397d05
attempt to detect existing installation better
BenWestgate May 24, 2024
22ebe64
remove background process for gpg_refresh, just wait in main process …
BenWestgate May 24, 2024
6b4d4e8
signature download must complete before trying to get version & chang…
BenWestgate May 24, 2024
1ee37b6
simplify download commands
BenWestgate May 24, 2024
c8b4f75
just use good_sig to check sigs. use verify.py to check at the end. I…
BenWestgate May 24, 2024
3b8e56c
fix unary operator expected
BenWestgate May 24, 2024
14188e9
fix condition to launch bails-wallet, notification looked better
BenWestgate May 24, 2024
9aecc7b
stop printing secrets to terminal
BenWestgate May 24, 2024
b7e8bc8
export stop-btc as a new command
BenWestgate May 24, 2024
e76af21
comment out unreachable lines
BenWestgate May 24, 2024
5b44b49
remove datadir entry from BitcoinQt.conf
BenWestgate May 24, 2024
4c963ed
fix dialog width, don't start qt automatically, remove funded check
BenWestgate May 24, 2024
4499c59
fix prune calc to not warn on welcome
BenWestgate May 24, 2024
18bd4af
Update install-core
BenWestgate May 24, 2024
2df354d
stop bitcoin-wallet from starting and stopping core, use bitcoin-qt
BenWestgate May 24, 2024
7cdf031
fix json format
BenWestgate May 24, 2024
04b1433
fix getting stuck in loop if the user doesn't open bitcoin core.
BenWestgate May 24, 2024
53d6259
delay link_dotfiles, tmpfs install from b, simplify wget, don't copy …
BenWestgate May 24, 2024
d346d8f
don't ask for passphrase when we're already in spaced-repetition
BenWestgate May 24, 2024
d664a39
Remove all dbus-send commands that no longer work
BenWestgate May 25, 2024
82db508
correct datadir path typo for wallet search
BenWestgate May 25, 2024
391c87e
install BAILS to dotfiles from b script, rm unused variable, relocate…
BenWestgate May 25, 2024
11c904f
fix erroneous '"' in script
BenWestgate May 25, 2024
1eb97f8
add the tmpfs log to bitcoin.conf
BenWestgate May 25, 2024
bb8bfc4
mkdir -p needed now that rsync doesn't copy to DATA_DIR anymore
BenWestgate May 25, 2024
a356040
Clean up several dialogs from bails-wallet for Tails 6.0
BenWestgate May 25, 2024
dc8e92e
add placeholded README.md for ~.bitcoin
BenWestgate May 25, 2024
05a927c
use correct tpscli command "is_unlocked"
BenWestgate May 25, 2024
3c9bd45
double quote variables
BenWestgate May 25, 2024
672795a
correct is_unlocked to is-unlocked
BenWestgate May 25, 2024
beec719
rewrite builder-keys with only those who signed the most recent relea…
BenWestgate May 25, 2024
b38cc0a
attempt to prevent logout after restoring a wallet.
BenWestgate May 25, 2024
18f9303
removed notifications from chainstate-preload, only prompt ab lock pa…
BenWestgate May 25, 2024
2680226
ensure persistent features are activated, each start
BenWestgate May 25, 2024
dd6b095
bump version, remove settings coming soon, they're complete
BenWestgate May 26, 2024
f0a1f28
fix settings dialog formatting
BenWestgate May 26, 2024
ae7ddd7
fix setting prune and dbcache at launch
BenWestgate May 26, 2024
9aee73f
warn if prune is off and space gets low, reactivate dbcache if unsync…
BenWestgate May 26, 2024
7a8b8ac
don't immediately display bails has installed/updated, auto exit bail…
BenWestgate May 26, 2024
4f9fd5a
do not continue execution if dotfiles was off
BenWestgate May 26, 2024
5d10774
move update all keys title to gpg --refresh-keys
BenWestgate May 26, 2024
222725f
correct comment about symlinks
BenWestgate May 26, 2024
ba5c894
Merge branch 'master' into 44-trust-individuals
BenWestgate May 26, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 40 additions & 3 deletions b
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,18 @@
# THE SOFTWARE.

###############################################################################
# Sets environment variable and launches install-core
# Sets environment variable and launches install-core and/or installs Bails
###############################################################################

export VERSION='v0.6.0-alpha'
export ICON="--window-icon=$HOME/.local/share/icons/bails128.png"
DOTFILES='/live/persistence/TailsData_unlocked/dotfiles'

if [ "$1" == "--help" ]; then
echo "Bails Version: $VERSION"
exit 0
fi

# Check for root.
if [[ $(id -u) = "0" ]]; then
echo "
Expand All @@ -32,6 +41,34 @@ YOU SHOULD NOT RUN THIS SCRIPT AS ROOT!
read -rp "PRESS ENTER TO EXIT SCRIPT, AND RUN AGAIN AS $USER. "
exit 0
fi


BAILS_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
export BAILS_DIR
$BAILS_DIR/bails/.local/bin/install-core
# Installs Bails to tmpfs
rsync --recursive "$BAILS_DIR/bails/" "$HOME"
# shellcheck disable=SC1091
. "$HOME"/.profile
if [ -z "$1" ]; then # Don't update/install core if ran with a parameter
install-core
else
persistent-setup
fi &

until /usr/local/lib/tpscli is-unlocked && \
/usr/local/lib/tpscli is-active Dotfiles && \
[ -d "$DOTFILES" ] && [ -w "$DOTFILES" ]; do
sleep 1
done
# Install Bails to Persistent Storage
rsync -r --remove-source-files "$BAILS_DIR"/bails/ $DOTFILES
rsync --remove-source-files --recursive "$BAILS_DIR"/ $DOTFILES/.local/share/bails
rm -rf "$BAILS_DIR"

wait
if [ -z "$1" ]; then
zenity --info --title="Bails install successful" --text="Bails $VERSION has been installed." "$ICON" --icon-name=bails128
else
zenity --info --title="Bails update successful" --text="Bails has been updated to $VERSION." "$ICON" --icon-name=bails128
fi


3 changes: 3 additions & 0 deletions bails/.bitcoin/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
This directory is not the datadir, it will be copied to dotfiles which symlinks it into $HOME. It will contain the bitcoin.conf with the datadir= key set. This prevents accidentally ever using ~/.bitcoin, the default datadir that won't persist, even when launched from the command line as long as dotfiles are on.

This file will be clobbered by the README.md from bitcoin-core later.
5 changes: 5 additions & 0 deletions bails/.cache/fontconfig/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Ignore everything in this directory
# This will create a destination in dotfiles later to preserve .cache/fontconfig from Bitcoin Core
*
# Except this file
!.gitignore
1 change: 0 additions & 1 deletion bails/.config/Bitcoin/Bitcoin-Qt.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
[General]
mask_values=true
strDataDir=/live/persistence/TailsData_unlocked/Persistent/.bitcoin
strThirdPartyTxUrls=explorerzydxu5ecjrkwceayqybizmpjjznk5izmitf2modhcusuqlid.onion/tx/%s
8 changes: 4 additions & 4 deletions bails/.local/bin/bails-backup
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# that they should be tested at least once a year, ideally twice or
# quarterly. The file is removed after backup is complete.



gnome-terminal --wait --title="Log of Persistent Storage Backup" --hide-menubar \
-- tails-installer --clone
stop-btc
#TODO move file described above into the autostart
tails-installer --backup
#TODO remove that file
9 changes: 7 additions & 2 deletions bails/.local/bin/bails-cloner
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,10 @@
# originals are restored and the temporary password is displayed for
# the clone's owner to photograph or write down. Files then restored.

gnome-terminal --wait --title="Log of Persistent Storage Clone" --hide-menubar \
-- tails-installer --clone
zenity --info --title='Coming soon'
exit 1
#stop-btc
#TODO move file described above into the autostart
#TODO display temporary passphrase
#tails-installer --backup
#TODO remove that file
28 changes: 16 additions & 12 deletions bails/.local/bin/bails-menu
Original file line number Diff line number Diff line change
Expand Up @@ -28,29 +28,33 @@

# Set environment variables
export WAYLAND_DISPLAY=""
export LOCAL_DIR="/live/persistence/TailsData_unlocked/dotfiles/.local/"
export DOTFILES="/live/persistence/TailsData_unlocked/dotfiles"
export LOCAL_DIR="$DOTFILES/.local/"
export DATA_DIR="/live/persistence/TailsData_unlocked/Persistent/.bitcoin"
export BAILS_DIR="$LOCAL_DIR"

# Fetch installed version
# shellcheck disable=SC1091
. $LOCAL_DIR/share/bails/b --help

onlynet_onion() {
zenity --question --title='Network Privacy' --width=420 --text='Bails offers different settings for connecting to the Bitcoin network. By default, Bitcoin Core connects to both clearnet and Tor (onion) peers, providing a balance between usability and privacy.
zenity --question --title='Network Privacy' --text='Bails offers two settings for connecting to the Bitcoin network. By default, Bitcoin Core connects to both clearnet and Tor (onion) peers, providing a balance between usability and privacy.

Would you like to enhance privacy by connecting exclusively to Tor (onion) peers with reduced clearnet exposure? This may limit your network diversity and can be less stable if you have limited Tor peers.' --icon-name=tor-connection --default-cancel
Would you like to enhance privacy by connecting exclusively to Tor (onion) peers with reduced clearnet exposure? This may limit your network diversity, speed and can be less stable if you have limited Tor peers.' --icon-name=tor-connection --default-cancel

zenity_exit_status=$?

if [ $zenity_exit_status = 0 ]; then
# User chose to enable -onlynet=onion
sed --in-place 's/#onlynet=<net>/onlynet=onion/' $DATA_DIR/bitcoin.conf
sed --in-place 's/#onlynet=<net>/onlynet=onion/' $DOTFILES/.bitcoin/bitcoin.conf
zenity --info --title='Network settings updated' --text='You have chosen to connect exclusively to Tor (onion) peers.

Your network settings have been updated.' --width=420 --icon-name=tor-connected-symbolic
Your network settings have been updated.' --icon-name=tor-connected-symbolic

else
# User chose default network settings
sed --in-place 's/onlynet=onion/#onlynet=<net>/' $DATA_DIR/bitcoin.conf
sed --in-place 's/onlynet=onion/#onlynet=<net>/' $DOTFILES/.bitcoin/bitcoin.conf
zenity --info --title='Default network settings' --text='You have chosen to keep the default network settings.
Bitcoin Core will continue to connect to both clearnet and Tor (onion) peers.' --width=420 --icon-name=tor-disconnected-symbolic
Bitcoin Core will continue to connect to both clearnet and Tor (onion) peers.' --icon-name=tor-disconnected-symbolic

fi
}
Expand All @@ -72,7 +76,7 @@ case "$response" in
"Clone") bails-clone ;;
"Backup") bails-backup ;;
"Settings") setting=$(zenity --window-icon="$LOCAL_DIR/share/icons/bails128.png" --question \
--icon-name=org.gnome.Settings --title=Settings --text="Coming soon\n\nConfigure Bitcoin Core on Tails" \
--icon-name=org.gnome.Settings --title=Settings --text="Configure Bitcoin Core on Tails" \
--extra-button="Update Bitcoin Core" --extra-button="Update Bails" --extra-button="Network Privacy" \
--switch --width=300) ;;
"Help") help=$(zenity --window-icon="$LOCAL/share/icons/bails128.png" --question \
Expand All @@ -83,17 +87,17 @@ case "$response" in
esac

case "$help" in
"Donate") xdg-open bitcoin: ;; # FIXME change address
"Donate") xdg-open bitcoin: ;; # FIXME: change address
"Report a Bug") tor-browser https://github.com/BenWestgate/Bails/issues ;;
"About") zenity --info --window-icon="$LOCAL_DIR/share/icons/bails128.png" \
--title="About Bails" --icon-name=bails128 --text="Bails version v0.5.0\n\nCopyright (C) 2023 Ben Westgate\n\nPlease contribute if you find Bails useful. Visit <a href='https://twitter.com/BenWestgate_'>https://twitter.com/BenWestgate_</a> for further information about the software.\nThe source code is available from <a href='https://github.com/BenWestgate/Bails'>https://github.com/BenWestgate/Bails</a>.\n\nThis is experimental software.\nDistributed under the MIT software license, see the accompanying file COPYING or <a href='https://opensource.org/licenses/MIT'>https://opensource.org/licenses/MIT</a>" --width=650 ;;
--title="About Bails" --icon-name=bails128 --text="Bails version $VERSION\n\nCopyright © 2024 Ben Westgate\n\nPlease contribute if you find Bails useful. Visit <a href='https://twitter.com/BenWestgate_'>https://twitter.com/BenWestgate_</a> for further information about the software.\nThe source code is available from <a href='https://github.com/BenWestgate/Bails'>https://github.com/BenWestgate/Bails</a>.\n\nThis is experimental software.\nDistributed under the MIT software license, see the accompanying file COPYING or <a href='https://opensource.org/licenses/MIT'>https://opensource.org/licenses/MIT</a>" --width=650 ;;
"Online Help") xdg-open https://bitcoin-core-on-tails.slack.com/ && \
xdg-open https://t.me/bails_support ;;
esac

case "$setting" in
"Update Bitcoin Core") /usr/bin/gnome-terminal --title="Updating Bitcoin Core..." --hide-menubar \
-- "$LOCAL_DIR/bin/install-core" ;;
-- "install-core" ;;
"Update Bails") /usr/bin/gnome-terminal --title="Updating Bails..." --hide-menubar \
-- rm -rf bails && git clone https://github.com/benwestgate/bails --depth=1 && bails/b ;;
"Network Privacy") onlynet_onion ;;
Expand Down
Loading