Skip to content

Commit

Permalink
Update README & Homepage with https://getbin.io references (#8)
Browse files Browse the repository at this point in the history
* Update README with https://getbin.io

* Update homepage with getbin references

* Update Makefile
  • Loading branch information
suyashkumar authored Jul 22, 2019
1 parent 80c02a5 commit 7729a8a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
BINARY = binary-fetcher
BINARY = getbin

.PHONY: build
build:
Expand Down
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,50 +2,50 @@
<img src="https://suyashkumar.com/assets/img/terminal_large.png" width="80">
<h3 align="center">GitHub Release Downloader</h3>
<p align="center">Download latest GitHub release binaries (for your OS/arch) using <code>wget</code> or <code>curl</code></p>
<p align="center"><code>wget --content-disposition https://bin.suyash.io/suyashkumar/ssl-proxy</code></p>
<p align="center"> <a href="https://goreportcard.com/report/github.com/suyashkumar/bin"><img src="https://goreportcard.com/badge/github.com/suyashkumar/bin" alt=""></a> <a href="https://godoc.org/github.com/suyashkumar/bin"><img src="https://godoc.org/github.com/suyashkumar/bin?status.svg" alt=""></a>
<p align="center"><code>wget --content-disposition https://getbin.io/suyashkumar/ssl-proxy</code></p>
<p align="center"> <a href="https://goreportcard.com/report/github.com/suyashkumar/getbin"><img src="https://goreportcard.com/badge/github.com/suyashkumar/getbin" alt=""></a> <a href="https://godoc.org/github.com/suyashkumar/getbin"><img src="https://godoc.org/github.com/suyashkumar/getbin?status.svg" alt=""></a>
</p>
</p>

## Overview
This is a simple server (deployed @ https://bin.suyash.io) that makes it easy to download the latest binary associated with _any GitHub repo release_ using regular old `wget` and `curl`. It attempts to use your User-Agent to fetch the right GitHub release asset for your OS/arch, but also lets you provide query parameters to specify OS/arch, and optionally uncompress the release artifact on the fly.
This is a simple server (deployed @ https://getbin.io) that makes it easy to download the latest binary associated with _any GitHub repo release_ using regular old `wget` and `curl`. It attempts to use your User-Agent to fetch the right GitHub release asset for your OS/arch, but also lets you provide query parameters to specify OS/arch, and optionally uncompress the release artifact on the fly.

I mostly just built this as a way to distribute my software binaries easily without dealing with `brew`, `npm`, etc (though they certainly have their advantages & trust). I can just give my users a one line download link that will always get them the latest released binary for their platform, and _all I have to do is just update GitHub releases like I normally do_.

Basic functionality currently exists (with some assumptions, see below), but this is still a work in progress with many improvements forthcoming. This currently will work as expected with all of my repos/releases.
Basic functionality currently exists (with some assumptions, see below), but this is still a work in progress with many improvements forthcoming. This currently will work as expected with all of __my__ repos/releases.

## Usage
Let's say you wanted to get the __latest__ [`suyashkumar/ssl-proxy`](https://github.com/suyashkumar/ssl-proxy) binary for your OS/arch. You simply:
```sh
wget -qO- https://bin.suyash.io/suyashkumar/ssl-proxy | tar xvz
wget -qO- https://getbin.io/suyashkumar/ssl-proxy | tar xvz
```
or with `curl` you usually must specify your os (since it is not included in the User-Agent):
```sh
curl -LJ "https://bin.suyash.io/suyashkumar/ssl-proxy?os=darwin" | tar xvz
curl -LJ "https://getbin.io/suyashkumar/ssl-proxy?os=darwin" | tar xvz
```
### Use with any* GitHub repo
The generalized request format is `GET https://bin.suyash.io/GITHUB_USERNAME/GITHUB_REPO`. See section below for assumptions.
The generalized request format is `GET https://getbin.io/GITHUB_USERNAME/GITHUB_REPO`. See section below for assumptions.

Let's say we wanted the latest distribution of [`goreleaser/goreleaser`](https://github.com/goreleaser/goreleaser/):
```sh
wget -qO- https://bin.suyash.io/goreleaser/goreleaser | tar xvz
wget -qO- https://getbin.io/goreleaser/goreleaser | tar xvz
```

Generally, the server software attempts to detect your OS (and in the future, architecture) automatically from your `User-Agent`, but also allows you to specify your own intentions as seen with `curl` above. We're piping into `tar` here because the original release assets are compressed, but you can also uncompress on the fly (see below)

#### Uncompress on the fly
If you want to not bother with piping into tar or zip as above, the server can decompress on the fly to serve you the binary (assuming it is the only file in the archive):
```sh
wget --content-disposition "https://bin.suyash.io/suyashkumar/ssl-proxy?uncompress=true"
wget --content-disposition "https://getbin.io/suyashkumar/ssl-proxy?uncompress=true"
```

If your release asset is __not compressed__, you can simply:
```sh
wget --content-disposition "https://bin.suyash.io/suyashkumar/ssl-proxy"
wget --content-disposition "https://getbin.io/suyashkumar/ssl-proxy"
```
or
```sh
curl -LOJ "https://bin.suyash.io/suyashkumar/ssl-proxy?os=darwin"
curl -LOJ "https://getbin.io/suyashkumar/ssl-proxy?os=darwin"
```


Expand Down
10 changes: 5 additions & 5 deletions handlers/home.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const homeMessage = `
<h1> GitHub Release Downloader </h1>
<p>
This tool helps you download the latest binaries from GitHub releases quickly using curl or wget.
Find out more at the <a href="https://github.com/suyashkumar/bin">GitHub README for this project.</a>
Find out more at the <a href="https://github.com/suyashkumar/getbin">GitHub README for this project.</a>
</p>
<p>
Let's say you wanted to download the latest version of
Expand All @@ -30,20 +30,20 @@ const homeMessage = `
<p>
Download and untar the <b>latest</b> release of ssl-proxy for your OS (will be based on wget's
<code>User-Agent</code>): <br />
<code>wget -qO- "https://bin.suyash.io/suyashkumar/ssl-proxy" | tar xvz</code> <br />
<code>wget -qO- "https://getbin.io/suyashkumar/ssl-proxy" | tar xvz</code> <br />
</p>
<p>
You can also specify the OS you wish to download for as follows (can be either <code>darwin</code>,
<code>linux</code>, or <code>windows</code>: <br />
<code>wget -qO- "https://bin.suyash.io/suyashkumar/ssl-proxy?os=darwin" | tar xvz</code> <br />
<code>wget -qO- "https://getbin.io/suyashkumar/ssl-proxy?os=darwin" | tar xvz</code> <br />
</p>
<p>
You can also let the server handle uncompression for you: <br />
<code>wget --content-disposition "https://bin.suyash.io/suyashkumar/ssl-proxy?os=darwin?uncompress=true"</code> <br />
<code>wget --content-disposition "https://getbin.io/suyashkumar/ssl-proxy?os=darwin?uncompress=true"</code> <br />
</p>
<p>
You can also use <code>curl</code>. Note, you must always specify <code>os</code> with curl. <br />
<code> curl -LJ "https://bin.suyash.io/suyashkumar/ssl-proxy?os=darwin" | tar xvz </code> <br />
<code> curl -LJ "https://getbin.io/suyashkumar/ssl-proxy?os=darwin" | tar xvz </code> <br />
</p>
</div>
</article>
Expand Down

0 comments on commit 7729a8a

Please sign in to comment.