newsdev/driveshaft

Name: driveshaft

Owner: NYT Newsroom Developers

Description: Google Drive ? JSON ? S3

Created: 2015-05-14 23:26:17.0

Updated: 2018-05-24 13:14:28.0

Pushed: 2018-05-22 15:17:10.0

Homepage: https://newsdev.github.io/driveshaft/

Size: 1525

Language: Ruby

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Driveshaft

Driveshaft is a Sinatra application built to turn Google Spreadsheets and Google Documents into JSON with the click of a button.

Quickstart

For the full user guide, please refer to the documentation. Or, if you're somewhat familiar with Ruby applications and Google Authentication / S3, use this quickstart guide to get up and running.

Heroku Quickstart

Deploy instantly with Heroku.

Deploy

Dependencies

Be sure to have the following system dependencies installed:

t, Ruby, Node
ew install git node ruby

wer
m install -g bower

ndler
m install bundler
Clone the repository and resolve app dependencies
t clone git@github.com:newsdev/driveshaft.git
 driveshaft
wer install
ndle install
Environmental Variables

Driveshaft uses environmental variables for configuration. Set the following variables either at runtime on the commandline, or in your /~.bash_profile.

Set at least one, or several, of the following to authenticate against the Google API. You will need to set up a Google Developers Project with the Drive API enabled. Then create a set of credentials. Public API Keys, and any of the three OAuth2 mechanisms, are supported.

To use an API Key, set GOOGLE_APICLIENT_KEY to the key. For any type of OAuth certificate, set the variable to a path to the certificate file, or the contents of the certificate itself.

blic API Key
LE_APICLIENT_KEY="***"

tive Application Client
LE_APICLIENT_CLIENTSECRETS_INSTALLED="***"

b Application Client
LE_APICLIENT_CLIENTSECRETS_WEB="***"

rvice Account
LE_APICLIENT_CLIENTSECRETS_SERVICEACCOUNT="***"

Required for S3 access. Use credentials that have access to any S3 buckets you wish to use.

ACCESS_KEY_ID="****"
SECRET_ACCESS_KEY="****"
REGION="us-east-1"

Driveshaft settings:

ESHAFT_SETTINGS_AUTH_REQUIRED="false" # true to require client-side login
ESHAFT_SETTINGS_AUTH_DOMAIN="nytimes.com" # restrict login to a single domain
ESHAFT_SETTINGS_MAX_VERSIONS="5" # set to a maximum number of previous file versions to keep on S3

Optional drive key and s3 destination for a Google Spreadsheet to use to power the index page. It should follow the format of this spreadhseet (you can copy the spreadsheet into a new one to start).

ESHAFT_SETTINGS_INDEX_DESTINATION="s3://BUCKET/PATH.json"
ESHAFT_SETTINGS_INDEX_KEY="DRIVE_KEY"
Run the app locally
ma

http://localhost:9292/

Documentation

Documentation is available on the gh-pages branch. To view or contribute to the docs, checkout that branch, and run the following to start the documentation server:

install jekyll
ll server
Contribute

Questions / comments / feature requests / concerns? Please use the Issues page.

Contributors

Released at the OpenNews Code Convening at the 2015 Write The Docs conference, with the support of the Knight Foundation and The Mozilla Foundation.

License

The documentation and code are licensed under the Apache License, Version 2.0.

Copyright 2015 The New York Times Company.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.