letsencrypt_webfaction 1.0.1 → 1.1.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: bacf8a3dfdbc43a59c2442f47b15e5e2b2e8074a
4
- data.tar.gz: 59d622ebb77d9e1020a5d36cc32ae0e63df5542c
3
+ metadata.gz: f80a89c3d834f421b0284b77471e9417384f7e67
4
+ data.tar.gz: 4446d3527bc746de8dc5f8b48dc1353b73eb2ba3
5
5
  SHA512:
6
- metadata.gz: ca636c3c4df8b446035148ab57647f60491f9526f45cd1b0af3b6c9d4a1c124350fc9d09fe350c0711f801b6a6de3465f81b0e104ad7a18a76589768a46d2e57
7
- data.tar.gz: edeae9fd9ed9d58cba1a0534edd0660453be82b2be65f144c222c2e8656d19260366e7bfeca3fbd6de774ba539749f8a5cf959f64c609913c77b48cb53d8bdb9
6
+ metadata.gz: 9b24b706c95298e09e2d126f53123240b4f2d12b32d1f1822c0c8c61704e6c43decb90fec32c9f3776b33891e75522619c65faae23f3551033b9f87554a51dcf
7
+ data.tar.gz: 29b1f9645e0162ab53654c50faa62153bc8cde3779714cd3534b975c427b7490b9e0d25708c121cf4ba700f02581dd2333fd0e0fcb850df486925e90cb7472a6
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
Binary file
data/.codeclimate.yml CHANGED
@@ -1,4 +1,3 @@
1
- ---
2
1
  engines:
3
2
  duplication:
4
3
  enabled: true
@@ -10,7 +9,8 @@ engines:
10
9
  rubocop:
11
10
  enabled: true
12
11
  checks:
13
- Rubocop/Rails: false
12
+ Rubocop/Rails:
13
+ enabled: false
14
14
  ratings:
15
15
  paths:
16
16
  - "**.inc"
data/.travis.yml CHANGED
@@ -1,6 +1,6 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.3.0
3
+ - 2.3.1
4
4
  - 2.2
5
5
  - 2.1
6
6
  before_install:
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ v1.1.0
2
+
3
+ * Support for additional special email configuration.
4
+ * Building on the previous feature, additional documentation around Gmail support.
5
+ * Fix issue where users had to specify all params in a custom config file.
6
+
1
7
  v1.0.1
2
8
 
3
9
  * Clean up help response.
data/README.md CHANGED
@@ -103,6 +103,29 @@ In the case of a PHP site, such as Drupal or Wordpress, look for the folder with
103
103
 
104
104
  In the case of a Rails app, look for a folder called `public/`. If you are deploying your app with Capistrano, this could show up in `/home/myuser/webapps/myapp/current/public/`.
105
105
 
106
+ ### Custom email configuration
107
+
108
+ Particularly in the case of Gmail, you may need to override the default usage of Sendmail and use SMTP. You can add custom configuration to the config file you pass, in order to accomplish this.
109
+
110
+ A Gmail example might be:
111
+
112
+ ```yaml
113
+ email_configuration:
114
+ :via: 'smtp'
115
+ :via_options:
116
+ :address: 'smtp.gmail.com'
117
+ :port: '587'
118
+ :enable_starttls_auto: true
119
+ :user_name: 'myuser@gmail.com'
120
+ :password: 'password_see_note'
121
+ :authentication: 'plain'
122
+ :domain: 'localhost.localdomain' # the HELO domain provided by the client to the server
123
+ ```
124
+
125
+ See the wiki for additional Gmail specific notes.
126
+
127
+ For all possible options, see [the Pony configuration](https://github.com/benprew/pony).
128
+
106
129
  ## Development
107
130
 
108
131
  To run the script directly from the repository, use:
@@ -14,8 +14,7 @@ Gem::Specification.new do |spec|
14
14
  'LetsEncrypt on Webfaction hosts. It can be added to ' \
15
15
  'cron where it will validate your domains ' \
16
16
  'automatically, place the generated certs in a common ' \
17
- 'folder, and then email you directions and example ' \
18
- 'text to send the WebFaction support team.'
17
+ 'folder, and then email the WebFaction support team directions'
19
18
  spec.homepage = 'https://github.com/will-in-wi/letsencrypt-webfaction'
20
19
  spec.license = 'MIT'
21
20
 
@@ -25,7 +24,7 @@ Gem::Specification.new do |spec|
25
24
  spec.require_paths = %w(lib)
26
25
 
27
26
  spec.cert_chain = ['certs/will_in_wi.pem']
28
- spec.signing_key = File.expand_path('~/.ssh/gem-private_key.pem') if $0 =~ /gem\z/
27
+ spec.signing_key = File.expand_path('~/.ssh/gem-private_key.pem') if $PROGRAM_NAME.end_with?('gem')
29
28
 
30
29
  spec.required_ruby_version = '>= 2.1.0'
31
30
 
@@ -1,3 +1,3 @@
1
1
  module LetsencryptWebfaction
2
- VERSION = '1.0.1'.freeze
2
+ VERSION = '1.1.0'.freeze
3
3
  end
@@ -33,7 +33,7 @@ module LetsencryptWebfaction
33
33
  private
34
34
 
35
35
  def emailer
36
- @emails ||= LetsencryptWebfaction::Emailer.new instructions, support_email: @options.support_email, account_email: @options.account_email, notification_email: @options.admin_notification_email
36
+ @emails ||= LetsencryptWebfaction::Emailer.new instructions, support_email: @options.support_email, account_email: @options.account_email, notification_email: @options.admin_notification_email, email_configuration: @options.email_configuration
37
37
  end
38
38
 
39
39
  def instructions
@@ -29,6 +29,9 @@ module LetsencryptWebfaction
29
29
  attr_reader field
30
30
  end
31
31
 
32
+ # EMail config is special, as it only comes from the config file, due to complexity.
33
+ attr_reader :email_configuration
34
+
32
35
  def initialize(options)
33
36
  @options = options
34
37
 
@@ -64,8 +67,11 @@ module LetsencryptWebfaction
64
67
  def load_config!(config_path)
65
68
  config = YAML.load_file(config_path)
66
69
  FIELDS.each do |field|
70
+ next unless config[field.identifier.to_s]
67
71
  instance_variable_set("@#{field.identifier}", config[field.identifier.to_s])
68
72
  end
73
+
74
+ @email_configuration = config['email_configuration'] || {}
69
75
  end
70
76
 
71
77
  def handle_config(opts)
@@ -45,9 +45,5 @@ module LetsencryptWebfaction
45
45
  File.write(File.join(@public_dir, challenge.filename), challenge.file_content)
46
46
  end
47
47
  end
48
-
49
- def delete_files!
50
- # TODO
51
- end
52
48
  end
53
49
  end
@@ -4,7 +4,7 @@ module LetsencryptWebfaction
4
4
  class Emailer
5
5
  SUBJECT_MESSAGE = 'New certificate installation'.freeze
6
6
 
7
- def initialize(instructions, support_email: '', account_email: '', notification_email: '')
7
+ def initialize(instructions, support_email: '', account_email: '', notification_email: '', email_configuration: {})
8
8
  @instructions = instructions
9
9
 
10
10
  raise Error, 'Missing account_email' if account_email == '' || account_email.nil?
@@ -13,6 +13,8 @@ module LetsencryptWebfaction
13
13
  @support_email = support_email
14
14
  @account_email = account_email
15
15
  @notification_email = notification_email
16
+
17
+ Pony.options = email_configuration
16
18
  end
17
19
 
18
20
  def send!
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: letsencrypt_webfaction
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - William Johnston
@@ -30,7 +30,7 @@ cert_chain:
30
30
  urnVFSXSvmjoq2UEqNf39Ffw4ZJ2QYuxlOLEInXhf1Rij1+KYHwHoT6qaOmk+fgY
31
31
  XWr3WAp8Tv/ogSwGuBGWtsjMTEzbRxAJbRXQDFEMeXJAvzon0o6hUtU=
32
32
  -----END CERTIFICATE-----
33
- date: 2016-03-29 00:00:00.000000000 Z
33
+ date: 2016-05-05 00:00:00.000000000 Z
34
34
  dependencies:
35
35
  - !ruby/object:Gem::Dependency
36
36
  name: acme-client
@@ -160,8 +160,8 @@ dependencies:
160
160
  version: '3.3'
161
161
  description: A tool to simplify the manual process of using LetsEncrypt on Webfaction
162
162
  hosts. It can be added to cron where it will validate your domains automatically,
163
- place the generated certs in a common folder, and then email you directions and
164
- example text to send the WebFaction support team.
163
+ place the generated certs in a common folder, and then email the WebFaction support
164
+ team directions
165
165
  email:
166
166
  - william@johnstonhaus.us
167
167
  executables:
metadata.gz.sig CHANGED
Binary file