redmine_with_git 0.7.0 → 0.7.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/config/initializers/000_dependencies.rb +15 -6
- data/installer/programs/redmine/installer/triggers/list/redmine_git_hosting_rescue.sh +2 -0
- data/installer/setup.sh +4 -0
- data/installer/tasks/_before_run.sh +1 -1
- data/installer/tasks/gitolite_setup.sh +1 -3
- data/installer/tasks/redmine_enabled_scm_setting.sh +4 -2
- data/installer/tasks/redmine_git_hosting_settings.sh +4 -2
- data/installer/tasks/redmine_git_hosting_ssh_key.sh +2 -1
- data/installer/tasks/ssh_server.sh +14 -0
- data/installer/tasks/ssh_server_running.sh +16 -0
- data/lib/redmine_with_git/dump/base.rb +2 -2
- data/lib/redmine_with_git/dump/database.rb +1 -5
- data/lib/redmine_with_git/dump_load/database.rb +9 -0
- data/lib/redmine_with_git/load/database.rb +1 -5
- data/lib/redmine_with_git/patches/redmine_git_hosting/cache/database_patch.rb +2 -5
- data/lib/redmine_with_git/patches/redmine_git_hosting/commands/git/git_patch.rb +2 -3
- data/lib/redmine_with_git/version.rb +1 -1
- metadata +8 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2219380d4334bafe782080437e1bcd84ebff15941299c8bbaf2f2771864083e9
|
4
|
+
data.tar.gz: 228fe248d3a5e5d9e9d023aee75579a5d0485b3686cf5fac3055129db9437267
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
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.
|
23
|
+
requires_redmine_plugin(:redmine_installer, version_or_higher: '0.15.0')
|
15
24
|
end
|
16
25
|
end
|
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"
|
@@ -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/
|
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/
|
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/
|
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/
|
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
|
-
|
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,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/
|
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::
|
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
|
-
|
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
|
-
|
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.
|
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
|
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.
|
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
|
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}")
|
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.
|
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:
|
11
|
+
date: 2022-06-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name: avm
|
14
|
+
name: avm
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '0.
|
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.
|
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.
|
140
|
+
rubygems_version: 3.1.6
|
139
141
|
signing_key:
|
140
142
|
specification_version: 4
|
141
143
|
summary: Additional features for RedmineGitHosting.
|