Code Monkey home page Code Monkey logo

open-gs's Introduction

This is an OSX application that registers and responds to the gs:// and s3:// protocols, letting you open Google Cloud Storage and Amazon S3 URIs from a browser or command line in your web browser.

It wraps the https:// protocol, opening your default browser to https://console.cloud.google.com/storage/browser/<ORIGINAL_URI> or https://console.aws.amazon.com/s3/buckets/<ORIGINAL_URI>.

Installation

git clone [email protected]:abstrctn/open-gs.git
cd open-gs

ln -s $(pwd)/gs.app /Applications/gs.app

The first time you open a gs:// link, OSX will ask for confirmation. Check the Always open these types of links in the associated app box to prevent the dialog from appearing in the future.

If you keep getting the "Website wants to open this open this application" prompt, try adding the protocols to Chrome's URLWhitelist setting. (You'll need to restart Chrome.)

defaults write com.google.Chrome URLWhitelist -array 'gs://*' 's3://*'

Details

The portion of the URL after browser/ must match a directory prefix that exists in the bucket, which will show all files within that directory. The path-based filter will only work on directories, you cannot include a file name as part of the page.

A separate prefix querystring can be used to filter the results, and this support filenames. Thus the script attempts to strip filenames by removing everything after the final slash in the URL, and sending it as the prefix querystring parameter instead. This process is skipped if the gs url contains only the bucket name without a path.

e.g., gs://bucket/directory/ -> https://console.cloud.google.com/storage/browser/bucket/directory e.g., gs://bucket/directory/file.txt -> https://console.cloud.google.com/storage/browser/bucket/directory?prefix=file.txt

Development

source/main.applescript contains the source code for the compiled script gs.app/Contents/Resources/Scripts/main.scpt. After editing the file in source, run make build to compile the script into the .app.

Changelog

v0.2.1 - Go to bucket index page by passing no bucket name. v0.2.0 - Added support for s3:// protocol. v0.1.0 - Initial release with support for gs:// protocol.

Authors

Michael Strickland

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.