waydroid / docs

https://docs.waydro.id/
16 stars 45 forks source link

Improve Debian install and add F-Droid install instruction #71

Open yurtpage opened 4 months ago

yurtpage commented 4 months ago

Please see commit comments for details.

yurtpage commented 4 months ago

@aleasto could you please review?

aleasto commented 4 months ago

I think the install and run apps section would need to be split into a purely CLI approach and a purely graphical approach:

I don't like wget && bash && rm ... We can mitigate partially downloaded files by wrapping the content in a function and calling it as the last line. Not that the script can do any harm if partially executed anyways...

yurtpage commented 3 months ago

I made the changes because I experienced a real problems that tried to fix. When I first executed the curl https://repo.waydro.id | sudo bash this is how it looks for me:

$ curl https://repo.waydro.id | sudo bash
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0[s100  1699  100  1699    0     0   3426      0 --:--:-- --:--:-- --:--:--  3432

E.g. as you may see I got a progress and then it stuck. Once I pressed ^C it printed: sudo: a password is required. So I just didn't saw the password prompt. I tried a second time:

$ curl https://repo.waydro.id | sudo bash
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  1699  100  1699    0     0   9724      0 --:--:-- --:--:-- --:--:--  9764[sudo] password for yurt: 

Now I see the password prompt but in some weird place. So the issue is that with a piping the curl can download one line and then start the sudo bash command in a pipe and feed the one line. That's why we see the password prompt mixed with the progress output.

The simplest solution is to just a hide the progress (-s Silent or quiet mode. -S When used with -s it makes curl show an error message if it fails):

$ curl -sS https://repo.waydro.id | sudo bash
[sudo] password for yurt: 

But technically speaking we still have two issues (both are unlikely):

  1. Partial download
  2. The curl downloading may be blocked until the pipe processed (but a pipe has a big buffer)

So instead to just make it plain and simple I decided to rewrite it to download and execute. Not a big deal as for me, it's still one line. But some users may prefer to review the downloaded script before executing.

Please merge the PR and then you may improve it on top the changes once you'll have a time. The changes are better than current from a newcomer user perspective (e.g. like me).