shared-infrastructure 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0ab310c1021610fd228d494c52b067320a0a0503
4
- data.tar.gz: db99f26ed6843d4d2bf49fe52c14c1e79ee07ff1
3
+ metadata.gz: ac6f2b797902cb75d59273db4e59a09801925ad3
4
+ data.tar.gz: 2225a1a5ad142f4a34fb75931f7dc86c64dcde2e
5
5
  SHA512:
6
- metadata.gz: 6b75bcf5f739670e7b6db6ec484266ea65d9f796c9fdc46ae99fe7d5c01d53da04961b4aa448d6422d897d977e1494196140c452dfdb7eeb0206fcb2250bac4e
7
- data.tar.gz: 47348811cd3a760a4de943072f950c79e13f3a2c6ea7f73902aa726307801bb4744cbbedcdc2d5e3740772f5d41f4b3fbc3413533e0321c791dbbaaf4cb83878
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, _certificate_domain = nil)
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: Nginx::ReverseProxyLocation.new(proxy_url)
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.3
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-26 00:00:00.000000000 Z
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