Git Product home page Git Product logo

getbin's Introduction

GitHub Release Downloader

Download latest GitHub release binaries (for your OS/arch) using wget or curl

wget --content-disposition https://getbin.io/suyashkumar/ssl-proxy

Overview

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.

Usage

Let's say you wanted to get the latest suyashkumar/ssl-proxy binary for your OS/arch. You simply:

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):

curl -LJ "https://getbin.io/suyashkumar/ssl-proxy?os=darwin" | tar xvz 

Use with any* GitHub repo

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:

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):

wget --content-disposition "https://getbin.io/suyashkumar/ssl-proxy?uncompress=true" 

If your release asset is not compressed, you can simply:

wget --content-disposition "https://getbin.io/suyashkumar/ssl-proxy"

or

curl -LOJ "https://getbin.io/suyashkumar/ssl-proxy?os=darwin"

Notes & Assumptions

  • If you are not using the inline uncompress feature, you'll notice that the server just transparently issues wget or curl a 301 HTTP redirect to the proper GitHub artifact URL. This way you can have some faith the artifact is whatever was uploaded to that GitHub release.
  • Currently, the OS is auto matched based on the supplied User-Agent. curl does not supply a user agent, so the query parameter os must be supplied. The architecture is assumed to be amd64/x86.
  • The GitHub release asset filename currently must contain (darwin, linux, or windows) and (x86 or amd64). More to be expanded with this basic regex in the future. Probably will want to have all GOOS and GOARCH.

TODO

  • Inline, automatic uncompression of binaries
  • Handle GitHub preleases
  • Handle different architectures without assumptions (currently assuming x86/amd64)
  • Improved binary name matching regex
  • Fetch specific tagged releases

Attribution

The terminal icon used above is made by Paomedia from iconfinder.com and is released under CC BY 3.0.

getbin's People

Contributors

dependabot[bot] avatar suyashkumar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

getbin's Issues

Update to getbin.io

Migrate the deployed domain to getbin.io to make it clear this is a general tool.

service is down

heya. thanks for providing this service. it seems to be down right now though

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.