shared-infrastructure 0.0.3 → 0.0.4
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ac6f2b797902cb75d59273db4e59a09801925ad3
|
4
|
+
data.tar.gz: 2225a1a5ad142f4a34fb75931f7dc86c64dcde2e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b5f3c49119662abed44d2caa374be45d57250c936b83b65015cdd71fc3e904d65f5d7b6391ce687a64fb653f630b3cf0334351e8e1d6b8bffdefd6f8a279bfb1
|
7
|
+
data.tar.gz: 7ecea13f4f49d5e1446ec6862e02cf17bf05d1e6a01a961e3aaf1f563a6af97f0bde66011e74566dcb11823d3eb30583768c8c89c43c164b2f46cbb2ca7cb80e
|
@@ -53,12 +53,17 @@ Finally, re-run this script to configure nginx for TLS.
|
|
53
53
|
end
|
54
54
|
|
55
55
|
class ReverseProxyHttp < Base
|
56
|
-
def initialize(domain_name, proxy_url,
|
56
|
+
def initialize(domain_name, proxy_url, certificate_domain = nil)
|
57
57
|
super(domain_name,
|
58
58
|
Nginx::ServerBlock.new(
|
59
59
|
server: Nginx::Server.new(domain_name),
|
60
60
|
listen: Nginx::ListenHttp.new,
|
61
|
-
location:
|
61
|
+
location: [
|
62
|
+
# TODO: the following should really only happen when the domains
|
63
|
+
# are different.
|
64
|
+
Nginx::AcmeLocation.new(certificate_domain || domain_name),
|
65
|
+
Nginx::ReverseProxyLocation.new(proxy_url)
|
66
|
+
]
|
62
67
|
)
|
63
68
|
)
|
64
69
|
end
|
@@ -17,6 +17,21 @@ module Nginx
|
|
17
17
|
attr_reader :location
|
18
18
|
end
|
19
19
|
|
20
|
+
class AcmeLocation < Location
|
21
|
+
def initialize(certificate_domain, location = "/.well-known")
|
22
|
+
super(location)
|
23
|
+
@certificate_domain = certificate_domain
|
24
|
+
end
|
25
|
+
|
26
|
+
def to_s(level = 0)
|
27
|
+
Lines.new("location #{location} {",
|
28
|
+
" alias #{File.join(Nginx.root_directory(certificate_domain), ".well-known")};",
|
29
|
+
"}").format(level)
|
30
|
+
end
|
31
|
+
|
32
|
+
attr_reader :certificate_domain, :location
|
33
|
+
end
|
34
|
+
|
20
35
|
class ActionCableLocation < Location
|
21
36
|
def initialize(domain_name, location = "/cable")
|
22
37
|
super(location)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shared-infrastructure
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Larry Reid
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-10-
|
11
|
+
date: 2017-10-30 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: 'For static sites, Rails apps, and reverse proxies.
|
14
14
|
|