certbot 0.0.1.pre.1 → 0.0.1.pre.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +14 -4
- data/app/controllers/certbot_controller.rb +2 -3
- data/config/routes.rb +1 -1
- data/lib/certbot/configuration.rb +3 -3
- data/lib/certbot/engine.rb +3 -0
- data/lib/certbot/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ffea510708e98db7b405b9bfbf8e545a22c4677e
|
4
|
+
data.tar.gz: 4c600b80462e4ee71b95a0ce84bfda86196417df
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c7d27a37e005752550aaa571552b76fdcf75f2951e977bd85fced953c07d0a30c8e013af08c8cbd7d35a90f315948613ac98f3f0ecc295d61471ba8e1d0a8a50
|
7
|
+
data.tar.gz: bcc8efbcb798cdf7fce28957b18a05f6d2bd85f1c21376e46ddd34dd0df72d933f7eaae2422a74abf14b9c0cf0e69b9064cb3fee3646d1cdb2c0d50095dd5024
|
data/README.md
CHANGED
@@ -1,5 +1,15 @@
|
|
1
|
+
## Overview
|
2
|
+
This gem is an implementation of the [certbot http-01
|
3
|
+
challenge](https://tools.ietf.org/html/draft-ietf-acme-acme-01#page-38)
|
4
|
+
for use in Rails applications.
|
5
|
+
|
1
6
|
## Installation
|
2
7
|
|
8
|
+
```ruby
|
9
|
+
# Gemfile
|
10
|
+
gem 'certbot'
|
11
|
+
```
|
12
|
+
|
3
13
|
NOTE: the certbot challenge/response *must* be served over HTTP without
|
4
14
|
SSL. This means that your Rails application can not have the `force_ssl` flag
|
5
15
|
set in your `config/application.rb`.
|
@@ -11,14 +21,14 @@ http://guides.rubyonrails.org/action_controller_overview.html#force-https-protoc
|
|
11
21
|
|
12
22
|
By default, this library is configured via ENV variables.
|
13
23
|
```
|
14
|
-
|
15
|
-
|
24
|
+
CERTBOT_TOKEN = Certbot challenge token
|
25
|
+
CERTBOT_KEY_AUTHORIZATION = Certbot key authorization for valid request
|
16
26
|
```
|
17
27
|
|
18
28
|
The challenge and token can also be configured via Ruby API.
|
19
29
|
```ruby
|
20
30
|
Certbot.configure do |config|
|
21
|
-
config.
|
22
|
-
config.
|
31
|
+
config.token = 'my_challenge_token'
|
32
|
+
config.key_authorization = 'my_key_authorization'
|
23
33
|
end
|
24
34
|
```
|
@@ -1,8 +1,7 @@
|
|
1
1
|
class CertbotController < Certbot::ApplicationController
|
2
2
|
def show
|
3
|
-
|
4
|
-
|
5
|
-
render text: certbot_config.token
|
3
|
+
if params[:token] == certbot_config.token
|
4
|
+
render text: certbot_config.key_authorization
|
6
5
|
else
|
7
6
|
render nothing: true, status: 404
|
8
7
|
end
|
data/config/routes.rb
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
module Certbot
|
2
2
|
class Configuration
|
3
|
-
# Default: ENV['CERTBOT_CHALLENGE']
|
4
|
-
attr_accessor :challenge
|
5
3
|
# Default: ENV['CERTBOT_TOKEN']
|
6
4
|
attr_accessor :token
|
5
|
+
# Default: ENV['CERTBOT_KEY_AUTHORIZATION']
|
6
|
+
attr_accessor :key_authorization
|
7
7
|
|
8
8
|
def initialize
|
9
|
-
@challenge = ENV['CERTBOT_CHALLENGE']
|
10
9
|
@token = ENV['CERTBOT_TOKEN']
|
10
|
+
@key_authorization = ENV['CERTBOT_KEY_AUTHORIZATION']
|
11
11
|
end
|
12
12
|
end
|
13
13
|
end
|
data/lib/certbot/engine.rb
CHANGED
@@ -6,5 +6,8 @@ module Certbot
|
|
6
6
|
initializer 'certbot.config.force_ssl_assertion' do |app|
|
7
7
|
raise InvalidConfigurationError, 'force_ssl can not be enabled globally. see http://guides.rubyonrails.org/action_controller_overview.html#force-https-protocol' if app.config.force_ssl
|
8
8
|
end
|
9
|
+
# initializer 'certbot.config.filter_parameters' do |app|
|
10
|
+
# app.config.filter_parameters << 'challenge'
|
11
|
+
# end
|
9
12
|
end
|
10
13
|
end
|
data/lib/certbot/version.rb
CHANGED