rails_dev_ssl 0.1.3 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/dependabot.yml +15 -0
- data/.github/workflows/release.yml +50 -0
- data/.github/workflows/test.yml +25 -0
- data/.tool-versions +1 -0
- data/Gemfile +0 -2
- data/Gemfile.lock +20 -20
- data/README.md +32 -12
- data/lib/rails_dev_ssl/version.rb +1 -1
- data/rails_dev_ssl.gemspec +23 -23
- metadata +9 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e974560b8fb20937d21ad73323186a118618806a33606a1ca9e7fa8ff80ed235
|
4
|
+
data.tar.gz: 4349b9f97cdd71cf48250d9155ac2548dcd371afa42ec788400e1b465b92d8d2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 30a0da22855c1afd9209bedfe29940b47ec0a10c494490c495f0182e1c9f3dc41421cb666388860862689e8eb1ba8a29db8a4e5122f427573aa3cf04460b6dc3
|
7
|
+
data.tar.gz: 69d4d86289afd7f9108c6daa262972a96916541b7fb8e111c7030f5b58fbec36c9d185fb09e5f98e946eeadfe4ee9a516638b022f6ff5c7bbe015a3e0c08e75e
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# To get started with Dependabot version updates, you'll need to specify which
|
2
|
+
# package ecosystems to update and where the package manifests are located.
|
3
|
+
# Please see the documentation for all configuration options:
|
4
|
+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
|
5
|
+
|
6
|
+
version: 2
|
7
|
+
updates:
|
8
|
+
- package-ecosystem: "bundler" # See documentation for possible values
|
9
|
+
directory: "/" # Location of package manifests
|
10
|
+
schedule:
|
11
|
+
interval: "weekly"
|
12
|
+
- package-ecosystem: "github-actions"
|
13
|
+
directory: "/"
|
14
|
+
schedule:
|
15
|
+
interval: "weekly"
|
@@ -0,0 +1,50 @@
|
|
1
|
+
name: Ruby Gem
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches:
|
6
|
+
- main
|
7
|
+
|
8
|
+
concurrency:
|
9
|
+
group: build-and-publish-${{ github.workflow }}-${{ github.ref }}
|
10
|
+
cancel-in-progress: true
|
11
|
+
|
12
|
+
jobs:
|
13
|
+
test:
|
14
|
+
uses: ./.github/workflows/test.yml
|
15
|
+
secrets: inherit
|
16
|
+
build:
|
17
|
+
needs: [test]
|
18
|
+
name: Build + Publish
|
19
|
+
runs-on: ubuntu-latest
|
20
|
+
permissions:
|
21
|
+
contents: read
|
22
|
+
packages: write
|
23
|
+
|
24
|
+
steps:
|
25
|
+
- uses: actions/checkout@v3
|
26
|
+
- name: Set up Ruby
|
27
|
+
uses: actions/setup-ruby@v1
|
28
|
+
|
29
|
+
- name: Publish to GPR
|
30
|
+
run: |
|
31
|
+
mkdir -p $HOME/.gem
|
32
|
+
touch $HOME/.gem/credentials
|
33
|
+
chmod 0600 $HOME/.gem/credentials
|
34
|
+
printf -- "---\n:github: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
|
35
|
+
gem build *.gemspec
|
36
|
+
gem push --KEY github --host https://rubygems.pkg.github.com/${OWNER} *.gem
|
37
|
+
env:
|
38
|
+
GEM_HOST_API_KEY: "Bearer ${{secrets.GITHUB_TOKEN}}"
|
39
|
+
OWNER: ${{ github.repository_owner }}
|
40
|
+
|
41
|
+
- name: Publish to RubyGems
|
42
|
+
run: |
|
43
|
+
mkdir -p $HOME/.gem
|
44
|
+
touch $HOME/.gem/credentials
|
45
|
+
chmod 0600 $HOME/.gem/credentials
|
46
|
+
printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
|
47
|
+
gem build *.gemspec
|
48
|
+
gem push *.gem
|
49
|
+
env:
|
50
|
+
GEM_HOST_API_KEY: "${{secrets.RUBYGEMS_AUTH_TOKEN}}"
|
@@ -0,0 +1,25 @@
|
|
1
|
+
name: Test
|
2
|
+
on:
|
3
|
+
push:
|
4
|
+
branches-ignore:
|
5
|
+
- main
|
6
|
+
workflow_call:
|
7
|
+
|
8
|
+
concurrency:
|
9
|
+
group: test-${{ github.workflow }}-${{ github.ref }}
|
10
|
+
cancel-in-progress: true
|
11
|
+
|
12
|
+
jobs:
|
13
|
+
rspec:
|
14
|
+
runs-on: ubuntu-latest
|
15
|
+
|
16
|
+
steps:
|
17
|
+
- uses: actions/checkout@v3
|
18
|
+
|
19
|
+
- name: Set up Ruby
|
20
|
+
uses: ruby/setup-ruby@v1
|
21
|
+
with:
|
22
|
+
bundler-cache: true
|
23
|
+
|
24
|
+
- name: Test with RSpec
|
25
|
+
run: bundle exec rspec
|
data/.tool-versions
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
ruby 2.7.7
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,32 +1,32 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
rails_dev_ssl (0.1.
|
4
|
+
rails_dev_ssl (0.1.5)
|
5
5
|
thor (~> 1.0)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
|
-
coderay (1.1.
|
11
|
-
diff-lcs (1.
|
12
|
-
method_source (0.
|
13
|
-
pry (0.
|
14
|
-
coderay (~> 1.1
|
15
|
-
method_source (~>
|
10
|
+
coderay (1.1.3)
|
11
|
+
diff-lcs (1.5.0)
|
12
|
+
method_source (1.0.0)
|
13
|
+
pry (0.14.2)
|
14
|
+
coderay (~> 1.1)
|
15
|
+
method_source (~> 1.0)
|
16
16
|
rake (13.0.6)
|
17
|
-
rspec (3.
|
18
|
-
rspec-core (~> 3.
|
19
|
-
rspec-expectations (~> 3.
|
20
|
-
rspec-mocks (~> 3.
|
21
|
-
rspec-core (3.
|
22
|
-
rspec-support (~> 3.
|
23
|
-
rspec-expectations (3.
|
17
|
+
rspec (3.12.0)
|
18
|
+
rspec-core (~> 3.12.0)
|
19
|
+
rspec-expectations (~> 3.12.0)
|
20
|
+
rspec-mocks (~> 3.12.0)
|
21
|
+
rspec-core (3.12.1)
|
22
|
+
rspec-support (~> 3.12.0)
|
23
|
+
rspec-expectations (3.12.2)
|
24
24
|
diff-lcs (>= 1.2.0, < 2.0)
|
25
|
-
rspec-support (~> 3.
|
26
|
-
rspec-mocks (3.
|
25
|
+
rspec-support (~> 3.12.0)
|
26
|
+
rspec-mocks (3.12.3)
|
27
27
|
diff-lcs (>= 1.2.0, < 2.0)
|
28
|
-
rspec-support (~> 3.
|
29
|
-
rspec-support (3.
|
28
|
+
rspec-support (~> 3.12.0)
|
29
|
+
rspec-support (3.12.0)
|
30
30
|
thor (1.2.1)
|
31
31
|
|
32
32
|
PLATFORMS
|
@@ -34,10 +34,10 @@ PLATFORMS
|
|
34
34
|
|
35
35
|
DEPENDENCIES
|
36
36
|
bundler (~> 2.0)
|
37
|
-
pry (~> 0.
|
37
|
+
pry (~> 0.14.2)
|
38
38
|
rails_dev_ssl!
|
39
39
|
rake (~> 13.0)
|
40
40
|
rspec (~> 3.0)
|
41
41
|
|
42
42
|
BUNDLED WITH
|
43
|
-
2.
|
43
|
+
2.4.7
|
data/README.md
CHANGED
@@ -14,36 +14,50 @@ gem 'rails_dev_ssl', group: :development
|
|
14
14
|
|
15
15
|
And then execute:
|
16
16
|
|
17
|
-
|
17
|
+
```sh
|
18
|
+
bundle
|
19
|
+
```
|
18
20
|
|
19
21
|
Or install it yourself as:
|
20
22
|
|
21
|
-
|
23
|
+
```sh
|
24
|
+
gem install rails_dev_ssl
|
25
|
+
```
|
22
26
|
|
23
27
|
## Usage
|
24
28
|
|
25
|
-
|
29
|
+
For a list of available commands, run
|
30
|
+
|
31
|
+
```sh
|
32
|
+
rails_dev_ssl
|
33
|
+
```
|
34
|
+
|
35
|
+
### Generate certificates
|
36
|
+
|
37
|
+
```sh
|
38
|
+
rails_dev_ssl generate_certificates
|
39
|
+
```
|
26
40
|
|
27
|
-
|
41
|
+
will create a new directory in your project folder called "ssl" and ask for information to be added to your local certificate authority. Inside the `ssl` directory will be your config file and `server.crt` and `server.key` files.
|
28
42
|
|
29
|
-
|
43
|
+
## Configuring puma
|
30
44
|
|
31
45
|
If you use puma to serve your app, you can use your new certificates by passing them when calling puma:
|
32
46
|
|
33
|
-
```
|
47
|
+
```sh
|
34
48
|
puma -C config/puma.rb -b 'ssl://127.0.0.1:<port>?key=./ssl/server.key&cert=./ssl/server.crt'
|
35
49
|
```
|
36
50
|
|
37
51
|
or in `config/puma.rb`:
|
38
52
|
|
39
|
-
```
|
53
|
+
```ruby
|
40
54
|
ssl_bind '127.0.0.1', '<port>', {
|
41
55
|
key: ./ssl/server.key,
|
42
56
|
cert: ./ssl/server.crt
|
43
57
|
}
|
44
58
|
```
|
45
59
|
|
46
|
-
|
60
|
+
## Customization
|
47
61
|
|
48
62
|
You can change the certificate directory using `setup <directory>`, for example, `rails_dev_ssl setup lib/ssl` to put the certificates inside your lib directory.
|
49
63
|
|
@@ -51,15 +65,21 @@ You can generate the `server.crt.cnf` file using the `generate_config` command.
|
|
51
65
|
|
52
66
|
You may want to add this directory to your project's `.gitignore` file.
|
53
67
|
|
54
|
-
|
68
|
+
## Browser warnings
|
55
69
|
|
56
70
|
When you use your first self-signed certificate, your browser will warn you about an untrusted certificate authority. You'll need to trust the rootCA you created for your project.
|
57
71
|
|
58
72
|
Chrome and Firefox will ask you to add the certificate authority in the app. To use Safari, you'll need to add the CA to your keychain. You can do this with the `add_ca_to_keychain` command.
|
59
73
|
|
60
|
-
|
74
|
+
## /etc/hosts
|
61
75
|
|
62
|
-
You may want to add an entry to your `/etc/hosts` file to include the CN you set in the `generate_config` step. This will allow you to visit the domain in your browser instead of using 127.0.0.1 (for example, https://localhost.ssl/path/to/your/app
|
76
|
+
You may want to add an entry to your `/etc/hosts` file to include the CN you set in the `generate_config` step. This will allow you to visit the domain in your browser instead of using 127.0.0.1 (for example, `https://localhost.ssl/path/to/your/app`.)
|
77
|
+
|
78
|
+
Add this line to your `/etc/hosts` file:
|
79
|
+
|
80
|
+
```text
|
81
|
+
127.0.0.1 localhost.ssl
|
82
|
+
```
|
63
83
|
|
64
84
|
## Development
|
65
85
|
|
@@ -71,7 +91,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
71
91
|
|
72
92
|
## Contributing
|
73
93
|
|
74
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/viamin/rails_dev_ssl.
|
94
|
+
Bug reports and pull requests are welcome on GitHub at [https://github.com/viamin/rails_dev_ssl](https://github.com/viamin/rails_dev_ssl).
|
75
95
|
|
76
96
|
## License
|
77
97
|
|
data/rails_dev_ssl.gemspec
CHANGED
@@ -1,29 +1,29 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
lib = File.expand_path(
|
3
|
+
lib = File.expand_path("lib", __dir__)
|
4
4
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
5
|
-
require
|
5
|
+
require "rails_dev_ssl/version"
|
6
6
|
|
7
7
|
Gem::Specification.new do |spec|
|
8
|
-
spec.name
|
9
|
-
spec.version
|
10
|
-
spec.authors
|
11
|
-
spec.email
|
8
|
+
spec.name = "rails_dev_ssl"
|
9
|
+
spec.version = RailsDevSsl::VERSION
|
10
|
+
spec.authors = ["Bart Agapinan"]
|
11
|
+
spec.email = ["bart@sonic.net"]
|
12
12
|
|
13
|
-
spec.summary
|
14
|
-
spec.description
|
15
|
-
spec.homepage
|
16
|
-
spec.license
|
13
|
+
spec.summary = "Use SSL for rails development"
|
14
|
+
spec.description = "Generate SSL certificates for your rails development environment"
|
15
|
+
spec.homepage = "https://github.com/viamin/rails_dev_ssl"
|
16
|
+
spec.license = "MIT"
|
17
17
|
|
18
18
|
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
|
19
19
|
# to allow pushing to a single host or delete this section to allow pushing to any host.
|
20
20
|
if spec.respond_to?(:metadata)
|
21
|
-
spec.metadata[
|
22
|
-
spec.metadata[
|
23
|
-
spec.metadata[
|
21
|
+
spec.metadata["homepage_uri"] = spec.homepage
|
22
|
+
spec.metadata["source_code_uri"] = "https://github.com/viamin/rails_dev_ssl"
|
23
|
+
spec.metadata["changelog_uri"] = "https://github.com/viamin/rails_dev_ssl/blob/master/CHANGELOG.md"
|
24
24
|
else
|
25
|
-
raise
|
26
|
-
|
25
|
+
raise "RubyGems 2.0 or newer is required to protect against " \
|
26
|
+
"public gem pushes."
|
27
27
|
end
|
28
28
|
|
29
29
|
# Specify which files should be added to the gem when it is released.
|
@@ -31,14 +31,14 @@ Gem::Specification.new do |spec|
|
|
31
31
|
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
32
32
|
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
33
33
|
end
|
34
|
-
spec.bindir
|
35
|
-
spec.executables
|
36
|
-
spec.require_paths = [
|
34
|
+
spec.bindir = "exe"
|
35
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
36
|
+
spec.require_paths = ["lib"]
|
37
37
|
|
38
|
-
spec.add_dependency
|
38
|
+
spec.add_dependency "thor", "~> 1.0"
|
39
39
|
|
40
|
-
spec.add_development_dependency
|
41
|
-
spec.add_development_dependency
|
42
|
-
spec.add_development_dependency
|
43
|
-
spec.add_development_dependency
|
40
|
+
spec.add_development_dependency "bundler", "~> 2.0"
|
41
|
+
spec.add_development_dependency "pry", "~> 0.14.2"
|
42
|
+
spec.add_development_dependency "rake", "~> 13.0"
|
43
|
+
spec.add_development_dependency "rspec", "~> 3.0"
|
44
44
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_dev_ssl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bart Agapinan
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-02-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -44,14 +44,14 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 0.
|
47
|
+
version: 0.14.2
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 0.
|
54
|
+
version: 0.14.2
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rake
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -88,8 +88,12 @@ executables:
|
|
88
88
|
extensions: []
|
89
89
|
extra_rdoc_files: []
|
90
90
|
files:
|
91
|
+
- ".github/dependabot.yml"
|
92
|
+
- ".github/workflows/release.yml"
|
93
|
+
- ".github/workflows/test.yml"
|
91
94
|
- ".gitignore"
|
92
95
|
- ".rspec"
|
96
|
+
- ".tool-versions"
|
93
97
|
- ".travis.yml"
|
94
98
|
- CHANGELOG.md
|
95
99
|
- Gemfile
|
@@ -125,7 +129,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
125
129
|
- !ruby/object:Gem::Version
|
126
130
|
version: '0'
|
127
131
|
requirements: []
|
128
|
-
rubygems_version: 3.
|
132
|
+
rubygems_version: 3.3.26
|
129
133
|
signing_key:
|
130
134
|
specification_version: 4
|
131
135
|
summary: Use SSL for rails development
|