letsencrypt-cli 0.1.2 → 0.1.3

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: a5b3813e16fc68f65ed8fa6ce4950f9795347700
4
- data.tar.gz: 18b2289f486d78fe6271177173acbf2c31851754
3
+ metadata.gz: f328743f9d14408d872df2bdd9d95726cc6f413a
4
+ data.tar.gz: 4ef212afa3f1ecbe12d8698c6874578e45a9f78f
5
5
  SHA512:
6
- metadata.gz: 61d3c309f9f88de49af7c8ada2af58e836603da55eebf4b1dab1a10e21b179d9a941a14711e7de3f794e67d662cb20dc157c57d1415576baabb133775c52ba2e
7
- data.tar.gz: a32ea34099e4ef5ef1a856bfe1d3dc2a1291d8fa4fcc6cee76152d750a19ede4fcee28716fb601173b5f680587b5975b2275166bb1bc79030323df2080d31184
6
+ metadata.gz: f5b9537171b8e2ca786a59ee08d788a2f75e8c11ea4164a2cf4c9659872e894ca8c03b06817dd4951ec72c1c43889e3a6a86e450a4ebea940ffed28b1c1c4fec
7
+ data.tar.gz: e0f9604d54c50d03f398f8b5dbef901494d259a1d4f3c8a36ec6370584345b0f6c05324873b480547fec1a4019826560839db06eebffa21a4433d9cb943112b2
data/README.md CHANGED
@@ -26,7 +26,13 @@ $ letsencrypt-cli --version
26
26
 
27
27
  Unfortunately, most Linux distributions does not ship a current Ruby version (Version 1.9.3 or 2.0).
28
28
 
29
- If you are installing this as a non-root user, you might want to try RVM (needs no root:
29
+ If you are installing this as a non-root user, you might want to try RVM. Installation itself needs no root, but needs some packages:
30
+
31
+ ```
32
+ sudo apt-get install curl bison build-essential zlib1g-dev libssl-dev libreadline6-dev libxml2-dev libgmp-dev git-core
33
+ ```
34
+
35
+ To install RVM:
30
36
 
31
37
  ```
32
38
  gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
@@ -61,23 +67,20 @@ letsencrypt-cli help cert
61
67
  # creates account_key.json in current_dir
62
68
  letsencrypt-cli register -t myemail@example.com
63
69
 
64
-
65
70
  # authorize one or more domains/subdomains
66
71
  letsencrypt-cli authorize -t --webroot-path /var/www/default example.com www.example.com somedir.example.com
67
72
 
68
73
  # experimental: authorize all server_names in /etc/nginx/sites-enabled/*
69
74
  letsencrypt-cli authorize_all -t --webroot-path /var/www/default
70
75
 
71
-
72
- # create a certificate for before authorized domains.
76
+ # create a certificate for domains that are already authorized within the last minutes (1h-2h I think)
73
77
  # the first domain will be the cn subject. All other are subjectAlternateName
74
78
  # if cert.pem already exists, will only create a new one if the old is expired
75
79
  # (30 days before expiration) -> see full help
76
80
  letsencrypt-cli help cert
77
81
 
78
82
  letsencrypt-cli cert -t example.com www.example.com somdir.example.com
79
- # will create key.pem fullchain.pem chain.pem and cert.pem
80
-
83
+ # will create key.pem fullchain.pem chain.pem and cert.pem in current directory
81
84
 
82
85
  # checks validation date of given certificate. Exists non-zero if not exists or
83
86
  # will expire in 30 days
@@ -13,11 +13,11 @@ module Letsencrypt
13
13
  method_option :key_length, desc: "Length of generated private key", type: :numeric, default: 4096
14
14
  def register(email)
15
15
  if email.nil? || email == ""
16
- log "no E-Mail specified!", :fatal
16
+ wrapper.log "no E-Mail specified!", :fatal
17
17
  exit 1
18
18
  end
19
19
  if !email[/.*@.*/]
20
- log "not an email", :fatal
20
+ wrapper.log "not an email", :fatal
21
21
  exit 1
22
22
  end
23
23
  registration = wrapper.client.register(contact: "mailto:" + email)
@@ -27,8 +27,9 @@ module Letsencrypt
27
27
 
28
28
  desc 'authorize_all', "Verify all server_names in /etc/nginx/sites-enabled/* (needs read access)"
29
29
  method_option :webroot_path, desc: "Path to mapped .acme-challenge folder (no subdir)", aliases: '-w', required: true
30
+ method_option :webserver_dir, desc: "Path to webserver configs", default: "/etc/nginx/sites-enabled"
30
31
  def authorize_all
31
- lines = Dir['/etc/nginx/sites-enabled/*'].map{|file| File.read(file).lines.grep(/^\s*server_name/) }.flatten
32
+ lines = Dir[ File.join(@options[:webserver_dir], "*")].map{|file| File.read(file).lines.grep(/^\s*server_name/) }.flatten
32
33
  domains = lines.flatten.map{|i| i.strip.split(/[; ]/).drop(1) }.flatten.reject{|i| i.length < 3 }.uniq
33
34
  authorize(*domains)
34
35
  end
@@ -56,7 +57,7 @@ module Letsencrypt
56
57
  method_option :days_valid, desc: "If the --certificate-path already exists, only create new stuff, if that certificate isn't valid for less than the given number of days", default: 30, type: :numeric
57
58
  def cert(*domains)
58
59
  if domains.length == 0
59
- $stderr.puts "no domains given"
60
+ wrapper.log "no domains given", :fatal
60
61
  exit 1
61
62
  end
62
63
  wrapper.cert(domains)
@@ -1,5 +1,5 @@
1
1
  module Letsencrypt
2
2
  module Cli
3
- VERSION = "0.1.2"
3
+ VERSION = "0.1.3"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: letsencrypt-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefan Wienert
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-12-05 00:00:00.000000000 Z
11
+ date: 2015-12-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: acme-client