I hereby claim:
- I am jmileham on github.
- I am jmileham (https://keybase.io/jmileham) on keybase.
- I have a public key ASCRcZUF4rFbb0eb18iYtveFXV7ivmA3xqEJIojw2u3eYwo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
// Inspired by Kendall Buchanan, (https://github.com/kendagriff) | |
// Rewritten for hash URLs by John Mileham | |
// MIT licence | |
// Version 0.0.1 | |
(function() { | |
var originalLoadUrl = Backbone.History.prototype.loadUrl; |
class MyModel < ActiveRecord::Base | |
has_attached_file :foo, hash_secret: "SomeSufficientlyRandomSecret", :path => ":hash.:extension" | |
end |
# You'll need to pregenerate a keyring with your pubkey in it and add to your repo. | |
# GPG does this automatically when you import keys to a non-existant keyring file. | |
module Paperclip | |
class Encrypt < Processor | |
def make | |
raise ArgumentError.new("no :encrypt_to address provided. (#{@options.inspect})") unless @options[:encrypt_to] | |
Tempfile.new(['attachment','.pgp']).tap do |outfile| | |
Paperclip.run('gpg', '--batch --always-trust --keyring :keyring --no-default-keyring -o :out -r :recipient -e :in', :in => @file.path, :out => outfile.path, :recipient => @options[:encrypt_to], :keyring => PATH_TO_MY_KEYRING) |