darjeelink 0.14.5 → 0.14.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +24 -1
- data/app/controllers/darjeelink/application_controller.rb +11 -9
- data/lib/darjeelink/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4303964ff9a26e9645a23dc23ddf42b0e4c0149d96bf0be0ff190cdabe45a3e9
|
4
|
+
data.tar.gz: 923d1bc1d321f08b66cf519bad76ce50c07418558ab15d2b97185071ffc9aee7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 701f1be73fdefefed0ae84171fc7ac341bda12b182eaefb48bc1d3654781163b79a9c022dbcbe0097cd6542a8831ede814a251fdf9adf65b3bec6a39c6887053
|
7
|
+
data.tar.gz: cd5a66b7216dce4a247a5a3ce586caf75ec259653228e76e31daad7745a708fdacd2de6fb7f35fbfe757027077d90ac8573677663116a07da18cffd3017e45eb
|
data/README.md
CHANGED
@@ -120,9 +120,32 @@ Change the database url to be different to the development one i.e. `postgres://
|
|
120
120
|
## Releasing
|
121
121
|
Darjeelink follows [Semantic Versioning](https://semver.org)
|
122
122
|
|
123
|
+
### Pre-releasing - Staging tests
|
124
|
+
There are several ways to test the gem before releasing it.
|
125
|
+
|
126
|
+
One way, is to check the new development branch into Github, and then use `portkey-app` to test it in a staging environment.
|
127
|
+
|
128
|
+
- Create a new branch in the `darjeelink` repo with a sensible name related to your intended release: e.g. `darjeelink-v0.14.6-upgrade`.
|
129
|
+
- Perform the required upgrades, security patching, etc for the new release.
|
130
|
+
- Bump the version number as required (see below).
|
131
|
+
- Create a new branch in the `portkey-app` repo with a sensible name related to your intdended release: e.g. `darjeelink-v0.14.6-upgrade`.
|
132
|
+
- In the `Gemfile` of the portkey-app repo, change the `darjeelink` gem to point to the branch you just created in the darjeelink repo.
|
133
|
+
```gemfile
|
134
|
+
# Actual URL Shortener
|
135
|
+
# gem 'darjeelink' <-- Temporarilly change this. Remeber to change it back, and run bundle install to update the Gemfile.lock when done!
|
136
|
+
gem 'darjeelink', git: 'https://github.com/38degrees/darjeelink.git',
|
137
|
+
branch: 'darjeelink-v0.14.6-upgrade'
|
138
|
+
```
|
139
|
+
- Update the `Gemfile.lock` in the `portkey-app` repo by running `bundle install` and commit then push the changes.
|
140
|
+
- Deploy your branch of the portkey-app to the staging environment and test the changes.
|
141
|
+
|
142
|
+
NB: When you have followed the production release steps below and created a GitHub release, you can then update the `Gemfile` in the `portkey-app` repo to point to the new release tag.
|
143
|
+
|
144
|
+
### Releasing - Production
|
145
|
+
|
123
146
|
Once all necessary changes have made it in to master and you are ready to do a release you need to do these steps.
|
124
147
|
|
125
|
-
Note that if you are running in a vagrant VM, most of these steps can be done from
|
148
|
+
Note that if you are running in a vagrant VM or `docker-shell.sh` constainer, most of these steps can be done from the terminal session.
|
126
149
|
|
127
150
|
- Update `lib/darjeelink/version.rb` to the new version
|
128
151
|
- Run `bundle install` to pick up the change in Gemfile.lock
|
@@ -9,25 +9,27 @@ module Darjeelink
|
|
9
9
|
|
10
10
|
private
|
11
11
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
request.ip
|
17
|
-
end
|
18
|
-
end
|
19
|
-
|
12
|
+
# Disabling these rubocop rules. This is a simple function and tested in production sinve version 0.14.4.
|
13
|
+
#
|
14
|
+
# rubocop:disable Metrics/AbcSize
|
15
|
+
# rubocop:disable Layout/LineLength
|
20
16
|
# Check user IP address against whitelist from ENV
|
21
17
|
def check_ip_whitelist
|
22
18
|
return unless Rails.env.production?
|
23
19
|
return unless Rails.application.config.permitted_ips
|
24
20
|
|
25
|
-
ip_to_verify =
|
21
|
+
ip_to_verify = if Rails.application.config.respond_to?(:client_ip_header) && Rails.application.config.client_ip_header.present?
|
22
|
+
request.headers[Rails.application.config.client_ip_header]
|
23
|
+
else
|
24
|
+
request.ip
|
25
|
+
end
|
26
26
|
|
27
27
|
return if Rails.application.config.permitted_ips.split(',').include? ip_to_verify
|
28
28
|
|
29
29
|
render plain: 'Access Denied', status: :forbidden
|
30
30
|
end
|
31
|
+
# rubocop:enable Metrics/AbcSize
|
32
|
+
# rubocop:enable Layout/LineLength
|
31
33
|
|
32
34
|
# Authenticate against Google OAuth
|
33
35
|
def authenticate
|
data/lib/darjeelink/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: darjeelink
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.14.
|
4
|
+
version: 0.14.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Hulme
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-03-
|
11
|
+
date: 2024-03-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: omniauth
|