Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarius Mathiesen <marius@gitorious.org>2013-01-09 09:00:08 (GMT)
committer Marius Mathiesen <marius@gitorious.org>2013-01-09 09:00:08 (GMT)
commit5ce56a5259e288042a4a458520773dd7f7d32587 (patch)
tree43cc2fcb03f5d7ec93a0b12702c35bbb696ae1da
parent7aee937c43644bd85069bbb0c5b48a6293c90bb3 (diff)
parentded49bbc1b9922f4f89343baec1829b5439d4d87 (diff)
Merge branch '2.x-stable'
-rw-r--r--Gemfile2
-rw-r--r--Gemfile.lock36
-rw-r--r--app/controllers/blobs_controller.rb6
-rw-r--r--app/helpers/blobs_helper.rb2
-rw-r--r--app/views/users/show.html.erb1
-rw-r--r--config/environment.rb2
-rw-r--r--config/gitorious.sample.yml6
-rw-r--r--lib/gitorious.rb2
-rw-r--r--test/functional/blobs_controller_test.rb4
9 files changed, 32 insertions, 29 deletions
diff --git a/Gemfile b/Gemfile
index 7aef161..f8d8caf 100644
--- a/Gemfile
+++ b/Gemfile
@@ -1,6 +1,6 @@
source "http://rubygems.org"
-gem "rails", "2.3.14"
+gem "rails", "2.3.15"
gem "chronic", "0.3.0"
gem "geoip", "0.8.9"
gem "daemons", "1.1.0", :require => false
diff --git a/Gemfile.lock b/Gemfile.lock
index f74be46..f5d9d6f 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -8,22 +8,22 @@ GEM
remote: http://rubygems.org/
specs:
SystemTimer (1.2.3)
- actionmailer (2.3.14)
- actionpack (= 2.3.14)
- actionpack (2.3.14)
- activesupport (= 2.3.14)
- rack (~> 1.1.0)
+ actionmailer (2.3.15)
+ actionpack (= 2.3.15)
+ actionpack (2.3.15)
+ activesupport (= 2.3.15)
+ rack (~> 1.1.3)
activemessaging (0.7.1)
activesupport (>= 1.0.0)
- activerecord (2.3.14)
- activesupport (= 2.3.14)
+ activerecord (2.3.15)
+ activesupport (= 2.3.15)
activerecord-jdbc-adapter (1.2.2.1)
activerecord-jdbcmysql-adapter (1.2.2.1)
activerecord-jdbc-adapter (~> 1.2.2.1)
jdbc-mysql (~> 5.1.0)
- activeresource (2.3.14)
- activesupport (= 2.3.14)
- activesupport (2.3.14)
+ activeresource (2.3.15)
+ activesupport (= 2.3.15)
+ activesupport (2.3.15)
acts-as-taggable-on (2.0.6)
addressable (2.2.8)
after_commit (1.0.10)
@@ -90,15 +90,15 @@ GEM
mime-types
proxymachine (1.2.4)
eventmachine (>= 0.12.10)
- rack (1.1.3)
+ rack (1.1.4)
rack-test (0.6.2)
rack (>= 1.0)
- rails (2.3.14)
- actionmailer (= 2.3.14)
- actionpack (= 2.3.14)
- activerecord (= 2.3.14)
- activeresource (= 2.3.14)
- activesupport (= 2.3.14)
+ rails (2.3.15)
+ actionmailer (= 2.3.15)
+ actionpack (= 2.3.15)
+ activerecord (= 2.3.15)
+ activeresource (= 2.3.15)
+ activesupport (= 2.3.15)
rake (>= 0.8.3)
raindrops (0.10.0)
rake (0.8.7)
@@ -192,7 +192,7 @@ DEPENDENCIES
oauth (= 0.4.4)
paperclip (~> 2.7.2)
proxymachine (= 1.2.4)
- rails (= 2.3.14)
+ rails (= 2.3.15)
rake (= 0.8.7)
rdiscount (= 1.3.1.1)
resque (= 1.9.8)
diff --git a/app/controllers/blobs_controller.rb b/app/controllers/blobs_controller.rb
index 677bea7..df6dd9d 100644
--- a/app/controllers/blobs_controller.rb
+++ b/app/controllers/blobs_controller.rb
@@ -65,7 +65,7 @@ class BlobsController < ApplicationController
@ref, @path = branch_and_path(params[:branch_and_path], @git)
if @git.git.cat_file({:t => true}, @ref) == "blob"
@blob = @git.blob(@ref)
- if @blob.size > 500.kilobytes
+ if @blob.size > eval(GitoriousConfig["max_download_blob_size"] || '500.kilobytes')
flash[:error] = I18n.t "blobs_controller.raw_error", :size => @blob.size
redirect_to project_repository_path(@project, @repository) and return
end
@@ -80,12 +80,12 @@ class BlobsController < ApplicationController
if stale?(:etag => Digest::SHA1.hexdigest(@commit.id + params[:branch_and_path].join), :last_modified => @commit.committed_date.utc)
@blob = @git.tree(@commit.tree.id, ["#{@path.join("/")}"]).contents.first
render_not_found and return unless @blob
- if @blob.size > 500.kilobytes
+ if @blob.size > eval(GitoriousConfig["max_download_blob_size"] || '500.kilobytes')
flash[:error] = I18n.t "blobs_controller.raw_error", :size => @blob.size
redirect_to project_repository_path(@project, @repository) and return
end
expires_in 30.minutes
- headers["Content-Disposition"] = %[attachment;filename="#{@blob.name}"]
+# headers["Content-Disposition"] = %[attachment;filename="#{@blob.name}"]
render :text => @blob.data, :content_type => @blob.mime_type
end
end
diff --git a/app/helpers/blobs_helper.rb b/app/helpers/blobs_helper.rb
index 1649066..7335838 100644
--- a/app/helpers/blobs_helper.rb
+++ b/app/helpers/blobs_helper.rb
@@ -99,7 +99,7 @@ module BlobsHelper
end
def too_big_to_render?(size)
- size > 350.kilobytes
+ size > eval(GitoriousConfig["max_render_blob_size"] || '350.kilobytes')
end
class BlameRenderer
diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb
index 05723c5..43fec68 100644
--- a/app/views/users/show.html.erb
+++ b/app/views/users/show.html.erb
@@ -39,6 +39,7 @@
</li><% end -%>
<li>
<%= t("views.users.member_for") %> <%= time_ago_in_words(@user.created_at) %>
+ <% if @user.suspended? -%>(suspended)<% end -%>
</li>
</ul>
</div>
diff --git a/config/environment.rb b/config/environment.rb
index 7745b74..bd06aaf 100644
--- a/config/environment.rb
+++ b/config/environment.rb
@@ -4,7 +4,7 @@
# you don't control web/app server and can't set it the proper way
# Specifies gem version of Rails to use when vendor/rails is not present
-RAILS_GEM_VERSION = '2.3.14' unless defined? RAILS_GEM_VERSION
+RAILS_GEM_VERSION = '2.3.15' unless defined? RAILS_GEM_VERSION
# Bootstrap the Rails environment, frameworks, and default configuration
require File.join(File.dirname(__FILE__), 'boot')
diff --git a/config/gitorious.sample.yml b/config/gitorious.sample.yml
index 312bc30..c70dbfe 100644
--- a/config/gitorious.sample.yml
+++ b/config/gitorious.sample.yml
@@ -222,6 +222,12 @@ production:
# Mangle visible e-mail addresses (spam protection)
#mangle_email_addresses: true
+ # The maximum size of a raw blob that can be downloaded.
+ #max_download_blob_size: 500.kilobytes
+
+ # The maximum size of a text blob that can be rendered.
+ #max_render_blob_size: 350.kilobytes
+
# Available project licenses. This can be configured as an array of licenses:
#
# licenses:
diff --git a/lib/gitorious.rb b/lib/gitorious.rb
index bcacdf3..b383289 100644
--- a/lib/gitorious.rb
+++ b/lib/gitorious.rb
@@ -16,5 +16,5 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#++
module Gitorious
- VERSION = "2.4.4"
+ VERSION = "2.4.5"
end
diff --git a/test/functional/blobs_controller_test.rb b/test/functional/blobs_controller_test.rb
index a37db1b..180a281 100644
--- a/test/functional/blobs_controller_test.rb
+++ b/test/functional/blobs_controller_test.rb
@@ -120,7 +120,6 @@ class BlobsControllerTest < ActionController::TestCase
blob_mock.expects(:data).returns("blabla")
blob_mock.expects(:size).returns(200.kilobytes)
blob_mock.expects(:mime_type).returns("text/plain")
- blob_mock.expects(:name).returns("README.doc")
commit_stub = mock("commit")
commit_stub.stubs(:id).returns("a"*40)
commit_stub.stubs(:tree).returns(commit_stub)
@@ -139,7 +138,6 @@ class BlobsControllerTest < ActionController::TestCase
assert_equal "blabla", @response.body
assert_equal "text/plain", @response.content_type
assert_equal "max-age=1800, private", @response.headers['Cache-Control']
- assert_equal %[attachment;filename="README.doc"], @response.headers["Content-Disposition"]
end
should "get the blob data from a blob sha and render it as text/plain" do
@@ -255,7 +253,6 @@ class BlobsControllerTest < ActionController::TestCase
blob_mock.expects(:data).returns("blabla")
blob_mock.expects(:size).returns(200.kilobytes)
blob_mock.expects(:mime_type).returns("text/plain")
- blob_mock.expects(:name).returns("README.doc")
commit_stub = mock("commit")
commit_stub.stubs(:id).returns("a"*40)
commit_stub.stubs(:tree).returns(commit_stub)
@@ -321,7 +318,6 @@ class BlobsControllerTest < ActionController::TestCase
blob_mock.expects(:data).returns("blabla")
blob_mock.expects(:size).returns(200.kilobytes)
blob_mock.expects(:mime_type).returns("text/plain")
- blob_mock.expects(:name).returns("README.doc")
commit_stub = mock("commit")
commit_stub.stubs(:id).returns("a"*40)
commit_stub.stubs(:tree).returns(commit_stub)