Project

General

Profile

Feature #3081

Feature #3076: migrate to new (2018-03) server "host2.osmocom.org"

migrate redmine to new server

Added by laforge about 1 year ago. Updated about 1 year ago.

Status:
Resolved
Priority:
Low
Assignee:
Category:
-
Target version:
-
Start date:
03/19/2018
Due date:
% Done:

100%

Spec Reference:

Description

migrate our redmine instance to the new server.

Should be possible to migrate individually, by re-creating the redmine installation on the new host, migrating the database, and sobsequently changing the reverse proxy.


Related issues

Related to Osmocom.org Servers - Bug #3264: content-disposition of JPG attachments is not inlineResolved05/14/2018

History

#1 Updated by laforge about 1 year ago

  • Status changed from New to Stalled
  • % Done changed from 0 to 70

This is almost working. I've managed to get a redmine 3.2 docker container with mscgen and graphviz/dotty to render our pages nicely, as expected.

However, OpenID fails with the following error:

Processing by OpenIdProviderController#confirm as HTML
  Parameters: {"authenticity_token"=>"PMdjc/LOgi3+rmNNCxeftA863I1dxecprPYO+japLX61oCDNsG7KqWR0jHWR3pzmDIODwmG3aWSDg41jule46Q==", "id_to_send"=>"7", "yes"=>"yes"}
  Current user: laforge (id=7)
Completed 500 Internal Server Error in 24ms (ActiveRecord: 11.1ms)

LoadError (library not found for class Digest::HMAC -- digest/hmac):
  plugins/redmine_openid_provider/app/controllers/open_id_provider_controller.rb:156:in `render_response'
  plugins/redmine_openid_provider/app/controllers/open_id_provider_controller.rb:73:in `confirm'
  lib/redmine/sudo_mode.rb:63:in `sudo_mode'

I'm confused by the fact that no bit of source code seems to contain either 'digest/hmac' or 'Digest::HMAC' anywhere ?!?

The log file is in /external/redmine/log/production.log and the redmine instance is running on host2.osmocom.org, in case somebody wants to test it.

#3 Updated by zecke about 1 year ago

From the "update-redmine.sh" script there is:

echo "You need to re-apply https://www.redmine.org/issues/2047 for svg support" 
echo "app/models/attachment.rb app/helpers/application_helper.rb" 

This is mostly adding "|svg" to lines already having png|jpg. I have done it by hand but it should be mostly stable (we could do it by sed if we are afraid the patch fails to apply).

#4 Updated by zecke about 1 year ago

Digest: This seems a bit of the magic of ruby but I vaguely remember having seen this before. I have either patched or backported a fix. In newer Ruby versions "Digest" has been deprecated. The diff to "stock" openid 2.3.0 is:

diff -Nurd lib/openid/cryptutil.rb /usr/local/lib/ruby/gems/2.3/gems/ruby-openid-2.3.0/lib/openid/cryptutil.rb
--- lib/openid/cryptutil.rb    1970-01-01 00:00:00.000000000 +0000
+++ /usr/local/lib/ruby/gems/2.3/gems/ruby-openid-2.3.0/lib/openid/cryptutil.rb    2017-07-17 18:25:45.146746571 +0000
@@ -2,7 +2,7 @@
 require "digest/sha1" 
 require "digest/sha2" 
 begin
-  require "digest/hmac" 
+  require "openssl" 
 rescue LoadError
   begin
     # Try loading the ruby-hmac files if they exist
@@ -33,27 +33,19 @@
     end

     def CryptUtil.sha1(text)
-      return Digest::SHA1.digest(text)
+      return OpenSSL::Digest.new('sha1').digest(text)
     end

     def CryptUtil.hmac_sha1(key, text)
-      if Digest.const_defined? :HMAC
-        Digest::HMAC.new(key,Digest::SHA1).update(text).digest
-      else
-        return HMAC::SHA1.digest(key, text)
-      end
+      return OpenSSL::HMAC.digest('sha1', key, text)
     end

     def CryptUtil.sha256(text)
-      return Digest::SHA256.digest(text)
+      return OpenSSL::Digest.new('sha256').digest(text)
     end

     def CryptUtil.hmac_sha256(key, text)
-      if Digest.const_defined? :HMAC
-        Digest::HMAC.new(key,Digest::SHA256).update(text).digest
-      else
-        return HMAC::SHA256.digest(key, text)
-      end
+      return OpenSSL::HMAC.digest('sha256', key, text)
     end

     # Generate a random string of the given length, composed of the

And general ruby magic for autoloading based on Demand..

$ irb
irb(main):008:0> require 'digest'       # This loads the module
irb(main):010:0> Digest::HMAC         # Now we attempt to access something inside the module, triggering loading.. Digest::FOO would trigger digest/foo
LoadError: library not found for class Digest::HMAC -- digest/hmac
    from /usr/local/lib/ruby/2.3/digest.rb:16:in `const_missing'
    from (irb):10
    from /usr/local/bin/irb:11:in `<main>'

#5 Updated by laforge about 1 year ago

On Mon, May 14, 2018 at 04:42:25AM +0000, zecke [REDMINE] wrote:

From the "update-redmine.sh" script there is:

> echo "You need to re-apply https://www.redmine.org/issues/2047 for svg support" 
> echo "app/models/attachment.rb app/helpers/application_helper.rb" 
> 

This is mostly adding "|svg" to lines already having png|jpg. I have done it by hand but it should be mostly stable (we could do it by sed if we are afraid the patch fails to apply).

Thanks.

I've added it to the Dockerfile, see https://gerrit.osmocom.org/#/c/docker-playground/+/9156

#6 Updated by laforge about 1 year ago

On Mon, May 14, 2018 at 05:01:25AM +0000, zecke [REDMINE] wrote:

Digest: This seems a bit of the magic of ruby but I vaguely remember having seen this before. I have either patched or backported a fix. In newer Ruby versions "Digest" has been deprecated. The diff to "stock" openid 2.3.0 is:

Applied in https://gerrit.osmocom.org/#/c/docker-playground/+/9157

#7 Updated by laforge about 1 year ago

  • Related to Bug #3264: content-disposition of JPG attachments is not inline added

#8 Updated by laforge about 1 year ago

  • Status changed from Stalled to Resolved
  • % Done changed from 70 to 100

migration to new machine and freebsd->docker complete. openid integration with gerrit works.

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 48.8 MB)