boot-clj / boot

Build tooling for Clojure.
https://boot-clj.github.io/
Eclipse Public License 1.0
1.75k stars 180 forks source link

boot does not support proxy settings #604

Closed dingmaotu closed 6 years ago

dingmaotu commented 7 years ago

Because of network issues, boot can not reach github download directly. There is no way to tell boot to use a proxy. Or like lein.bat, a HTTP_CLIENT env variable can be used to specify a custom download command.

Deraen commented 7 years ago

You can provide :proxy property in Boot env: https://github.com/cemerick/pomegranate/blob/pomegranate-0.3.0/src/main/clojure/cemerick/pomegranate/aether.clj#L665-L673

dingmaotu commented 7 years ago

@Deraen Maybe I didn't make myself clear. I mean the boot.exe executable automatically downloads boot.jar file from github, and this process can not be configured to use a proxy. Though I can download the jar file manually, it is not that smooth. I know I'd better report this to launch4j 😅

Bost commented 7 years ago

I have a working hack! It involves recompiling the boot binary file and serving all necessary files (boot.sh, boot.jar, etc.) from a local server. See my changes in https://github.com/Bost/boot/commit/20df86c09485b0a40a698f8183fbbb8ab172a428

mkdir -p /tmp/download/2.7.1 && cd /tmp/download/2.7.1 && wget https://github.com/boot-clj/boot/releases/download/2.7.1/boot.jar
mkdir -p /tmp/download/2.7.2 && cd /tmp/download/2.7.2 && wget https://github.com/boot-clj/boot/releases/download/2.7.2/boot.jar
mkdir -p /tmp/download/2.4.2 && cd /tmp/download/2.4.2 && wget https://github.com/boot-clj/boot/releases/download/2.4.2/boot.jar
python3 -m http.server 8000 --bind 127.0.0.1 # spin up the local server
cd ~
git clone https://github.com/Bost/boot.git && cd boot
git checkout 20df86c09485b0a40a698f8183fbbb8ab172a428 
# recompile the boot binary
make deps && make install 
cd <your-app-using-boot>
# in the boot.properties set: BOOT_VERSION=2.7.2
# unset any proxy variables like $http_proxy, $https_proxy etc.
~/boot/bin/boot <your-boot-params>

Enjoy! :)

rattboi commented 6 years ago

That's great that there's a recompile hack, but there's no interest in getting this to work without the hack? I'm running into the same issue at my corporate job, and I'd like to use boot/clj, but these kinds of issues will push away further acceptance.

I'm going to attempt to persevere, and maybe if I find a workable solution, I'll send in a PR.

martinklepsch commented 6 years ago

Hey @rattboi & @Bost :)

I haven’t yet had a chance to look at the changes made in @Bost’s fork but there definitely is an interest in making this work for people behind proxies.

A PR that roughly follows leiningen’s footsteps would be appreciated. But other ideas are equally welcome. 😊

Thanks for taking the time to contribute 🙌

martinklepsch commented 6 years ago

So, it turns out this issue is more appropriately handled in boot-bin as that is where the initial boot.jar is downloaded.

There's a similar issue https://github.com/boot-clj/boot-bin/issues/2 which also outlines a potential fix. This should be documented better.

Interestingly the githuburl var doesn't seem to be used at all anymore so I opened a PR to remove it.

I'll close this now, please direct any further discussion around this issue to https://github.com/boot-clj/boot-bin/issues/2 or reopen this if you disagree that this is a problem with boot-bin.