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 Debian install and add F-Droid install instruction #71

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

yurtpage
Copy link

Please see commit comments for details.

Instead of a curl we can use the wget that is always installed on all Debian systems.
But since the curl is needed inside of the installation script we still need to install it before. We may get rid of it later.

The wget uses the -nv flag to not show a progress but show any errors.
The script is downloaded first to temp folder and only then being executed. This protects us from executing partially downloaded file.
Instead of piping we executing a bash with the file name and once executed it will be removed.
Add waydroid app list command.
Extend example of installing F-Droid.
@yurtpage
Copy link
Author

@aleasto could you please review?

@aleasto
Copy link
Member

aleasto commented May 21, 2024

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

  • CLI: waydroid app install and waydroid app launch
  • Graphical: click on an apk file to install, launch it via the applications menu

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
Copy link
Author

yurtpage commented May 24, 2024

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants