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

HTTP_PROXY env variable not fetched by GuzzleHttp #878

Closed
ozmoze opened this issue Jul 19, 2022 · 9 comments
Closed

HTTP_PROXY env variable not fetched by GuzzleHttp #878

ozmoze opened this issue Jul 19, 2022 · 9 comments

Comments

@ozmoze
Copy link

ozmoze commented Jul 19, 2022

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

@maximemoreillon
Copy link

I am also experiencing issues when using Heimdall behind a corporate proxy

@ozmoze
Copy link
Author

ozmoze commented Aug 29, 2022

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"
        }
    ]
}

@keriati keriati added the enhancement New feature or request label Dec 16, 2022
@Goro2030
Copy link

Goro2030 commented Apr 2, 2023

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

@github-actions
Copy link

github-actions bot commented May 3, 2023

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.

@ozmoze
Copy link
Author

ozmoze commented Jun 15, 2023

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']);
}

`

@github-actions
Copy link

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.

@Pandemonium1986
Copy link

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.

@LinuxServer-CI
Copy link

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.

@LinuxServer-CI LinuxServer-CI closed this as not planned Won't fix, can't repro, duplicate, stale Nov 22, 2023
@LinuxServer-CI LinuxServer-CI moved this from Non-Docker Issues to Done in Issue & PR Tracker Nov 22, 2023
Copy link

This issue is locked due to inactivity

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Archived in project
Development

No branches or pull requests

6 participants