ipfs / kubo

An IPFS implementation in Go
https://docs.ipfs.tech/how-to/command-line-quick-start/
Other
16.03k stars 3k forks source link

wget and curl #888

Closed chriscool closed 8 years ago

chriscool commented 9 years ago

We use both wget and curl in "t0110-gateway.sh" and we also use curl in "t0111-gateway-writable.sh".

Maybe we could get rid of wget and use only curl.

In test/sharness/Makefile there is also:

# will fail if curl is not installed.
# TODO: get rid of this and install curl with git or ipfs.
install_curl_pls = "curl is required to run tests. please install it"
curl:
        @which curl >/dev/null || (echo "$(install_curl_pls)" && false)

but I wonder if we could use something like https://github.com/christophwitzko/go-curl instead.

whyrusleeping commented 9 years ago

go-curl looks nice, and that removes an extra dependency, although it blows my mind that curl isnt installed by default on every machine.

jbenet commented 9 years ago

Oh nice find-- it would be nice to use go-curl and avoid the curl installation -- which seemed potentially cumbersome last i looked at it. The drawback is we wont get the nice options curl has to check things about the requests. I guess it's worth asking what we use and whether we need it. if we don't let's use go-curl. if we do, then i guess it's curl [1]

[1] i like using https://github.com/jakubroztocil/httpie it has nicer syntax -- but since it's python, that likley makes using it way worse...

chriscool commented 9 years ago

Ok, so my plan is to first replace wget with curl (done in #891, please CR it again) and then see if go-curl has everything we need to replace curl.

jbenet commented 9 years ago

sounds good! (also, merged #891)

whyrusleeping commented 8 years ago

update here? @chriscool

chriscool commented 8 years ago

Unfortunately https://github.com/christophwitzko/go-curl is only a go library. We would need to make it a binary and make it accept and use some command line options to be able to use it. So maybe for now it is ok to just use curl.

About wget, it is still used in the Dockerfile:

> git grep wget
Dockerfile: && apk add --update bash curl wget ca-certificates zip \
Dockerfile: && wget https://gobuilder.me/get/github.com/ipfs/go-ipfs/cmd/ipfs/ipfs_${VERSION}_linux-386.zip \
Dockerfile: && apk del wget zip curl
Godeps/_workspace/src/github.com/huin/goupnp/README.md:3. Download UPnP specification data (if not done already): `wget http://upnp.org/resources/upnpresources.zip`

and it is probably ok there, as wget should be on the docker image we use otherwise it would never work.

So I am closing this.