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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 430f0a78b637b1616a545273c26c80158958073f
4
- data.tar.gz: c72c55d0a5b90ccfc8a8316729d53d7222da53ee
3
+ metadata.gz: 49d09ddb462630cc102a2dceec68d8d5cbea813c
4
+ data.tar.gz: 2e3a235daec84af70c6f064743ed82ee3d397e43
5
5
  SHA512:
6
- metadata.gz: de0437ae1ce92788751b6c6128e3e764a6eebc12e83308d803d917e0b6848d70222e42c34db10b4e54a8861c13d177a42f4a92cd929ffc2bf494241b0fe50638
7
- data.tar.gz: 399c05f51366617a9541808162ddfc951283ec9b544dc34f72de18b18c08c0e113b71d97db79a6be9f883ffbc939ee8efdc45a7cebfaed8b3f78f977a166dd5e
6
+ metadata.gz: 7c1f98558959e1b40a1ee1bcc83272e0ae083c0eca35ca22f33ce1c0a0e3919dfd23f28b7980a620228b074db2e5e4138d259c386f9dfbb660a034f1612bf360
7
+ data.tar.gz: 435cf3f3840011a70633c3fa699629ff5da3b55a95c499d8241b57662854d2de8288e161c77bc2db1ee832c061dcf997fb80222368c566a12ae2686b2a0fdc79
@@ -1,4 +1,4 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.2.4
4
- - 2.3.0
3
+ - 2.2.5
4
+ - 2.3.1
@@ -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?
@@ -1,3 +1,3 @@
1
1
  class PublishToWeb
2
- VERSION = "2.2.6"
2
+ VERSION = "2.3.0"
3
3
  end
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.2.6
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-05-24 00:00:00.000000000 Z
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.4.5.1
224
+ rubygems_version: 2.5.1
225
225
  signing_key:
226
226
  specification_version: 4
227
227
  summary: Handle Protonet PublishToWeb Connection