-
Notifications
You must be signed in to change notification settings - Fork 61
install.sh
script which makes the installation processes easier
#364
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 8000 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ConceptACK
Some preliminary comments.
5dd1b66
to
9091551
Compare
Trying this on If I already have dialog it doesn't happen |
daccc97
to
ab69224
Compare
@lucad70 suggested, in person, to add on initial screen:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've tested all options and with/without some requirements installed. It seems to work fine.
Leaving some comments, mostly related to the docs.
Some of those options seems "Advanced". Is it hard to make an "Advanced Configuration" sub-menu? This should cause less confusion for newbies.
bea7463
to
fc3ca7b
Compare
fc3ca7b
to
fa70662
Compare
Added an advanced menu and simplified the main menu. Should i squash to one commit or keep 2 commits? |
If I go to some option like Wallet -> Add xpub and then select cancel, it shows me an error, but then just starts the installation process without letting me configure anything else |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One extra round of review (hopefully one the last). Mostly about the setup, the interactive windows looks good.
florestaUserPath="/usr/lib/sysusers.d/florestad.conf" | ||
florestaService="/usr/lib/systemd/system/florestad.service" | ||
distribution=$(lsb_release -sc) | ||
architecture=$(dpkg --print-architecture) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thinking about a future compatibility with non-dpkg distros, maybe using uname -m
instead?
contrib/install.sh
Outdated
# Function to be printed on console when user need some | ||
# assistance on usage, cli options, etc. | ||
show_usage() { | ||
echo "Install or uninstall Florestad and floresta_cli in your system." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the binary name shouldn't be capitalized.
contrib/install.sh
Outdated
echo " -x, --xpub <XPUB> Define an xpub to be loaded onto config.toml." | ||
echo " -d, --desc <DESC> Define a descriptor to be loaded onto config.toml." | ||
echo " -a, --address <ADDR> Define am bitcoin address to be loaded onto config.toml" | ||
echo " -n, --network <NETWORK> Pass --network onto built service with valid networks:" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This option is only relevant for the systemd file, right? I think it's nice to make this clear.
contrib/install.sh
Outdated
-v | --assume-valid) | ||
check_interactive_mode | ||
assume_valid="$2" | ||
shift 2 # Corrected from shift to shift 2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment probably shouldn't be here
# func: download_floresta | ||
# | ||
# Download floresta from releases and check integrity | ||
# TODO: add signature verification when possible |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just as an FYI: Until 0.7.0 I did not sign the source code. This file is created by github and I didn't really care for it.
From 0.8.0 onward I will sign it as well
contrib/install.sh
Outdated
|
||
sha256res=$(sha256sum $tarDest | awk -F" " '{ print $1 }') | ||
sha256exp="733b1e2bcecfdf5ab552b81db428b125e6f8154cccfda69b5e746da7a4a0a322" | ||
if [ ! "$sha256res" == "$sha256exp" ]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something that could be done in a follow-up: even on error, we should call the clean-up methods. Even better would be to remove what was already copied over, so we don't leave garbage back from an unsuccessful install.
fi | ||
|
||
if [ -f "$florestaUserPath" ]; then | ||
echo "🧹 Removing sysusers config: $florestaUserPath" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You have to call systemd-users after this, no?
fa70662
to
91a0ede
Compare
fixed |
On a fresh ubuntu install I've ran on the same thing using 91a0ede. If I go into wallet > add xpub > cancel it shows invalid xpub, then invalid config and starts installing without asking me anything. |
91a0ede
to
a60fbfe
Compare
Reproduced and verified that the same behavior applies to the steps of adding descriptors and addresses. Fixed. I believe i should rebase it too, or no need? |
I don't think it's needed, it's up to you When I select review and "yes", I'm being thrown back to the wallet configuration |
a60fbfe
to
bc90121
Compare
Fixed (i believe), but now introduced another issue 😓. Can't go out of script when typing many ESCs. |
…easier: * only for debian for now; * user have option to run interactively or wit CLI arguments; * it installs apt-get/rust dependencies, build florestad/floresta_cli and make a proper configuration of systemd service in a semi-customizable way. User can select: * the type of network (bitcoin, sigtest, testnet, regtest); * wallet; * advanced setup * review box. * xpub, ypub, zpub or tpub; * descriptor; * specific address. * a node to connect to (ip:port); * proxy (socks5 only); * a zeromq server to listen to (ip:port); * enable cfilters and filters-start-height; * assume-valid (with a blockheight to choose) and assume-utreexo; * ssl (check if openssl exists, install it if necessary and generate PKCS#8 key and certificate paths and electrum ip/port); .
fixed |
bc90121
to
d139cb9
Compare
interactive_add_xpub() { | ||
local xpub_regex="^(xpub|ypub|zpub|tpub)[A-Za-z0-9]{107}$" # (X/Y/Z/T)PUBS are 111 chars | ||
|
||
while true; do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I select Cancel
, it shows "Invalid Descriptor" and open the xpub input again
What is this PR for?
Fix #362
What is the purpose of this pull request?
Which aspect of floresta its being addresed?
Checklists
just lint
;cargo test
;Description
Added and
install.sh
script which makes the installation processeseasier (only for debian-like systems for now).
It installs apt-get dependencies, install rustup, build
florestad/floresta_cli and configure a proper systemd service in a
semi-customizable way.
It was also necessary to add some configurations to florestad.service so
that the service could run properly.
Notes to the reviewers
It was inspired by @Davidson-Souza that already made scripts for Archlinux and with some DMs, a desire about make possible a procedure like
wget https://vinteum.org/floresta/install.sh | bash
.