ALMinium (Redmine) Gitリポジトリ追加に必要な設定

SCM Creator Pluginの設定変更が必要。ALMINIUM_HOME/config/scm.ymlに allow_add_local: true を追加する。plugins/redmine_scm/config/scm.yml ではないので注意。

$ cat /opt/alminium/config/scm.yml 
production:
   auto_create: true
   deny_delete: true
   post_create: /opt/alminium/bin/alm-scm-post-create
   allow_add_local: true
   svn:
     path: /var/opt/alminium/svn
     svnadmin: /usr/bin/svnadmin
     url: http(s)://ホスト名/svn
   git:
     path: /var/opt/alminium/git
     git: /usr/bin/git
     options: --bare 
     url: http(s)://ホスト名/git
   mercurial:
     path: /var/opt/alminium/hg
     hg: /usr/bin/hg
     url: http(s)://ホスト名/hg

デフォルトだと「Adding local repositories was denied by the administrator」というエラーが出てリポジトリを追加させてくれない。このメッセージで grep すると plugins/redmine_scm/config/locales/en.yml が引っかかり、このメッセージのキーが scm_local_repositories_denied らしいので、このキーで再度 grep すると plugins/redmine_scm/lib/scm_repositories_controller_patch.rb に以下のコードが見かり、allow_add_local にたどり着く。

    if ScmConfig['only_creator'] && request.post? && @repository.errors.empty? && !@repository.created_with_scm
        @repository.errors.add(:base, :scm_only_creator)
    elsif !ScmConfig['allow_add_local'] && request.post? && @repository.errors.empty? && !@repository.created_with_scm &&
        attributes['url'] =~ %r{^(file://|([a-z]:)?\.*[\\/])}i
        @repository.errors.add(:base, :scm_local_repositories_denied)
    end

SCM Creator の設定 : Redmine SCM Creator - Configuration - Projects

/admin/info

Environment:
  Redmine version                          2.0.3.stable
  Ruby version                             1.9.3 (x86_64-linux)
  Rails version                            3.2.6
  Environment                              production
  Database adapter                         Mysql2
Redmine plugins:
  redmine_backlogs                         v0.9.26
  redmine_banner                           0.0.7
  redmine_git_branch_hook                  0.2.1
  redmine_lightbox                         0.0.1
  redmine_plugin_views_revisions           0.0.1
  redmine_redcarpet_formatter              2.0.1
  redmine_scm                              0.4.1
  redmine_spent_time_column                2.0.0-devel
  redmine_xls_export                       0.2.0