upgrade to Rails 3.2.3
This commit is contained in:
parent
4d58940e51
commit
ab2e740ca2
21 changed files with 139 additions and 467 deletions
11
Gemfile
11
Gemfile
|
|
@ -3,11 +3,12 @@ source 'http://rubygems.org'
|
||||||
gem 'bundler', '> 1.1.0'
|
gem 'bundler', '> 1.1.0'
|
||||||
ruby '1.9.3' if ENV['HEROKU']
|
ruby '1.9.3' if ENV['HEROKU']
|
||||||
|
|
||||||
gem 'rails', '3.1.4'
|
gem 'rails', '3.2.3'
|
||||||
gem 'rails_autolink'
|
|
||||||
gem 'foreman', '0.41'
|
gem 'foreman', '0.41'
|
||||||
gem 'whenever'
|
gem 'whenever'
|
||||||
|
|
||||||
|
gem 'rails_autolink'
|
||||||
gem 'thin', '~> 1.3.1', :require => false
|
gem 'thin', '~> 1.3.1', :require => false
|
||||||
|
|
||||||
# cross-origin resource sharing
|
# cross-origin resource sharing
|
||||||
|
|
@ -21,7 +22,7 @@ gem 'jwt'
|
||||||
gem 'oauth2-provider', '0.0.19'
|
gem 'oauth2-provider', '0.0.19'
|
||||||
gem 'remotipart', '~> 1.0'
|
gem 'remotipart', '~> 1.0'
|
||||||
|
|
||||||
gem 'omniauth', '1.0.1'
|
gem 'omniauth', '1.0.3'
|
||||||
gem 'omniauth-facebook'
|
gem 'omniauth-facebook'
|
||||||
gem 'omniauth-tumblr'
|
gem 'omniauth-tumblr'
|
||||||
gem 'omniauth-twitter'
|
gem 'omniauth-twitter'
|
||||||
|
|
@ -112,8 +113,8 @@ gem 'gon'
|
||||||
# assets
|
# assets
|
||||||
|
|
||||||
group :assets do
|
group :assets do
|
||||||
gem 'sass-rails', '3.1.4'
|
|
||||||
gem 'bootstrap-sass', '~> 2.0.2'
|
gem 'bootstrap-sass', '~> 2.0.2'
|
||||||
|
gem 'sass-rails', '3.2.5'
|
||||||
|
|
||||||
# Windows and OSX have an execjs compatible runtime built-in, Linux users should
|
# Windows and OSX have an execjs compatible runtime built-in, Linux users should
|
||||||
# install Node.js or use 'therubyracer'.
|
# install Node.js or use 'therubyracer'.
|
||||||
|
|
@ -186,8 +187,6 @@ group :development do
|
||||||
gem 'parallel_tests', :require => false
|
gem 'parallel_tests', :require => false
|
||||||
gem 'yard', :require => false
|
gem 'yard', :require => false
|
||||||
|
|
||||||
# rails 3.2 goodness
|
|
||||||
gem 'active_reload'
|
|
||||||
|
|
||||||
# for tracing AR object instantiation and memory usage per request
|
# for tracing AR object instantiation and memory usage per request
|
||||||
gem 'oink'
|
gem 'oink'
|
||||||
|
|
|
||||||
187
Gemfile.lock
187
Gemfile.lock
|
|
@ -15,9 +15,9 @@ GIT
|
||||||
|
|
||||||
GIT
|
GIT
|
||||||
remote: git://github.com/diaspora/diaspora-client.git
|
remote: git://github.com/diaspora/diaspora-client.git
|
||||||
revision: 99dd3728172834b01e2acae0604fe3865456d969
|
revision: 86bd398a60320e06d9b8f9c865955dfe2df851db
|
||||||
specs:
|
specs:
|
||||||
diaspora-client (0.1.2)
|
diaspora-client (0.1.3.1)
|
||||||
activerecord
|
activerecord
|
||||||
em-http-request
|
em-http-request
|
||||||
em-synchrony
|
em-synchrony
|
||||||
|
|
@ -29,10 +29,10 @@ GIT
|
||||||
|
|
||||||
GIT
|
GIT
|
||||||
remote: git://github.com/pivotal/jasmine-gem.git
|
remote: git://github.com/pivotal/jasmine-gem.git
|
||||||
revision: c72e8d248d49a1ebe53f31a09ac511194ad4edf1
|
revision: 1e075fbf5a69812fcc914c453f002ecf5bed38ab
|
||||||
specs:
|
specs:
|
||||||
jasmine (1.2.0.rc3)
|
jasmine (1.2.0)
|
||||||
jasmine-core (>= 1.2.0.rc3)
|
jasmine-core (>= 1.2.0)
|
||||||
rack (~> 1.0)
|
rack (~> 1.0)
|
||||||
rspec (>= 1.3.1)
|
rspec (>= 1.3.1)
|
||||||
selenium-webdriver (>= 0.1.3)
|
selenium-webdriver (>= 0.1.3)
|
||||||
|
|
@ -41,41 +41,39 @@ GEM
|
||||||
remote: http://rubygems.org/
|
remote: http://rubygems.org/
|
||||||
specs:
|
specs:
|
||||||
SystemTimer (1.2.3)
|
SystemTimer (1.2.3)
|
||||||
actionmailer (3.1.4)
|
actionmailer (3.2.3)
|
||||||
actionpack (= 3.1.4)
|
actionpack (= 3.2.3)
|
||||||
mail (~> 2.3.0)
|
mail (~> 2.4.4)
|
||||||
actionpack (3.1.4)
|
actionpack (3.2.3)
|
||||||
activemodel (= 3.1.4)
|
activemodel (= 3.2.3)
|
||||||
activesupport (= 3.1.4)
|
activesupport (= 3.2.3)
|
||||||
builder (~> 3.0.0)
|
builder (~> 3.0.0)
|
||||||
erubis (~> 2.7.0)
|
erubis (~> 2.7.0)
|
||||||
i18n (~> 0.6)
|
journey (~> 1.0.1)
|
||||||
rack (~> 1.3.6)
|
rack (~> 1.4.0)
|
||||||
rack-cache (~> 1.1)
|
rack-cache (~> 1.2)
|
||||||
rack-mount (~> 0.8.2)
|
|
||||||
rack-test (~> 0.6.1)
|
rack-test (~> 0.6.1)
|
||||||
sprockets (~> 2.0.3)
|
sprockets (~> 2.1.2)
|
||||||
active_reload (0.6.1)
|
activemodel (3.2.3)
|
||||||
activemodel (3.1.4)
|
activesupport (= 3.2.3)
|
||||||
activesupport (= 3.1.4)
|
|
||||||
builder (~> 3.0.0)
|
builder (~> 3.0.0)
|
||||||
i18n (~> 0.6)
|
activerecord (3.2.3)
|
||||||
activerecord (3.1.4)
|
activemodel (= 3.2.3)
|
||||||
activemodel (= 3.1.4)
|
activesupport (= 3.2.3)
|
||||||
activesupport (= 3.1.4)
|
arel (~> 3.0.2)
|
||||||
arel (~> 2.2.3)
|
|
||||||
tzinfo (~> 0.3.29)
|
tzinfo (~> 0.3.29)
|
||||||
activerecord-import (0.2.9)
|
activerecord-import (0.2.9)
|
||||||
activerecord (~> 3.0)
|
activerecord (~> 3.0)
|
||||||
activerecord (~> 3.0)
|
activerecord (~> 3.0)
|
||||||
activeresource (3.1.4)
|
activeresource (3.2.3)
|
||||||
activemodel (= 3.1.4)
|
activemodel (= 3.2.3)
|
||||||
activesupport (= 3.1.4)
|
activesupport (= 3.2.3)
|
||||||
activesupport (3.1.4)
|
activesupport (3.2.3)
|
||||||
|
i18n (~> 0.6)
|
||||||
multi_json (~> 1.0)
|
multi_json (~> 1.0)
|
||||||
acts-as-taggable-on (2.2.2)
|
acts-as-taggable-on (2.2.2)
|
||||||
rails (~> 3.0)
|
rails (~> 3.0)
|
||||||
acts_as_api (0.3.11)
|
acts_as_api (0.4)
|
||||||
activemodel (>= 3.0.0)
|
activemodel (>= 3.0.0)
|
||||||
activesupport (>= 3.0.0)
|
activesupport (>= 3.0.0)
|
||||||
rack (>= 1.1.0)
|
rack (>= 1.1.0)
|
||||||
|
|
@ -83,15 +81,15 @@ GEM
|
||||||
airbrake (3.0.9)
|
airbrake (3.0.9)
|
||||||
activesupport
|
activesupport
|
||||||
builder
|
builder
|
||||||
arel (2.2.3)
|
arel (3.0.2)
|
||||||
asset_sync (0.3.1)
|
asset_sync (0.4.1)
|
||||||
activemodel
|
activemodel
|
||||||
fog
|
fog
|
||||||
bbenezech-nested_form (0.0.6)
|
bbenezech-nested_form (0.0.6)
|
||||||
bcrypt-ruby (3.0.1)
|
bcrypt-ruby (3.0.1)
|
||||||
bootstrap-sass (2.0.3)
|
bootstrap-sass (2.0.3)
|
||||||
builder (3.0.0)
|
builder (3.0.0)
|
||||||
capistrano (2.9.0)
|
capistrano (2.12.0)
|
||||||
highline
|
highline
|
||||||
net-scp (>= 1.0.0)
|
net-scp (>= 1.0.0)
|
||||||
net-sftp (>= 2.0.0)
|
net-sftp (>= 2.0.0)
|
||||||
|
|
@ -114,9 +112,9 @@ GEM
|
||||||
ffi (~> 1.0.6)
|
ffi (~> 1.0.6)
|
||||||
chronic (0.6.7)
|
chronic (0.6.7)
|
||||||
client_side_validations (3.1.4)
|
client_side_validations (3.1.4)
|
||||||
coffee-rails (3.1.1)
|
coffee-rails (3.2.2)
|
||||||
coffee-script (>= 2.2.0)
|
coffee-script (>= 2.2.0)
|
||||||
railties (~> 3.1.0)
|
railties (~> 3.2.0)
|
||||||
coffee-script (2.2.0)
|
coffee-script (2.2.0)
|
||||||
coffee-script-source
|
coffee-script-source
|
||||||
execjs
|
execjs
|
||||||
|
|
@ -124,12 +122,11 @@ GEM
|
||||||
columnize (0.3.6)
|
columnize (0.3.6)
|
||||||
cookiejar (0.3.0)
|
cookiejar (0.3.0)
|
||||||
crack (0.3.1)
|
crack (0.3.1)
|
||||||
cucumber (1.1.9)
|
cucumber (1.2.0)
|
||||||
builder (>= 2.1.2)
|
builder (>= 2.1.2)
|
||||||
diff-lcs (>= 1.1.2)
|
diff-lcs (>= 1.1.3)
|
||||||
gherkin (~> 2.9.0)
|
gherkin (~> 2.10.0)
|
||||||
json (>= 1.4.6)
|
json (>= 1.4.6)
|
||||||
term-ansicolor (>= 1.0.6)
|
|
||||||
cucumber-rails (1.3.0)
|
cucumber-rails (1.3.0)
|
||||||
capybara (>= 1.1.2)
|
capybara (>= 1.1.2)
|
||||||
cucumber (>= 1.1.8)
|
cucumber (>= 1.1.8)
|
||||||
|
|
@ -154,13 +151,13 @@ GEM
|
||||||
em-socksify
|
em-socksify
|
||||||
eventmachine (>= 1.0.0.beta.4)
|
eventmachine (>= 1.0.0.beta.4)
|
||||||
http_parser.rb (>= 0.5.3)
|
http_parser.rb (>= 0.5.3)
|
||||||
em-socksify (0.1.0)
|
em-socksify (0.2.0)
|
||||||
eventmachine
|
eventmachine (>= 1.0.0.beta.4)
|
||||||
em-synchrony (1.0.0)
|
em-synchrony (1.0.0)
|
||||||
eventmachine (>= 1.0.0.beta.1)
|
eventmachine (>= 1.0.0.beta.1)
|
||||||
erubis (2.7.0)
|
erubis (2.7.0)
|
||||||
eventmachine (1.0.0.beta.4)
|
eventmachine (1.0.0.beta.4)
|
||||||
excon (0.13.2)
|
excon (0.13.4)
|
||||||
execjs (1.3.2)
|
execjs (1.3.2)
|
||||||
multi_json (~> 1.0)
|
multi_json (~> 1.0)
|
||||||
factory_girl (2.6.4)
|
factory_girl (2.6.4)
|
||||||
|
|
@ -190,7 +187,7 @@ GEM
|
||||||
net-ssh (>= 2.1.3)
|
net-ssh (>= 2.1.3)
|
||||||
nokogiri (~> 1.5.0)
|
nokogiri (~> 1.5.0)
|
||||||
ruby-hmac
|
ruby-hmac
|
||||||
foreigner (1.1.5)
|
foreigner (1.1.6)
|
||||||
activerecord (>= 3.0.0)
|
activerecord (>= 3.0.0)
|
||||||
foreman (0.41.0)
|
foreman (0.41.0)
|
||||||
thor (>= 0.13.6)
|
thor (>= 0.13.6)
|
||||||
|
|
@ -200,37 +197,41 @@ GEM
|
||||||
rspec-instafail (~> 0.2.0)
|
rspec-instafail (~> 0.2.0)
|
||||||
ruby-progressbar (~> 0.0.10)
|
ruby-progressbar (~> 0.0.10)
|
||||||
gem_plugin (0.2.3)
|
gem_plugin (0.2.3)
|
||||||
gherkin (2.9.3)
|
gherkin (2.10.0)
|
||||||
json (>= 1.4.6)
|
json (>= 1.4.6)
|
||||||
gon (3.0.2)
|
gon (3.0.2)
|
||||||
actionpack (>= 2.3.0)
|
actionpack (>= 2.3.0)
|
||||||
json
|
json
|
||||||
guard (1.0.1)
|
guard (1.0.3)
|
||||||
ffi (>= 0.5.0)
|
ffi (>= 0.5.0)
|
||||||
thor (~> 0.14.6)
|
thor (>= 0.14.6)
|
||||||
guard-cucumber (0.7.5)
|
guard-cucumber (0.8.0)
|
||||||
cucumber (>= 0.10)
|
cucumber (>= 1.2.0)
|
||||||
guard (>= 0.8.3)
|
guard (>= 0.8.3)
|
||||||
guard-rspec (0.7.0)
|
guard-rspec (0.7.2)
|
||||||
guard (>= 0.10.0)
|
guard (>= 0.10.0)
|
||||||
guard-spork (0.5.2)
|
guard-spork (0.8.0)
|
||||||
guard (>= 0.10.0)
|
guard (>= 0.10.0)
|
||||||
spork (>= 0.8.4)
|
spork (>= 0.8.4)
|
||||||
haml (3.1.5)
|
haml (3.1.5)
|
||||||
handlebars_assets (0.4.1)
|
handlebars_assets (0.4.4)
|
||||||
execjs (>= 1.2.9)
|
execjs (>= 1.2.9)
|
||||||
sprockets (>= 2.0.3)
|
sprockets (>= 2.0.3)
|
||||||
tilt
|
tilt
|
||||||
hashie (1.2.0)
|
hashie (1.2.0)
|
||||||
heroku (2.23.0)
|
heroku (2.25.0)
|
||||||
launchy (>= 0.3.2)
|
launchy (>= 0.3.2)
|
||||||
netrc (~> 0.7.1)
|
netrc (~> 0.7.1)
|
||||||
rest-client (~> 1.6.1)
|
rest-client (~> 1.6.1)
|
||||||
rubyzip
|
rubyzip
|
||||||
heroku_san (2.1.1)
|
heroku-api (0.1.6)
|
||||||
|
excon (~> 0.13.3)
|
||||||
|
heroku_san (3.0.0)
|
||||||
|
activesupport
|
||||||
heroku (>= 2)
|
heroku (>= 2)
|
||||||
|
heroku-api (>= 0.1.2)
|
||||||
rake
|
rake
|
||||||
highline (1.6.11)
|
highline (1.6.12)
|
||||||
hike (1.2.1)
|
hike (1.2.1)
|
||||||
hodel_3000_compliant_logger (0.1.0)
|
hodel_3000_compliant_logger (0.1.0)
|
||||||
hpricot (0.8.6)
|
hpricot (0.8.6)
|
||||||
|
|
@ -243,9 +244,10 @@ GEM
|
||||||
actionpack (~> 3.0)
|
actionpack (~> 3.0)
|
||||||
i18n-inflector (~> 2.6)
|
i18n-inflector (~> 2.6)
|
||||||
railties (~> 3.0)
|
railties (~> 3.0)
|
||||||
jasmine-core (1.2.0.rc3)
|
jasmine-core (1.2.0)
|
||||||
jquery-rails (1.0.19)
|
journey (1.0.3)
|
||||||
railties (~> 3.0)
|
jquery-rails (2.0.2)
|
||||||
|
railties (>= 3.2.0, < 5.0)
|
||||||
thor (~> 0.14)
|
thor (~> 0.14)
|
||||||
jquery-ui-rails (0.2.2)
|
jquery-ui-rails (0.2.2)
|
||||||
jquery-rails
|
jquery-rails
|
||||||
|
|
@ -263,7 +265,7 @@ GEM
|
||||||
addressable
|
addressable
|
||||||
linecache (0.46)
|
linecache (0.46)
|
||||||
rbx-require-relative (> 0.0.4)
|
rbx-require-relative (> 0.0.4)
|
||||||
mail (2.3.3)
|
mail (2.4.4)
|
||||||
i18n (>= 0.4.0)
|
i18n (>= 0.4.0)
|
||||||
mime-types (~> 1.16)
|
mime-types (~> 1.16)
|
||||||
treetop (~> 1.4.8)
|
treetop (~> 1.4.8)
|
||||||
|
|
@ -273,7 +275,7 @@ GEM
|
||||||
mime-types (1.18)
|
mime-types (1.18)
|
||||||
mini_magick (3.4)
|
mini_magick (3.4)
|
||||||
subexec (~> 0.2.1)
|
subexec (~> 0.2.1)
|
||||||
mobile-fu (1.0.0)
|
mobile-fu (1.1.0)
|
||||||
rack-mobile-detect
|
rack-mobile-detect
|
||||||
rails
|
rails
|
||||||
mock_redis (0.4.1)
|
mock_redis (0.4.1)
|
||||||
|
|
@ -293,9 +295,9 @@ GEM
|
||||||
net-ssh-gateway (1.1.0)
|
net-ssh-gateway (1.1.0)
|
||||||
net-ssh (>= 1.99.1)
|
net-ssh (>= 1.99.1)
|
||||||
netrc (0.7.1)
|
netrc (0.7.1)
|
||||||
newrelic_rpm (3.3.2.1)
|
newrelic_rpm (3.3.4.1)
|
||||||
nokogiri (1.5.2)
|
nokogiri (1.5.2)
|
||||||
oauth (0.4.5)
|
oauth (0.4.6)
|
||||||
oauth2 (0.5.0)
|
oauth2 (0.5.0)
|
||||||
faraday (>= 0.6.1, < 0.8)
|
faraday (>= 0.6.1, < 0.8)
|
||||||
multi_json (~> 1.0.0)
|
multi_json (~> 1.0.0)
|
||||||
|
|
@ -305,7 +307,7 @@ GEM
|
||||||
oink (0.9.3)
|
oink (0.9.3)
|
||||||
activerecord
|
activerecord
|
||||||
hodel_3000_compliant_logger
|
hodel_3000_compliant_logger
|
||||||
omniauth (1.0.1)
|
omniauth (1.0.3)
|
||||||
hashie (~> 1.2)
|
hashie (~> 1.2)
|
||||||
rack
|
rack
|
||||||
omniauth-facebook (1.2.0)
|
omniauth-facebook (1.2.0)
|
||||||
|
|
@ -318,24 +320,22 @@ GEM
|
||||||
omniauth (~> 1.0)
|
omniauth (~> 1.0)
|
||||||
omniauth-tumblr (1.0)
|
omniauth-tumblr (1.0)
|
||||||
omniauth-oauth (~> 1.0)
|
omniauth-oauth (~> 1.0)
|
||||||
omniauth-twitter (0.0.8)
|
omniauth-twitter (0.0.9)
|
||||||
omniauth-oauth (~> 1.0)
|
omniauth-oauth (~> 1.0)
|
||||||
orm_adapter (0.0.7)
|
orm_adapter (0.0.7)
|
||||||
parallel (0.5.16)
|
parallel (0.5.16)
|
||||||
parallel_tests (0.7.2)
|
parallel_tests (0.8.1)
|
||||||
parallel
|
parallel
|
||||||
pg (0.13.2)
|
pg (0.13.2)
|
||||||
polyglot (0.3.3)
|
polyglot (0.3.3)
|
||||||
rack (1.3.6)
|
rack (1.4.1)
|
||||||
rack-cache (1.2)
|
rack-cache (1.2)
|
||||||
rack (>= 0.4)
|
rack (>= 0.4)
|
||||||
rack-cors (0.2.4)
|
rack-cors (0.2.6)
|
||||||
rack
|
rack
|
||||||
rack-fiber_pool (0.9.2)
|
rack-fiber_pool (0.9.2)
|
||||||
rack-mobile-detect (0.3.0)
|
rack-mobile-detect (0.3.0)
|
||||||
rack
|
rack
|
||||||
rack-mount (0.8.3)
|
|
||||||
rack (>= 1.0.0)
|
|
||||||
rack-piwik (0.1.2)
|
rack-piwik (0.1.2)
|
||||||
rack-pjax (0.5.9)
|
rack-pjax (0.5.9)
|
||||||
hpricot (~> 0.8.6)
|
hpricot (~> 0.8.6)
|
||||||
|
|
@ -347,14 +347,14 @@ GEM
|
||||||
rack
|
rack
|
||||||
rack-test (0.6.1)
|
rack-test (0.6.1)
|
||||||
rack (>= 1.0)
|
rack (>= 1.0)
|
||||||
rails (3.1.4)
|
rails (3.2.3)
|
||||||
actionmailer (= 3.1.4)
|
actionmailer (= 3.2.3)
|
||||||
actionpack (= 3.1.4)
|
actionpack (= 3.2.3)
|
||||||
activerecord (= 3.1.4)
|
activerecord (= 3.2.3)
|
||||||
activeresource (= 3.1.4)
|
activeresource (= 3.2.3)
|
||||||
activesupport (= 3.1.4)
|
activesupport (= 3.2.3)
|
||||||
bundler (~> 1.0)
|
bundler (~> 1.0)
|
||||||
railties (= 3.1.4)
|
railties (= 3.2.3)
|
||||||
rails-i18n (0.6.3)
|
rails-i18n (0.6.3)
|
||||||
i18n (~> 0.5)
|
i18n (~> 0.5)
|
||||||
rails_admin (0.0.3)
|
rails_admin (0.0.3)
|
||||||
|
|
@ -370,16 +370,16 @@ GEM
|
||||||
rails (~> 3.1)
|
rails (~> 3.1)
|
||||||
remotipart (~> 1.0)
|
remotipart (~> 1.0)
|
||||||
sass-rails (~> 3.1)
|
sass-rails (~> 3.1)
|
||||||
rails_autolink (1.0.6)
|
rails_autolink (1.0.7)
|
||||||
rails (~> 3.1)
|
rails (~> 3.1)
|
||||||
railties (3.1.4)
|
railties (3.2.3)
|
||||||
actionpack (= 3.1.4)
|
actionpack (= 3.2.3)
|
||||||
activesupport (= 3.1.4)
|
activesupport (= 3.2.3)
|
||||||
rack-ssl (~> 1.3.2)
|
rack-ssl (~> 1.3.2)
|
||||||
rake (>= 0.8.7)
|
rake (>= 0.8.7)
|
||||||
rdoc (~> 3.4)
|
rdoc (~> 3.4)
|
||||||
thor (~> 0.14.6)
|
thor (~> 0.14.6)
|
||||||
raindrops (0.8.0)
|
raindrops (0.8.1)
|
||||||
rake (0.9.2.2)
|
rake (0.9.2.2)
|
||||||
rbx-require-relative (0.0.9)
|
rbx-require-relative (0.0.9)
|
||||||
rdoc (3.12)
|
rdoc (3.12)
|
||||||
|
|
@ -398,7 +398,7 @@ GEM
|
||||||
resque (~> 1.0)
|
resque (~> 1.0)
|
||||||
rest-client (1.6.7)
|
rest-client (1.6.7)
|
||||||
mime-types (>= 1.16)
|
mime-types (>= 1.16)
|
||||||
rpm_contrib (2.1.8)
|
rpm_contrib (2.1.9)
|
||||||
newrelic_rpm (>= 3.1.1)
|
newrelic_rpm (>= 3.1.1)
|
||||||
newrelic_rpm (>= 3.1.1)
|
newrelic_rpm (>= 3.1.1)
|
||||||
rspec (2.9.0)
|
rspec (2.9.0)
|
||||||
|
|
@ -425,31 +425,37 @@ GEM
|
||||||
ruby-progressbar (0.0.10)
|
ruby-progressbar (0.0.10)
|
||||||
rubyzip (0.9.8)
|
rubyzip (0.9.8)
|
||||||
sass (3.1.18)
|
sass (3.1.18)
|
||||||
|
<<<<<<< HEAD
|
||||||
sass-rails (3.1.4)
|
sass-rails (3.1.4)
|
||||||
actionpack (~> 3.1.0)
|
actionpack (~> 3.1.0)
|
||||||
railties (~> 3.1.0)
|
railties (~> 3.1.0)
|
||||||
sass (>= 3.1.4)
|
sass (>= 3.1.4)
|
||||||
sprockets (~> 2.0.0)
|
sprockets (~> 2.0.0)
|
||||||
tilt (~> 1.3.2)
|
tilt (~> 1.3.2)
|
||||||
|
=======
|
||||||
|
sass-rails (3.2.5)
|
||||||
|
railties (~> 3.2.0)
|
||||||
|
sass (>= 3.1.10)
|
||||||
|
tilt (~> 1.3)
|
||||||
|
>>>>>>> upgrade to Rails 3.2.3
|
||||||
selenium-webdriver (2.22.0.rc1)
|
selenium-webdriver (2.22.0.rc1)
|
||||||
childprocess (>= 0.2.5)
|
childprocess (>= 0.2.5)
|
||||||
ffi (~> 1.0)
|
ffi (~> 1.0)
|
||||||
libwebsocket (~> 0.1.3)
|
libwebsocket (~> 0.1.3)
|
||||||
multi_json (~> 1.0)
|
multi_json (~> 1.0)
|
||||||
rubyzip
|
rubyzip
|
||||||
simple_oauth (0.1.5)
|
simple_oauth (0.1.8)
|
||||||
sinatra (1.3.2)
|
sinatra (1.3.2)
|
||||||
rack (~> 1.3, >= 1.3.6)
|
rack (~> 1.3, >= 1.3.6)
|
||||||
rack-protection (~> 1.2)
|
rack-protection (~> 1.2)
|
||||||
tilt (~> 1.3, >= 1.3.3)
|
tilt (~> 1.3, >= 1.3.3)
|
||||||
spork (1.0.0rc2)
|
spork (1.0.0rc2)
|
||||||
sprockets (2.0.4)
|
sprockets (2.1.3)
|
||||||
hike (~> 1.2)
|
hike (~> 1.2)
|
||||||
rack (~> 1.0)
|
rack (~> 1.0)
|
||||||
tilt (~> 1.1, != 1.3.0)
|
tilt (~> 1.1, != 1.3.0)
|
||||||
sqlite3 (1.3.5)
|
sqlite3 (1.3.6)
|
||||||
subexec (0.2.1)
|
subexec (0.2.2)
|
||||||
term-ansicolor (1.0.7)
|
|
||||||
thin (1.3.1)
|
thin (1.3.1)
|
||||||
daemons (>= 1.0.9)
|
daemons (>= 1.0.9)
|
||||||
eventmachine (>= 0.12.6)
|
eventmachine (>= 0.12.6)
|
||||||
|
|
@ -477,7 +483,7 @@ GEM
|
||||||
raindrops (~> 0.7)
|
raindrops (~> 0.7)
|
||||||
vegas (0.1.11)
|
vegas (0.1.11)
|
||||||
rack (>= 1.0.0)
|
rack (>= 1.0.0)
|
||||||
warden (1.1.1)
|
warden (1.2.0)
|
||||||
rack (>= 1.0)
|
rack (>= 1.0)
|
||||||
webmock (1.6.2)
|
webmock (1.6.2)
|
||||||
addressable (>= 2.2.2)
|
addressable (>= 2.2.2)
|
||||||
|
|
@ -488,14 +494,13 @@ GEM
|
||||||
will_paginate (3.0.3)
|
will_paginate (3.0.3)
|
||||||
xpath (0.1.4)
|
xpath (0.1.4)
|
||||||
nokogiri (~> 1.3)
|
nokogiri (~> 1.3)
|
||||||
yard (0.7.5)
|
yard (0.8.1)
|
||||||
|
|
||||||
PLATFORMS
|
PLATFORMS
|
||||||
ruby
|
ruby
|
||||||
|
|
||||||
DEPENDENCIES
|
DEPENDENCIES
|
||||||
SystemTimer (= 1.2.3)
|
SystemTimer (= 1.2.3)
|
||||||
active_reload
|
|
||||||
activerecord-import (~> 0.2.9)
|
activerecord-import (~> 0.2.9)
|
||||||
acts-as-taggable-on (~> 2.2.2)
|
acts-as-taggable-on (~> 2.2.2)
|
||||||
acts_as_api
|
acts_as_api
|
||||||
|
|
@ -551,7 +556,7 @@ DEPENDENCIES
|
||||||
nokogiri (= 1.5.2)
|
nokogiri (= 1.5.2)
|
||||||
oauth2-provider (= 0.0.19)
|
oauth2-provider (= 0.0.19)
|
||||||
oink
|
oink
|
||||||
omniauth (= 1.0.1)
|
omniauth (= 1.0.3)
|
||||||
omniauth-facebook
|
omniauth-facebook
|
||||||
omniauth-tumblr
|
omniauth-tumblr
|
||||||
omniauth-twitter
|
omniauth-twitter
|
||||||
|
|
@ -561,7 +566,7 @@ DEPENDENCIES
|
||||||
rack-piwik
|
rack-piwik
|
||||||
rack-rewrite (~> 1.2.1)
|
rack-rewrite (~> 1.2.1)
|
||||||
rack-ssl
|
rack-ssl
|
||||||
rails (= 3.1.4)
|
rails (= 3.2.3)
|
||||||
rails-i18n
|
rails-i18n
|
||||||
rails_admin (~> 0.0.3)
|
rails_admin (~> 0.0.3)
|
||||||
rails_autolink
|
rails_autolink
|
||||||
|
|
@ -578,7 +583,7 @@ DEPENDENCIES
|
||||||
rspec-rails (~> 2.9.0)
|
rspec-rails (~> 2.9.0)
|
||||||
ruby-debug
|
ruby-debug
|
||||||
ruby-oembed (~> 0.8.7)
|
ruby-oembed (~> 0.8.7)
|
||||||
sass-rails (= 3.1.4)
|
sass-rails (= 3.2.5)
|
||||||
selenium-webdriver (= 2.22.0.rc1)
|
selenium-webdriver (= 2.22.0.rc1)
|
||||||
settingslogic!
|
settingslogic!
|
||||||
spork (~> 1.0rc2)
|
spork (~> 1.0rc2)
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ class NotificationsController < ApplicationController
|
||||||
pager.replace(result)
|
pager.replace(result)
|
||||||
end
|
end
|
||||||
@notifications.each do |n|
|
@notifications.each do |n|
|
||||||
n[:note_html] = render_to_string( :partial => 'notify_popup_item', :locals => { :n => n } )
|
n.note_html = render_to_string( :partial => 'notify_popup_item', :locals => { :n => n } )
|
||||||
end
|
end
|
||||||
@group_days = @notifications.group_by{|note| I18n.l(note.created_at, :format => I18n.t('date.formats.fullmonth_day')) }
|
@group_days = @notifications.group_by{|note| I18n.l(note.created_at, :format => I18n.t('date.formats.fullmonth_day')) }
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -77,9 +77,9 @@ class PostsController < ApplicationController
|
||||||
current_user.retract(@post)
|
current_user.retract(@post)
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.js { render 'destroy' }
|
format.js { render 'destroy',:layout => false, :format => :js }
|
||||||
format.json { render :nothing => true, :status => 204 }
|
format.json { render :nothing => true, :status => 204 }
|
||||||
format.all { redirect_to stream_path }
|
format.any { redirect_to stream_path }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,8 @@ class Notification < ActiveRecord::Base
|
||||||
has_many :actors, :class_name => 'Person', :through => :notification_actors, :source => :person
|
has_many :actors, :class_name => 'Person', :through => :notification_actors, :source => :person
|
||||||
belongs_to :target, :polymorphic => true
|
belongs_to :target, :polymorphic => true
|
||||||
|
|
||||||
|
attr_accessor :note_html
|
||||||
|
|
||||||
def self.for(recipient, opts={})
|
def self.for(recipient, opts={})
|
||||||
self.where(opts.merge!(:recipient_id => recipient.id)).order('updated_at desc')
|
self.where(opts.merge!(:recipient_id => recipient.id)).order('updated_at desc')
|
||||||
end
|
end
|
||||||
|
|
@ -33,6 +35,10 @@ class Notification < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def as_json(opts={})
|
||||||
|
super(opts.merge(:methods => :note_html))
|
||||||
|
end
|
||||||
|
|
||||||
def email_the_user(target, actor)
|
def email_the_user(target, actor)
|
||||||
self.recipient.mail(self.mail_job, self.recipient_id, actor.id, target.id)
|
self.recipient.mail(self.mail_job, self.recipient_id, actor.id, target.id)
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -61,6 +61,7 @@ class Post < ActiveRecord::Base
|
||||||
self.class.name
|
self.class.name
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def root; end
|
||||||
def raw_message; ""; end
|
def raw_message; ""; end
|
||||||
def mentioned_people; []; end
|
def mentioned_people; []; end
|
||||||
def photos; []; end
|
def photos; []; end
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
.span-24
|
.span-24
|
||||||
= render :partial => 'admins/admin_bar.haml'
|
= render :partial => 'admins/admin_bar'
|
||||||
%br
|
%br
|
||||||
%br
|
%br
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
|
|
||||||
.span-24
|
.span-24
|
||||||
= render :partial => 'admins/admin_bar.haml'
|
= render :partial => 'admins/admin_bar'
|
||||||
%br
|
%br
|
||||||
%br
|
%br
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
|
|
||||||
.span-24
|
.span-24
|
||||||
= render :partial => 'admins/admin_bar.haml'
|
= render :partial => 'admins/admin_bar'
|
||||||
.span-24.prepend-4
|
.span-24.prepend-4
|
||||||
|
|
||||||
%h3
|
%h3
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
|
|
||||||
.span-24
|
.span-24
|
||||||
= render :partial => 'admins/admin_bar.haml'
|
= render :partial => 'admins/admin_bar'
|
||||||
%br
|
%br
|
||||||
%br
|
%br
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,4 +3,4 @@
|
||||||
-# the COPYRIGHT file.
|
-# the COPYRIGHT file.
|
||||||
|
|
||||||
|
|
||||||
=render :partial => 'home/show' rescue "put something in app/views/home/_show.html.haml"
|
=render :partial => 'home/show' rescue "put something in app/views/home/_show.html"
|
||||||
|
|
|
||||||
|
|
@ -9,5 +9,5 @@
|
||||||
<Link rel='http://webfinger.net/rel/profile-page' type='text/html' <%=person_href(@person, :absolute => true)%>/>
|
<Link rel='http://webfinger.net/rel/profile-page' type='text/html' <%=person_href(@person, :absolute => true)%>/>
|
||||||
<Link rel="http://schemas.google.com/g/2010#updates-from" type="application/atom+xml" href="<%=@person.public_url%>.atom"/>
|
<Link rel="http://schemas.google.com/g/2010#updates-from" type="application/atom+xml" href="<%=@person.public_url%>.atom"/>
|
||||||
|
|
||||||
<Link rel="diaspora-public-key" type = 'RSA' href="<%=Base64.encode64s(@person.exported_key)%>"/>
|
<Link rel="diaspora-public-key" type = 'RSA' href="<%=Base64.strict_encode64(@person.exported_key)%>"/>
|
||||||
</XRD>
|
</XRD>
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,17 @@ Diaspora::Application.configure do
|
||||||
# Don't care if the mailer can't send
|
# Don't care if the mailer can't send
|
||||||
config.action_mailer.raise_delivery_errors = false
|
config.action_mailer.raise_delivery_errors = false
|
||||||
config.active_support.deprecation = [:stderr, :log]
|
config.active_support.deprecation = [:stderr, :log]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# Raise exception on mass assignment protection for Active Record models
|
||||||
|
config.active_record.mass_assignment_sanitizer = :strict
|
||||||
|
|
||||||
|
# Log the query plan for queries taking more than this (works
|
||||||
|
# with SQLite, MySQL, and PostgreSQL)
|
||||||
|
config.active_record.auto_explain_threshold_in_seconds = 0.5
|
||||||
#config.threadsafe!
|
#config.threadsafe!
|
||||||
|
|
||||||
# Monkeypatch around the nasty "2.5MB exception page" issue, caused by very large environment vars
|
# Monkeypatch around the nasty "2.5MB exception page" issue, caused by very large environment vars
|
||||||
# This snippet via: http://stackoverflow.com/questions/3114993/exception-pages-in-development-mode-take-upwards-of-15-30-seconds-to-render-why
|
# This snippet via: http://stackoverflow.com/questions/3114993/exception-pages-in-development-mode-take-upwards-of-15-30-seconds-to-render-why
|
||||||
# Relevant Rails ticket: https://rails.lighthouseapp.com/projects/8994/tickets/5027-_request_and_responseerb-and-diagnosticserb-take-an-increasingly-long-time-to-render-in-development-with-multiple-show-tables-calls
|
# Relevant Rails ticket: https://rails.lighthouseapp.com/projects/8994/tickets/5027-_request_and_responseerb-and-diagnosticserb-take-an-increasingly-long-time-to-render-in-development-with-multiple-show-tables-calls
|
||||||
|
|
@ -39,7 +49,7 @@ Diaspora::Application.configure do
|
||||||
"<#{self.class.name} - tooooo long>"
|
"<#{self.class.name} - tooooo long>"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
[ActionController::Base, ActionDispatch::RemoteIp::RemoteIpGetter, OmniAuth::Strategy, Warden::Proxy].each do |klazz|
|
[ActionController::Base, OmniAuth::Strategy, Warden::Proxy].each do |klazz|
|
||||||
klazz.send(:include, SmallInspect)
|
klazz.send(:include, SmallInspect)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,9 @@ Diaspora::Application.configure do
|
||||||
config.action_mailer.delivery_method = :test
|
config.action_mailer.delivery_method = :test
|
||||||
config.active_support.deprecation = :stderr
|
config.active_support.deprecation = :stderr
|
||||||
|
|
||||||
|
# config.active_record.mass_assignment_sanitizer = :strict
|
||||||
|
|
||||||
|
|
||||||
# Configure static asset server for tests with Cache-Control for performance
|
# Configure static asset server for tests with Cache-Control for performance
|
||||||
config.serve_static_assets = true
|
config.serve_static_assets = true
|
||||||
config.static_cache_control = "public, max-age=3600"
|
config.static_cache_control = "public, max-age=3600"
|
||||||
|
|
@ -37,8 +40,6 @@ Diaspora::Application.configure do
|
||||||
config.assets.enabled = true
|
config.assets.enabled = true
|
||||||
config.assets.debug = false
|
config.assets.debug = false
|
||||||
|
|
||||||
# Allow pass debug_assets=true as a query parameter to load pages with unpackaged assets
|
|
||||||
config.assets.allow_debugging = true
|
|
||||||
|
|
||||||
# fixes url helper issue in rspec
|
# fixes url helper issue in rspec
|
||||||
#config.threadsafe!
|
#config.threadsafe!
|
||||||
|
|
|
||||||
|
|
@ -2,16 +2,6 @@
|
||||||
# licensed under the Affero General Public License version 3 or later. See
|
# licensed under the Affero General Public License version 3 or later. See
|
||||||
# the COPYRIGHT file.
|
# the COPYRIGHT file.
|
||||||
|
|
||||||
require_dependency "rack/fixed_request"
|
|
||||||
OmniAuth.config.full_host = lambda do |env|
|
|
||||||
request_url = Rack::FixedRequest.new(env).url
|
|
||||||
# Copied from OmniAuth::Strategy#full_host (omniauth-0.2.6)
|
|
||||||
uri = URI.parse(request_url.gsub(/\?.*$/,''))
|
|
||||||
uri.path = ''
|
|
||||||
uri.query = nil
|
|
||||||
uri.to_s
|
|
||||||
end
|
|
||||||
|
|
||||||
Rails.application.config.middleware.use OmniAuth::Builder do
|
Rails.application.config.middleware.use OmniAuth::Builder do
|
||||||
if SERVICES['twitter'] && SERVICES['twitter']['consumer_key'] && SERVICES['twitter']['consumer_secret']
|
if SERVICES['twitter'] && SERVICES['twitter']['consumer_key'] && SERVICES['twitter']['consumer_secret']
|
||||||
provider :twitter, SERVICES['twitter']['consumer_key'], SERVICES['twitter']['consumer_secret']
|
provider :twitter, SERVICES['twitter']['consumer_key'], SERVICES['twitter']['consumer_secret']
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ module Diaspora
|
||||||
# @param [OpenSSL::PKey::RSA] key An RSA key
|
# @param [OpenSSL::PKey::RSA] key An RSA key
|
||||||
# @return [String] A Base64 encoded signature of #signable_string with key
|
# @return [String] A Base64 encoded signature of #signable_string with key
|
||||||
def sign_with_key(key)
|
def sign_with_key(key)
|
||||||
sig = Base64.encode64s(key.sign( OpenSSL::Digest::SHA256.new, signable_string ))
|
sig = Base64.strict_encode64(key.sign( OpenSSL::Digest::SHA256.new, signable_string ))
|
||||||
log_hash = {:event => :sign_with_key, :status => :complete}
|
log_hash = {:event => :sign_with_key, :status => :complete}
|
||||||
log_hash.merge(:model_id => self.id) if self.respond_to?(:persisted?)
|
log_hash.merge(:model_id => self.id) if self.respond_to?(:persisted?)
|
||||||
Rails.logger.info(log_hash)
|
Rails.logger.info(log_hash)
|
||||||
|
|
|
||||||
|
|
@ -9,14 +9,14 @@ module Encryptor
|
||||||
ciphertext = aes_encrypt(cleartext, aes_key)
|
ciphertext = aes_encrypt(cleartext, aes_key)
|
||||||
encrypted_key = encrypt_aes_key aes_key
|
encrypted_key = encrypt_aes_key aes_key
|
||||||
cipher_hash = {:aes_key => encrypted_key, :ciphertext => ciphertext}
|
cipher_hash = {:aes_key => encrypted_key, :ciphertext => ciphertext}
|
||||||
Base64.encode64s( cipher_hash.to_json )
|
Base64.strict_encode64( cipher_hash.to_json )
|
||||||
end
|
end
|
||||||
|
|
||||||
def gen_aes_key
|
def gen_aes_key
|
||||||
cipher = OpenSSL::Cipher.new('AES-256-CBC')
|
cipher = OpenSSL::Cipher.new('AES-256-CBC')
|
||||||
key = cipher.random_key
|
key = cipher.random_key
|
||||||
iv = cipher.random_iv
|
iv = cipher.random_iv
|
||||||
{'key' => Base64.encode64s(key), 'iv' => Base64.encode64s(iv)}
|
{'key' => Base64.strict_encode64(key), 'iv' => Base64.strict_encode64(iv)}
|
||||||
end
|
end
|
||||||
|
|
||||||
def aes_encrypt(txt, key)
|
def aes_encrypt(txt, key)
|
||||||
|
|
@ -27,11 +27,11 @@ module Encryptor
|
||||||
ciphertext = ''
|
ciphertext = ''
|
||||||
ciphertext << cipher.update(txt)
|
ciphertext << cipher.update(txt)
|
||||||
ciphertext << cipher.final
|
ciphertext << cipher.final
|
||||||
Base64.encode64s(ciphertext)
|
Base64.strict_encode64(ciphertext)
|
||||||
end
|
end
|
||||||
|
|
||||||
def encrypt_aes_key key
|
def encrypt_aes_key key
|
||||||
Base64.encode64s(public_key.public_encrypt( key.to_json ))
|
Base64.strict_encode64(public_key.public_encrypt( key.to_json ))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -106,7 +106,7 @@ class Postzord::Dispatcher
|
||||||
def queue_remote_delivery_job(remote_people)
|
def queue_remote_delivery_job(remote_people)
|
||||||
Resque.enqueue(Jobs::HttpMulti,
|
Resque.enqueue(Jobs::HttpMulti,
|
||||||
@sender.id,
|
@sender.id,
|
||||||
Base64.encode64s(@object.to_diaspora_xml),
|
Base64.strict_encode64(@object.to_diaspora_xml),
|
||||||
remote_people.map{|p| p.id},
|
remote_people.map{|p| p.id},
|
||||||
self.class.to_s)
|
self.class.to_s)
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -1,340 +0,0 @@
|
||||||
# Copied and renamed from https://github.com/rack/rack/blob/1.3.4/lib/rack/request.rb
|
|
||||||
require 'rack/utils'
|
|
||||||
|
|
||||||
module Rack
|
|
||||||
# Rack::Request provides a convenient interface to a Rack
|
|
||||||
# environment. It is stateless, the environment +env+ passed to the
|
|
||||||
# constructor will be directly modified.
|
|
||||||
#
|
|
||||||
# req = Rack::Request.new(env)
|
|
||||||
# req.post?
|
|
||||||
# req.params["data"]
|
|
||||||
#
|
|
||||||
# The environment hash passed will store a reference to the Request object
|
|
||||||
# instantiated so that it will only instantiate if an instance of the Request
|
|
||||||
# object doesn't already exist.
|
|
||||||
|
|
||||||
class FixedRequest
|
|
||||||
# The environment of the request.
|
|
||||||
attr_reader :env
|
|
||||||
|
|
||||||
def initialize(env)
|
|
||||||
@env = env
|
|
||||||
end
|
|
||||||
|
|
||||||
def body; @env["rack.input"] end
|
|
||||||
def script_name; @env["SCRIPT_NAME"].to_s end
|
|
||||||
def path_info; @env["PATH_INFO"].to_s end
|
|
||||||
def request_method; @env["REQUEST_METHOD"] end
|
|
||||||
def query_string; @env["QUERY_STRING"].to_s end
|
|
||||||
def content_length; @env['CONTENT_LENGTH'] end
|
|
||||||
|
|
||||||
def content_type
|
|
||||||
content_type = @env['CONTENT_TYPE']
|
|
||||||
content_type.nil? || content_type.empty? ? nil : content_type
|
|
||||||
end
|
|
||||||
|
|
||||||
def session; @env['rack.session'] ||= {} end
|
|
||||||
def session_options; @env['rack.session.options'] ||= {} end
|
|
||||||
def logger; @env['rack.logger'] end
|
|
||||||
|
|
||||||
# The media type (type/subtype) portion of the CONTENT_TYPE header
|
|
||||||
# without any media type parameters. e.g., when CONTENT_TYPE is
|
|
||||||
# "text/plain;charset=utf-8", the media-type is "text/plain".
|
|
||||||
#
|
|
||||||
# For more information on the use of media types in HTTP, see:
|
|
||||||
# http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.7
|
|
||||||
def media_type
|
|
||||||
content_type && content_type.split(/\s*[;,]\s*/, 2).first.downcase
|
|
||||||
end
|
|
||||||
|
|
||||||
# The media type parameters provided in CONTENT_TYPE as a Hash, or
|
|
||||||
# an empty Hash if no CONTENT_TYPE or media-type parameters were
|
|
||||||
# provided. e.g., when the CONTENT_TYPE is "text/plain;charset=utf-8",
|
|
||||||
# this method responds with the following Hash:
|
|
||||||
# { 'charset' => 'utf-8' }
|
|
||||||
def media_type_params
|
|
||||||
return {} if content_type.nil?
|
|
||||||
Hash[*content_type.split(/\s*[;,]\s*/)[1..-1].
|
|
||||||
collect { |s| s.split('=', 2) }.
|
|
||||||
map { |k,v| [k.downcase, v] }.flatten]
|
|
||||||
end
|
|
||||||
|
|
||||||
# The character set of the request body if a "charset" media type
|
|
||||||
# parameter was given, or nil if no "charset" was specified. Note
|
|
||||||
# that, per RFC2616, text/* media types that specify no explicit
|
|
||||||
# charset are to be considered ISO-8859-1.
|
|
||||||
def content_charset
|
|
||||||
media_type_params['charset']
|
|
||||||
end
|
|
||||||
|
|
||||||
def scheme
|
|
||||||
if @env['HTTPS'] == 'on'
|
|
||||||
'https'
|
|
||||||
elsif @env['HTTP_X_FORWARDED_SSL'] == 'on'
|
|
||||||
'https'
|
|
||||||
elsif @env['HTTP_X_FORWARDED_PROTO']
|
|
||||||
@env['HTTP_X_FORWARDED_PROTO'].split(',')[0]
|
|
||||||
else
|
|
||||||
@env["rack.url_scheme"]
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def ssl?
|
|
||||||
scheme == 'https'
|
|
||||||
end
|
|
||||||
|
|
||||||
def host_with_port
|
|
||||||
if forwarded = @env["HTTP_X_FORWARDED_HOST"]
|
|
||||||
forwarded.split(/,\s?/).last
|
|
||||||
else
|
|
||||||
@env['HTTP_HOST'] || "#{@env['SERVER_NAME'] || @env['SERVER_ADDR']}:#{@env['SERVER_PORT']}"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def port
|
|
||||||
if port = host_with_port.split(/:/)[1]
|
|
||||||
port.to_i
|
|
||||||
elsif port = @env['HTTP_X_FORWARDED_PORT']
|
|
||||||
port.to_i
|
|
||||||
elsif ssl?
|
|
||||||
443
|
|
||||||
elsif @env.has_key?("HTTP_X_FORWARDED_HOST")
|
|
||||||
80
|
|
||||||
else
|
|
||||||
@env["SERVER_PORT"].to_i
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def host
|
|
||||||
# Remove port number.
|
|
||||||
host_with_port.to_s.gsub(/:\d+\z/, '')
|
|
||||||
end
|
|
||||||
|
|
||||||
def script_name=(s); @env["SCRIPT_NAME"] = s.to_s end
|
|
||||||
def path_info=(s); @env["PATH_INFO"] = s.to_s end
|
|
||||||
|
|
||||||
|
|
||||||
# Checks the HTTP request method (or verb) to see if it was of type DELETE
|
|
||||||
def delete?; request_method == "DELETE" end
|
|
||||||
|
|
||||||
# Checks the HTTP request method (or verb) to see if it was of type GET
|
|
||||||
def get?; request_method == "GET" end
|
|
||||||
|
|
||||||
# Checks the HTTP request method (or verb) to see if it was of type HEAD
|
|
||||||
def head?; request_method == "HEAD" end
|
|
||||||
|
|
||||||
# Checks the HTTP request method (or verb) to see if it was of type OPTIONS
|
|
||||||
def options?; request_method == "OPTIONS" end
|
|
||||||
|
|
||||||
# Checks the HTTP request method (or verb) to see if it was of type PATCH
|
|
||||||
def patch?; request_method == "PATCH" end
|
|
||||||
|
|
||||||
# Checks the HTTP request method (or verb) to see if it was of type POST
|
|
||||||
def post?; request_method == "POST" end
|
|
||||||
|
|
||||||
# Checks the HTTP request method (or verb) to see if it was of type PUT
|
|
||||||
def put?; request_method == "PUT" end
|
|
||||||
|
|
||||||
# Checks the HTTP request method (or verb) to see if it was of type TRACE
|
|
||||||
def trace?; request_method == "TRACE" end
|
|
||||||
|
|
||||||
|
|
||||||
# The set of form-data media-types. Requests that do not indicate
|
|
||||||
# one of the media types presents in this list will not be eligible
|
|
||||||
# for form-data / param parsing.
|
|
||||||
FORM_DATA_MEDIA_TYPES = [
|
|
||||||
'application/x-www-form-urlencoded',
|
|
||||||
'multipart/form-data'
|
|
||||||
]
|
|
||||||
|
|
||||||
# The set of media-types. Requests that do not indicate
|
|
||||||
# one of the media types presents in this list will not be eligible
|
|
||||||
# for param parsing like soap attachments or generic multiparts
|
|
||||||
PARSEABLE_DATA_MEDIA_TYPES = [
|
|
||||||
'multipart/related',
|
|
||||||
'multipart/mixed'
|
|
||||||
]
|
|
||||||
|
|
||||||
# Determine whether the request body contains form-data by checking
|
|
||||||
# the request Content-Type for one of the media-types:
|
|
||||||
# "application/x-www-form-urlencoded" or "multipart/form-data". The
|
|
||||||
# list of form-data media types can be modified through the
|
|
||||||
# +FORM_DATA_MEDIA_TYPES+ array.
|
|
||||||
#
|
|
||||||
# A request body is also assumed to contain form-data when no
|
|
||||||
# Content-Type header is provided and the request_method is POST.
|
|
||||||
def form_data?
|
|
||||||
type = media_type
|
|
||||||
meth = env["rack.methodoverride.original_method"] || env['REQUEST_METHOD']
|
|
||||||
(meth == 'POST' && type.nil?) || FORM_DATA_MEDIA_TYPES.include?(type)
|
|
||||||
end
|
|
||||||
|
|
||||||
# Determine whether the request body contains data by checking
|
|
||||||
# the request media_type against registered parse-data media-types
|
|
||||||
def parseable_data?
|
|
||||||
PARSEABLE_DATA_MEDIA_TYPES.include?(media_type)
|
|
||||||
end
|
|
||||||
|
|
||||||
# Returns the data recieved in the query string.
|
|
||||||
def GET
|
|
||||||
if @env["rack.request.query_string"] == query_string
|
|
||||||
@env["rack.request.query_hash"]
|
|
||||||
else
|
|
||||||
@env["rack.request.query_string"] = query_string
|
|
||||||
@env["rack.request.query_hash"] = parse_query(query_string)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
# Returns the data recieved in the request body.
|
|
||||||
#
|
|
||||||
# This method support both application/x-www-form-urlencoded and
|
|
||||||
# multipart/form-data.
|
|
||||||
def POST
|
|
||||||
if @env["rack.input"].nil?
|
|
||||||
raise "Missing rack.input"
|
|
||||||
elsif @env["rack.request.form_input"].eql? @env["rack.input"]
|
|
||||||
@env["rack.request.form_hash"]
|
|
||||||
elsif form_data? || parseable_data?
|
|
||||||
@env["rack.request.form_input"] = @env["rack.input"]
|
|
||||||
unless @env["rack.request.form_hash"] = parse_multipart(env)
|
|
||||||
form_vars = @env["rack.input"].read
|
|
||||||
|
|
||||||
# Fix for Safari Ajax postings that always append \0
|
|
||||||
# form_vars.sub!(/\0\z/, '') # performance replacement:
|
|
||||||
form_vars.slice!(-1) if form_vars[-1] == ?\0
|
|
||||||
|
|
||||||
@env["rack.request.form_vars"] = form_vars
|
|
||||||
@env["rack.request.form_hash"] = parse_query(form_vars)
|
|
||||||
|
|
||||||
@env["rack.input"].rewind
|
|
||||||
end
|
|
||||||
@env["rack.request.form_hash"]
|
|
||||||
else
|
|
||||||
{}
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
# The union of GET and POST data.
|
|
||||||
def params
|
|
||||||
@params ||= self.GET.merge(self.POST)
|
|
||||||
rescue EOFError
|
|
||||||
self.GET
|
|
||||||
end
|
|
||||||
|
|
||||||
# shortcut for request.params[key]
|
|
||||||
def [](key)
|
|
||||||
params[key.to_s]
|
|
||||||
end
|
|
||||||
|
|
||||||
# shortcut for request.params[key] = value
|
|
||||||
def []=(key, value)
|
|
||||||
params[key.to_s] = value
|
|
||||||
end
|
|
||||||
|
|
||||||
# like Hash#values_at
|
|
||||||
def values_at(*keys)
|
|
||||||
keys.map{|key| params[key] }
|
|
||||||
end
|
|
||||||
|
|
||||||
# the referer of the client
|
|
||||||
def referer
|
|
||||||
@env['HTTP_REFERER']
|
|
||||||
end
|
|
||||||
alias referrer referer
|
|
||||||
|
|
||||||
def user_agent
|
|
||||||
@env['HTTP_USER_AGENT']
|
|
||||||
end
|
|
||||||
|
|
||||||
def cookies
|
|
||||||
hash = @env["rack.request.cookie_hash"] ||= {}
|
|
||||||
string = @env["HTTP_COOKIE"]
|
|
||||||
|
|
||||||
return hash if string == @env["rack.request.cookie_string"]
|
|
||||||
hash.clear
|
|
||||||
|
|
||||||
# According to RFC 2109:
|
|
||||||
# If multiple cookies satisfy the criteria above, they are ordered in
|
|
||||||
# the Cookie header such that those with more specific Path attributes
|
|
||||||
# precede those with less specific. Ordering with respect to other
|
|
||||||
# attributes (e.g., Domain) is unspecified.
|
|
||||||
Utils.parse_query(string, ';,').each { |k,v| hash[k] = Array === v ? v.first : v }
|
|
||||||
@env["rack.request.cookie_string"] = string
|
|
||||||
hash
|
|
||||||
rescue => error
|
|
||||||
raise error.class, "cannot parse Cookie header: #{error.message}"
|
|
||||||
end
|
|
||||||
|
|
||||||
def xhr?
|
|
||||||
@env["HTTP_X_REQUESTED_WITH"] == "XMLHttpRequest"
|
|
||||||
end
|
|
||||||
|
|
||||||
def base_url
|
|
||||||
url = scheme + "://"
|
|
||||||
url << host
|
|
||||||
|
|
||||||
if scheme == "https" && port != 443 ||
|
|
||||||
scheme == "http" && port != 80
|
|
||||||
url << ":#{port}"
|
|
||||||
end
|
|
||||||
|
|
||||||
url
|
|
||||||
end
|
|
||||||
|
|
||||||
# Tries to return a remake of the original request URL as a string.
|
|
||||||
def url
|
|
||||||
base_url + fullpath
|
|
||||||
end
|
|
||||||
|
|
||||||
def path
|
|
||||||
script_name + path_info
|
|
||||||
end
|
|
||||||
|
|
||||||
def fullpath
|
|
||||||
query_string.empty? ? path : "#{path}?#{query_string}"
|
|
||||||
end
|
|
||||||
|
|
||||||
def accept_encoding
|
|
||||||
@env["HTTP_ACCEPT_ENCODING"].to_s.split(/\s*,\s*/).map do |part|
|
|
||||||
encoding, parameters = part.split(/\s*;\s*/, 2)
|
|
||||||
quality = 1.0
|
|
||||||
if parameters and /\Aq=([\d.]+)/ =~ parameters
|
|
||||||
quality = $1.to_f
|
|
||||||
end
|
|
||||||
[encoding, quality]
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def trusted_proxy?(ip)
|
|
||||||
ip =~ /^127\.0\.0\.1$|^(10|172\.(1[6-9]|2[0-9]|30|31)|192\.168)\.|^::1$|^fd[0-9a-f]{2}:.+|^localhost$/i
|
|
||||||
end
|
|
||||||
|
|
||||||
def ip
|
|
||||||
remote_addrs = @env['REMOTE_ADDR'] ? @env['REMOTE_ADDR'].split(/[,\s]+/) : []
|
|
||||||
remote_addrs.reject! { |addr| trusted_proxy?(addr) }
|
|
||||||
|
|
||||||
return remote_addrs.first if remote_addrs.any?
|
|
||||||
|
|
||||||
forwarded_ips = @env['HTTP_X_FORWARDED_FOR'] ? @env['HTTP_X_FORWARDED_FOR'].strip.split(/[,\s]+/) : []
|
|
||||||
|
|
||||||
if client_ip = @env['HTTP_CLIENT_IP']
|
|
||||||
# If forwarded_ips doesn't include the client_ip, it might be an
|
|
||||||
# ip spoofing attempt, so we ignore HTTP_CLIENT_IP
|
|
||||||
return client_ip if forwarded_ips.include?(client_ip)
|
|
||||||
end
|
|
||||||
|
|
||||||
return forwarded_ips.reject { |ip| trusted_proxy?(ip) }.last || @env["REMOTE_ADDR"]
|
|
||||||
end
|
|
||||||
|
|
||||||
protected
|
|
||||||
def parse_query(qs)
|
|
||||||
Utils.parse_nested_query(qs)
|
|
||||||
end
|
|
||||||
|
|
||||||
def parse_multipart(env)
|
|
||||||
Rack::Multipart.parse_multipart(env)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
@ -10,7 +10,7 @@ module Base64
|
||||||
# Alphabet'' in RFC 4648.
|
# Alphabet'' in RFC 4648.
|
||||||
# The alphabet uses '-' instead of '+' and '_' instead of '/'.
|
# The alphabet uses '-' instead of '+' and '_' instead of '/'.
|
||||||
def urlsafe_encode64(bin)
|
def urlsafe_encode64(bin)
|
||||||
self.encode64s(bin).tr("+/", "-_")
|
self.strict_encode64(bin).tr("+/", "-_")
|
||||||
end
|
end
|
||||||
|
|
||||||
# Returns the Base64-decoded version of +str+.
|
# Returns the Base64-decoded version of +str+.
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ describe Diaspora::Encryptable do
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'does not verify the fallback after rollout window' do
|
it 'does not verify the fallback after rollout window' do
|
||||||
sig = Base64.encode64s(bob.encryption_key.sign( "SHA", @comment.signable_string ))
|
sig = Base64.strict_encode64(bob.encryption_key.sign( "SHA", @comment.signable_string ))
|
||||||
@comment.verify_signature(sig, bob.person).should be_false
|
@comment.verify_signature(sig, bob.person).should be_false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue