Week 3 - Day 12

July 18, 2017 14:29 UTC Team berlin diamonds (Discourse) [2017]Subscribe to this teams's activities

We have ready the first version of our Discourse backups to Google Drive plugin, yay! The instructions for its usage are in the readme of the repository:
Discourse googledrive backups plugin

Today we've:

  • Learnt how to use opendiff to solve conflicts in github (git mergetool)
  • We discovered that the 'google_drive gem' was reading the full json hash with the credentials as if it was a (veeeery long) path. It raised the error "Errno::ENAMETOOLONG".

We didn't want to include a path to a file (this would mean forcing the user to put the json file into the Plugin structure manually). The idea was to let the user copy&paste its json-formatted credentials provided by google into the UI of the plugin settings and connect like that to Drive.

Luckily, this gem also gives the option to pass an IO object to create a session. We converted the json-alike string into one and connected to Drive successfully: session = GoogleDrive::Session.fromserviceaccountkey(StringIO.new(SiteSetting.discoursebackupstodriveapikey))


You must be logged in to add a comment.