Hi,
I recently retried cockpit and then I remembered that when tested last time I could not find out how *cockpit-packagekit* could use a proxy server for retrieving updates.
I am behind a firewall and have configured a proxy in |/etc/dnf/dnf.conf| which works perfectly with dnf.
But within cockpit this setting is not recognized. I also experimented with overrides for the docker.socket service and setting the |http_proxy| and |https_proxy| variables there but not chance to get it working.
Am I missing something or is it so, that this has not been adressed, yet? Or will it ever?
Found old bug reports about that e.g.
https://bugs.centos.org/view.php?id=16587 https://bugs.centos.org/view.php?id=16587 https://bugzilla.redhat.com/show_bug.cgi?id=1348843 https://bugzilla.redhat.com/show_bug.cgi?id=1348843
Any idea how to set a proxy for cockpit-packagekit or is packagekit still not supporting it?
Thanks in advance
PCFreak
Hello PCFreak,
Der PCFreak [2021-03-12 9:17 +0100]:
https://bugzilla.redhat.com/show_bug.cgi?id=1348843
Any idea how to set a proxy for cockpit-packagekit or is packagekit still not supporting it?
That bugzilla's comment #14 says:
You need to set the ProxyHTTP= key in /etc/PackageKit/PackageKit.conf – this came up on #fedora-kde today and setting the key worked.
Does that work for you?
Note, you can test this outside of cockpit with e.g.
pkcon refresh --force pkcon get-updates
or
pkcon update
Martin
Hi Martin,
thanks for the fast reply. I only had an Oracle Linux Box as a VM available at home but I did some tests and think they are also meaningful.
Actually the correct command to refresh is |pkcon refresh force|. Setting a proxy within |/etc/PackageKit/PackageKit.conf| with |ProxyHTTP=| was not even recognized or interpreted I think. I ran packagekitd manually in verbose mode and saw nothing about a proxy. In the end your mail took me in the right direction pointing me at PackageKit.
I created an override for the packagekit.service as |/usr/lib/systemd/system/packagekit.service.d/override.conf| with the following content:
|[Service] Environment="http_proxy=http://10.11.12.13:8080/" Environment="https_proxy=http://10.11.12.13:8080/" |
Now cockpit worked but this “was not a nice approach”.
But then my inventive spirit was awakened and i checked a CentOS7 applicance we got from a 3rd party at work that i know connects via proxy to the updates and the updates also work via cockpit. While I am not allowed to change config there to play arround I could find out, where this box has the proxy settings in place:
|find /etc/ -type f -exec grep -Hni '10.11.12.13' '{}' ; /etc/yum.conf:28:proxy=http://10.11.12.13:8080/ /etc/sysconfig/proxy:1:HTTPS_PROXY="http://10.11.12.13:8080/" /etc/sysconfig/proxy:2:HTTP_PROXY="http://10.11.12.13:8080/" /etc/sysconfig/proxy:4:PROXY="http://10.11.12.13:8080/" |
On this Centos7 appliance box updates via yum and cockpit (PackageKit) work like a charm.
So I added the same settings to my test VM and removed the previously added override directory |/usr/lib/systemd/system/packagekit.service.d/| entirely. I did a reboot then and aftewards everything worked (including |pkcon|).
It would be nice if someone could just confirm if |ProxyHTTP=| should or is really and still recognized by PackageKit or if it is only one more rumor. I think currently it is not used in any way.
Thank you very much for your reply and idea. At least I have now a working way.
Regards
Peter aka PCFreak https://chemnitzer.linux-tage.de/2021/de/programm/beitrag/193 https://chemnitzer.linux-tage.de/2021/de/programm/beitrag/193
Am 12.03.21 um 10:36 schrieb Martin Pitt:
Hello PCFreak,
Der PCFreak [2021-03-12 9:17 +0100]:
https://bugzilla.redhat.com/show_bug.cgi?id=1348843
Any idea how to set a proxy for cockpit-packagekit or is packagekit still not supporting it?
That bugzilla's comment #14 says:
You need to set the ProxyHTTP= key in /etc/PackageKit/PackageKit.conf – this came up on #fedora-kde today and setting the key worked.
Does that work for you?
Note, you can test this outside of cockpit with e.g.
pkcon refresh --force pkcon get-updates
or
pkcon update
Martin _______________________________________________ cockpit-devel mailing list -- cockpit-devel@lists.fedorahosted.org To unsubscribe send an email to cockpit-devel-leave@lists.fedorahosted.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedorahosted.org/archives/list/cockpit-devel@lists.fedorahoste... Do not reply to spam on the list, report it: https://pagure.io/fedora-infrastructure
Am 12.03.21 um 10:36 schrieb Martin Pitt:
Hello PCFreak,
Der PCFreak [2021-03-12 9:17 +0100]:
https://bugzilla.redhat.com/show_bug.cgi?id=1348843
Any idea how to set a proxy for cockpit-packagekit or is packagekit still not supporting it?
That bugzilla's comment #14 says:
You need to set the ProxyHTTP= key in /etc/PackageKit/PackageKit.conf – this came up on #fedora-kde today and setting the key worked.
Does that work for you?
Note, you can test this outside of cockpit with e.g.
pkcon refresh --force pkcon get-updates
or
pkcon update
Martin _______________________________________________ cockpit-devel mailing list -- cockpit-devel@lists.fedorahosted.org To unsubscribe send an email to cockpit-devel-leave@lists.fedorahosted.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedorahosted.org/archives/list/cockpit-devel@lists.fedorahoste... Do not reply to spam on the list, report it: https://pagure.io/fedora-infrastructure
Hello Peter,
thanks for your investigations!
Der PCFreak [2021-03-12 22:56 +0100]:
Actually the correct command to refresh is |pkcon refresh force|.
Oops, sorry, yes -- (non)intuitive syntax for the win :-/
Setting a proxy within |/etc/PackageKit/PackageKit.conf| with |ProxyHTTP=| was not even recognized or interpreted I think.
Indeed:
# strings /usr/lib64/packagekit-backend/libpk_backend_* | grep Proxy (nothing)
# strings /usr/libexec/packagekitd | grep Proxy CannotSetProxy SetProxy method called: %s, %s
/usr/share/dbus-1/interfaces/org.freedesktop.PackageKit.xml indeed offers a SetProxy() method, but `rpm -ql PackageKit | xargs grep SetProxy` does not show any binary for that -- i.e. it seems nothing implements that interface.
I followed up to https://bugzilla.redhat.com/show_bug.cgi?id=1348843 to point that out, so that other people don't get misled either.
I created an override for the packagekit.service as |/usr/lib/systemd/system/packagekit.service.d/override.conf| with the following content:
|[Service] Environment="http_proxy=http://10.11.12.13:8080/" Environment="https_proxy=http://10.11.12.13:8080/" |
Now cockpit worked but this “was not a nice approach”.
Indeed, so that is actually not a bad approach -- $http_proxy etc. are standard env variable, and injecting them into services that way is a standard approach. Of course it sucks a bit that this needs to be done for every service individually.
/etc/sysconfig/proxy:1:HTTPS_PROXY="http://10.11.12.13:8080/" /etc/sysconfig/proxy:2:HTTP_PROXY="http://10.11.12.13:8080/" /etc/sysconfig/proxy:4:PROXY="http://10.11.12.13:8080/" |
Interesting! I don't see PackageKit to even look at /sysconfig (according to `strings`), but if this works, so much the better!
It would be nice if someone could just confirm if |ProxyHTTP=| should or is really and still recognized by PackageKit or if it is only one more rumor. I think currently it is not used in any way.
Correct.. Possibly this?
Version 0.8.14 ~~~~~~~~~~~~~~ Released: 2013-12-02 [...] Deprecations and Removed Features: - Do not allow the user to specify the proxy in PackageKit.conf (Richard Hughes)
Thanks!
Martin
cockpit-devel@lists.fedorahosted.org