codeword 0.1.1 → 0.2.0.beta2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +3 -0
- data/.ruby-version +1 -1
- data/CHANGELOG.md +3 -0
- data/README.md +7 -16
- data/app/controllers/codeword/codeword_controller.rb +1 -1
- data/app/helpers/codeword/codeword_helper.rb +1 -5
- data/app/views/layouts/codeword/_inline_css.html.erb +2 -0
- data/app/views/layouts/codeword/_normalize.html.erb +2 -0
- data/app/views/layouts/codeword/application.html.erb +2 -4
- data/codeword.gemspec +2 -2
- data/lib/codeword/version.rb +1 -1
- data/lib/codeword.rb +5 -12
- data/screenshot.png +0 -0
- metadata +8 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 58628581dfc6ebc297114f5d05ca82b625d1f777eb28fb66cb83caf818b5337b
|
4
|
+
data.tar.gz: a554b130eb17b6fe35e60ecb7bd6d318b1c43e61665ed8438e1b6476c4e4b985
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f76067c4a6e801c693e970c60ea94179fb35d8e4d03f1c52cd6fcfdf2735a87004357d4490d296d3ebcd380b859e89ce894165098a74a49aec39806b6e04caed
|
7
|
+
data.tar.gz: a3c85b0d037a52c7df10bbad807e2f05e6a71fd4e030f4dff514c93ddb5f7c6d20303235aed514064310d828878219d04385ec37ec84818e74add0a42a2b3a3a
|
data/.gitignore
CHANGED
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.
|
1
|
+
3.4.1
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
# Codeword
|
2
2
|
|
3
|
-
A simple gem to more elegantly place a staging server or other in-progress
|
3
|
+
A simple gem to more elegantly place a staging server or other in-progress Ruby on Rails application behind a basic codeword. It’s easy to implement, share with clients/collaborators, and more beautiful than the typical password-protection sheet.
|
4
|
+
|
5
|
+

|
4
6
|
|
5
7
|
## Installation
|
6
8
|
|
@@ -32,14 +34,14 @@ If you think you might need a hint:
|
|
32
34
|
ENV['CODEWORD_HINT'] = 'Something that you do not tell everyone.'
|
33
35
|
```
|
34
36
|
|
35
|
-
|
37
|
+
You can add your codeword via Rails credentials in your `credentials.yml.enc` file (`$ bin/rails credentials:edit`):
|
36
38
|
|
37
39
|
```yml
|
38
40
|
codeword: 'love'
|
39
41
|
codeword_hint: 'Pepé Le Pew'
|
40
42
|
```
|
41
43
|
|
42
|
-
Alternately,
|
44
|
+
Alternately, credentials in Rails >= 5.2 may be organized under the `codeword` namespace:
|
43
45
|
|
44
46
|
```yml
|
45
47
|
codeword:
|
@@ -47,13 +49,6 @@ codeword:
|
|
47
49
|
hint: 'Pepé Le Pew'
|
48
50
|
```
|
49
51
|
|
50
|
-
If you’re using [Figaro](https://github.com/laserlemon/figaro), set your Codeword codeword and hint (optional) in your application.yml file:
|
51
|
-
|
52
|
-
```yml
|
53
|
-
codeword: 'love'
|
54
|
-
codeword_hint: 'Pepé Le Pew'
|
55
|
-
```
|
56
|
-
|
57
52
|
**Codewords are not case-sensitive, by design. Keep it simple.**
|
58
53
|
|
59
54
|
## Advanced Usage
|
@@ -100,10 +95,6 @@ If you would like to change the content or design of the codeword page, you can
|
|
100
95
|
|
101
96
|
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
102
97
|
|
103
|
-
##
|
104
|
-
|
105
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/dankimio/codeword.
|
106
|
-
|
107
|
-
## License
|
98
|
+
## Acknowledgements
|
108
99
|
|
109
|
-
|
100
|
+
Codeword is a fork of [lockup](https://github.com/interdiscipline/lockup).
|
@@ -3,11 +3,7 @@
|
|
3
3
|
module Codeword
|
4
4
|
module CodewordHelper
|
5
5
|
def codeword_hint
|
6
|
-
@codeword_hint ||=
|
7
|
-
ENV['CODEWORD_HINT'] ||
|
8
|
-
ENV['codeword_hint'] ||
|
9
|
-
::Codeword.from_config(:hint, :secrets) ||
|
10
|
-
::Codeword.from_config(:hint)
|
6
|
+
@codeword_hint ||= ENV['CODEWORD_HINT'] || ENV['codeword_hint'] || ::Codeword.from_config(:hint)
|
11
7
|
end
|
12
8
|
end
|
13
9
|
end
|
@@ -8,10 +8,8 @@
|
|
8
8
|
|
9
9
|
<title>Please enter the code word to continue…</title>
|
10
10
|
|
11
|
-
|
12
|
-
|
13
|
-
<%= render partial: 'layouts/codeword/inline_css' %>
|
14
|
-
</style>
|
11
|
+
<%= render partial: 'layouts/codeword/normalize' %>
|
12
|
+
<%= render partial: 'layouts/codeword/inline_css' %>
|
15
13
|
</head>
|
16
14
|
|
17
15
|
<body>
|
data/codeword.gemspec
CHANGED
@@ -21,10 +21,10 @@ Gem::Specification.new do |spec|
|
|
21
21
|
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
22
22
|
end
|
23
23
|
|
24
|
-
spec.add_dependency 'rails', '>= 6'
|
24
|
+
spec.add_dependency 'rails', '>= 6.1'
|
25
25
|
|
26
26
|
spec.add_development_dependency 'capybara', '~> 2.9'
|
27
27
|
spec.add_development_dependency 'debug'
|
28
28
|
spec.add_development_dependency 'launchy', '~> 2.4'
|
29
|
-
spec.add_development_dependency 'rspec-rails', '~>
|
29
|
+
spec.add_development_dependency 'rspec-rails', '~> 6.0'
|
30
30
|
end
|
data/lib/codeword/version.rb
CHANGED
data/lib/codeword.rb
CHANGED
@@ -6,13 +6,11 @@ module Codeword
|
|
6
6
|
extend ActiveSupport::Concern
|
7
7
|
|
8
8
|
included do
|
9
|
-
before_action :check_for_codeword
|
9
|
+
before_action :check_for_codeword
|
10
10
|
end
|
11
11
|
|
12
|
-
def self.from_config(setting
|
13
|
-
|
14
|
-
|
15
|
-
store = Rails.application.public_send(secrets_or_credentials)
|
12
|
+
def self.from_config(setting)
|
13
|
+
store = Rails.application.credentials
|
16
14
|
|
17
15
|
store.codeword.respond_to?(:fetch) &&
|
18
16
|
store.codeword.fetch(setting, store.public_send("codeword_#{setting}")) ||
|
@@ -35,21 +33,16 @@ module Codeword
|
|
35
33
|
@cookie_lifetime ||=
|
36
34
|
ENV['COOKIE_LIFETIME_IN_WEEKS'] ||
|
37
35
|
ENV['cookie_lifetime_in_weeks'] ||
|
38
|
-
Codeword.from_config(:cookie_lifetime_in_weeks, :secrets) ||
|
39
36
|
Codeword.from_config(:cookie_lifetime_in_weeks)
|
40
37
|
end
|
41
38
|
|
42
39
|
def codeword_code
|
43
|
-
@codeword_code ||=
|
44
|
-
ENV['CODEWORD'] ||
|
45
|
-
ENV['codeword'] ||
|
46
|
-
Codeword.from_config(:codeword, :secrets) ||
|
47
|
-
Codeword.from_config(:codeword)
|
40
|
+
@codeword_code ||= ENV['CODEWORD'] || ENV['codeword'] || Codeword.from_config(:codeword)
|
48
41
|
end
|
49
42
|
|
50
43
|
def codeword_cookie_lifetime
|
51
44
|
seconds = (cookie_lifetime.to_f * 1.week).to_i
|
52
|
-
if seconds
|
45
|
+
if seconds.positive?
|
53
46
|
seconds
|
54
47
|
else
|
55
48
|
5.years
|
data/screenshot.png
ADDED
Binary file
|
metadata
CHANGED
@@ -1,15 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: codeword
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0.beta2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dan Kim
|
8
8
|
- gb Studio
|
9
|
-
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2025-02-05 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: rails
|
@@ -17,14 +16,14 @@ dependencies:
|
|
17
16
|
requirements:
|
18
17
|
- - ">="
|
19
18
|
- !ruby/object:Gem::Version
|
20
|
-
version: '6'
|
19
|
+
version: '6.1'
|
21
20
|
type: :runtime
|
22
21
|
prerelease: false
|
23
22
|
version_requirements: !ruby/object:Gem::Requirement
|
24
23
|
requirements:
|
25
24
|
- - ">="
|
26
25
|
- !ruby/object:Gem::Version
|
27
|
-
version: '6'
|
26
|
+
version: '6.1'
|
28
27
|
- !ruby/object:Gem::Dependency
|
29
28
|
name: capybara
|
30
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -73,14 +72,14 @@ dependencies:
|
|
73
72
|
requirements:
|
74
73
|
- - "~>"
|
75
74
|
- !ruby/object:Gem::Version
|
76
|
-
version: '
|
75
|
+
version: '6.0'
|
77
76
|
type: :development
|
78
77
|
prerelease: false
|
79
78
|
version_requirements: !ruby/object:Gem::Requirement
|
80
79
|
requirements:
|
81
80
|
- - "~>"
|
82
81
|
- !ruby/object:Gem::Version
|
83
|
-
version: '
|
82
|
+
version: '6.0'
|
84
83
|
description: A simple gem to more elegantly place a staging server or other in-progress
|
85
84
|
application behind a basic codeword. It’s easy to implement, share with clients/collaborators,
|
86
85
|
and more beautiful than the typical password-protection sheet.
|
@@ -110,6 +109,7 @@ files:
|
|
110
109
|
- lib/codeword.rb
|
111
110
|
- lib/codeword/engine.rb
|
112
111
|
- lib/codeword/version.rb
|
112
|
+
- screenshot.png
|
113
113
|
- script/rails
|
114
114
|
homepage: https://github.com/dankimio/codeword
|
115
115
|
licenses:
|
@@ -118,7 +118,6 @@ metadata:
|
|
118
118
|
homepage_uri: https://github.com/dankimio/codeword
|
119
119
|
source_code_uri: https://github.com/dankimio/codeword
|
120
120
|
changelog_uri: https://github.com/dankimio/codeword/CHANGELOG.md
|
121
|
-
post_install_message:
|
122
121
|
rdoc_options: []
|
123
122
|
require_paths:
|
124
123
|
- lib
|
@@ -133,8 +132,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
133
132
|
- !ruby/object:Gem::Version
|
134
133
|
version: '0'
|
135
134
|
requirements: []
|
136
|
-
rubygems_version: 3.2
|
137
|
-
signing_key:
|
135
|
+
rubygems_version: 3.6.2
|
138
136
|
specification_version: 4
|
139
137
|
summary: Lock staging servers from search engines and prying eyespec.
|
140
138
|
test_files: []
|