containerize_me 0.1.1 → 0.1.2
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.
- data/lib/containerize_me.rb +14 -11
- data/templates/ubuntu_rails_hosting_stack.yaml +1 -0
- metadata +3 -3
data/lib/containerize_me.rb
CHANGED
@@ -11,7 +11,7 @@ require base + '/cp_dep_libs'
|
|
11
11
|
ENV['PATH'] += "/opt/cyberconnect/bin:/opt/cyberconnect/usr/bin:/opt/cyberconnect/sbin:/opt/cyberconnect/usr/sbin"
|
12
12
|
|
13
13
|
class ContainerizeMe
|
14
|
-
VERSION = '0.1.
|
14
|
+
VERSION = '0.1.2'
|
15
15
|
end
|
16
16
|
class JailKitNotFoundError < StandardError ; end
|
17
17
|
class JailNotWritable < StandardError ; end
|
@@ -189,12 +189,25 @@ module Jail
|
|
189
189
|
cfg[:users].each { |user| Jail.add_user(user) } if cfg[:users].kind_of?(Array)
|
190
190
|
end
|
191
191
|
|
192
|
+
if cfg.has_key?(:add_non_system_users)
|
193
|
+
if cfg[:add_non_system_users].kind_of?(Array)
|
194
|
+
cfg[:add_non_system_users].each { |user|
|
195
|
+
add_user_not_in_root_system(user)
|
196
|
+
user_home = "#{@config.jail}/home/#{user}"
|
197
|
+
FileUtils.mkdir_p(user_home) unless File.directory?(user_home)
|
198
|
+
`chroot #{@config.jail} chown #{user} #{user_home}`
|
199
|
+
}
|
200
|
+
end
|
201
|
+
end
|
202
|
+
|
192
203
|
if cfg.has_key?(:mkdir)
|
193
204
|
if cfg[:mkdir].kind_of?(Array)
|
194
205
|
cfg[:mkdir].each { |dir|
|
195
206
|
d = "#{@config.jail}#{dir[:item]}"
|
196
207
|
FileUtils.mkdir_p d unless File.directory?(d)
|
197
208
|
if dir[:user].length > 0 && dir[:group].length > 0
|
209
|
+
# in case the user exists in the jail but not system
|
210
|
+
#`chroot #{@config.jail} chown #{dir[:user]}:#{dir[:group]} #{dir[:item]}`
|
198
211
|
FileUtils.chown(dir[:user], dir[:group], d)
|
199
212
|
FileUtils.chmod(dir[:mode], d) if dir.has_key?(:mode)
|
200
213
|
end
|
@@ -237,16 +250,6 @@ module Jail
|
|
237
250
|
}
|
238
251
|
end
|
239
252
|
end
|
240
|
-
|
241
|
-
if cfg.has_key?(:add_non_system_users)
|
242
|
-
if cfg[:add_non_system_users].kind_of?(Array)
|
243
|
-
cfg[:add_non_system_users].each { |user|
|
244
|
-
add_user_not_in_root_system(user)
|
245
|
-
}
|
246
|
-
end
|
247
|
-
end
|
248
|
-
|
249
|
-
|
250
253
|
end
|
251
254
|
|
252
255
|
def perform
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: containerize_me
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.1.
|
5
|
+
version: 0.1.2
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Cliff Cyphers
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-08-
|
13
|
+
date: 2011-08-30 00:00:00 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: platform_helpers
|
@@ -89,7 +89,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
89
89
|
requirements: []
|
90
90
|
|
91
91
|
rubyforge_project: containerize_me
|
92
|
-
rubygems_version: 1.8.
|
92
|
+
rubygems_version: 1.8.10
|
93
93
|
signing_key:
|
94
94
|
specification_version: 3
|
95
95
|
summary: Containerize Me is intended to provide a cross distro linux means for easily defining charactieristics of a chroot jail in yaml format
|