redmine_with_git 0.7.0 → 0.7.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ad334021b2ed9f85e6ffe0a9903d1d660271fb25ad66a080fe35679c89d14489
4
- data.tar.gz: 237a9c00566a1bf59f94914047b0f43d51b895a49e1f72c8e33ff97afa9389ed
3
+ metadata.gz: 2219380d4334bafe782080437e1bcd84ebff15941299c8bbaf2f2771864083e9
4
+ data.tar.gz: 228fe248d3a5e5d9e9d023aee75579a5d0485b3686cf5fac3055129db9437267
5
5
  SHA512:
6
- metadata.gz: 27845700bf01636bbe3321023d307c46694d697870ced4ecba062d7ebdbc585d15ceead4c329c8f878e3838f9f78c84f1febe3717989b263b972892e683375ad
7
- data.tar.gz: d090756bbffc58cdc438aa7b34ecebfd39ec95a647b7c4ceb404b151f7cd360828c24ee00161c936cd94c7c25b78efedceb4a5f35542f589af5d8cd4bdaae10c
6
+ metadata.gz: 1b347512823f7c5851d9657ae37ea6723a045b6416207e2d483aebd1a0f68abe9778e9262a979e331c88cc94e7fe93592e62380806d5145d00bbb482eb64a6db
7
+ data.tar.gz: cfe10d54564b08047d5b5d5147c0e1730906f5eb2e1a4f80c8698c82aa1dcdd378e697ea11cefe82827a9ff40a2f8f76e1cbad6c55bf2e7654c4820e4722f854
@@ -3,14 +3,23 @@
3
3
  Redmine::Plugin.post_register :redmine_with_git do
4
4
  # Source: https://github.com/esquilo-azul/redmine_nonproject_modules
5
5
  requires_redmine_plugin(:redmine_nonproject_modules, version_or_higher: '0.3.1')
6
- # Source: https://github.com/jbox-web/redmine_bootstrap_kit.git
7
- # Note: redmine_bootstrap_kit is a redmine_git_hosting's dependency.
8
- requires_redmine_plugin(:redmine_bootstrap_kit, version_or_higher: '0.2.5')
9
- # Source: https://github.com/esquilo-azul/redmine_git_hosting
10
- requires_redmine_plugin(:redmine_git_hosting, version_or_higher: '1.2.3.1')
6
+
7
+ if ::Redmine::VERSION.to_s < '4'
8
+ # Source: https://github.com/jbox-web/redmine_bootstrap_kit.git
9
+ # Note: redmine_bootstrap_kit is a redmine_git_hosting's dependency.
10
+ requires_redmine_plugin(:redmine_bootstrap_kit, version_or_higher: '0.2.5')
11
+ # Source: https://github.com/jbox-web/redmine_git_hosting.git
12
+ requires_redmine_plugin(:redmine_git_hosting, version_or_higher: '1.2.3.1')
13
+ else
14
+ # Source: https://github.com/jbox-web/additionals
15
+ # Note: additionals is a redmine_git_hosting's dependency.
16
+ requires_redmine_plugin(:additionals, version_or_higher: '2.0.24')
17
+ # Source: https://github.com/jbox-web/redmine_git_hosting.git
18
+ requires_redmine_plugin(:redmine_git_hosting, version_or_higher: '4.0.1.1')
19
+ end
11
20
 
12
21
  # Source: https://github.com/esquilo-azul/redmine_installer
13
22
  if ::Redmine::Plugin.registered_plugins.keys.include?(:redmine_installer)
14
- requires_redmine_plugin(:redmine_installer, version_or_higher: '0.10.0')
23
+ requires_redmine_plugin(:redmine_installer, version_or_higher: '0.15.0')
15
24
  end
16
25
  end
@@ -3,4 +3,6 @@
3
3
  set -u
4
4
  set -e
5
5
 
6
+ if bool_r "$SKIP_DATABASE"; then exit 0; fi
7
+
6
8
  programeiro /rails/rake redmine_with_git:rescue
data/installer/setup.sh CHANGED
@@ -33,3 +33,7 @@ if [ ! -v 'REDMINE_CONFIGURATION_EXTRA' ]; then
33
33
  export REDMINE_CONFIGURATION_EXTRA=''
34
34
  fi
35
35
  export REDMINE_CONFIGURATION_EXTRA+=" scm_xiolite_command: /usr/bin/git"
36
+
37
+ # SSH Server
38
+ export SSH_SERVER_PACKAGE="openssh-server"
39
+ export SSH_SERVER_SERVICE="ssh"
@@ -1,3 +1,3 @@
1
1
  # Task dependencies
2
2
  taskeiro_add_dependency redmine_bundle redmine_with_git_bundle_requirements
3
- taskeiro_add_dependency development redmine_git_hosting
3
+ taskeiro_add_dependency redmine_base redmine_git_hosting
@@ -4,7 +4,7 @@ set -u
4
4
  set -e
5
5
 
6
6
  function task_dependencies {
7
- echo gitolite_rc gitolite redmine_git_hosting_ssh_key
7
+ echo gitolite_rc gitolite redmine_git_hosting_ssh_key ssh_server_running
8
8
  }
9
9
 
10
10
  function task_condition {
@@ -14,8 +14,6 @@ function task_condition {
14
14
  function task_fix {
15
15
  set -u
16
16
  set -e
17
- programeiro /apt/assert_installed openssh-server
18
- sudo service ssh restart
19
17
  local tempdir=$(sudo -u "$(programeiro /rails/user)" mktemp -d)
20
18
  local publickey_temp="$tempdir/$(basename "$(programeiro /redmine_git_hosting/ssh_key)")".pub
21
19
  sudo -u "$(programeiro /rails/user)" chmod 777 "$tempdir" -R
@@ -9,7 +9,7 @@ function enabled_scm_setting_template {
9
9
  export -f enabled_scm_setting_template
10
10
 
11
11
  function enabled_scm_setting_current {
12
- programeiro /redmine/get_setting_value 'enabled_scm'
12
+ programeiro /redmine/setting/read 'enabled_scm'
13
13
  }
14
14
  export -f enabled_scm_setting_current
15
15
 
@@ -18,11 +18,13 @@ function task_dependencies {
18
18
  }
19
19
 
20
20
  function task_condition {
21
+ if bool_r "$SKIP_DATABASE"; then return 0; fi
22
+
21
23
  return $(programeiro /text/diff_commands 'enabled_scm_setting_template' 'enabled_scm_setting_current')
22
24
  }
23
25
 
24
26
  function task_fix {
25
27
  set -u
26
28
  set -e
27
- programeiro /redmine/set_setting_value 'enabled_scm' "$(enabled_scm_setting_template)"
29
+ programeiro /redmine/setting/write 'enabled_scm' "$(enabled_scm_setting_template)"
28
30
  }
@@ -10,7 +10,7 @@ function redmine_git_hosting_setting_template {
10
10
  export -f redmine_git_hosting_setting_template
11
11
 
12
12
  function redmine_git_hosting_setting_current {
13
- programeiro /redmine/get_setting_value 'plugin_redmine_git_hosting'
13
+ programeiro /redmine/setting/read 'plugin_redmine_git_hosting'
14
14
  }
15
15
  export -f redmine_git_hosting_setting_current
16
16
 
@@ -19,11 +19,13 @@ function task_dependencies {
19
19
  }
20
20
 
21
21
  function task_condition {
22
+ if bool_r "$SKIP_DATABASE"; then return 0; fi
23
+
22
24
  return $(programeiro /text/diff_commands 'redmine_git_hosting_setting_template' 'redmine_git_hosting_setting_current')
23
25
  }
24
26
 
25
27
  function task_fix {
26
- programeiro /redmine/set_setting_value 'plugin_redmine_git_hosting' \
28
+ programeiro /redmine/setting/write 'plugin_redmine_git_hosting' \
27
29
  "$(redmine_git_hosting_setting_template)"
28
30
  programeiro /redmine/installer/triggers/set 'redmine_git_hosting_rescue'
29
31
  }
@@ -12,6 +12,7 @@ function task_condition {
12
12
  export -f task_condition
13
13
 
14
14
  function task_fix {
15
- sudo -u "$redmine_user" -H ssh-keygen -t rsa -f "$ssh_key" -N ''
15
+ # https://github.com/libgit2/pygit2/issues/1013#issuecomment-679200156
16
+ sudo -u "$redmine_user" -H ssh-keygen -m PEM -t rsa -b 2048 -t rsa -f "$ssh_key" -N ''
16
17
  }
17
18
  export -f task_fix
@@ -0,0 +1,14 @@
1
+ #!/bin/bash
2
+
3
+ set -u
4
+ set -e
5
+
6
+ PACKAGES=("$SSH_SERVER_PACKAGE")
7
+
8
+ function task_condition {
9
+ programeiro /apt/installed "${PACKAGES[@]}"
10
+ }
11
+
12
+ function task_fix {
13
+ programeiro /apt/assert_installed "${PACKAGES[@]}"
14
+ }
@@ -0,0 +1,16 @@
1
+ #!/bin/bash
2
+
3
+ set -u
4
+ set -e
5
+
6
+ function task_condition {
7
+ programeiro /linux/service_running "$SSH_SERVER_SERVICE"
8
+ }
9
+
10
+ function task_dependencies {
11
+ echo ssh_server
12
+ }
13
+
14
+ function task_fix {
15
+ sudo service "$SSH_SERVER_SERVICE" start
16
+ }
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'avm/files/rotate'
3
+ require 'avm/data/rotate'
4
4
  require 'eac_ruby_utils/patches/object/asserts'
5
5
  require 'eac_ruby_utils/listable'
6
6
 
@@ -61,7 +61,7 @@ module RedmineWithGit
61
61
 
62
62
  def run_if_rotate
63
63
  if ::File.exist?(path) && overwrite == OVERWRITE_ROTATE
64
- rotate = ::Avm::Files::Rotate.new(path, space_limit: space_limit)
64
+ rotate = ::Avm::Data::Rotate.new(path, space_limit: space_limit)
65
65
  ::Rails.logger.info "Rotating \"#{rotate.source_path}\"..."
66
66
  rotate.run
67
67
  ::Rails.logger.info "Rotated to \"#{rotate.target_path}\""
@@ -8,11 +8,7 @@ module RedmineWithGit
8
8
  private
9
9
 
10
10
  def build_command
11
- env.command(
12
- [password_arg, 'pg_dump', '-x', '-c', '-O',
13
- '-h', database_schema['host'], '-U', database_schema['username'], '-d',
14
- database_schema['database'], '@ESC_|'] + compress_args
15
- )
11
+ build_postgres_command('pg_dump', ['-x', '-c', '-O', '@ESC_|'] + compress_args)
16
12
  end
17
13
  end
18
14
  end
@@ -3,6 +3,15 @@
3
3
  module RedmineWithGit
4
4
  module DumpLoad
5
5
  module Database
6
+ def build_postgres_command(command, args = [])
7
+ env.command(
8
+ [password_arg, command] + {
9
+ host: database_schema['host'], port: database_schema['port'],
10
+ username: database_schema['username'], dbname: database_schema['database']
11
+ }.flat_map { |k, v| ["--#{k}", v] } + args
12
+ )
13
+ end
14
+
6
15
  def database_schema
7
16
  Rails.configuration.database_configuration[Rails.env]
8
17
  end
@@ -31,11 +31,7 @@ module RedmineWithGit
31
31
  end
32
32
 
33
33
  def psql_command
34
- env.command(
35
- [password_arg, 'psql',
36
- '-h', database_schema['host'], '-U', database_schema['username'], '-d',
37
- database_schema['database']]
38
- )
34
+ build_postgres_command('psql')
39
35
  end
40
36
 
41
37
  def psql_sql_command(sql)
@@ -4,14 +4,11 @@ module RedmineGitHosting
4
4
  module Cache
5
5
  module DatabasePatch
6
6
  def self.included(base)
7
- base.include(InstanceMethods)
8
- base.class_eval do
9
- alias_method_chain :apply_cache_limit, :redmine_with_git
10
- end
7
+ base.prepend(InstanceMethods)
11
8
  end
12
9
 
13
10
  module InstanceMethods
14
- def apply_cache_limit_with_redmine_with_git
11
+ def apply_cache_limit
15
12
  return unless max_cache_elements >= 0 && GitCache.count > max_cache_elements
16
13
 
17
14
  GitCache.order(created_at: :desc).last.destroy
@@ -6,13 +6,12 @@ module RedmineWithGit
6
6
  module Commands
7
7
  module GitPatch
8
8
  def self.included(base)
9
- base.send(:include, InstanceMethods)
10
- base.alias_method_chain :git_version, :redmine_with_git
9
+ base.prepend(InstanceMethods)
11
10
  end
12
11
  end
13
12
 
14
13
  module InstanceMethods
15
- def git_version_with_redmine_with_git
14
+ def git_version
16
15
  sudo_git('--version')
17
16
  rescue RedmineGitHosting::Error::GitoliteCommandException => e
18
17
  logger.error("Can't retrieve Git version: #{e.output}")
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RedmineWithGit
4
- VERSION = '0.7.0'
4
+ VERSION = '0.7.3'
5
5
  end
metadata CHANGED
@@ -1,29 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redmine_with_git
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.7.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Esquilo Azul Company
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-05-05 00:00:00.000000000 Z
11
+ date: 2022-06-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: avm-tools
14
+ name: avm
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0.48'
19
+ version: '0.7'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '0.48'
26
+ version: '0.7'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: eac_rails_utils
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -93,6 +93,8 @@ files:
93
93
  - installer/tasks/redmine_git_hosting_ssh_key.sh
94
94
  - installer/tasks/redmine_gitolite_sudoer.sh
95
95
  - installer/tasks/redmine_with_git_bundle_requirements.sh
96
+ - installer/tasks/ssh_server.sh
97
+ - installer/tasks/ssh_server_running.sh
96
98
  - installer/template/gitolite.rc
97
99
  - installer/template/redmine_enabled_scm_setting_value
98
100
  - installer/template/redmine_git_hosting_setting_value.sql
@@ -135,7 +137,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
135
137
  - !ruby/object:Gem::Version
136
138
  version: '0'
137
139
  requirements: []
138
- rubygems_version: 3.0.9
140
+ rubygems_version: 3.1.6
139
141
  signing_key:
140
142
  specification_version: 4
141
143
  summary: Additional features for RedmineGitHosting.