Add a one-liner installer
What should restic do differently? Which functionality do you think we should add?
Add https://rclone.org/install/ like curl https://rclone.org/install.sh | sudo bash.
This would detect the OS, detect if the script was run with sudo (system-wide), install restic (beta) ask the user, if cron for auto-updates should be used (Y/n) and display some wonderful ascii (logo?).
The problem with curl | sudo bash is that you need to trust that the source is not compromised, but I would argue that the basic linux-only installation already gets long, anyone wanting to trust themselves may review and fork the script.
What are you trying to do?
Install restic on many machines with copy pasta, currently I have:
curl -s https://api.github.com/repos/restic/restic/releases/latest | grep 'browser_download_url.*linux_amd64.bz2"' | cut -d : -f 2,3 | tr -d \" | xargs -n 1 curl -sSL > /tmp/restic.bz2 && sudo sh -c 'bzip2 -dc /tmp/restic.bz2 > /usr/local/bin/restic && chmod +x /usr/local/bin/restic' # Install restic on Linux.
sudo sh -c '(crontab -l;echo "$((0+RANDOM%60)) $((0+RANDOM%24)) */3 * * restic self-update -q")|crontab -' # Add crontab entry to auto-update restic. To avoid problems with everyone updating at the same time, add a bit of random. Might have problems with mobile devices running a cron (and not something like anacron), what happen to be offline at the time of scheduled update.
Since I'm in a mood already, I'll assign myself to the issue.
And I spent 3 hours on the ascii banner
.. look at it!
just look at it!
I did the math wrong and it is 160 chars wide, not 80!

cat << "EOF"
イエウ
エオオア
アィア ウオエ
ウオウ ア
ウオウ
ァィィィィ ィウウイ ィゥイァ ァイゥイァ アィィェオウィィィィ ィィィィィィ ィゥイア
ィオオオオァェオオオォ ゥォオオオォウ ウォオオオォウ ウオオオオオオオオォ ォオオオオエ ゥォオオオォェ
アゥゥォオゥオォェエエ イオォウゥウォオゥ イオォウイウォオイ イウウエオエウウウウ ゥウウウオエ イオオェゥウォオウ
エオエウ エオイ ィオォ ェオゥ イエウ ウオウ アオエ エオゥ アォォ
エオエ ォォ エオァ ェオェ ウオウ アオエ ォォ ゥウァ
エオゥ ィオォウウウウウエオイ ィォオォェゥァ ウオウ アオエ アオエ
エオィ ィオオォォォォォォォイ ィエォオオォェァ ウオウ アオエ ィオエ
エオア アオエ イェォオェ ウオウ アオエ アオエ
エオア ォォ イオォ ウオウ アオエ ォォ ゥェァ
エオア エオウ エォア エォィ ィオエ ゥオェ アオエ エオウ ィォォ
ウウォオウウウイ ィオオェウェォオェ ウオォェゥウォオゥ アォオエェェウ ウェェェオォェェェイ ィオオエウェォオウ
ォオオオオオオェ イエオオオォェ ウォオオオォウ イエォオオォ ォオオオオオオオオウ イエオオオォウ
ァイィ ィイィ アア アイィ
EOF
Hmm, at first I was thinking "dude, it's just one binary, what is there to install", but I realize it might be useful to have something like this for more automated or batchy deployments..
Regarding the logo though, I'm not sure it's great to require Unicode characters, I think we should stick to plain old ASCII, preferrably the lower half of it, just to be extremely platform neutral. The image you showed is nice, but there seems to be some funky characters in there :)
I concur @rawtaz's point of using ASCII only characters. CJK characters may have different widths on different platforms, and some just don't display them at all.
Just wanted to add 2 points you should keep in mind when writing the installer:
- restic binaries require
bzip2to unpack, which is not installed on all systems by default - the bash- and or zsh-completion file should be installed as well
@rawtaz:
Would it be possible to provide the restic binaries as tar.gz? The reason why I'm asking is because:
- the Ansible unarchive module can't handle pure
.gzor.bz2files - on most systems the only reason why I need to install
bzip2is because of restic
I scrapped the logo, rip.
Instead of the logo we have something like this at the end:

I'm not proud of the link's order, this is the most sensible I could do with the long github link in 80 chars. (Add restic.net/github as a redirect ?)
There isn't a licence as well, I think the best location would be /usr/share/doc/restic/copyright; but it might be taken by the package manager's version of restic. The how-to access the licence in the info box needs changing.
@dimejo thanks for the bash/zsh recommendation!
I also do agree, that bzip is not so common. tar.gz or zip would be preferred.
I'm not going to talk about all the code (you'll see it soon), but this is what I have as flags rn. Anything I missed?

Most of the script should be done in a day's work, so probably tomorrow.
I feel like this is getting so large, that I might turn it in to a project (as a template). Any idea if something like this already exists?
I feel like this is getting so large, that I might turn it in to a project (as a template). Any idea if something like this already exists?
Do you mean a similiar project for restic or a complex installer in general?
I feel like this is getting so large, that I might turn it in to a project (as a template). Any idea if something like this already exists?
Do you mean a similiar project for restic or a complex installer in general?
A complex installer in general, but I would be stuck on the 'ethical' side of there probably shouldn't be many projects what used it (first, curl to bash is blind trust, secondly, you should use the package managers where possible, but that should be in theory handled by flatpaks and alike (right now you have a long page for install commands per-distro)).
Thinking about it today, I think it's better to keep it a one-off with many comments (if somebody does think they actually need it, it is easy to copy pasta). Otherwise, it could end up creating a yet-an-another-war (flatpak vs snap vs appimage vs your distro's and another between the different distros) between package managers, installation methods and other. Not that I think that the war shouldn't happen, just I don't want to deal with it and I believe there's someone more knowledgable on the topic of installers, packaging and so on.
Not in a mood to work on this, but while working on other stuff (and needed to install rust on a remote machine) I noticed, rust also has an install script. https://www.rust-lang.org/tools/install
@dimejo We're considering it, and thank you for the suggestion :)