nitos_testbed_rc 1.0.0.pre.5 → 1.0.0.pre.6

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/README.md CHANGED
@@ -35,7 +35,8 @@ Use omf_cert.rb script to generate the following certificates and place them on
35
35
  % mkdir /root/.omf/trusted_roots
36
36
  % cd /root/.omf
37
37
 
38
- Create a root certificate (change DOMAIN)
38
+ Create a root certificate (change DOMAIN).
39
+ Importand!!! If you already have a root certificate (probably created while installing omf_sfa) DO NOT create this certificate again and use the old one instead.
39
40
 
40
41
  % ruby omf_cert.rb --email root@DOMAIN -o /root/.omf/trusted_roots/root.pem --duration 5000000 create_root
41
42
 
@@ -49,7 +50,7 @@ Create a certificate for cm_proxy of NTRC (change DOMAIN, XMPP_DOMAIN and if you
49
50
 
50
51
  Create a certificate for frisbee_proxy of NTRC (change DOMAIN, XMPP_DOMAIN and if you wish the output file names).
51
52
 
52
- % ruby omf_cert.rb -o cm_factory.pem --email cm_factory@DOMAIN --resource-type cm_factory --resource-id xmpp://cm_factory@XMPP_DOMAIN --root /root/.omf/trusted_roots/root.pem --duration 50000000 create_resource
53
+ % ruby omf_cert.rb -o frisbee_factory.pem --email frisbee_factory@DOMAIN --resource-type frisbee_factory --resource-id xmpp://frisbee_factory@XMPP_DOMAIN --root /root/.omf/trusted_roots/root.pem --duration 50000000 create_resource
53
54
 
54
55
  Create a certificate for the omf6 script, this certificate is inside the directory '~/.omf', every user of the testbed should have his own certificate in order to use omf6 script (change DOMAIN, USERNAME and if you wish the output file names).
55
56
 
@@ -161,7 +162,21 @@ Change configuration file '~/.omf/etc/user_proxy_conf.yaml', which is related to
161
162
  Run proxies
162
163
  -----------
163
164
 
164
- You can execute all proxies with one command:
165
+ To start/stop/restart the upstart service of nitos_testbed_rc use:
166
+
167
+ % start ntrc
168
+ % stop ntrc
169
+ % restart ntrc
170
+
171
+ Starting ntrc as an upstart will generate the following log files:
172
+
173
+ - user rc: /var/log/upstart/ntrc_user.log
174
+
175
+ - frisbee rc: /var/log/upstart/ntrc_frisbee.log
176
+
177
+ - cm rc: /var/log/upstart/ntrc_cm.log
178
+
179
+ Alternatively (mostly for debugging reasons) you can execute all proxies with one command:
165
180
 
166
181
  % run_proxies
167
182
 
data/bin/cm_proxy CHANGED
@@ -77,14 +77,22 @@ class CmPDP
77
77
  return msg
78
78
  end
79
79
 
80
+ if acc == 'root'
81
+ debug "AUTH PASSED"
82
+ msg.properties.state.node = node[:resources].first
83
+ return msg
84
+ end
85
+
80
86
  node = node[:resources].first
81
87
  lease = nil
82
- node[:leases].each do |l|
83
- l = l[:lease]
84
- next if l[:account][:name] != acc
85
- if Time.parse(l[:valid_from]) <= Time.now && Time.parse(l[:valid_until]) >= Time.now
86
- lease = l
87
- break
88
+ unless node[:leases].nil?
89
+ node[:leases].each do |l|
90
+ l = l[:lease]
91
+ next if l[:account][:name] != acc
92
+ if Time.parse(l[:valid_from]) <= Time.now && Time.parse(l[:valid_until]) >= Time.now
93
+ lease = l
94
+ break
95
+ end
88
96
  end
89
97
  end
90
98
 
data/bin/frisbee_proxy CHANGED
@@ -81,14 +81,22 @@ class FrisbeePDP
81
81
  return msg
82
82
  end
83
83
 
84
+ if acc == 'root'
85
+ debug "AUTH PASSED"
86
+ msg.properties.state.node = node
87
+ return msg
88
+ end
89
+
84
90
  node = node[:resources].first
85
91
  lease = nil
86
- node[:leases].each do |l|
87
- l = l[:lease]
88
- next if l[:account][:name] != acc
89
- if Time.parse(l[:valid_from]) <= Time.now && Time.parse(l[:valid_until]) >= Time.now
90
- lease = l
91
- break
92
+ unless node[:leases].nil?
93
+ node[:leases].each do |l|
94
+ l = l[:lease]
95
+ next if l[:account][:name] != acc
96
+ if Time.parse(l[:valid_from]) <= Time.now && Time.parse(l[:valid_until]) >= Time.now
97
+ lease = l
98
+ break
99
+ end
92
100
  end
93
101
  end
94
102
 
@@ -169,8 +169,8 @@ module OmfRc::ResourceProxy::User
169
169
  }, :ALL)
170
170
  else #if msg!=0 then the application failed to complete
171
171
  path = "/home/#{res.property.username}/.ssh/"
172
- if File.exists?("#{path}/pub_key.pem") && File.exists?("#{path}/key.pem")#if keys exist just read the pub_key for the inform
173
- file = File.open("#{path}/pub_key.pem", "rb")
172
+ if File.exists?("#{path}/id_rsa.pub") && File.exists?("#{path}/id_rsa")#if keys exist just read the pub_key for the inform
173
+ file = File.open("#{path}/id_rsa.pub", "rb")
174
174
  pub_key = file.read
175
175
  file.close
176
176
  else #if keys do not exist create them and then inform
@@ -183,7 +183,9 @@ module OmfRc::ResourceProxy::User
183
183
  FileUtils.mkdir_p(path)
184
184
  end
185
185
 
186
- File.write("#{path}/id_rsa.pub", pub_key.to_pem)
186
+ pub_key = pub_key.to_pem
187
+
188
+ File.write("#{path}/id_rsa.pub", pub_key)
187
189
  File.write("#{path}/id_rsa", key.to_pem)
188
190
  end
189
191
  res.inform(:status, {
@@ -193,7 +195,7 @@ module OmfRc::ResourceProxy::User
193
195
  exit_code: msg,
194
196
  msg: msg,
195
197
  uid: res.uid, # do we really need this? Should be identical to 'src'
196
- pub_key: pub_key.to_pem
198
+ pub_key: pub_key
197
199
  }, :ALL)
198
200
  end
199
201
  else
data/lib/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module NITOS
2
2
  module TestbedRc
3
- VERSION = "1.0.0.pre.5"
3
+ VERSION = "1.0.0.pre.6"
4
4
  end
5
5
  end
@@ -22,5 +22,6 @@ Gem::Specification.new do |s|
22
22
  s.add_runtime_dependency "omf_common", "~> 6.1.3"
23
23
  s.add_runtime_dependency "omf_rc", "~> 6.1.3"
24
24
  s.add_runtime_dependency "nokogiri", "~> 1.6.0"
25
+ s.add_runtime_dependency "progress_bar", "~> 1.0.3"
25
26
  s.add_development_dependency "net-ssh", "~> 2.8.0"
26
27
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nitos_testbed_rc
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.pre.5
4
+ version: 1.0.0.pre.6
5
5
  prerelease: 6
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-09-26 00:00:00.000000000 Z
12
+ date: 2014-11-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: omf_common
@@ -59,6 +59,22 @@ dependencies:
59
59
  - - ~>
60
60
  - !ruby/object:Gem::Version
61
61
  version: 1.6.0
62
+ - !ruby/object:Gem::Dependency
63
+ name: progress_bar
64
+ requirement: !ruby/object:Gem::Requirement
65
+ none: false
66
+ requirements:
67
+ - - ~>
68
+ - !ruby/object:Gem::Version
69
+ version: 1.0.3
70
+ type: :runtime
71
+ prerelease: false
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ~>
76
+ - !ruby/object:Gem::Version
77
+ version: 1.0.3
62
78
  - !ruby/object:Gem::Dependency
63
79
  name: net-ssh
64
80
  requirement: !ruby/object:Gem::Requirement