<p>Harald Welte has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/9392">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">redmine: Migrate from 3.2 to 3.4<br><br>Change-Id: I8bfd387c71477c4dfdea2eb8520415ce129a3b32<br>---<br>M redmine/Dockerfile<br>D redmine/redmine-image-content-disposition.diff<br>D redmine/redmine-issue-2047-svg-image-support.diff<br>D redmine/redmine-openid-hmac-digest.diff<br>4 files changed, 2 insertions(+), 144 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/docker-playground refs/changes/92/9392/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/redmine/Dockerfile b/redmine/Dockerfile</span><br><span>index 1d8362d..25f6308 100644</span><br><span>--- a/redmine/Dockerfile</span><br><span>+++ b/redmine/Dockerfile</span><br><span>@@ -1,17 +1,9 @@</span><br><span style="color: hsl(0, 100%, 40%);">-FROM redmine:3.2</span><br><span style="color: hsl(120, 100%, 40%);">+FROM redmine:3.4</span><br><span> </span><br><span> RUN        apt-get update && \</span><br><span>  apt-get install -y --no-install-recommends \</span><br><span>                 graphviz \</span><br><span style="color: hsl(120, 100%, 40%);">+            imagemagick \</span><br><span>                mscgen \</span><br><span>             patch && \</span><br><span>   apt-get clean</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-COPY       redmine-issue-2047-svg-image-support.diff /tmp/redmine-issue-2047-svg-image-support.diff</span><br><span style="color: hsl(0, 100%, 40%);">-RUN     cd app && patch -p1 < /tmp/redmine-issue-2047-svg-image-support.diff</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-COPY     redmine-openid-hmac-digest.diff /tmp/</span><br><span style="color: hsl(0, 100%, 40%);">-RUN        cd /usr/local/bundle/gems/ruby-openid-2.3.0 && patch -p0 < /tmp/redmine-openid-hmac-digest.diff</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-COPY  redmine-image-content-disposition.diff /tmp/</span><br><span style="color: hsl(0, 100%, 40%);">-RUN patch -p1 < /tmp/redmine-image-content-disposition.diff</span><br><span>diff --git a/redmine/redmine-image-content-disposition.diff b/redmine/redmine-image-content-disposition.diff</span><br><span>deleted file mode 100644</span><br><span>index 50d83db..0000000</span><br><span>--- a/redmine/redmine-image-content-disposition.diff</span><br><span>+++ /dev/null</span><br><span>@@ -1,64 +0,0 @@</span><br><span style="color: hsl(0, 100%, 40%);">-From 6c94d485cb3e23559da8f0356a1052a620d7a2c2 Mon Sep 17 00:00:00 2001</span><br><span style="color: hsl(0, 100%, 40%);">-From: Harald Welte <laforge@gnumonks.org></span><br><span style="color: hsl(0, 100%, 40%);">-Date: Mon, 14 May 2018 23:16:51 +0200</span><br><span style="color: hsl(0, 100%, 40%);">-Subject: [PATCH] chagnge content-disposition of pdf/image/text/patch to</span><br><span style="color: hsl(0, 100%, 40%);">- 'inline'</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-Related:  https://osmocom.org/issues/3264</span><br><span>----</span><br><span style="color: hsl(0, 100%, 40%);">- app/controllers/attachments_controller.rb | 9 ++++++++-</span><br><span style="color: hsl(0, 100%, 40%);">- app/models/attachment.rb                  | 8 ++++++++</span><br><span style="color: hsl(0, 100%, 40%);">- 2 files changed, 16 insertions(+), 1 deletion(-)</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb</span><br><span style="color: hsl(0, 100%, 40%);">-index c2b5fa9c8..f2a57c31d 100644</span><br><span>---- a/app/controllers/attachments_controller.rb</span><br><span style="color: hsl(0, 100%, 40%);">-+++ b/app/controllers/attachments_controller.rb</span><br><span style="color: hsl(0, 100%, 40%);">-@@ -57,7 +57,7 @@ class AttachmentsController < ApplicationController</span><br><span style="color: hsl(0, 100%, 40%);">-       # images are sent inline</span><br><span style="color: hsl(0, 100%, 40%);">-       send_file @attachment.diskfile, :filename => filename_for_content_disposition(@attachment.filename),</span><br><span style="color: hsl(0, 100%, 40%);">-                                       :type => detect_content_type(@attachment),</span><br><span style="color: hsl(0, 100%, 40%);">--                                      :disposition => 'attachment'</span><br><span style="color: hsl(0, 100%, 40%);">-+                                      :disposition => disposition(@attachment)</span><br><span style="color: hsl(0, 100%, 40%);">-     end</span><br><span style="color: hsl(0, 100%, 40%);">-   end</span><br><span style="color: hsl(0, 100%, 40%);">- </span><br><span style="color: hsl(0, 100%, 40%);">-@@ -188,4 +188,12 @@ class AttachmentsController < ApplicationController</span><br><span style="color: hsl(0, 100%, 40%);">-     end</span><br><span style="color: hsl(0, 100%, 40%);">-     content_type.to_s</span><br><span style="color: hsl(0, 100%, 40%);">-   end</span><br><span style="color: hsl(0, 100%, 40%);">-+</span><br><span style="color: hsl(0, 100%, 40%);">-+  def disposition(attachment)</span><br><span style="color: hsl(0, 100%, 40%);">-+    if attachment.is_pdf? || attachment.is_image? || attachment.is_diff? || attachment.is_text?</span><br><span style="color: hsl(0, 100%, 40%);">-+      'inline'</span><br><span style="color: hsl(0, 100%, 40%);">-+    else</span><br><span style="color: hsl(0, 100%, 40%);">-+      'attachment'</span><br><span style="color: hsl(0, 100%, 40%);">-+    end</span><br><span style="color: hsl(0, 100%, 40%);">-+  end</span><br><span style="color: hsl(0, 100%, 40%);">- end</span><br><span style="color: hsl(0, 100%, 40%);">-diff --git a/app/models/attachment.rb b/app/models/attachment.rb</span><br><span style="color: hsl(0, 100%, 40%);">-index 3d16f57cc..a2520b0d5 100644</span><br><span>---- a/app/models/attachment.rb</span><br><span style="color: hsl(0, 100%, 40%);">-+++ b/app/models/attachment.rb</span><br><span style="color: hsl(0, 100%, 40%);">-@@ -236,10 +236,18 @@ class Attachment < ActiveRecord::Base</span><br><span style="color: hsl(0, 100%, 40%);">-     Redmine::MimeType.is_type?('text', filename)</span><br><span style="color: hsl(0, 100%, 40%);">-   end</span><br><span style="color: hsl(0, 100%, 40%);">- </span><br><span style="color: hsl(0, 100%, 40%);">-+  def is_image?</span><br><span style="color: hsl(0, 100%, 40%);">-+    Redmine::MimeType.is_type?('image', filename)</span><br><span style="color: hsl(0, 100%, 40%);">-+  end</span><br><span style="color: hsl(0, 100%, 40%);">-+</span><br><span style="color: hsl(0, 100%, 40%);">-   def is_diff?</span><br><span style="color: hsl(0, 100%, 40%);">-     self.filename =~ /\.(patch|diff)$/i</span><br><span style="color: hsl(0, 100%, 40%);">-   end</span><br><span style="color: hsl(0, 100%, 40%);">- </span><br><span style="color: hsl(0, 100%, 40%);">-+  def is_pdf?</span><br><span style="color: hsl(0, 100%, 40%);">-+    Redmine::MimeType.of(filename) == "application/pdf"</span><br><span style="color: hsl(0, 100%, 40%);">-+  end</span><br><span style="color: hsl(0, 100%, 40%);">-+</span><br><span style="color: hsl(0, 100%, 40%);">-   # Returns true if the file is readable</span><br><span style="color: hsl(0, 100%, 40%);">-   def readable?</span><br><span style="color: hsl(0, 100%, 40%);">-     File.readable?(diskfile)</span><br><span>--- </span><br><span style="color: hsl(0, 100%, 40%);">-2.17.0</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span>diff --git a/redmine/redmine-issue-2047-svg-image-support.diff b/redmine/redmine-issue-2047-svg-image-support.diff</span><br><span>deleted file mode 100644</span><br><span>index 23fc1e2..0000000</span><br><span>--- a/redmine/redmine-issue-2047-svg-image-support.diff</span><br><span>+++ /dev/null</span><br><span>@@ -1,24 +0,0 @@</span><br><span style="color: hsl(0, 100%, 40%);">-diff -ru app.orig/helpers/application_helper.rb app/helpers/application_helper.rb</span><br><span>---- app.orig/helpers/application_helper.rb      2018-01-08 19:37:37.000000000 +0000</span><br><span style="color: hsl(0, 100%, 40%);">-+++ app/helpers/application_helper.rb   2018-05-14 08:15:11.558390732 +0000</span><br><span style="color: hsl(0, 100%, 40%);">-@@ -637,7 +637,7 @@</span><br><span style="color: hsl(0, 100%, 40%);">-     attachments = options[:attachments] || []</span><br><span style="color: hsl(0, 100%, 40%);">-     attachments += obj.attachments if obj.respond_to?(:attachments)</span><br><span style="color: hsl(0, 100%, 40%);">-     if attachments.present?</span><br><span style="color: hsl(0, 100%, 40%);">--      text.gsub!(/src="([^\/"]+\.(bmp|gif|jpg|jpe|jpeg|png))"(\s+alt="([^"]*)")?/i) do |m|</span><br><span style="color: hsl(0, 100%, 40%);">-+      text.gsub!(/src="([^\/"]+\.(bmp|gif|jpg|jpe|jpeg|png|svg))"(\s+alt="([^"]*)")?/i) do |m|</span><br><span style="color: hsl(0, 100%, 40%);">-         filename, ext, alt, alttext = $1.downcase, $2, $3, $4</span><br><span style="color: hsl(0, 100%, 40%);">-         # search for the picture in attachments</span><br><span style="color: hsl(0, 100%, 40%);">-         if found = Attachment.latest_attach(attachments, CGI.unescape(filename))</span><br><span style="color: hsl(0, 100%, 40%);">-diff -ru app.orig/models/attachment.rb app/models/attachment.rb</span><br><span>---- app.orig/models/attachment.rb       2018-01-08 19:37:37.000000000 +0000</span><br><span style="color: hsl(0, 100%, 40%);">-+++ app/models/attachment.rb    2018-05-14 08:14:49.542526978 +0000</span><br><span style="color: hsl(0, 100%, 40%);">-@@ -193,7 +193,7 @@</span><br><span style="color: hsl(0, 100%, 40%);">-   end</span><br><span style="color: hsl(0, 100%, 40%);">- </span><br><span style="color: hsl(0, 100%, 40%);">-   def image?</span><br><span style="color: hsl(0, 100%, 40%);">--    !!(self.filename =~ /\.(bmp|gif|jpg|jpe|jpeg|png)$/i)</span><br><span style="color: hsl(0, 100%, 40%);">-+    !!(self.filename =~ /\.(bmp|gif|jpg|jpe|jpeg|png|svg)$/i)</span><br><span style="color: hsl(0, 100%, 40%);">-   end</span><br><span style="color: hsl(0, 100%, 40%);">- </span><br><span style="color: hsl(0, 100%, 40%);">-   def thumbnailable?</span><br><span>diff --git a/redmine/redmine-openid-hmac-digest.diff b/redmine/redmine-openid-hmac-digest.diff</span><br><span>deleted file mode 100644</span><br><span>index e5b22dc..0000000</span><br><span>--- a/redmine/redmine-openid-hmac-digest.diff</span><br><span>+++ /dev/null</span><br><span>@@ -1,46 +0,0 @@</span><br><span style="color: hsl(0, 100%, 40%);">-diff -Nurd lib/openid/cryptutil.rb</span><br><span style="color: hsl(0, 100%, 40%);">-/usr/local/lib/ruby/gems/2.3/gems/ruby-openid-2.3.0/lib/openid/cryptutil.rb</span><br><span>---- lib/openid/cryptutil.rb     1970-01-01 00:00:00.000000000 +0000</span><br><span style="color: hsl(0, 100%, 40%);">-+++ /usr/local/lib/ruby/gems/2.3/gems/ruby-openid-2.3.0/lib/openid/cryptutil.rb 2017-07-17</span><br><span style="color: hsl(0, 100%, 40%);">-18:25:45.146746571 +0000</span><br><span style="color: hsl(0, 100%, 40%);">-@@ -2,7 +2,7 @@</span><br><span style="color: hsl(0, 100%, 40%);">- require "digest/sha1"</span><br><span style="color: hsl(0, 100%, 40%);">- require "digest/sha2"</span><br><span style="color: hsl(0, 100%, 40%);">- begin</span><br><span style="color: hsl(0, 100%, 40%);">--  require "digest/hmac"</span><br><span style="color: hsl(0, 100%, 40%);">-+  require "openssl"</span><br><span style="color: hsl(0, 100%, 40%);">- rescue LoadError</span><br><span style="color: hsl(0, 100%, 40%);">-   begin</span><br><span style="color: hsl(0, 100%, 40%);">-     # Try loading the ruby-hmac files if they exist</span><br><span style="color: hsl(0, 100%, 40%);">-@@ -33,27 +33,19 @@</span><br><span style="color: hsl(0, 100%, 40%);">-     end</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-     def CryptUtil.sha1(text)</span><br><span style="color: hsl(0, 100%, 40%);">--      return Digest::SHA1.digest(text)</span><br><span style="color: hsl(0, 100%, 40%);">-+      return OpenSSL::Digest.new('sha1').digest(text)</span><br><span style="color: hsl(0, 100%, 40%);">-     end</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-     def CryptUtil.hmac_sha1(key, text)</span><br><span style="color: hsl(0, 100%, 40%);">--      if Digest.const_defined? :HMAC</span><br><span style="color: hsl(0, 100%, 40%);">--        Digest::HMAC.new(key,Digest::SHA1).update(text).digest</span><br><span style="color: hsl(0, 100%, 40%);">--      else</span><br><span style="color: hsl(0, 100%, 40%);">--        return HMAC::SHA1.digest(key, text)</span><br><span style="color: hsl(0, 100%, 40%);">--      end</span><br><span style="color: hsl(0, 100%, 40%);">-+      return OpenSSL::HMAC.digest('sha1', key, text)</span><br><span style="color: hsl(0, 100%, 40%);">-     end</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-     def CryptUtil.sha256(text)</span><br><span style="color: hsl(0, 100%, 40%);">--      return Digest::SHA256.digest(text)</span><br><span style="color: hsl(0, 100%, 40%);">-+      return OpenSSL::Digest.new('sha256').digest(text)</span><br><span style="color: hsl(0, 100%, 40%);">-     end</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-     def CryptUtil.hmac_sha256(key, text)</span><br><span style="color: hsl(0, 100%, 40%);">--      if Digest.const_defined? :HMAC</span><br><span style="color: hsl(0, 100%, 40%);">--        Digest::HMAC.new(key,Digest::SHA256).update(text).digest</span><br><span style="color: hsl(0, 100%, 40%);">--      else</span><br><span style="color: hsl(0, 100%, 40%);">--        return HMAC::SHA256.digest(key, text)</span><br><span style="color: hsl(0, 100%, 40%);">--      end</span><br><span style="color: hsl(0, 100%, 40%);">-+      return OpenSSL::HMAC.digest('sha256', key, text)</span><br><span style="color: hsl(0, 100%, 40%);">-     end</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-     # Generate a random string of the given length, composed of the</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/9392">change 9392</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/9392"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: docker-playground </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I8bfd387c71477c4dfdea2eb8520415ce129a3b32 </div>
<div style="display:none"> Gerrit-Change-Number: 9392 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Harald Welte <laforge@gnumonks.org> </div>