letsencrypt_webfaction 4.0.0 → 4.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +1 -4
- data/.rubocop.yml +18 -6
- data/.travis.yml +4 -2
- data/CHANGELOG.md +4 -0
- data/Gemfile +3 -1
- data/README.md +5 -5
- data/Rakefile +2 -0
- data/docs/rbenv.md +6 -8
- data/docs/upgrading.md +17 -0
- data/exe/letsencrypt_webfaction +1 -0
- data/letsencrypt_webfaction.gemspec +5 -5
- data/lib/letsencrypt_webfaction.rb +3 -1
- data/lib/letsencrypt_webfaction/application.rb +2 -0
- data/lib/letsencrypt_webfaction/application/init.rb +2 -0
- data/lib/letsencrypt_webfaction/application/run.rb +2 -0
- data/lib/letsencrypt_webfaction/application/version.rb +2 -0
- data/lib/letsencrypt_webfaction/certificate_installer.rb +2 -0
- data/lib/letsencrypt_webfaction/certificate_issuer.rb +2 -0
- data/lib/letsencrypt_webfaction/domain_validator.rb +2 -0
- data/lib/letsencrypt_webfaction/errors.rb +2 -0
- data/lib/letsencrypt_webfaction/logger_output.rb +2 -0
- data/lib/letsencrypt_webfaction/options.rb +3 -1
- data/lib/letsencrypt_webfaction/options/certificate.rb +3 -1
- data/lib/letsencrypt_webfaction/webfaction_api_credentials.rb +2 -0
- metadata +20 -7
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 4c4a64d238719879ad06960eb2cd9f6d563d8ed9bd5196087a7786d6ed06d40e
|
4
|
+
data.tar.gz: a98a94eff65248af07a9e5bb3f8f2a58f526e8ccaf1c13d1cf9e4b69ac854e54
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b6875968dd2e9c00d9e5bba5fb7a9c3df70fb0da19224e093d7a64d60e0ef34386f827c807bdf5f3e23b6607fb820108843b5014cb836c5b2c930a9dddb8e14d
|
7
|
+
data.tar.gz: 1ccc78c90709c904fa9fa9b09b50b4f1a7a95318864a195c19cc6e0e189d0e4e77ed48ff1a5e918d936fcb587950624e1ac05e3919962008099b1e0025dcf520
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
data/.rubocop.yml
CHANGED
@@ -6,9 +6,9 @@ AllCops:
|
|
6
6
|
- 'bin/*'
|
7
7
|
# Keep rubocop from scanning installed gems.
|
8
8
|
- 'vendor/**/*'
|
9
|
-
TargetRubyVersion: 2.
|
9
|
+
TargetRubyVersion: 2.4
|
10
10
|
# Line length is something that isn't dogmatic. 80 chars is a good recommendation.
|
11
|
-
|
11
|
+
Layout/LineLength:
|
12
12
|
Enabled: false
|
13
13
|
# This requires leading comments which can tend to be redundant.
|
14
14
|
Style/Documentation:
|
@@ -26,10 +26,6 @@ Metrics/ModuleLength:
|
|
26
26
|
# Tests involve piles of code.
|
27
27
|
- 'spec/**/*'
|
28
28
|
|
29
|
-
# I'm not pulling in a library, or forcing Ruby 2.3+
|
30
|
-
Layout/IndentHeredoc:
|
31
|
-
Enabled: false
|
32
|
-
|
33
29
|
# When we use $stderr.puts, we don't see that as verbose.
|
34
30
|
Style/StderrPuts:
|
35
31
|
Enabled: false
|
@@ -70,3 +66,19 @@ Style/TrailingCommaInArguments:
|
|
70
66
|
# Seems buggy for now.
|
71
67
|
Layout/ClosingHeredocIndentation:
|
72
68
|
Enabled: false
|
69
|
+
|
70
|
+
# Enable new cops
|
71
|
+
Layout/SpaceAroundMethodCallOperator:
|
72
|
+
Enabled: true
|
73
|
+
Lint/RaiseException:
|
74
|
+
Enabled: true
|
75
|
+
Lint/StructNewOverride:
|
76
|
+
Enabled: true
|
77
|
+
Style/ExponentialNotation:
|
78
|
+
Enabled: true
|
79
|
+
Style/HashEachMethods:
|
80
|
+
Enabled: true
|
81
|
+
Style/HashTransformKeys:
|
82
|
+
Enabled: true
|
83
|
+
Style/HashTransformValues:
|
84
|
+
Enabled: true
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,10 @@ Unreleased
|
|
2
2
|
|
3
3
|
* Your change here!
|
4
4
|
|
5
|
+
v4.0.1
|
6
|
+
|
7
|
+
* Require Ruby >=2.4 (mostly because Faraday, which this depends on, doesn't support 2.2 anymore. Also not support 2.3 because of the xmlrpc library extraction. This just makes things easier, and it seems like WebFaction supports this new version of Ruby everywhere now.)
|
8
|
+
|
5
9
|
v4.0.0
|
6
10
|
|
7
11
|
* Support ACMEv2
|
data/Gemfile
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
source 'https://rubygems.org'
|
2
4
|
|
3
5
|
# Specify your gem's dependencies in test_gem.gemspec
|
@@ -9,7 +11,7 @@ group :development, :test do
|
|
9
11
|
gem 'pry-doc'
|
10
12
|
gem 'rake', '~> 12.0'
|
11
13
|
gem 'rspec', '~> 3.4'
|
12
|
-
gem 'rubocop', '~> 0.
|
14
|
+
gem 'rubocop', '~> 0.82.0'
|
13
15
|
gem 'rubocop-performance'
|
14
16
|
gem 'simplecov', '~> 0.11'
|
15
17
|
gem 'timecop', '~> 0.9.1'
|
data/README.md
CHANGED
@@ -61,14 +61,14 @@ All places where you need to substitute a value specific to your setup will be d
|
|
61
61
|
Run the following command in an SSH session to install the letsencrypt_webfaction package via the [RubyGems package management site](https://rubygems.org/gems/letsencrypt_webfaction):
|
62
62
|
|
63
63
|
```sh
|
64
|
-
GEM_HOME=$HOME/.letsencrypt_webfaction/gems RUBYLIB=$GEM_HOME/lib gem2.
|
64
|
+
GEM_HOME=$HOME/.letsencrypt_webfaction/gems RUBYLIB=$GEM_HOME/lib gem2.4 install letsencrypt_webfaction
|
65
65
|
```
|
66
66
|
|
67
67
|
Add the following to `~/.bash_profile` (using, for example, an FTP client or your favorite text editor):
|
68
68
|
|
69
69
|
```sh
|
70
70
|
function letsencrypt_webfaction {
|
71
|
-
GEM_HOME=$HOME/.letsencrypt_webfaction/gems PATH=$PATH:$GEM_HOME/bin RUBYLIB=$GEM_HOME/lib ruby2.
|
71
|
+
GEM_HOME=$HOME/.letsencrypt_webfaction/gems PATH=$PATH:$GEM_HOME/bin RUBYLIB=$GEM_HOME/lib ruby2.4 $HOME/.letsencrypt_webfaction/gems/bin/letsencrypt_webfaction $*
|
72
72
|
}
|
73
73
|
```
|
74
74
|
This will simplify the running of the LetsEncrypt WebFaction command, by setting some variables in advance.
|
@@ -131,7 +131,7 @@ The Cron task should run daily (or however often you prefer) and will only renew
|
|
131
131
|
Your Cron task should look like:
|
132
132
|
|
133
133
|
```cron
|
134
|
-
18 3 * * * PATH=$PATH:$GEM_HOME/bin:/usr/local/bin GEM_HOME=$HOME/.letsencrypt_webfaction/gems RUBYLIB=$GEM_HOME/lib ruby2.
|
134
|
+
18 3 * * * PATH=$PATH:$GEM_HOME/bin:/usr/local/bin GEM_HOME=$HOME/.letsencrypt_webfaction/gems RUBYLIB=$GEM_HOME/lib ruby2.4 $HOME/.letsencrypt_webfaction/gems/bin/letsencrypt_webfaction run --quiet
|
135
135
|
```
|
136
136
|
|
137
137
|
*Note the usage of `--quiet` to keep the success message from being shown and emailed.*
|
@@ -148,14 +148,14 @@ You can find the current version by running `letsencrypt_webfaction --version`.
|
|
148
148
|
|
149
149
|
[The changelog](CHANGELOG.md) describes changes from version to version.
|
150
150
|
|
151
|
-
LetsEncrypt WebFaction follows [Semantic Versioning](http://semver.org/). In a nutshell, a version number such as `1.2.
|
151
|
+
LetsEncrypt WebFaction follows [Semantic Versioning](http://semver.org/). In a nutshell, a version number such as `1.2.4` is divided as `major.minor.patch`. When the major version is incremented, you will probably have to change something about the configuration to make it work. The changelog will let you know what changes you need to make. When the minor version is incremented, there are new features but existing features haven't changed. If the patch version is incremented, the changes are all under the hood and shouldn't change or add any existing features.
|
152
152
|
|
153
153
|
TL;DR: Be careful with major version upgrades and you should be fine with upgrading to minor or patch releases.
|
154
154
|
|
155
155
|
To upgrade, run the following command to fetch and install the newest version from RubyGems:
|
156
156
|
|
157
157
|
```sh
|
158
|
-
GEM_HOME=$HOME/.letsencrypt_webfaction/gems RUBYLIB=$GEM_HOME/lib gem2.
|
158
|
+
GEM_HOME=$HOME/.letsencrypt_webfaction/gems RUBYLIB=$GEM_HOME/lib gem2.4 install letsencrypt_webfaction
|
159
159
|
```
|
160
160
|
|
161
161
|
## Development
|
data/Rakefile
CHANGED
data/docs/rbenv.md
CHANGED
@@ -4,22 +4,20 @@ This method is useful if you are already using RBEnv to manage Ruby, or if you a
|
|
4
4
|
|
5
5
|
Follow the instructions to [set up RBEnv](https://github.com/rbenv/rbenv) and [Ruby Build](https://github.com/rbenv/ruby-build#readme) on your WebFaction server.
|
6
6
|
|
7
|
-
Once you have done so, install Ruby 2.
|
7
|
+
Once you have done so, install Ruby 2.4+. Then set the local Ruby and install the Gem. Finally unset the local Ruby so that you don't run into problems.
|
8
8
|
|
9
|
-
$ rbenv install 2.
|
10
|
-
$ rbenv local 2.
|
9
|
+
$ rbenv install 2.7.0 # Installs Ruby 2.7.0
|
10
|
+
$ rbenv local 2.7.0 # Sets Ruby 2.7.0 as the default version in the current folder.
|
11
11
|
$ gem install letsencrypt_webfaction # Installs this utility from RubyGems.
|
12
12
|
$ rbenv rehash # Makes RBenv aware of the letsencrypt_webfaction utility.
|
13
|
-
$ rm .ruby-version # Unsets Ruby 2.
|
14
|
-
|
15
|
-
*Ruby 2.4.0+ is not supported since they removed the XMLRPC library from core and moved it to a gem. This Gem doesn't work in Ruby <2.3, leaving us with an issue as the majority of system Rubies used with this project are <2.4. So don't use 2.4 for now. If you absolutely want to, make sure you install the xmlrpc gem manually.*
|
13
|
+
$ rm .ruby-version # Unsets Ruby 2.7.0 as the default version in the current folder.
|
16
14
|
|
17
15
|
## Cron usage
|
18
16
|
|
19
17
|
Instead of the cron command in the readme, when using rbenv it would look like the following:
|
20
18
|
|
21
19
|
```cron
|
22
|
-
18 3 * * * RBENV_ROOT=~/.rbenv RBENV_VERSION=2.
|
20
|
+
18 3 * * * RBENV_ROOT=~/.rbenv RBENV_VERSION=2.7.0 ~/.rbenv/bin/rbenv exec letsencrypt_webfaction --letsencrypt_account_email [you@youremail.com] --domains [yourdomain.com,www.yourdomain.com] --public ~/webapps/[yourapp/your_public_html]/ --quiet --username [yourusername] --password [yourpassword]
|
23
21
|
```
|
24
22
|
|
25
23
|
## Upgrading
|
@@ -27,5 +25,5 @@ Instead of the cron command in the readme, when using rbenv it would look like t
|
|
27
25
|
To upgrade the installed version, run:
|
28
26
|
|
29
27
|
```sh
|
30
|
-
RBENV_VERSION=2.
|
28
|
+
RBENV_VERSION=2.7.0 gem install letsencrypt_webfaction
|
31
29
|
```
|
data/docs/upgrading.md
CHANGED
@@ -7,6 +7,23 @@ Switching to ACMEv2 broke backwards compatibility in a couple ways.
|
|
7
7
|
directory = "https://acme-staging-v02.api.letsencrypt.org/directory" # Staging
|
8
8
|
#directory = "https://acme-v02.api.letsencrypt.org/directory" # Production
|
9
9
|
```
|
10
|
+
- You need to change all references from Ruby 2.2 to 2.4.
|
11
|
+
Run:
|
12
|
+
```bash
|
13
|
+
GEM_HOME=$HOME/.letsencrypt_webfaction/gems RUBYLIB=$GEM_HOME/lib gem2.4 install letsencrypt_webfaction
|
14
|
+
```
|
15
|
+
And then change
|
16
|
+
```bash
|
17
|
+
function letsencrypt_webfaction {
|
18
|
+
GEM_HOME=$HOME/.letsencrypt_webfaction/gems PATH=$PATH:$GEM_HOME/bin RUBYLIB=$GEM_HOME/lib ruby2.2 $HOME/.letsencrypt_webfaction/gems/bin/letsencrypt_webfaction $*
|
19
|
+
}
|
20
|
+
```
|
21
|
+
to
|
22
|
+
```bash
|
23
|
+
function letsencrypt_webfaction {
|
24
|
+
GEM_HOME=$HOME/.letsencrypt_webfaction/gems PATH=$PATH:$GEM_HOME/bin RUBYLIB=$GEM_HOME/lib ruby2.4 $HOME/.letsencrypt_webfaction/gems/bin/letsencrypt_webfaction $*
|
25
|
+
}
|
26
|
+
```
|
10
27
|
|
11
28
|
# Upgrading from v2 to v3
|
12
29
|
|
data/exe/letsencrypt_webfaction
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
lib = File.expand_path('lib', __dir__)
|
2
4
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
3
5
|
require 'letsencrypt_webfaction'
|
@@ -25,11 +27,9 @@ Gem::Specification.new do |spec|
|
|
25
27
|
spec.cert_chain = ['certs/will_in_wi.pem']
|
26
28
|
spec.signing_key = File.expand_path('~/.ssh/gem-private_key.pem') if $PROGRAM_NAME.end_with?('gem')
|
27
29
|
|
28
|
-
spec.required_ruby_version = '>= 2.
|
30
|
+
spec.required_ruby_version = '>= 2.4.0'
|
29
31
|
|
30
32
|
spec.add_runtime_dependency 'acme-client', '~> 2.0'
|
31
|
-
spec.add_runtime_dependency 'toml-rb', '~>
|
32
|
-
|
33
|
-
# This will be required for Ruby 2.4. But it is incompatible for Ruby <2.3. Unsupporting Ruby 2.4 for the moment.
|
34
|
-
# spec.add_runtime_dependency 'xmlrpc', '~> 0.3.0'
|
33
|
+
spec.add_runtime_dependency 'toml-rb', '~> 2.0'
|
34
|
+
spec.add_runtime_dependency 'xmlrpc', '~> 0.3.0'
|
35
35
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'toml-rb'
|
2
4
|
require 'socket'
|
3
5
|
|
@@ -7,7 +9,7 @@ module LetsencryptWebfaction
|
|
7
9
|
class Options
|
8
10
|
NON_BLANK_FIELDS = %i[username password letsencrypt_account_email directory api_url servername].freeze
|
9
11
|
|
10
|
-
WEBFACTION_API_URL = 'https://api.webfaction.com/'
|
12
|
+
WEBFACTION_API_URL = 'https://api.webfaction.com/'
|
11
13
|
|
12
14
|
def initialize(args)
|
13
15
|
@config = args
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module LetsencryptWebfaction
|
2
4
|
class Options
|
3
5
|
class Certificate
|
@@ -43,7 +45,7 @@ module LetsencryptWebfaction
|
|
43
45
|
e[:method] = 'must be "http01"' unless SUPPORTED_VALIDATION_METHODS.include?(validation_method)
|
44
46
|
e[:public] = "can't be empty" if public_dirs.none?
|
45
47
|
e[:name] = "can't be blank" if cert_name.nil? || cert_name == ''
|
46
|
-
e[:name] = 'can only include letters, numbers, and underscores' if cert_name
|
48
|
+
e[:name] = 'can only include letters, numbers, and underscores' if VALID_CERT_NAME.match?(cert_name)
|
47
49
|
e[:key_size] = "must be one of #{VALID_KEY_SIZES.join(', ')}" unless VALID_KEY_SIZES.include?(key_size)
|
48
50
|
end
|
49
51
|
end
|
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: 4.0.
|
4
|
+
version: 4.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- William Johnston
|
@@ -30,7 +30,7 @@ cert_chain:
|
|
30
30
|
is7nzWq9MtbVDHPaE5a10t+7UoSjPzWFe4qKnxjB8RjfGymDvy4+H2eJbRQE932E
|
31
31
|
Dm3/IFNc1K3ekU2WQEZ3O0WHQY8bCBgCAD/U/CiTaLUOm4VsPnYLAx4=
|
32
32
|
-----END CERTIFICATE-----
|
33
|
-
date: 2020-04-
|
33
|
+
date: 2020-04-18 00:00:00.000000000 Z
|
34
34
|
dependencies:
|
35
35
|
- !ruby/object:Gem::Dependency
|
36
36
|
name: acme-client
|
@@ -52,14 +52,28 @@ dependencies:
|
|
52
52
|
requirements:
|
53
53
|
- - "~>"
|
54
54
|
- !ruby/object:Gem::Version
|
55
|
-
version: '
|
55
|
+
version: '2.0'
|
56
|
+
type: :runtime
|
57
|
+
prerelease: false
|
58
|
+
version_requirements: !ruby/object:Gem::Requirement
|
59
|
+
requirements:
|
60
|
+
- - "~>"
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '2.0'
|
63
|
+
- !ruby/object:Gem::Dependency
|
64
|
+
name: xmlrpc
|
65
|
+
requirement: !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
67
|
+
- - "~>"
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: 0.3.0
|
56
70
|
type: :runtime
|
57
71
|
prerelease: false
|
58
72
|
version_requirements: !ruby/object:Gem::Requirement
|
59
73
|
requirements:
|
60
74
|
- - "~>"
|
61
75
|
- !ruby/object:Gem::Version
|
62
|
-
version:
|
76
|
+
version: 0.3.0
|
63
77
|
description: A tool to simplify the manual process of using LetsEncrypt on Webfaction
|
64
78
|
hosts. It can be added to cron where it will validate your domains automatically,
|
65
79
|
place the generated certs in a common folder, and then email the WebFaction support
|
@@ -117,15 +131,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
117
131
|
requirements:
|
118
132
|
- - ">="
|
119
133
|
- !ruby/object:Gem::Version
|
120
|
-
version: 2.
|
134
|
+
version: 2.4.0
|
121
135
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
122
136
|
requirements:
|
123
137
|
- - ">="
|
124
138
|
- !ruby/object:Gem::Version
|
125
139
|
version: '0'
|
126
140
|
requirements: []
|
127
|
-
|
128
|
-
rubygems_version: 2.5.1
|
141
|
+
rubygems_version: 3.1.2
|
129
142
|
signing_key:
|
130
143
|
specification_version: 4
|
131
144
|
summary: LetsEncrypt utility client for WebFaction hosts.
|
metadata.gz.sig
CHANGED
Binary file
|