rhoconnect 5.5.0.22 → 5.5.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.
- checksums.yaml +4 -4
- data/Gemfile.lock +21 -21
- data/generators/templates/application/settings/settings.yml +0 -22
- data/lib/rhoconnect/client.rb +2 -4
- data/lib/rhoconnect/jobs/ping_job.rb +9 -20
- data/lib/rhoconnect/ping/apple.rb +3 -25
- data/lib/rhoconnect/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f819ccfcf70cacf49151ffc6ed04485860e0d34a
|
|
4
|
+
data.tar.gz: 4c014947eef4bc42b1758117f737c5d9f43a106f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ca2fdc537bfbf91e5f8d40631b99920ee6d8eb2569789e05c5ba6538051a38f825820c6997bc879f3e94d38df683d771ade8df38b0991a590f2931112493b394
|
|
7
|
+
data.tar.gz: 67f0bbc6f2963750329419aec0cdcd82c9f26a7ee4f64e2c53f449d9f35d17beedee4097e61e3ebcf9b2c61db6311d4e4ed94c23693d6a988143c23d82a880fd
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
rhoconnect (5.5.
|
|
4
|
+
rhoconnect (5.5.2)
|
|
5
5
|
bundler (~> 1.0)
|
|
6
6
|
connection_pool (~> 1.2.0)
|
|
7
7
|
json (~> 1.8)
|
|
@@ -29,22 +29,22 @@ GEM
|
|
|
29
29
|
mime-types
|
|
30
30
|
xml-simple
|
|
31
31
|
backports (3.6.8)
|
|
32
|
-
builder (3.2.
|
|
32
|
+
builder (3.2.2)
|
|
33
33
|
cabin (0.9.0)
|
|
34
|
-
childprocess (0.
|
|
34
|
+
childprocess (0.5.9)
|
|
35
35
|
ffi (~> 1.0, >= 1.0.11)
|
|
36
36
|
clamp (1.0.1)
|
|
37
37
|
connection_pool (1.2.0)
|
|
38
38
|
crack (0.4.3)
|
|
39
39
|
safe_yaml (~> 1.0.0)
|
|
40
40
|
daemons (1.2.4)
|
|
41
|
-
diff-lcs (1.
|
|
41
|
+
diff-lcs (1.2.5)
|
|
42
42
|
docile (1.1.5)
|
|
43
|
-
dotenv (2.
|
|
43
|
+
dotenv (2.1.1)
|
|
44
44
|
eventmachine (1.0.9.1)
|
|
45
45
|
excon (0.22.1)
|
|
46
46
|
ffaker (1.14.0)
|
|
47
|
-
ffi (1.9.
|
|
47
|
+
ffi (1.9.14)
|
|
48
48
|
fog (1.11.1)
|
|
49
49
|
builder
|
|
50
50
|
excon (~> 0.20)
|
|
@@ -56,8 +56,8 @@ GEM
|
|
|
56
56
|
nokogiri (~> 1.5.0)
|
|
57
57
|
ruby-hmac
|
|
58
58
|
formatador (0.2.5)
|
|
59
|
-
fpm (1.
|
|
60
|
-
archive-tar-minitar
|
|
59
|
+
fpm (1.7.0)
|
|
60
|
+
archive-tar-minitar
|
|
61
61
|
arr-pm (~> 0.0.10)
|
|
62
62
|
backports (>= 2.6.2)
|
|
63
63
|
cabin (>= 0.6.0)
|
|
@@ -69,23 +69,23 @@ GEM
|
|
|
69
69
|
ruby-xz
|
|
70
70
|
insist (1.0.0)
|
|
71
71
|
io-like (0.3.0)
|
|
72
|
-
json (1.8.
|
|
72
|
+
json (1.8.3)
|
|
73
73
|
mime-types (1.25.1)
|
|
74
74
|
mono_logger (1.1.0)
|
|
75
75
|
multi_json (1.12.1)
|
|
76
76
|
mustache (0.99.8)
|
|
77
77
|
net-scp (1.2.1)
|
|
78
78
|
net-ssh (>= 2.6.5)
|
|
79
|
-
net-ssh (
|
|
79
|
+
net-ssh (3.2.0)
|
|
80
80
|
nokogiri (1.5.11)
|
|
81
|
-
pleaserun (0.0.
|
|
81
|
+
pleaserun (0.0.27)
|
|
82
82
|
cabin (> 0)
|
|
83
83
|
clamp
|
|
84
84
|
dotenv
|
|
85
85
|
insist
|
|
86
86
|
mustache (= 0.99.8)
|
|
87
87
|
stud
|
|
88
|
-
public_suffix (2.0.
|
|
88
|
+
public_suffix (2.0.4)
|
|
89
89
|
rack (1.5.5)
|
|
90
90
|
rack-fiber_pool (0.9.3)
|
|
91
91
|
rack-protection (1.5.3)
|
|
@@ -93,10 +93,10 @@ GEM
|
|
|
93
93
|
rack-test (0.6.3)
|
|
94
94
|
rack (>= 1.0)
|
|
95
95
|
rake (10.4.2)
|
|
96
|
-
redis (3.3.
|
|
97
|
-
redis-namespace (1.5.
|
|
96
|
+
redis (3.3.2)
|
|
97
|
+
redis-namespace (1.5.2)
|
|
98
98
|
redis (~> 3.0, >= 3.0.4)
|
|
99
|
-
resque (1.
|
|
99
|
+
resque (1.26.0)
|
|
100
100
|
mono_logger (~> 1.0)
|
|
101
101
|
multi_json (~> 1.0)
|
|
102
102
|
redis-namespace (~> 1.3)
|
|
@@ -116,27 +116,27 @@ GEM
|
|
|
116
116
|
ruby-xz (0.2.3)
|
|
117
117
|
ffi (~> 1.9)
|
|
118
118
|
io-like (~> 0.3)
|
|
119
|
-
rubyzip (1.2.
|
|
119
|
+
rubyzip (1.2.0)
|
|
120
120
|
safe_yaml (1.0.4)
|
|
121
|
-
simplecov (0.
|
|
121
|
+
simplecov (0.12.0)
|
|
122
122
|
docile (~> 1.1.0)
|
|
123
123
|
json (>= 1.8, < 3)
|
|
124
124
|
simplecov-html (~> 0.10.0)
|
|
125
125
|
simplecov-html (0.10.0)
|
|
126
126
|
simplecov-rcov (0.2.3)
|
|
127
127
|
simplecov (>= 0.4.1)
|
|
128
|
-
sinatra (1.4.
|
|
128
|
+
sinatra (1.4.7)
|
|
129
129
|
rack (~> 1.5)
|
|
130
130
|
rack-protection (~> 1.4)
|
|
131
131
|
tilt (>= 1.3, < 3)
|
|
132
|
-
sqlite3 (1.3.
|
|
132
|
+
sqlite3 (1.3.12)
|
|
133
133
|
stud (0.0.22)
|
|
134
134
|
thin (1.7.0)
|
|
135
135
|
daemons (~> 1.0, >= 1.0.9)
|
|
136
136
|
eventmachine (~> 1.0, >= 1.0.4)
|
|
137
137
|
rack (>= 1, < 3)
|
|
138
138
|
thor (0.18.1)
|
|
139
|
-
tilt (2.0.
|
|
139
|
+
tilt (2.0.5)
|
|
140
140
|
vegas (0.1.11)
|
|
141
141
|
rack (>= 1.0.0)
|
|
142
142
|
webmock (1.9.3)
|
|
@@ -173,4 +173,4 @@ DEPENDENCIES
|
|
|
173
173
|
win32-process
|
|
174
174
|
|
|
175
175
|
BUNDLED WITH
|
|
176
|
-
1.
|
|
176
|
+
1.13.6
|
|
@@ -1,28 +1,6 @@
|
|
|
1
1
|
:sources:
|
|
2
2
|
|
|
3
3
|
:development:
|
|
4
|
-
:iphoneserver: gateway.sandbox.push.apple.com
|
|
5
|
-
:iphoneport: 2195
|
|
6
|
-
## Note: example how define Apple push certificate
|
|
7
|
-
#:iphonecertfile: settings/aps_development_myapp.pem
|
|
8
|
-
#:iphonepassphrase: store01
|
|
9
|
-
## Note: example how define set of Apple certificates when differnet applications use the same RhoConnect server
|
|
10
|
-
## In this case each application should be define "rho_app_id" in build.yml
|
|
11
|
-
## This is example how define two Apple's certificates for two applications with
|
|
12
|
-
## first application rho_app_id = com.tautechnologies.store01
|
|
13
|
-
## second application rho_app_id = com.tautechnologies.store02
|
|
14
|
-
## you should define rho_app_id without ":" -> "com.tautechnologies.store01" not ":com.tautechnologies.store01"
|
|
15
|
-
## if application do not has rho_app_id or you do not defined :iphonecertificates then
|
|
16
|
-
## :iphonecertfile and :iphonepassphrase from root of settings will be used
|
|
17
|
-
## for prepare *.pem firstly prepare *.p12 in "Keychain Access" application then use this command for convert to *.pem :
|
|
18
|
-
## openssl pkcs12 -in mycert.p12 -out mycert.pem -nodes -clcerts
|
|
19
|
-
#:iphonecertificates:
|
|
20
|
-
# com.tautechnologies.store01:
|
|
21
|
-
# :iphonecertfile: settings/aps_development_store01.pem
|
|
22
|
-
# :iphonepassphrase: store01
|
|
23
|
-
# com.tautechnologies.store02:
|
|
24
|
-
# :iphonecertfile: settings/aps_development_store02.pem
|
|
25
|
-
# :iphonepassphrase: store02
|
|
26
4
|
:redis: localhost:6379
|
|
27
5
|
:syncserver: http://localhost:9292
|
|
28
6
|
:push_server: http://someappname@localhost:8675/
|
data/lib/rhoconnect/client.rb
CHANGED
|
@@ -6,8 +6,6 @@ module Rhoconnect
|
|
|
6
6
|
field :device_push_type, :string
|
|
7
7
|
field :device_pin, :string
|
|
8
8
|
field :device_port, :string
|
|
9
|
-
field :device_app_id, :string
|
|
10
|
-
field :device_app_version, :string
|
|
11
9
|
field :phone_id, :string
|
|
12
10
|
field :user_id, :string
|
|
13
11
|
field :last_sync, :datetime
|
|
@@ -132,7 +130,7 @@ module Rhoconnect
|
|
|
132
130
|
end
|
|
133
131
|
|
|
134
132
|
def update_fields(params)
|
|
135
|
-
[:device_type, :device_push_type,:device_pin,:device_port,:phone_id
|
|
133
|
+
[:device_type, :device_push_type,:device_pin,:device_port,:phone_id].each do |setting|
|
|
136
134
|
self.send "#{setting}=".to_sym, params[setting].to_s if params[setting]
|
|
137
135
|
end
|
|
138
136
|
end
|
|
@@ -143,4 +141,4 @@ module Rhoconnect
|
|
|
143
141
|
raise ArgumentError.new('Missing required attribute source_name') unless params[:source_name]
|
|
144
142
|
end
|
|
145
143
|
end
|
|
146
|
-
end
|
|
144
|
+
end
|
|
@@ -32,29 +32,18 @@ module Rhoconnect
|
|
|
32
32
|
user = User.load(user_id)
|
|
33
33
|
clients = user.clients if user
|
|
34
34
|
if clients
|
|
35
|
-
client_objects = []
|
|
36
35
|
clients.members.each do |client_id|
|
|
37
|
-
|
|
38
|
-
client_objects << client_obj
|
|
39
|
-
end
|
|
40
|
-
sorted_clients = client_objects.sort! { |a,b| a.last_sync <=> b.last_sync }
|
|
41
|
-
sorted_clients.reverse_each do |client|
|
|
36
|
+
client = Client.load(client_id,{:source_name => '*'})
|
|
42
37
|
params.merge!(
|
|
43
|
-
'device_port' => client.device_port,
|
|
44
|
-
'device_pin' => client.device_pin,
|
|
45
|
-
'phone_id' => client.phone_id
|
|
46
|
-
'device_app_id' => client.device_app_id,
|
|
47
|
-
'device_app_version' => client.device_app_version
|
|
38
|
+
'device_port' => client.device_port,
|
|
39
|
+
'device_pin' => client.device_pin,
|
|
40
|
+
'phone_id' => client.phone_id
|
|
48
41
|
)
|
|
49
42
|
send_push = false
|
|
50
43
|
if client.device_type and client.device_type.size > 0
|
|
51
44
|
if client.phone_id and client.phone_id.size > 0
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
combined_phone_id = combined_phone_id + client.device_app_id
|
|
55
|
-
end
|
|
56
|
-
unless phone_ids.include? combined_phone_id
|
|
57
|
-
phone_ids << combined_phone_id
|
|
45
|
+
unless phone_ids.include? client.phone_id
|
|
46
|
+
phone_ids << client.phone_id
|
|
58
47
|
send_push = true
|
|
59
48
|
end
|
|
60
49
|
elsif client.device_pin and client.device_pin.size > 0
|
|
@@ -63,7 +52,7 @@ module Rhoconnect
|
|
|
63
52
|
send_push = true
|
|
64
53
|
end
|
|
65
54
|
else
|
|
66
|
-
log "Skipping ping for non-registered client_id '#{
|
|
55
|
+
log "Skipping ping for non-registered client_id '#{client_id}'..."
|
|
67
56
|
next
|
|
68
57
|
end
|
|
69
58
|
if send_push
|
|
@@ -83,10 +72,10 @@ module Rhoconnect
|
|
|
83
72
|
end
|
|
84
73
|
end
|
|
85
74
|
else
|
|
86
|
-
log "Dropping ping request for client_id '#{
|
|
75
|
+
log "Dropping ping request for client_id '#{client_id}' because it's already in user's device pin or phone_id list."
|
|
87
76
|
end
|
|
88
77
|
else
|
|
89
|
-
log "Skipping ping for non-registered client_id '#{
|
|
78
|
+
log "Skipping ping for non-registered client_id '#{client_id}'..."
|
|
90
79
|
end
|
|
91
80
|
end
|
|
92
81
|
else
|
|
@@ -3,32 +3,10 @@ require 'openssl'
|
|
|
3
3
|
module Rhoconnect
|
|
4
4
|
class Apple
|
|
5
5
|
def self.ping(params)
|
|
6
|
-
#log '$$$ ping params = '+params.to_s
|
|
7
6
|
settings = get_config(Rhoconnect.base_directory)[Rhoconnect.environment]
|
|
8
|
-
|
|
9
|
-
cert_file = nil # File.join(Rhoconnect.base_directory,settings[:iphonecertfile])
|
|
10
|
-
passphrase = nil
|
|
11
|
-
device_app_id = params[:device_app_id]
|
|
12
|
-
if device_app_id != nil
|
|
13
|
-
if settings[:iphonecertificates] != nil
|
|
14
|
-
if settings[:iphonecertificates][device_app_id] != nil
|
|
15
|
-
cert_file = settings[:iphonecertificates][device_app_id][:iphonecertfile]
|
|
16
|
-
passphrase = settings[:iphonecertificates][device_app_id][:iphonepassphrase]
|
|
17
|
-
end
|
|
18
|
-
end
|
|
19
|
-
end
|
|
20
|
-
if cert_file == nil
|
|
21
|
-
cert_file = settings[:iphonecertfile]
|
|
22
|
-
end
|
|
23
|
-
if passphrase == nil
|
|
24
|
-
passphrase = settings[:iphonepassphrase]
|
|
25
|
-
end
|
|
26
|
-
|
|
27
|
-
#puts '$$$ cert_file = '+cert_file.to_s
|
|
28
|
-
cert_file = File.join(Rhoconnect.base_directory,cert_file)
|
|
29
|
-
|
|
7
|
+
cert_file = File.join(Rhoconnect.base_directory,settings[:iphonecertfile])
|
|
30
8
|
cert = File.read(cert_file) if File.exists?(cert_file)
|
|
31
|
-
|
|
9
|
+
passphrase = settings[:iphonepassphrase]
|
|
32
10
|
host = settings[:iphoneserver]
|
|
33
11
|
port = settings[:iphoneport]
|
|
34
12
|
if(cert and host and port)
|
|
@@ -76,4 +54,4 @@ module Rhoconnect
|
|
|
76
54
|
super(params)
|
|
77
55
|
end
|
|
78
56
|
end
|
|
79
|
-
end
|
|
57
|
+
end
|
data/lib/rhoconnect/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rhoconnect
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 5.5.
|
|
4
|
+
version: 5.5.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Rhomobile
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2016-12-19 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|