shared-infrastructure 0.0.17 → 0.0.18

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: ef81857523282a713eba26de715419ab0edbd89e
4
- data.tar.gz: 376a56118921b56b22886fcee1a127a664e97c31
3
+ metadata.gz: 2388baa93ddfa0373ade38fdd49511f4ab4b48f3
4
+ data.tar.gz: 34351a7ee79549d6c740c3920c11809c4fe628a2
5
5
  SHA512:
6
- metadata.gz: 0f8bcea463528193ef8ce45bd4da49e7f4db031d44af740a6be1f333a388d444b3c07e5ddf122af03caff58835a6fa94fe751848ff36c4156e8549c536a91b5a
7
- data.tar.gz: aa185934ddd22031432fc6e85546ab87032ea4457b30655488bbbc5dae915dcb265824570dd466a1116359b0de9894d9ae348adb9b56e6a55f491e21fe860ecf
6
+ metadata.gz: 569dd911a7ce4aa8f1eb4619172c7674f9d5b862823ad7325845f37d06cd279ee53e93f324ab374ac977ad65fb7ed647142f4ac450a4c83aa5f1b2a4271843b8
7
+ data.tar.gz: 8e15c2b82da4e28f1557ae0dd614b4dc5db568b727fb33977c892880090e35ffa45244dc259c8157a1ea13ef1e0aa40d5eea3ab49f86ea09f4b6ddff24034491
@@ -9,18 +9,18 @@ module Nginx
9
9
 
10
10
  attr_reader :domain, :location_directory
11
11
 
12
- def alias_string(domain_name)
13
- File.join(Nginx.configuration.root_directory(domain ? domain.domain_name : domain_name), location_directory).to_s
12
+ def alias_string
13
+ File.join(domain.root, location_directory).to_s
14
14
  end
15
15
 
16
16
  def location
17
- "/#{location_directory}"
17
+ "/__x_accel"
18
18
  end
19
19
 
20
20
  def proxy_set_header(domain_name)
21
21
  [
22
22
  " proxy_set_header X-Sendfile-Type X-Accel-Redirect;",
23
- " proxy_set_header X-Accel-Mapping #{alias_string(domain_name)}/=#{location}/;"
23
+ " proxy_set_header X-Accel-Mapping #{alias_string}/=#{location}/;"
24
24
  ].join("\n")
25
25
  end
26
26
  end
@@ -23,7 +23,7 @@ sudo nginx -s reload
23
23
 
24
24
  Then run the following command:
25
25
 
26
- sudo certbot certonly --webroot -w #{Nginx.root_directory(domain.domain_name)} #{Nginx.certbot_domain_names(domain.domain_name)}
26
+ sudo certbot certonly --webroot -w #{Nginx.root_directory(domain.domain_name)} #{domain.certbot_domain_names}
27
27
 
28
28
  You can test renewal with:
29
29
 
@@ -105,12 +105,15 @@ Finally, re-run this script to configure nginx for TLS.
105
105
  end
106
106
 
107
107
  def save
108
- FileUtils.mkdir_p(SharedInfrastructure::Output.file_name(domain.root))
108
+ domain_root = SharedInfrastructure::Output.file_name(domain.root)
109
+ FileUtils.mkdir_p(domain_root)
109
110
  if Process.uid.zero?
110
111
  FileUtils.chown(user,
111
112
  "www-data",
112
- Nginx.root_directory(domain.domain_name))
113
+ domain_root)
113
114
  end
115
+ # Set the directory gid bit, so files created inside inherit the group.
116
+ File.chmod(File.stat(domain_root).mode | 0o2000, domain_root)
114
117
  super
115
118
  end
116
119
 
@@ -28,7 +28,7 @@ module Nginx
28
28
  def to_s(level = 0)
29
29
  Lines.new("location #{accel.location} {",
30
30
  " internal;",
31
- " alias #{accel.alias_string(domain ? domain.name : domain_name)};",
31
+ " alias #{accel.alias_string};",
32
32
  "}").format(level)
33
33
  end
34
34
 
@@ -41,7 +41,7 @@ module Runner
41
41
  # FIXME: This is only applicable to Rails apps.
42
42
  opts.on("-a LOCATION",
43
43
  "--accel LOCATION",
44
- "Location to serve when app responds with 'X-Accel'") do |accel_location|
44
+ "Location below application root to serve when app responds with 'X-Accel'") do |accel_location|
45
45
  options[:accel_location] = accel_location
46
46
  end
47
47
 
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.17
4
+ version: 0.0.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Larry Reid
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-04-27 00:00:00.000000000 Z
11
+ date: 2018-05-01 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: 'For static sites, Rails apps, and reverse proxies.
14
14