certbot 0.0.1.pre.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/README.md +24 -0
- data/Rakefile +29 -0
- data/app/assets/stylesheets/certbot/application.css +15 -0
- data/app/controllers/certbot/application_controller.rb +5 -0
- data/app/controllers/certbot_controller.rb +16 -0
- data/app/helpers/certbot/application_helper.rb +4 -0
- data/app/views/layouts/certbot/application.html.erb +14 -0
- data/config/routes.rb +3 -0
- data/lib/certbot.rb +14 -0
- data/lib/certbot/configuration.rb +13 -0
- data/lib/certbot/engine.rb +10 -0
- data/lib/certbot/version.rb +3 -0
- data/lib/tasks/certbot_tasks.rake +4 -0
- metadata +115 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 4625c1babb34c16f249d33f925a78b0f24576cff
|
4
|
+
data.tar.gz: 84180a7c52837d05ba2e33231988936400a86415
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 90a7956bdfc433db6921573739ae8341b220e7a1c5c9358382c2b5b7e50d6b41afff79abfb653b87a2377ba53b44283581dfaefe8ed7d0c31e4be804c59a18aa
|
7
|
+
data.tar.gz: 67e2bcb03c7be73ac4c10981ddddc51abcfeb8d5ae3c63688e7f6ef37515d156582f0227170a4974f7323bcc341902b68c23ece0c6c12b459b42ee4b482abc09
|
data/MIT-LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright 2016 BetterUp, Inc.
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
## Installation
|
2
|
+
|
3
|
+
NOTE: the certbot challenge/response *must* be served over HTTP without
|
4
|
+
SSL. This means that your Rails application can not have the `force_ssl` flag
|
5
|
+
set in your `config/application.rb`.
|
6
|
+
|
7
|
+
In order to enable application wide SSL, use this alternative method:
|
8
|
+
http://guides.rubyonrails.org/action_controller_overview.html#force-https-protocol
|
9
|
+
|
10
|
+
## Configuration
|
11
|
+
|
12
|
+
By default, this library is configured via ENV variables.
|
13
|
+
```
|
14
|
+
CERTBOT_CHALLENGE = Certbot challenge code
|
15
|
+
CERTBOT_TOKEN = Certbot response token
|
16
|
+
```
|
17
|
+
|
18
|
+
The challenge and token can also be configured via Ruby API.
|
19
|
+
```ruby
|
20
|
+
Certbot.configure do |config|
|
21
|
+
config.challenge = 'my_challenge_code'
|
22
|
+
config.token = 'my_response_token'
|
23
|
+
end
|
24
|
+
```
|
data/Rakefile
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
begin
|
2
|
+
require 'bundler/setup'
|
3
|
+
rescue LoadError
|
4
|
+
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
5
|
+
end
|
6
|
+
|
7
|
+
require 'rdoc/task'
|
8
|
+
|
9
|
+
RDoc::Task.new(:rdoc) do |rdoc|
|
10
|
+
rdoc.rdoc_dir = 'rdoc'
|
11
|
+
rdoc.title = 'Certbot'
|
12
|
+
rdoc.options << '--line-numbers'
|
13
|
+
rdoc.rdoc_files.include('README.rdoc')
|
14
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
15
|
+
end
|
16
|
+
|
17
|
+
APP_RAKEFILE = File.expand_path("../spec/dummy/Rakefile", __FILE__)
|
18
|
+
load 'rails/tasks/engine.rake'
|
19
|
+
|
20
|
+
load 'rails/tasks/statistics.rake'
|
21
|
+
|
22
|
+
Bundler::GemHelper.install_tasks
|
23
|
+
|
24
|
+
begin
|
25
|
+
require 'rspec/core/rake_task'
|
26
|
+
RSpec::Core::RakeTask.new(:spec)
|
27
|
+
rescue LoadError
|
28
|
+
end
|
29
|
+
task default: :spec
|
@@ -0,0 +1,15 @@
|
|
1
|
+
/*
|
2
|
+
* This is a manifest file that'll be compiled into application.css, which will include all the files
|
3
|
+
* listed below.
|
4
|
+
*
|
5
|
+
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
|
6
|
+
* or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
|
7
|
+
*
|
8
|
+
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
|
9
|
+
* compiled file so the styles you add here take precedence over styles defined in any styles
|
10
|
+
* defined in the other CSS/SCSS files in this directory. It is generally better to create a new
|
11
|
+
* file per style scope.
|
12
|
+
*
|
13
|
+
*= require_tree .
|
14
|
+
*= require_self
|
15
|
+
*/
|
@@ -0,0 +1,16 @@
|
|
1
|
+
class CertbotController < Certbot::ApplicationController
|
2
|
+
def show
|
3
|
+
challenge = params[:challenge]
|
4
|
+
if challenge == certbot_config.challenge
|
5
|
+
render text: certbot_config.token
|
6
|
+
else
|
7
|
+
render nothing: true, status: 404
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
private
|
12
|
+
|
13
|
+
def certbot_config
|
14
|
+
Certbot.configuration
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>Certbot</title>
|
5
|
+
<%= stylesheet_link_tag "certbot/application", media: "all" %>
|
6
|
+
<%= javascript_include_tag "certbot/application" %>
|
7
|
+
<%= csrf_meta_tags %>
|
8
|
+
</head>
|
9
|
+
<body>
|
10
|
+
|
11
|
+
<%= yield %>
|
12
|
+
|
13
|
+
</body>
|
14
|
+
</html>
|
data/config/routes.rb
ADDED
data/lib/certbot.rb
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
module Certbot
|
2
|
+
class Configuration
|
3
|
+
# Default: ENV['CERTBOT_CHALLENGE']
|
4
|
+
attr_accessor :challenge
|
5
|
+
# Default: ENV['CERTBOT_TOKEN']
|
6
|
+
attr_accessor :token
|
7
|
+
|
8
|
+
def initialize
|
9
|
+
@challenge = ENV['CERTBOT_CHALLENGE']
|
10
|
+
@token = ENV['CERTBOT_TOKEN']
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
module Certbot
|
2
|
+
InvalidConfigurationError = Class.new(StandardError)
|
3
|
+
|
4
|
+
class Engine < ::Rails::Engine
|
5
|
+
isolate_namespace Certbot
|
6
|
+
initializer 'certbot.config.force_ssl_assertion' do |app|
|
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
|
+
end
|
9
|
+
end
|
10
|
+
end
|
metadata
ADDED
@@ -0,0 +1,115 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: certbot
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1.pre.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- BetterUp Developers
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-05-30 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rails
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 4.2.6
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 4.2.6
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: sqlite3
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec-rails
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: shoulda-matchers
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
description: Rails engine for generating certs with certbot using the challenge and
|
70
|
+
response method
|
71
|
+
email:
|
72
|
+
- developers@betterup.co
|
73
|
+
executables: []
|
74
|
+
extensions: []
|
75
|
+
extra_rdoc_files: []
|
76
|
+
files:
|
77
|
+
- MIT-LICENSE
|
78
|
+
- README.md
|
79
|
+
- Rakefile
|
80
|
+
- app/assets/stylesheets/certbot/application.css
|
81
|
+
- app/controllers/certbot/application_controller.rb
|
82
|
+
- app/controllers/certbot_controller.rb
|
83
|
+
- app/helpers/certbot/application_helper.rb
|
84
|
+
- app/views/layouts/certbot/application.html.erb
|
85
|
+
- config/routes.rb
|
86
|
+
- lib/certbot.rb
|
87
|
+
- lib/certbot/configuration.rb
|
88
|
+
- lib/certbot/engine.rb
|
89
|
+
- lib/certbot/version.rb
|
90
|
+
- lib/tasks/certbot_tasks.rake
|
91
|
+
homepage: http://github.com/betterup/certbot
|
92
|
+
licenses:
|
93
|
+
- MIT
|
94
|
+
metadata: {}
|
95
|
+
post_install_message:
|
96
|
+
rdoc_options: []
|
97
|
+
require_paths:
|
98
|
+
- lib
|
99
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
105
|
+
requirements:
|
106
|
+
- - ">"
|
107
|
+
- !ruby/object:Gem::Version
|
108
|
+
version: 1.3.1
|
109
|
+
requirements: []
|
110
|
+
rubyforge_project:
|
111
|
+
rubygems_version: 2.6.4
|
112
|
+
signing_key:
|
113
|
+
specification_version: 4
|
114
|
+
summary: Rails engine for generating certs with certbot
|
115
|
+
test_files: []
|