letsencrypt_webfaction 3.0.1 → 3.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
  SHA256:
3
- metadata.gz: 9263db07dba22feb90f3728f7da736840de2467a15e58f79a7d56a83ecc59759
4
- data.tar.gz: 5c151a918d2ebe3626ade203e93da6245ce5ed6d9828e065bcd1d2e15b758323
3
+ metadata.gz: 1e3b0f98bf6ed31d880f2bb5f71ebde9eee5f4bfc4ea953321ec1abb94521078
4
+ data.tar.gz: d0528f7489385550750003ca33f49bd8c86ce6298d7ccaa74f269050ad8e7cc9
5
5
  SHA512:
6
- metadata.gz: 945e0ff96f7684b062c5021d6671bd3481d0bcb9a4bfe718894dda69e0b45c3b67125b298da0a9ca66bd016192d8fb7650bf415db8fd8de337de0d8d78a83bce
7
- data.tar.gz: 22e1cffd4fd0ac8c0f7764a8d7635bbe11ba2b0ce868256c30c895f5636dc1d3a99a278c367b074a1a1f03ad505fbd2734c52375bc7b5390a71676d1fc534e5b
6
+ metadata.gz: 9ee90ba6301aec0e5a0da927864a1023ef3fe8f9142f62314fd3c3430d7513f46a92e61f8ec99c85566384ec417ab3dd22ecff1482177f8b0602d1545749d12c
7
+ data.tar.gz: a40f0e3351ec79fd7eb65d1abdbc4e7e54a9bef850f316843fdf1d938f5fd5eba895546f576324bac42b6ece2917f12c8511383e20e01ef5f885abd366862ec1
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -4,7 +4,7 @@ AllCops:
4
4
  - 'bin/*'
5
5
  # Keep rubocop from scanning installed gems.
6
6
  - 'vendor/**/*'
7
- TargetRubyVersion: 2.1
7
+ TargetRubyVersion: 2.2
8
8
  # Line length is something that isn't dogmatic. 80 chars is a good recommendation.
9
9
  Metrics/LineLength:
10
10
  Enabled: false
@@ -2,7 +2,6 @@ language: ruby
2
2
  rvm:
3
3
  - 2.3.1
4
4
  - 2.2
5
- - 2.1
6
5
  before_install:
7
6
  - gem install bundler
8
7
  cache: bundler
@@ -1,3 +1,15 @@
1
+ Unreleased
2
+
3
+ * Your change here!
4
+
5
+ v3.1.0
6
+
7
+ * Set config file permissions to 600 on creation.
8
+ * Output version number with `--version` flag. Fixes [#139](https://github.com/will-in-wi/letsencrypt-webfaction/issues/139)
9
+ * Drop support for Ruby 2.1. It's unsupported upstream and third party libraries are dropping support. Feel free to file a ticket if you need this for some reason.
10
+ * Restore ability to define custom configuration files paths. Fixes [#136](https://github.com/will-in-wi/letsencrypt-webfaction/issues/136)
11
+ * [#144](https://github.com/will-in-wi/letsencrypt-webfaction/pull/144) - Tiny fix so that "default" does what it says on the tin. Thanks to @nootrope for raising this UX issue!
12
+
1
13
  v3.0.1
2
14
 
3
15
  * Improves messaging when requesting validation fails
data/Gemfile CHANGED
@@ -7,6 +7,7 @@ group :development, :test do
7
7
  gem 'bundler', '~> 1.11'
8
8
  gem 'pry', '~> 0.10'
9
9
  gem 'pry-byebug', '~> 3.3'
10
+ gem 'pry-doc'
10
11
  gem 'rake', '~> 12.0'
11
12
  gem 'rspec', '~> 3.4'
12
13
  gem 'rubocop', '~> 0.51'
data/README.md CHANGED
@@ -67,9 +67,15 @@ After saving `~/.bash_profile`, run the command `source $HOME/.bash_profile` to
67
67
 
68
68
  Run `letsencrypt_webfaction init` to generate a registration cert and the config file. Open the config file `nano -w ~/letsencrypt_webfaction.toml` and edit to reflect your configuration.
69
69
 
70
- Now, you are ready to run `letsencrypt_webfaction run` from your SSH session to get certificates.
70
+ Now, you are ready to run `letsencrypt_webfaction run` from your SSH session to get certificates. Note that by default the config file `letsencrypt_webfaction.toml` is pointed at the LetsEncrypt staging endpoint (the line that says: `endpoint = "https://acme-staging.api.letsencrypt.org/"`); meaning you will only get "test" certificates installed while using the stage endpoint. To issue live certificates you will need to comment out default line, and uncomment the production endpoint line (the line that says: `endpoint = "https://acme-v01.api.letsencrypt.org/" # Production`).
71
71
 
72
- After you run this command, you will see new certificates in the webfaction admin panel, with the names you have provided. You need to change your application to point to this certificate after the certificate has been issued. Future runs of this command will update the existing certificate entry and not require a change in the admin.
72
+ When you have tested with staging, you can remove the certificate from WebFaction control panel (make sure no webapps are using it first) and re-run with the production endpoint.
73
+
74
+ After you run this command, you will see new certificates in the webfaction admin panel (under `Domains / Websites`, then `SSL certificates`), with the names you have provided (ie, the `name = ` variable in the `letsencrypt_webfaction.toml` config file). You need to change your application to point to this certificate after the certificate has been issued. This change will take some time for Webfaction to deploy before you will be able to successfully connect with the `https` version of your site. After a short period, Webfaction will copy your generated certficates into the directory `/home/yourusername/certificates/`. Future runs of this command will update the existing certificate entry and not require a change in the admin panel.
75
+
76
+ Once you can connect to your site via `https` you might have broken images and CSS files. Such "[mixed content](https://support.cloudflare.com/hc/en-us/articles/200170476-How-do-I-fix-the-SSL-Mixed-Content-Error-Message-)" will need to be fixed: make sure any references to embeded content from your site uses `https` rather than `http`.
77
+
78
+ Finally, if you would like the `http` site to redirect to your `https`, follow the [Webfaction guidance](https://docs.webfaction.com/software/static.html#redirecting-from-http-to-https).
73
79
 
74
80
  ## Usage
75
81
 
@@ -15,7 +15,7 @@ The basic procedure to upgrade is:
15
15
 
16
16
  ## Upgrade the program
17
17
 
18
- Follow the [instructions in the readme](README.md#Upgrading).
18
+ Follow the [instructions in the readme](/README.md#Upgrading).
19
19
 
20
20
  ## Initialize the config file
21
21
 
@@ -25,7 +25,7 @@ Gem::Specification.new do |spec|
25
25
  spec.cert_chain = ['certs/will_in_wi.pem']
26
26
  spec.signing_key = File.expand_path('~/.ssh/gem-private_key.pem') if $PROGRAM_NAME.end_with?('gem')
27
27
 
28
- spec.required_ruby_version = '>= 2.1.0'
28
+ spec.required_ruby_version = '>= 2.2.0'
29
29
 
30
30
  spec.add_runtime_dependency 'acme-client', '~> 1.0'
31
31
  spec.add_runtime_dependency 'toml-rb', '~> 1.1'
@@ -1,3 +1,3 @@
1
1
  module LetsencryptWebfaction
2
- VERSION = '3.0.1'.freeze
2
+ VERSION = '3.1.0'.freeze
3
3
  end
@@ -1,11 +1,13 @@
1
1
  require 'letsencrypt_webfaction/application/init'
2
2
  require 'letsencrypt_webfaction/application/run'
3
+ require 'letsencrypt_webfaction/application/version'
3
4
 
4
5
  module LetsencryptWebfaction
5
6
  module Application
6
7
  SUPPORTED_COMMANDS = {
7
8
  'init' => LetsencryptWebfaction::Application::Init,
8
9
  'run' => LetsencryptWebfaction::Application::Run,
10
+ '--version' => LetsencryptWebfaction::Application::Version,
9
11
  }.freeze
10
12
 
11
13
  V2_COMMANDS = %i[key_size endpoint domains public letsencrypt_account_email api_url username password servername cert_name].freeze
@@ -27,6 +27,7 @@ module LetsencryptWebfaction
27
27
  puts 'Config file already exists. Skipping copy...'
28
28
  else
29
29
  FileUtils.cp(source, Dir.home)
30
+ File.chmod(0o600, File.join(Dir.home, 'letsencrypt_webfaction.toml'))
30
31
  puts 'Copied configuration file'
31
32
  end
32
33
  end
@@ -6,6 +6,7 @@ require 'letsencrypt_webfaction/logger_output'
6
6
 
7
7
  require 'acme-client'
8
8
  require 'optparse'
9
+ require 'pathname'
9
10
 
10
11
  module LetsencryptWebfaction
11
12
  module Application
@@ -13,15 +14,11 @@ module LetsencryptWebfaction
13
14
  RENEWAL_DELTA = 14 # days
14
15
 
15
16
  def initialize(args)
16
- parse_quiet(args)
17
+ @config_path = DefaultConfigPath.new
18
+ parse_options(args)
19
+ @config_path.validate!
17
20
 
18
- # TODO: args should be supported: --config
19
- unless Options.default_options_path.exist?
20
- $stderr.puts 'The configuration file is missing.'
21
- $stderr.puts 'You may need to run `letsencrypt_webfaction init`'
22
- raise AppExitError, 'config missing'
23
- end
24
- @options = LetsencryptWebfaction::Options.from_toml(Options.default_options_path)
21
+ @options = LetsencryptWebfaction::Options.from_toml(@config_path.path)
25
22
  end
26
23
 
27
24
  def run!
@@ -40,13 +37,50 @@ module LetsencryptWebfaction
40
37
 
41
38
  private
42
39
 
43
- def parse_quiet(args)
40
+ class DefaultConfigPath
41
+ attr_reader :path
42
+
43
+ def initialize
44
+ @path = Options.default_options_path
45
+ end
46
+
47
+ def validate!
48
+ return true if @path.exist?
49
+ print_error
50
+ raise AppExitError, 'config missing'
51
+ end
52
+
53
+ private
54
+
55
+ def print_error
56
+ $stderr.puts 'The configuration file is missing.'
57
+ $stderr.puts 'You may need to run `letsencrypt_webfaction init`'
58
+ end
59
+ end
60
+
61
+ class CustomConfigPath < DefaultConfigPath
62
+ def initialize(path)
63
+ @path = Pathname.new(path)
64
+ end
65
+
66
+ private
67
+
68
+ def print_error
69
+ $stderr.puts 'The given configuration file does not exist'
70
+ end
71
+ end
72
+
73
+ def parse_options(args)
44
74
  OptionParser.new do |opts|
45
75
  opts.banner = 'Usage: letsencrypt_webfaction run [options]'
46
76
 
47
77
  opts.on('--quiet', 'Run with minimal output (useful for cron)') do |q|
48
78
  Out.quiet = q
49
79
  end
80
+
81
+ opts.on('--config=CONFIG', 'Alternative configuration path') do |c|
82
+ @config_path = CustomConfigPath.new(c)
83
+ end
50
84
  end.parse!(args)
51
85
  end
52
86
 
@@ -0,0 +1,11 @@
1
+ module LetsencryptWebfaction
2
+ module Application
3
+ class Version
4
+ def initialize(_); end # rubocop:disable Naming/UncommunicativeMethodParamName
5
+
6
+ def run!
7
+ puts LetsencryptWebfaction::VERSION
8
+ end
9
+ end
10
+ end
11
+ end
@@ -40,7 +40,7 @@ public = "~/webapps/myapp/public_html"
40
40
  # the cert common name with the dots replaced by underscores. (Optional)
41
41
  # NOTE: If you change this and do not also rename it in the webfaction admin,
42
42
  # a new certificate will be issued.
43
- name = "mycertname1"
43
+ #name = "mycertname1"
44
44
 
45
45
  # The size of the private key. 4096 is the default. You can use 2048.
46
46
  #key_size = 4096
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: 3.0.1
4
+ version: 3.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - William Johnston
@@ -30,7 +30,7 @@ cert_chain:
30
30
  ilYPju4QWNSvpNVhV+T7JUvAHXva3Rayfp8SKRpvX8ZpRCjvpYfgbmNxXO2ST1qb
31
31
  KBba/yJfCMh+B65HfRUXBQRRDtJ2Vu8i0WmRUKenahAnpkkeVmqhWwY=
32
32
  -----END CERTIFICATE-----
33
- date: 2018-06-14 00:00:00.000000000 Z
33
+ date: 2018-08-04 00:00:00.000000000 Z
34
34
  dependencies:
35
35
  - !ruby/object:Gem::Dependency
36
36
  name: acme-client
@@ -95,6 +95,7 @@ files:
95
95
  - lib/letsencrypt_webfaction/application.rb
96
96
  - lib/letsencrypt_webfaction/application/init.rb
97
97
  - lib/letsencrypt_webfaction/application/run.rb
98
+ - lib/letsencrypt_webfaction/application/version.rb
98
99
  - lib/letsencrypt_webfaction/certificate_installer.rb
99
100
  - lib/letsencrypt_webfaction/certificate_issuer.rb
100
101
  - lib/letsencrypt_webfaction/domain_validator.rb
@@ -116,7 +117,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
116
117
  requirements:
117
118
  - - ">="
118
119
  - !ruby/object:Gem::Version
119
- version: 2.1.0
120
+ version: 2.2.0
120
121
  required_rubygems_version: !ruby/object:Gem::Requirement
121
122
  requirements:
122
123
  - - ">="
metadata.gz.sig CHANGED
Binary file