capistrano-twingly 4.0.4 → 4.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +3 -3
- data/CHANGELOG.md +23 -0
- data/README.md +1 -0
- data/capistrano-twingly.gemspec +1 -1
- data/lib/capistrano/twingly/tasks/nginx.rake +2 -0
- data/lib/capistrano/twingly/tasks/servers_from_srv_record.rake +16 -5
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6e9fcc36ffdef58414469cc49e1cfc11f645c8dd92f0abe2599e7cd61d508e40
|
4
|
+
data.tar.gz: eda3cd5412c4c2ba5af7100fad39a47009a0944e40ca9cf8dd393627c5e730b1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b8f9e0d29574b26cbe6b746e4d107cdfe1498182b20a06016a587a9a16eb6d61dcfc33b8579d073e454ff6b29211e2f0de5707988c815877f0add58df98c1c4f
|
7
|
+
data.tar.gz: bd6bbc8590824d69b1510049c479424acff5731a0bce73f30c4c91e56d076c5b81c00aaad0e3bf6219b70780a40a2251c075b20a730fbc381c79b40fb10b62cb
|
data/.github/workflows/ci.yml
CHANGED
@@ -6,15 +6,15 @@ on:
|
|
6
6
|
|
7
7
|
jobs:
|
8
8
|
build:
|
9
|
-
runs-on: ubuntu-
|
9
|
+
runs-on: ubuntu-22.04
|
10
10
|
|
11
11
|
strategy:
|
12
12
|
matrix:
|
13
|
-
ruby: [2.7.
|
13
|
+
ruby: [2.7.6, 3.0.4, 3.1.2]
|
14
14
|
|
15
15
|
steps:
|
16
16
|
- name: Checkout Code
|
17
|
-
uses: actions/checkout@
|
17
|
+
uses: actions/checkout@v3
|
18
18
|
|
19
19
|
- name: Setup Ruby ${{ matrix.ruby }}
|
20
20
|
uses: ruby/setup-ruby@v1
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,28 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## [v4.1.0](https://github.com/twingly/capistrano-twingly/tree/v4.1.0) (2023-01-10)
|
4
|
+
|
5
|
+
[Full Changelog](https://github.com/twingly/capistrano-twingly/compare/v4.0.4...v4.1.0)
|
6
|
+
|
7
|
+
**Fixed bugs:**
|
8
|
+
|
9
|
+
- Deploy broken in macOS 13 because of DNS issues [\#68](https://github.com/twingly/capistrano-twingly/issues/68)
|
10
|
+
|
11
|
+
**Merged pull requests:**
|
12
|
+
|
13
|
+
- Use datacenter gateway as fallback DNS server [\#69](https://github.com/twingly/capistrano-twingly/pull/69) ([roback](https://github.com/roback))
|
14
|
+
- Keep GitHub Actions file up-to-date [\#67](https://github.com/twingly/capistrano-twingly/pull/67) ([roback](https://github.com/roback))
|
15
|
+
|
16
|
+
## [v4.0.4](https://github.com/twingly/capistrano-twingly/tree/v4.0.4) (2022-06-28)
|
17
|
+
|
18
|
+
[Full Changelog](https://github.com/twingly/capistrano-twingly/compare/v4.0.3...v4.0.4)
|
19
|
+
|
20
|
+
**Merged pull requests:**
|
21
|
+
|
22
|
+
- Use net-ssh ~\> 7.0 [\#66](https://github.com/twingly/capistrano-twingly/pull/66) ([Pontus4](https://github.com/Pontus4))
|
23
|
+
- Run CI on latest Rubies [\#64](https://github.com/twingly/capistrano-twingly/pull/64) ([walro](https://github.com/walro))
|
24
|
+
- Ruby 3.0.0 on CI [\#62](https://github.com/twingly/capistrano-twingly/pull/62) ([walro](https://github.com/walro))
|
25
|
+
|
3
26
|
## [v4.0.3](https://github.com/twingly/capistrano-twingly/tree/v4.0.3) (2021-01-14)
|
4
27
|
|
5
28
|
[Full Changelog](https://github.com/twingly/capistrano-twingly/compare/v4.0.2...v4.0.3)
|
data/README.md
CHANGED
@@ -47,6 +47,7 @@ require 'capistrano/twingly/nginx'
|
|
47
47
|
set :app_name, 'contest-bamba'
|
48
48
|
set :server_names, %w(bamba.bloggportalen.se)
|
49
49
|
set :use_https, true # Optional
|
50
|
+
set :forwarded_protocol_is_https, true # Optional
|
50
51
|
|
51
52
|
namespace :deploy do
|
52
53
|
after :finishing, 'deploy:nginx:generate_config'
|
data/capistrano-twingly.gemspec
CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = "capistrano-twingly"
|
7
|
-
spec.version = '4.0
|
7
|
+
spec.version = '4.2.0'
|
8
8
|
spec.authors = ["Twingly AB"]
|
9
9
|
spec.email = ["support@twingly.com"]
|
10
10
|
spec.summary = %q{Capistrano 3 tasks used for Twingly's Ruby deployment}
|
@@ -9,6 +9,7 @@ namespace :deploy do
|
|
9
9
|
server_names = fetch(:server_names)
|
10
10
|
|
11
11
|
https_port = ":443" if fetch(:use_https)
|
12
|
+
forwarded_protocol_is_https = fetch(:forwarded_protocol_is_https)
|
12
13
|
|
13
14
|
conf = File.open('tmp/site.conf', 'w')
|
14
15
|
conf << %Q{
|
@@ -42,6 +43,7 @@ namespace :deploy do
|
|
42
43
|
proxy_set_header Host $host#{https_port};
|
43
44
|
proxy_set_header X-Real-IP $remote_addr;
|
44
45
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
46
|
+
#{forwarded_protocol_is_https ? "proxy_set_header X-Forwarded-Proto https;" : ""}
|
45
47
|
}
|
46
48
|
}\n}
|
47
49
|
conf.close
|
@@ -3,14 +3,25 @@ require 'resolv'
|
|
3
3
|
SRV_RECORDS = %w[
|
4
4
|
_rubyapps._tcp.sth.twingly.network
|
5
5
|
]
|
6
|
+
FALLBACK_DNS_SERVER = "gateway.sth.twingly.network"
|
6
7
|
|
7
|
-
resolver
|
8
|
+
def lookup_srv_records(resolver: Resolv::DNS.new)
|
9
|
+
SRV_RECORDS.map do |srv_record|
|
10
|
+
resolver.getresources(srv_record, Resolv::DNS::Resource::IN::SRV)
|
11
|
+
end.flatten.map(&:target).map(&:to_s)
|
12
|
+
end
|
13
|
+
|
14
|
+
servers = lookup_srv_records
|
8
15
|
|
9
|
-
|
10
|
-
|
11
|
-
|
16
|
+
# Query datacenter gateway directly if local DNS server is unable to find the SRV records
|
17
|
+
if servers.empty?
|
18
|
+
datacenter_dns_server_address = Resolv.getaddress(FALLBACK_DNS_SERVER)
|
12
19
|
|
13
|
-
|
20
|
+
resolver = Resolv::DNS.new(nameserver: datacenter_dns_server_address)
|
21
|
+
servers = lookup_srv_records(resolver: resolver)
|
22
|
+
|
23
|
+
raise "Can't find any servers, no records for #{SRV_RECORDS}" if servers.empty?
|
24
|
+
end
|
14
25
|
|
15
26
|
set :servers_from_srv_record, servers
|
16
27
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capistrano-twingly
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.0
|
4
|
+
version: 4.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Twingly AB
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-02-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capistrano
|
@@ -195,7 +195,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
195
195
|
- !ruby/object:Gem::Version
|
196
196
|
version: '0'
|
197
197
|
requirements: []
|
198
|
-
rubygems_version: 3.
|
198
|
+
rubygems_version: 3.4.4
|
199
199
|
signing_key:
|
200
200
|
specification_version: 4
|
201
201
|
summary: Capistrano 3 tasks used for Twingly's Ruby deployment
|