Opera
Opera

Reputation: 983

Installing Atom packages with git port blocked

I'm trying to install the autocomplete-clang plugin for atom. Unfortunately my company firewall blocks the 9418 port which is used by the git:// protocol.

I'm able to install plugins which use https:// URL to clone git repos and dependencies but when I try to install autocomplete-clang I get the following error :

npm WARN `git config --get remote.origin.url` returned wrong result (git://github.com/Kev/clang-flags.git) https://github.com/Kev/clang-flags.git
npm ERR! git clone git://github.com/Kev/clang-flags.git Cloning into bare repository '~/.atom/.apm/_git-remotes/git-github-com-Kev-clang-flags-git-1a523481'...
npm ERR! git clone git://github.com/Kev/clang-flags.git fatal: unable to connect to github.com:
npm ERR! git clone git://github.com/Kev/clang-flags.git github.com[0: 192.30.252.130]: errno=Connection timed out
npm ERR! Linux 3.11-2-amd64
npm ERR! argv "/usr/share/atom/resources/app/apm/bin/node" "/usr/share/atom/resources/app/apm/node_modules/npm/bin/npm-cli.js" "--globalconfig" "/home/clement/.atom/.apm/.apmrc" "--userconfig" "/home/clement/.atom/.apmrc" "install" "/tmp/d-115117-10848-qhdhe7/package.tgz" "--target=0.21.0" "--arch=x64"
npm ERR! node v0.10.35
npm ERR! npm  v2.3.0
npm ERR! code 128

npm ERR! Command failed: Cloning into bare repository '~/.atom/.apm/_git-remotes/git-github-com-Kev-clang-flags-git-1a523481'...
npm ERR! fatal: unable to connect to github.com:
npm ERR! github.com[0: 192.30.252.130]: errno=Connection timed out
npm ERR! 
npm ERR! 
npm ERR! 
npm ERR! If you need help, you may report this error at:
npm ERR!     

npm ERR! Please include the following file with any support request:
npm ERR!     /tmp/apm-install-dir-115117-10848-1qirptl/npm-debug.log

I tried to add this to my gitconfig:

[url "https://"]
    insteadOf = git://

I also redirected traffic from port 9418 to port 80

# iptables -t nat -L -n -v
Chain PREROUTING (policy ACCEPT 24948 packets, 4967K bytes)
 pkts bytes target     prot opt in     out     source               destination         
    0     0 REDIRECT   tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            tcp dpt:9418 redir ports 80

but it doesn't work. Did I miss something ? How could I bypass this block ?

Upvotes: 2

Views: 755

Answers (1)

VonC
VonC

Reputation: 1323313

Try first if you cannot instruct git to use https instead of git, all the time:

git config --global url."https://".insteadOf git://

The OP Opera confirms in the comments the issue to be linked to atom/apm 106, related to npm/npm 5257:

apm not respecting git config --global url."https://".insteadOf git://

Opera adds:

I edited the add-remote-git.js file (now containing the code that is referred to in atom/apm 106) and added the replace call suggested in the last comment.

Upvotes: 1

Related Questions