Eos-update-notifier proxy

eos-update-notifier is great. Thanks for creating it!
One suggestion is to add support for people behind a proxy (like in a corporate environment).

Currently, if a user is behind a proxy and has the http_proxy / https_proxy environment variables set (for example in /etc/environment), eos-update-notifier gives the error that there’s no internet connection.

The problem is with using the ping command to determine if there’s internet. Since ping doesn’t use the http_proxy env vars.

In /usr/share/endeavouros/scripts/eos-script-lib-yad (line 104 & 108):
under eos_yad_check_internet_connection,

Suggestion is to use curl instead of ping:

        #ping -c 1 8.8.8.8 >/dev/null && return 0   # is connected
        curl -s --connect-timeout 8 https://8.8.8.8 >/dev/null && return 0   # is connected
...
    #ping -c 1 8.8.8.8 >/dev/null || {
    curl -s --connect-timeout 8 https://8.8.8.8 >/dev/null || {

Since curl uses the system’s env vars, it’s aware if a proxy is set.
The systemd service will also work fine since it seems to be aware of /etc/environment, so no changes needed to override the eos-update-notifier.service to get proxy to work.

If people agree I can open a PR for this, or @manuel feel free to make the edits! I believe the code is here?

Thanks!

6 Likes

Welcome at the forum and thanks for figure this out!

1 Like

@ryencoke
Welcome!

And thanks for the great suggestion! I’ll implement it (mainly copy your code) and make it configurable.

1 Like

Now welcome version 2.2.18-1 provides this support.

After updating, you’ll need to copy the new settings (especially EOS_CONNECTION_CHECKER) from file /etc/eos-script-lib-yad.conf.pacnew into the real config file.

1 Like

Cool, looks good!
It’s probably a good idea to add a note (at bottom of /etc/eos-script-lib-yad.conf)? Regarding issues with ping and proxy, so to use curl instead in that case. Also, should the default be to use curl instead of ping?

I’ll add some notes.
Since curl should work for all users, I guess curl could be the default. I can change that too.

2 Likes

@manuel
I noticed something different this morning with the update notifier. The old familiar update box showed up on the screen. Then i used system update in the welcome screen and i saw some odd yad box flash on the screen as it did the update. Then another update notifier came up but there wasn’t any more updates? The only update was a new welcome version? It was perfect with the prior version. What has changed? New version is 2.2.21-1

Edit: Now I’ll have to wait until there are more updates to see what it does.

There were some small updates that shouldn’t cause big trouble.

No need to wait, you can downgrade a package, like geany, and then re-try updates.

    downgrade geany

and update again.

Not sure i did that right as i told it to ignore answering yes. What is geany? I went down to first one. Say’s no updates?
Edit: I went to version geany 1.34.1-1 Okay i get it!

[rick@xfce-pc ~]$ sudo pacman -Q geany
[sudo] password for rick: 
geany 1.34.1-1
[rick@xfce-pc ~]$ sudo pacman -S geany
:: geany is in IgnorePkg/IgnoreGroup. Install anyway? [Y/n] y
resolving dependencies...
looking for conflicting packages...

Packages (1) geany-1.36-1

Total Installed Size: 13.14 MiB
Net Upgrade Size: 0.34 MiB

:: Proceed with installation? [Y/n] y

geany is a text editor and IDE. Like an enhanced gedit if you will.

1 Like

Very good concept regarding Geany and can also compile sometimes …

I just removed the usage of eos-update-notifier from the welcome update button.
That should bring back the older behavior.
New is 2.2.23-1.

@manuel
Here is what i’m talking about. I went onto my other computer to check.

Edit: Do i answer yes or no on this new yad box?

It is what it says. The updater has detected that another process may be already updating (because of the lockfile), and it warns about it. You can continue only if you are sure no other process is updating.

But if pamac is checking and not really updating anything sometimes the update notifier comes up again. That doesn’t matter though right? It’s not really updating just checking?

Edit: I’m assuming this is put in place as to not cause an issue with pacman db?

The update notifier will check for updates again if the user waits more than a minute (or so) before reacting to the original notification.

And yes, the terminal window will show when the actual updating is taking place. Before that it is only checking.

If you know there’s no other updater actually updating, you can answer yes.

In your picture it shows only eos-update-notifier that is simply waiting to continue or be dismissed. So it is not updating anything at that point.

If you want to play it safe, dismiss both of them. Then do update with only one of them.