Can't update/install using composer behind a corporate firewall
Asked Answered
R

1

3

i'm trying to get composer to work on our server but i keep getting issues trying to install/update repositories.

I have configured the environment variables correctly to achieve all this:

http_proxy=http://fastweb.int.bell.ca:8083/
ftp_proxy=ftp://fastweb.int.bell.ca:8083/
HTTP_PROXY_REQUEST_FULLURI=false

I have also forced my composer to use HTTPS protocol only using the configuration directive:

"config": {
    "github-protocols": ["https"]
}

We tried to update the ca_bundle following the post SSL certificate rejected trying to access GitHub over HTTPS behind firewall by setting the GIT_SSL_NO_VERIFY or updating the ca-bundle.crt in /etc/pki/tls/certs...

Nothing seems to work!

Here's the output, it does it for all packages, i tried with and without --prefer-source just to see if it would help, still nothing...

./composer.phar update Loading composer repositories with package
information Updating dependencies (including require-dev)
    - Updating crazycodr/data-transform (dev-master 11f8499 => 2.0.2)
    Checking out 11f8499d0027468705fca72ab67acfbf8ee2e6be

[RuntimeException]   Failed to clone
https://github.com/crazycodr/data-transform.git via git, https and
http protocols, aborting.

- https://github.com/crazycodr/data-transform.git
    fatal: https://github.com/crazycodr/data-transform.git/info/refs?service=git-upload-pack not found: did you run git update-server-info on the server?
Rachitis answered 26/8, 2013 at 20:1 Comment(2)
Can you wget https://github.com/any/github/zipfile-download with that proxy setup? Can you manually git clone repos? I would think there should be a HTTPS_PROXY defined.Brei
I'll look into that tomorrow morning, thanks for the suggestionRachitis
Z
1

I confirm being able to clone/pull/push a GitHub repo behind a firewall.
And you do need https_proxy in addition of http_proxy:

set http_proxy=http://<login_internet>:<password_internet>@aproxy:aport
set https_proxy=http://<login_internet>:<password_internet>@aproxy:aport
set no_proxy=.company

(the no_proxy part is there to avoid using the proxy for internal url, internal to the company)

Zygophyte answered 27/8, 2013 at 6:33 Comment(2)
That did it perfectly wellRachitis
Note that the no_proxy only works with a very recent copy of composer. The pull request for evaluating that part of the environment variables was merged on 2013-08-11. Earlier versions do not evaluate it, and will happily try to use the proxy for local resources.Brei

© 2022 - 2024 — McMap. All rights reserved.