Heimdall
Heimdall copied to clipboard
HTTP_PROXY env variable not fetched by GuzzleHttp
Hello,
In our corporate network, we are behind a http proxy for internet access. Previously, heimdall was working fine when setting HTTP_PROXY, HTTPS_PROXY and NO_PROXY env variables in our deployment.
Now we are getting following error.
GuzzleHttp\Exception\ConnectException thrown with message "cURL error 6: Could not resolve host: appslist.heimdall.site (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://appslist.heimdall.site/list.json"
When digging into it, it seems that GuzzleHttp is not taking into account these environment variables.
From code in /var/www/localhost/heimdall/app/SupportedApps.php :
public static function getList()
{
// $list_url = 'https://apps.heimdall.site/list';
$list_url = config('app.appsource').'list.json';
$client = new Client(['http_errors' => false, 'verify' => false, 'timeout' => 15, 'connect_timeout' => 15]);
return $client->request('GET', $list_url);
}
While looking at GuzzleHttp documentation, proxy could be set in request fonction : link
I am also experiencing issues when using Heimdall behind a corporate proxy
The strange part is when we curl directly from the container, we are able to fetch the https://appslist.heimdall.site/list.json site
[root@~]# k exec -it heimdall-79c48cf898-4gqzc -- curl https://appslist.heimdall.site/list.json
{
"appcount": 358,
"apps": [{
"appid": "140902edbcc424c09736af28ab2de604c3bde936",
"name": "AdGuard Home",
"website": "https://github.com/AdguardTeam/AdGuardHome",
"license": "GNU General Public License v3.0 only",
"description": "AdGuard Home is a network-wide software for blocking ads & tracking. After you set it up, it'll cover ALL your home devices, and you don't need any client-side software for that.\r\n\r\nIt operates as a DNS server that re-routes tracking domains to a \"black hole,\" thus preventing your devices from connecting to those servers. It's based on software we use for our public AdGuard DNS servers -- both share a lot of common code.",
"enhanced": true,
"tile_background": "light",
"icon": "adguardhome.png",
"sha": "d40413449bb664842785f8e011926db457ad62dd"
},
/// output crooped ///
}, {
"appid": "d17139efd0d8e0cba9bf8380c9818838911dfe0f",
"name": "Zulip",
"website": "https://zulipchat.com",
"license": "Apache License 2.0",
"description": "Powerful open source team chat. Zulip combines the immediacy of real-time chat with an email threading model. With Zulip, you can catch up on important conversations while ignoring irrelevant ones.",
"enhanced": false,
"tile_background": "light",
"icon": "zulip.png",
"sha": "3a0df46433fcc2077745b553566c7064958c5092"
}
]
}
I'm not behind a proxy, and the list updater is throwing me the exact same error ...
GuzzleHttp\Exception\ConnectException cURL error 6: Could not resolve host: appslist.heimdall.site (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://appslist.heimdall.site/list.json
This issue has been automatically marked as stale because it has not had recent activity. This might be due to missing feedback from OP. It will be closed if no further activity occurs. Thank you for your contributions.
Hello,
We fixed it by adding following piece of code in /app/www/app/SupportedApps.php Adapt proxy_ip_address and proxy_port based on your environnement.
` public static function getList(): ResponseInterface { // $list_url = 'https://apps.heimdall.site/list'; $list_url = config('app.appsource').'list.json'; $client = new Client(['http_errors' => false, 'verify' => false, 'timeout' => 15, 'connect_timeout' => 15]);
return $client->request('GET', $list_url, ['proxy' => 'http://proxy_ip_address:proxy_port']);
}
`
This issue has been automatically marked as stale because it has not had recent activity. This might be due to missing feedback from OP. It will be closed if no further activity occurs. Thank you for your contributions.
return $client->request('GET', $list_url, ['proxy' => 'http://proxy_ip_address:proxy_port']);
I have the same problem in version 2.5.6. It works fine for me with this fix. But this creates an inconsistency in the docker image.
This issue has been automatically marked as stale because it has not had recent activity. This might be due to missing feedback from OP. It will be closed if no further activity occurs. Thank you for your contributions.
This issue is locked due to inactivity