reaper-man 0.1.2 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +14 -4
- data/bin/reaper-man +1 -1
- data/lib/reaper-man/command/repository/generate.rb +2 -1
- data/lib/reaper-man/command/sign.rb +16 -4
- data/lib/reaper-man/generator/apt.rb +11 -2
- data/lib/reaper-man/signer.rb +19 -4
- data/lib/reaper-man/signer/deb.rb +3 -8
- data/lib/reaper-man/util-scripts/{auto-debsigs → auto-helper} +2 -4
- data/lib/reaper-man/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2a9fa742e2b634580a7bbcf8c2fecec0f4aa7475
|
4
|
+
data.tar.gz: e5fbbbef5da442fbf19d79eae0076e09461222c6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a4adefa68d4ade7620ac4d88151f361bef6b6e31beccd24bc1f08a4a90225527ec8b80e8dd7ef259e2da01520655e2bf6d1849cddb264d2eaebb9c3fe3b6b5c4
|
7
|
+
data.tar.gz: f5c489deda65dbb86073cb34b7b247a4fd32fc8261d0920c97b02eeca2d0def7bb18239da10902ed415ef6ac29b6ca7fea0bc263c9b4d95d946af4d4a7b8655c
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -6,10 +6,12 @@ Grow code, harvest packages
|
|
6
6
|
|
7
7
|
### Harvests
|
8
8
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
9
|
+
Reaper man generates a `JSON` registry that describes one or more package repositories
|
10
|
+
that can be used to generate the expected repository file system. Packages are added
|
11
|
+
or removed from the registry, and regeneration of the repository file system is fast
|
12
|
+
and simple. The generated repository file system will refer to the referenced packages
|
13
|
+
but will not actually contain the referenced packages. Storage of the actual package
|
14
|
+
assets (and the delivery of said assets) is left to the reader.
|
13
15
|
|
14
16
|
### Support
|
15
17
|
|
@@ -50,6 +52,14 @@ or remove a specific version
|
|
50
52
|
|
51
53
|
This can also be used to update an existing repository structure.
|
52
54
|
|
55
|
+
### Dependencies
|
56
|
+
|
57
|
+
Commands that must be available within the path:
|
58
|
+
|
59
|
+
* `gpg`
|
60
|
+
* `debsigs`
|
61
|
+
* `expect`
|
62
|
+
|
53
63
|
## Infos
|
54
64
|
* Repository: https://github.com/hw-labs/reaper-man
|
55
65
|
* IRC: Freenode @ #heavywater
|
data/bin/reaper-man
CHANGED
@@ -71,7 +71,7 @@ Bogo::Cli::Setup.define do
|
|
71
71
|
|
72
72
|
command :sign do
|
73
73
|
description 'Sign package(s)'
|
74
|
-
|
74
|
+
instance_exec(&common_options)
|
75
75
|
on :S, :'package-system=', 'Packaging system to generate repository (apt/yum/rubygems/supermarket)', :required => true
|
76
76
|
on :Z, :'signing-chunk-size=', 'Number of packages to sign at once', :default => 20, :as => Integer
|
77
77
|
|
@@ -5,15 +5,27 @@ module ReaperMan
|
|
5
5
|
class Sign < Command
|
6
6
|
|
7
7
|
def execute!
|
8
|
+
files = arguments.map do |item|
|
9
|
+
if(File.file?(item))
|
10
|
+
item
|
11
|
+
else
|
12
|
+
File.directory?(item)
|
13
|
+
i_files = Dir.glob(File.join(item, '**', '*'))
|
14
|
+
i_files.delete_if do |path|
|
15
|
+
!File.file?(path)
|
16
|
+
end
|
17
|
+
i_files
|
18
|
+
end
|
19
|
+
end.flatten.compact.uniq
|
8
20
|
run_action 'Signing file(s)' do
|
9
21
|
signer = Signer.new(config)
|
10
|
-
files = Dir.glob(File.join(arguments.first, '**', '*'))
|
11
|
-
files.delete_if do |path|
|
12
|
-
!File.file?(path)
|
13
|
-
end
|
14
22
|
signer.package(*files)
|
15
23
|
nil
|
16
24
|
end
|
25
|
+
ui.info "Files signed:"
|
26
|
+
files.sort.each do |path|
|
27
|
+
ui.puts " #{ui.color(File.expand_path(path), :yellow)}"
|
28
|
+
end
|
17
29
|
end
|
18
30
|
|
19
31
|
end
|
@@ -36,6 +36,15 @@ module ReaperMan
|
|
36
36
|
end.compact
|
37
37
|
]
|
38
38
|
release_headers['Components'] = dist_args[:components].keys.join(' ')
|
39
|
+
signed = sign_file_if_setup('--clearsign') do
|
40
|
+
release_file(origin_name, dist_name, release_headers)
|
41
|
+
end
|
42
|
+
if(File.exists?("#{signed}.gpg"))
|
43
|
+
FileUtils.mv(
|
44
|
+
"#{signed}.gpg",
|
45
|
+
File.join(File.dirname(signed), 'InRelease')
|
46
|
+
)
|
47
|
+
end
|
39
48
|
sign_file_if_setup do
|
40
49
|
release_file(origin_name, dist_name, release_headers)
|
41
50
|
end
|
@@ -48,10 +57,10 @@ module ReaperMan
|
|
48
57
|
#
|
49
58
|
# @yield block returning file path
|
50
59
|
# @return [String] file path
|
51
|
-
def sign_file_if_setup
|
60
|
+
def sign_file_if_setup(opts=nil)
|
52
61
|
path = yield
|
53
62
|
if(signer && options[:sign])
|
54
|
-
signer.file(path)
|
63
|
+
signer.file(path, nil, opts)
|
55
64
|
end
|
56
65
|
path
|
57
66
|
end
|
data/lib/reaper-man/signer.rb
CHANGED
@@ -16,6 +16,12 @@ module ReaperMan
|
|
16
16
|
attr_reader :package_system
|
17
17
|
attr_reader :key_password
|
18
18
|
|
19
|
+
# command to use for file signing
|
20
|
+
HELPER_COMMAND = File.join(
|
21
|
+
File.expand_path(File.dirname(__FILE__)),
|
22
|
+
'util-scripts/auto-helper'
|
23
|
+
)
|
24
|
+
|
19
25
|
# Create new instance
|
20
26
|
#
|
21
27
|
# @param args [Hash]
|
@@ -48,12 +54,21 @@ module ReaperMan
|
|
48
54
|
# @param src [String] path to source file
|
49
55
|
# @param dst [String] path for destination file
|
50
56
|
# @return [String] destination file path
|
51
|
-
def file(src, dst=nil)
|
52
|
-
opts = ['--detach-sign', '--armor']
|
57
|
+
def file(src, dst=nil, sign_opts=nil)
|
58
|
+
opts = sign_opts ? [sign_opts].flatten.compact : ['--detach-sign', '--armor']
|
53
59
|
dst ||= src.sub(/#{Regexp.escape(File.extname(src))}$/, '.gpg')
|
54
60
|
opts << "--output '#{dst}'"
|
55
|
-
cmd = ([
|
56
|
-
|
61
|
+
cmd = (["gpg --default-key #{key_id}"] + opts + [src]).join(' ')
|
62
|
+
if(key_password)
|
63
|
+
shellout(
|
64
|
+
"#{HELPER_COMMAND} #{cmd}",
|
65
|
+
:environment => {
|
66
|
+
'REAPER_KEY_PASSWORD' => key_password
|
67
|
+
}
|
68
|
+
)
|
69
|
+
else
|
70
|
+
shellout(cmd)
|
71
|
+
end
|
57
72
|
dst
|
58
73
|
end
|
59
74
|
|
@@ -5,12 +5,6 @@ module ReaperMan
|
|
5
5
|
# Signing methods for deb files
|
6
6
|
module Deb
|
7
7
|
|
8
|
-
# command to use for file signing
|
9
|
-
SIGN_COMMAND = File.join(
|
10
|
-
File.expand_path(File.join(File.dirname(__FILE__), '..')),
|
11
|
-
'util-scripts/auto-debsigs'
|
12
|
-
)
|
13
|
-
|
14
8
|
# Sign given files
|
15
9
|
#
|
16
10
|
# @param pkgs [String] list of file paths
|
@@ -18,15 +12,16 @@ module ReaperMan
|
|
18
12
|
def package(*pkgs)
|
19
13
|
pkgs = valid_packages(*pkgs)
|
20
14
|
pkgs.each_slice(sign_chunk_size) do |pkgs|
|
15
|
+
cmd = %(debsigs --sign="#{sign_type}" --default-key="#{key_id}" #{pkgs.join(' ')})
|
21
16
|
if(key_password)
|
22
17
|
shellout(
|
23
|
-
"#{
|
18
|
+
"#{Signer::HELPER_COMMAND} #{cmd}",
|
24
19
|
:environment => {
|
25
20
|
'REAPER_KEY_PASSWORD' => key_password
|
26
21
|
}
|
27
22
|
)
|
28
23
|
else
|
29
|
-
shellout(
|
24
|
+
shellout(cmd)
|
30
25
|
end
|
31
26
|
end
|
32
27
|
true
|
@@ -4,14 +4,12 @@ log_user 0
|
|
4
4
|
|
5
5
|
set timeout 3
|
6
6
|
|
7
|
-
set
|
8
|
-
set signkey [lindex $argv 1]
|
9
|
-
set package [join [lrange $argv 2 [llength $argv]] " "]
|
7
|
+
set commandstring [join [lrange $argv 0 [llength $argv]] " "]
|
10
8
|
|
11
9
|
spawn /bin/bash
|
12
10
|
expect {
|
13
11
|
-re ".*\$ *$" {
|
14
|
-
send "
|
12
|
+
send "$commandstring\r"
|
15
13
|
}
|
16
14
|
timeout { exit 1 }
|
17
15
|
}
|
data/lib/reaper-man/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: reaper-man
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Roberts
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-07-
|
11
|
+
date: 2015-07-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bogo-cli
|
@@ -84,7 +84,7 @@ files:
|
|
84
84
|
- lib/reaper-man/signer.rb
|
85
85
|
- lib/reaper-man/signer/deb.rb
|
86
86
|
- lib/reaper-man/signer/rubygems.rb
|
87
|
-
- lib/reaper-man/util-scripts/auto-
|
87
|
+
- lib/reaper-man/util-scripts/auto-helper
|
88
88
|
- lib/reaper-man/utils.rb
|
89
89
|
- lib/reaper-man/utils/process.rb
|
90
90
|
- lib/reaper-man/version.rb
|