publish_to_web 2.2.6 → 2.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +2 -2
- data/lib/publish_to_web.rb +8 -1
- data/lib/publish_to_web/config.rb +5 -0
- data/lib/publish_to_web/directory.rb +10 -0
- data/lib/publish_to_web/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: 49d09ddb462630cc102a2dceec68d8d5cbea813c
|
4
|
+
data.tar.gz: 2e3a235daec84af70c6f064743ed82ee3d397e43
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7c1f98558959e1b40a1ee1bcc83272e0ae083c0eca35ca22f33ce1c0a0e3919dfd23f28b7980a620228b074db2e5e4138d259c386f9dfbb660a034f1612bf360
|
7
|
+
data.tar.gz: 435cf3f3840011a70633c3fa699629ff5da3b55a95c499d8241b57662854d2de8288e161c77bc2db1ee832c061dcf997fb80222368c566a12ae2686b2a0fdc79
|
data/.travis.yml
CHANGED
data/lib/publish_to_web.rb
CHANGED
@@ -36,7 +36,7 @@ class PublishToWeb
|
|
36
36
|
:proxy_user, :proxy_port, :directory_host, :logger, :config
|
37
37
|
|
38
38
|
def initialize(
|
39
|
-
forward_port: 80,
|
39
|
+
forward_port: 80,
|
40
40
|
bind_host: "127.0.0.1",
|
41
41
|
proxy_host: "proxy.protonet.info",
|
42
42
|
proxy_user: "localtunnel",
|
@@ -78,6 +78,13 @@ class PublishToWeb
|
|
78
78
|
directory.set_version
|
79
79
|
directory.public_key
|
80
80
|
|
81
|
+
directory.smtp_config.tap do |smtp|
|
82
|
+
config.smtp_host = smtp["host"]
|
83
|
+
config.smtp_sender = smtp["sender"]
|
84
|
+
config.smtp_user = smtp["user"]
|
85
|
+
config.smtp_pass = smtp["password"]
|
86
|
+
end
|
87
|
+
|
81
88
|
config.success = 'directory_configured'
|
82
89
|
rescue PublishToWeb::Directory::HttpResponseError => err
|
83
90
|
logger.warn "#{err.class}: #{err}"
|
@@ -32,5 +32,10 @@ class PublishToWeb
|
|
32
32
|
config_attribute :public_key, "ptw/publish_to_web_key_public"
|
33
33
|
config_attribute :success, "ptw/success"
|
34
34
|
config_attribute :error, "ptw/error"
|
35
|
+
|
36
|
+
config_attribute :smtp_host, "smtp/host"
|
37
|
+
config_attribute :smtp_sender, "smtp/sender"
|
38
|
+
config_attribute :smtp_user, "smtp/username"
|
39
|
+
config_attribute :smtp_pass, "smtp/password"
|
35
40
|
end
|
36
41
|
end
|
@@ -79,6 +79,16 @@ class PublishToWeb
|
|
79
79
|
end
|
80
80
|
end
|
81
81
|
|
82
|
+
def smtp_config
|
83
|
+
logger.info "Retrieving SMTP configuration from directory"
|
84
|
+
response = HTTP.get url_for('smtp_config'), params: { license_key: license_key }
|
85
|
+
if (200..299).include? response.status
|
86
|
+
JSON.parse(response.body)
|
87
|
+
else
|
88
|
+
raise HttpResponseError.new("Failed to retrieve smtp credentials from directory", response)
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
82
92
|
private
|
83
93
|
|
84
94
|
def public_key_ok?
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: publish_to_web
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Christoph Olszowka
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-08-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: net-ssh
|
@@ -221,7 +221,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
221
221
|
version: '0'
|
222
222
|
requirements: []
|
223
223
|
rubyforge_project:
|
224
|
-
rubygems_version: 2.
|
224
|
+
rubygems_version: 2.5.1
|
225
225
|
signing_key:
|
226
226
|
specification_version: 4
|
227
227
|
summary: Handle Protonet PublishToWeb Connection
|