bwrap 1.0.0.pre.alpha5 → 1.0.0.pre.beta1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/CHANGELOG.md +13 -0
- data/lib/bwrap/args/args.rb +5 -1
- data/lib/bwrap/args/bind/library.rb +125 -0
- data/lib/bwrap/args/bind/mime.rb +58 -0
- data/lib/bwrap/args/bind.rb +21 -90
- data/lib/bwrap/args/construct.rb +3 -2
- data/lib/bwrap/args/environment.rb +32 -1
- data/lib/bwrap/args/features.rb +40 -3
- data/lib/bwrap/args/library.rb +17 -10
- data/lib/bwrap/args/machine_id.rb +2 -1
- data/lib/bwrap/bwrap.rb +150 -0
- data/lib/bwrap/config/features.rb +81 -0
- data/lib/bwrap/config.rb +62 -71
- data/lib/bwrap/execution/exceptions.rb +24 -0
- data/lib/bwrap/execution/execute.rb +4 -1
- data/lib/bwrap/execution/execution.rb +147 -3
- data/lib/bwrap/execution/labels.rb +8 -1
- data/lib/bwrap/execution/path.rb +30 -10
- data/lib/bwrap/execution.rb +5 -161
- data/lib/bwrap/output/colors.rb +0 -2
- data/lib/bwrap/output/log.rb +1 -3
- data/lib/bwrap/output/output_impl.rb +181 -0
- data/lib/bwrap/output.rb +7 -153
- data/lib/bwrap/version.rb +1 -2
- data/lib/bwrap.rb +25 -78
- data.tar.gz.sig +0 -0
- metadata +8 -17
- metadata.gz.sig +0 -0
- data/lib/bwrap/output/output.rb +0 -8
data/lib/bwrap.rb
CHANGED
@@ -1,81 +1,28 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require "
|
4
|
-
|
5
|
-
#
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
require "bwrap
|
11
|
-
|
12
|
-
#
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
#
|
28
|
-
#
|
29
|
-
# @param command [String, Array] Command, with necessary arguments, to be executed inside bwrap
|
30
|
-
def run command
|
31
|
-
construct = Bwrap::Args::Construct.new
|
32
|
-
construct.command = command
|
33
|
-
construct.config = @config
|
34
|
-
bwrap_args = construct.construct_bwrap_args
|
35
|
-
|
36
|
-
exec_command = [ "bwrap" ]
|
37
|
-
exec_command += bwrap_args
|
38
|
-
exec_command.append command
|
39
|
-
exec_command += @cli_args if @cli_args
|
40
|
-
|
41
|
-
execute exec_command
|
42
|
-
|
43
|
-
construct.cleanup
|
44
|
-
end
|
45
|
-
|
46
|
-
# Parses global bwrap flags using Optimist.
|
47
|
-
#
|
48
|
-
# Sets instance variable `@cli_args`.
|
49
|
-
#
|
50
|
-
# @return [Hash] options parsed by {Optimist.options}
|
51
|
-
private def parse_options
|
52
|
-
options = Optimist.options do
|
53
|
-
version ::Bwrap::VERSION
|
54
|
-
|
55
|
-
banner "Usage:"
|
56
|
-
banner " #{$PROGRAM_NAME} [global options]\n \n"
|
57
|
-
banner "Global options:"
|
58
|
-
opt :verbose,
|
59
|
-
"Show verbose output",
|
60
|
-
short: "v"
|
61
|
-
opt :debug,
|
62
|
-
"Show debug output (useful when debugging a problem)",
|
63
|
-
short: "d"
|
64
|
-
opt :trace,
|
65
|
-
"Show trace output (noisiest, probably not useful for most of time)",
|
66
|
-
short: :none
|
67
|
-
opt :version,
|
68
|
-
"Print version and exit",
|
69
|
-
short: "V"
|
70
|
-
opt :help,
|
71
|
-
"Show help message",
|
72
|
-
short: "h"
|
73
|
-
|
74
|
-
educate_on_error
|
75
|
-
end
|
76
|
-
|
77
|
-
@cli_args = ARGV.dup
|
78
|
-
|
79
|
-
options
|
80
|
-
end
|
3
|
+
require "bwrap/bwrap"
|
4
|
+
|
5
|
+
# ruby-bwrap provides easy-to-use interface to run complex programs in sandboxes created with
|
6
|
+
# {https://github.com/containers/bubblewrap bubblewrap}.
|
7
|
+
#
|
8
|
+
# To run a program inside bubblewrap, a wrapper executable can be created. For example:
|
9
|
+
#
|
10
|
+
# require "bwrap"
|
11
|
+
#
|
12
|
+
# config = Bwrap::Config.new
|
13
|
+
# config.user = "dummy_user"
|
14
|
+
# config.full_system_mounts = true
|
15
|
+
# config.binaries_from = %w{
|
16
|
+
# /bin
|
17
|
+
# /usr/bin
|
18
|
+
# }
|
19
|
+
#
|
20
|
+
# bwrap = Bwrap::Bwrap.new config
|
21
|
+
# bwrap.parse_command_line_arguments
|
22
|
+
# bwrap.run "/bin/true"
|
23
|
+
#
|
24
|
+
# There also are few generic utilities, {Bwrap::Output} for handling output of scripts and
|
25
|
+
# {Bwrap::Execution} to run executables.
|
26
|
+
module Bwrap
|
27
|
+
# Empty module.
|
81
28
|
end
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bwrap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0.pre.
|
4
|
+
version: 1.0.0.pre.beta1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samu Voutilainen
|
@@ -34,22 +34,8 @@ cert_chain:
|
|
34
34
|
X4ioQwEn1/9tHs19VO1CLF58451HgEo1BXd7eWLmV1V5cqw0YWok1ly4L/Su/Phf
|
35
35
|
MRxVMHiVAqY=
|
36
36
|
-----END CERTIFICATE-----
|
37
|
-
date: 2021-
|
37
|
+
date: 2021-12-12 00:00:00.000000000 Z
|
38
38
|
dependencies:
|
39
|
-
- !ruby/object:Gem::Dependency
|
40
|
-
name: optimist
|
41
|
-
requirement: !ruby/object:Gem::Requirement
|
42
|
-
requirements:
|
43
|
-
- - "~>"
|
44
|
-
- !ruby/object:Gem::Version
|
45
|
-
version: '3.0'
|
46
|
-
type: :runtime
|
47
|
-
prerelease: false
|
48
|
-
version_requirements: !ruby/object:Gem::Requirement
|
49
|
-
requirements:
|
50
|
-
- - "~>"
|
51
|
-
- !ruby/object:Gem::Version
|
52
|
-
version: '3.0'
|
53
39
|
- !ruby/object:Gem::Dependency
|
54
40
|
name: bundler
|
55
41
|
requirement: !ruby/object:Gem::Requirement
|
@@ -134,14 +120,19 @@ files:
|
|
134
120
|
- lib/bwrap.rb
|
135
121
|
- lib/bwrap/args/args.rb
|
136
122
|
- lib/bwrap/args/bind.rb
|
123
|
+
- lib/bwrap/args/bind/library.rb
|
124
|
+
- lib/bwrap/args/bind/mime.rb
|
137
125
|
- lib/bwrap/args/construct.rb
|
138
126
|
- lib/bwrap/args/environment.rb
|
139
127
|
- lib/bwrap/args/features.rb
|
140
128
|
- lib/bwrap/args/library.rb
|
141
129
|
- lib/bwrap/args/machine_id.rb
|
142
130
|
- lib/bwrap/args/mount.rb
|
131
|
+
- lib/bwrap/bwrap.rb
|
143
132
|
- lib/bwrap/config.rb
|
133
|
+
- lib/bwrap/config/features.rb
|
144
134
|
- lib/bwrap/execution.rb
|
135
|
+
- lib/bwrap/execution/exceptions.rb
|
145
136
|
- lib/bwrap/execution/execute.rb
|
146
137
|
- lib/bwrap/execution/execution.rb
|
147
138
|
- lib/bwrap/execution/labels.rb
|
@@ -150,7 +141,7 @@ files:
|
|
150
141
|
- lib/bwrap/output/colors.rb
|
151
142
|
- lib/bwrap/output/levels.rb
|
152
143
|
- lib/bwrap/output/log.rb
|
153
|
-
- lib/bwrap/output/
|
144
|
+
- lib/bwrap/output/output_impl.rb
|
154
145
|
- lib/bwrap/version.rb
|
155
146
|
homepage: https://git.sr.ht/~smar/ruby-bwrap
|
156
147
|
licenses:
|
metadata.gz.sig
CHANGED
Binary file
|