newsdev / driveshaft Goto Github PK
View Code? Open in Web Editor NEWGoogle Drive → JSON → S3
Home Page: https://newsdev.github.io/driveshaft/
License: Other
Google Drive → JSON → S3
Home Page: https://newsdev.github.io/driveshaft/
License: Other
In the following google doc, if the last TKTKTK » is a link, the link is malformed in the output
[items]
use: y
kicker: TK
text: TK | TKTK | TKTKTK »
items: [
{
"use": "y",
"kicker": "TK",
"text": "TK | TKTK | <a href="http://www.nytimes.com">"
}
Google signs their iap headers with the ES256 algorithm which is not installed in the driveshaft base image
Content-Type is currently set to application/json
without a specified charset, leading to mangled smartquotes and other non-ASCII characters.
archieml.rb and spreadsheet.rb should both specify a charset when setting the Content-Type for uploading to S3 and direct download.
I'm getting this error when I try to publish a sheet and can't seem to pinpoint the problem.
I have published other sheets using driveshaft, but am running into errors with this one.
Is there a size limit to the sheet? or some sort of misconfiguration that would lead to this error?
Looks like it will require upgrading the drive api from v2
to v3
, as well as deal with some attribute name changes:
The after
callback in the authentication module makes a call to the Google+ API to retrieve the authenticating user's email address for identification.
Current instructions do not include Google+ as a required API. Not enabling it results in an error that is not surfaced, and if web authentication is required using the DRIVESHAFT_SETTINGS_AUTH_REQUIRED
setting, would result in an authentication redirect loop.
TODOs:
AUTH_REQUIRED
turned onRunning Driveshaft from Heroku, and set up OAuth with Google. Accepting the OAuth permissions redirects back to the Driveshaft callback and then immediately triggers the request dialog again. Assuming I have something misconfigured, but can't pinpoint where.
Driveshaft can't publish in a way that the output JSON file is accessible over HTTPS.
https://int.nyt.com/
doesn't work because the cert is for s3.amazonaws.com.
https://int.nyt.com.s3.amazonaws.com/
doesn't work because wildcard certs only match one level of dots down.
The solution, I think, is to make Driveshaft publish to a bucket with no dots in the name. I think @buth is creating one, called newsdev-secure-internal
or something or like.
Referenced in a few links in the documentation site's index.md. Probably just an outdated Heroku URL?
Line 16 in 0e14978
The instructions omit this at the moment — apparently, it should happen automatically, which is a more ambitious issue for @abstrctn to tackle some day!
Any suggestions for making sure static assets are generated as part of the build process on Heroku?
The cause seems to be that the Node buildpack wasn't executed on initial deployment:
remote: ! Warning: Multiple default buildpacks reported the ability to handle this app. The first buildpack in the list below will be used.
remote: Detected buildpacks: Ruby,Node.js
remote: See https://devcenter.heroku.com/articles/buildpacks#buildpack-detect-order
remote: -----> Ruby app detected
remote: -----> Compiling Ruby/Rack
The build was initiated via Heroku CLI because the Deploy to Heroku
button build process repeatedly failed. Thanks!
Wilson noticed today that clicking login takes you through Google OAUTH but redirects you to localhost:3000.
Do we need to log in at all?
If so, we should fix.
So documentation can list out the methods as POST (which is more correcterer), with the caveat that they respond to GET as well for the sake of bookmarklets like (example follows)
Should probably be dealt with in Adcom.
Ensure we're not hitting the Google API more often than is necessary.
A main example to check is the discovered_api
calls, and whether those can be cached somewhere.
A change introduced in 9fb8d34 includes an invalid ruby hash:
commit 9fb8d349c79e7bd2a6aef4ddcb38da6ca3f44fd9
Author: Michael Strickland <[email protected]>
Date: Thu Oct 22 16:44:23 2015 -0400
Return error message with backtrace.
diff --git a/lib/driveshaft/app.rb b/lib/driveshaft/app.rb
index c81a48d..a8c29bf 100644
--- a/lib/driveshaft/app.rb
+++ b/lib/driveshaft/app.rb
@@ -118,9 +118,12 @@ module Driveshaft
rescue Exception => e
status 200
export = {
- content_type: 'application/json',
- backtrace: e.backtrace,
- body: "Error converting #{@file['title'] || @file['id']} into #{@export_format}. (#{e.message})"
+ content_type: 'application/json; charset=utf-8',
+ body: {
+ "message": "Error converting #{@file['title'] || @file['id']} into #{@export_format}. (#{e.message})",
+ "backtrace": e.backtrace,
+ "status": "error"
+ }
}
end
Potentially related this other issue: archieml-ruby gem does not support freeform arrays yet, either.
c.f. newsdev/archieml-ruby#4
Would be handy in a lot of cases to trigger republishes on all destinations for all files in the index list. Or even a button on each list item in the index that publishes that file to all it's destinations with an optional dropdown to select an individual destination to publish.
Hey all, great project. I was following the Web Application Google Drive instructions here and received the following error after attempting to authenticate with my Google account:
Puma caught this error: undefined method `join' for #<String:0x007f5fc83d2e10> (NoMethodError)
I'm on Ubuntu 14.04 and have Ruby 2.2.1 installed with rbenv.
After searching for this error online, I discovered this discussion in the Sinatra repo: sinatra/sinatra#951. Apparently, Sinatra 1.4.5 (the version driveshaft is built on) has some issues with updated versions of Rack. I bumped Sinatra to 1.4.6 and attempted to authenticate again which gave me a NoMethodError
at https://github.com/newsdev/driveshaft/blob/develop/lib/driveshaft/auth.rb#L130
NoMethodError at /auth/callback undefined method `first' for nil:NilClass
I'll keep diagnosing but I'm curious if y'all have any ideas. Any guidance would be great. Thanks! I look forward to using this project regularly!
Thanks for (what I hope is) a great project. I am having some troubles just getting some basics running.
I can get the application running locally, but unless the spreadsheet is viewable to the world, all I get is an { }
empty object when I go to [id]/download
.
For instance, the demo spreadsheet works:
http://localhost:9292/16NZKPy_kyWb_c0jBLo_sTvyoGUrs-ISG7uMDHBMgM5U/download?
But, a test one that is not viewable to the world just gives me back the empty object:
http://localhost:9292/1Pg6ycnWBBUcyb1XaoZttVLffXL40LjSkdZSAclTc3-o/download?
A little debugging, looks like Google is saying the file is not found, which I think its a proxy for permissions issues, but the documentation is not super clear on how that's supposed to work (and Google's API console changes daily).
I have set up a a Google API project and given access to Drive and Google+ and created two credentials, one for GOOGLE_APICLIENT_KEY
and the other for GOOGLE_APICLIENT_SERVICEACCOUNT
and these are set as environment variables.
I don't know Ruby or Sinatra very well, so maybe I just need to find a way to get a bit more debugging information.
Thanks!
At the moment, Driveshaft lets you specify a Google Spreadsheet that lists other Drive files to use as an index page, which can work for an organization that keeps a shared collection of files. But because it's asynchronous (it needs to be published to S3), and has to be manually entered, it's less useful for individuals.
An alternative might be to render a user's available drive files on the index page? Rendering the contents of a shared folder might also be useful, and might even be more relevant for an organization than the current setup.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.