Merge branch 'master' into rkh-metrics
This commit is contained in:
commit
9e428ea00e
3
Gemfile
3
Gemfile
|
@ -9,9 +9,6 @@ gem 'travis-sidekiqs', github: 'travis-ci/travis-sidekiqs', require: nil, ref: '
|
||||||
gem 'sinatra' #github: 'sinatra/sinatra'
|
gem 'sinatra' #github: 'sinatra/sinatra'
|
||||||
gem 'sinatra-contrib', require: nil #github: 'sinatra/sinatra-contrib', require: nil
|
gem 'sinatra-contrib', require: nil #github: 'sinatra/sinatra-contrib', require: nil
|
||||||
|
|
||||||
# TODO need to release the gem as soon i'm certain this change makes sense
|
|
||||||
gem 'simple_states', github: 'svenfuchs/simple_states', branch: 'sf-set-state-early'
|
|
||||||
|
|
||||||
gem 'puma', '1.6.3'
|
gem 'puma', '1.6.3'
|
||||||
gem "sentry-raven", github: 'getsentry/raven-ruby'
|
gem "sentry-raven", github: 'getsentry/raven-ruby'
|
||||||
gem 'yard-sinatra', github: 'rkh/yard-sinatra'
|
gem 'yard-sinatra', github: 'rkh/yard-sinatra'
|
||||||
|
|
23
Gemfile.lock
23
Gemfile.lock
|
@ -34,15 +34,6 @@ GIT
|
||||||
yard-sinatra (1.0.0)
|
yard-sinatra (1.0.0)
|
||||||
yard (~> 0.7)
|
yard (~> 0.7)
|
||||||
|
|
||||||
GIT
|
|
||||||
remote: git://github.com/svenfuchs/simple_states.git
|
|
||||||
revision: b1d45144e6a758220d7b21f83b08dc92de0d3196
|
|
||||||
branch: sf-set-state-early
|
|
||||||
specs:
|
|
||||||
simple_states (0.1.1)
|
|
||||||
activesupport
|
|
||||||
hashr (~> 0.0.10)
|
|
||||||
|
|
||||||
GIT
|
GIT
|
||||||
remote: git://github.com/travis-ci/octopus.git
|
remote: git://github.com/travis-ci/octopus.git
|
||||||
revision: 2d4cca475479516f47c3144971205f50c335ad35
|
revision: 2d4cca475479516f47c3144971205f50c335ad35
|
||||||
|
@ -53,7 +44,7 @@ GIT
|
||||||
|
|
||||||
GIT
|
GIT
|
||||||
remote: git://github.com/travis-ci/travis-core.git
|
remote: git://github.com/travis-ci/travis-core.git
|
||||||
revision: 475973f29cd817bacec61db17a903730f4f07c51
|
revision: 828858bb78f104960663e267d07f0fc93d94fd0a
|
||||||
specs:
|
specs:
|
||||||
travis-core (0.0.1)
|
travis-core (0.0.1)
|
||||||
actionmailer (~> 3.2.12)
|
actionmailer (~> 3.2.12)
|
||||||
|
@ -69,7 +60,7 @@ GIT
|
||||||
rake
|
rake
|
||||||
redis (~> 3.0)
|
redis (~> 3.0)
|
||||||
rollout (~> 1.1.0)
|
rollout (~> 1.1.0)
|
||||||
simple_states (~> 0.1.1)
|
simple_states (~> 1.0.0)
|
||||||
thor (~> 0.14.6)
|
thor (~> 0.14.6)
|
||||||
|
|
||||||
GIT
|
GIT
|
||||||
|
@ -169,7 +160,7 @@ GEM
|
||||||
thor (>= 0.13.6)
|
thor (>= 0.13.6)
|
||||||
hashie (2.0.5)
|
hashie (2.0.5)
|
||||||
hashr (0.0.22)
|
hashr (0.0.22)
|
||||||
hike (1.2.2)
|
hike (1.2.3)
|
||||||
hitimes (1.2.1)
|
hitimes (1.2.1)
|
||||||
i18n (0.6.1)
|
i18n (0.6.1)
|
||||||
journey (1.0.4)
|
journey (1.0.4)
|
||||||
|
@ -190,7 +181,7 @@ GEM
|
||||||
mime-types (1.23)
|
mime-types (1.23)
|
||||||
mocha (0.14.0)
|
mocha (0.14.0)
|
||||||
metaclass (~> 0.0.1)
|
metaclass (~> 0.0.1)
|
||||||
multi_json (1.7.3)
|
multi_json (1.7.6)
|
||||||
multipart-post (1.2.0)
|
multipart-post (1.2.0)
|
||||||
net-http-persistent (2.8)
|
net-http-persistent (2.8)
|
||||||
net-http-pipeline (1.0.1)
|
net-http-pipeline (1.0.1)
|
||||||
|
@ -252,6 +243,9 @@ GEM
|
||||||
redis (~> 3)
|
redis (~> 3)
|
||||||
redis-namespace
|
redis-namespace
|
||||||
signature (0.1.7)
|
signature (0.1.7)
|
||||||
|
simple_states (1.0.0)
|
||||||
|
activesupport
|
||||||
|
hashr (~> 0.0.10)
|
||||||
sinatra (1.3.6)
|
sinatra (1.3.6)
|
||||||
rack (~> 1.4)
|
rack (~> 1.4)
|
||||||
rack-protection (~> 1.3)
|
rack-protection (~> 1.3)
|
||||||
|
@ -276,7 +270,7 @@ GEM
|
||||||
thor (0.14.6)
|
thor (0.14.6)
|
||||||
tilt (1.4.1)
|
tilt (1.4.1)
|
||||||
timers (1.1.0)
|
timers (1.1.0)
|
||||||
treetop (1.4.12)
|
treetop (1.4.14)
|
||||||
polyglot
|
polyglot
|
||||||
polyglot (>= 0.3.1)
|
polyglot (>= 0.3.1)
|
||||||
tzinfo (0.3.37)
|
tzinfo (0.3.37)
|
||||||
|
@ -306,7 +300,6 @@ DEPENDENCIES
|
||||||
rerun
|
rerun
|
||||||
rspec (~> 2.11)
|
rspec (~> 2.11)
|
||||||
sentry-raven!
|
sentry-raven!
|
||||||
simple_states!
|
|
||||||
sinatra
|
sinatra
|
||||||
sinatra-contrib
|
sinatra-contrib
|
||||||
travis-api!
|
travis-api!
|
||||||
|
|
31
lib/tasks/encyrpt_all_data.rake
Normal file
31
lib/tasks/encyrpt_all_data.rake
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
namespace :db do
|
||||||
|
task :encrypt_all_columns do
|
||||||
|
require 'travis'
|
||||||
|
Travis::Database.connect
|
||||||
|
|
||||||
|
to_encrypt = {
|
||||||
|
Request => [:token],
|
||||||
|
SslKey => [:private_key],
|
||||||
|
Token => [:token],
|
||||||
|
User => [:github_oauth_token]
|
||||||
|
}
|
||||||
|
|
||||||
|
encrypted_column = Travis::Model::EncryptedColumn.new
|
||||||
|
to_encrypt.each do |model, column_names|
|
||||||
|
model.find_in_batches do |records|
|
||||||
|
ActiveRecord::Base.transaction do
|
||||||
|
records.each do |record|
|
||||||
|
column_names.each do |column|
|
||||||
|
puts "Encrypting #{model}##{column} (id: #{record.id})"
|
||||||
|
|
||||||
|
data = record.send(column)
|
||||||
|
if encrypted_column.encrypt?(data)
|
||||||
|
record.update_column(column, encrypted_column.encrypt(data))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in New Issue
Block a user