capistrano-mb 0.24.0 → 0.25.0

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: 63f7e5e2b8eb0f126c2ac90f753353dd425eb801
4
- data.tar.gz: 69627248b8d4db581a8b4d2b74c2cba08bae5b88
3
+ metadata.gz: d68f254e189ca2c33534fd00783cd175af1a8406
4
+ data.tar.gz: 784f000997958d8c0f75a2d9a0a9d47373adfca7
5
5
  SHA512:
6
- metadata.gz: f5c706979093b9ab26c91659362647d13cdeff63aa2674e5bad8b543dffe5b17f5762a52348cb621f5dbcdd8adb5518d160d5f8f980c6cb9053e7beabfed0660
7
- data.tar.gz: 2e8d185754f3d922e7abf7810ab3221a4489c82ccda59e46f2001e086201c42d84a4f931c355caf43d27ea848b962e60264333c0e42135415c54291b86fe8fa3
6
+ metadata.gz: 3c50211747368f79ec6d0de1239cf36e08d801c07c36116e76b698ce0470fa7905f63f17f34d685a58a16cd47b40bae37fe125a0f88816ba16aaa5931c88e6ef
7
+ data.tar.gz: d80d91386d2948928deccd37237a34cd630188f23b456b34ec3bb5190c8e46ff06f3ee96579694408fdf1fa18092dee3d21d2d58d4bc85b92eef7191936053a4
data/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  * Your contribution here!
4
4
 
5
+ ## [0.25.0][] (2015-10-09)
6
+
7
+ * Add `X-Accel-Mapping` and appropriate NGINX configuration so that `send_file` used in a Rails controller is now accelerated using `X-Accel-Redirect`. For security this only works if the file being sent resides in the Rails app directory (e.g. `<rails_root>/tmp` or `<rails_root>/public`). This means `send_file` files will be served by NGINX natively, rather than through Rack.
8
+
5
9
  ## [0.24.0][] (2015-09-11)
6
10
 
7
11
  * Improve README with step-by-step installation instructions.
@@ -142,7 +146,8 @@ Flush console output after each line is printed. This allows deployment progress
142
146
 
143
147
  Initial Rubygems release!
144
148
 
145
- [Unreleased]: https://github.com/mattbrictson/capistrano-mb/compare/v0.24.0...HEAD
149
+ [Unreleased]: https://github.com/mattbrictson/capistrano-mb/compare/v0.25.0...HEAD
150
+ [0.25.0]: https://github.com/mattbrictson/capistrano-mb/compare/v0.24.0...v0.25.0
146
151
  [0.24.0]: https://github.com/mattbrictson/capistrano-mb/compare/v0.23.1...v0.24.0
147
152
  [0.23.1]: https://github.com/mattbrictson/capistrano-mb/compare/v0.23.0...v0.23.1
148
153
  [0.23.0]: https://github.com/mattbrictson/capistrano-mb/compare/v0.22.2...v0.23.0
@@ -72,6 +72,14 @@ upstream unicorn_<%= application_basename %> {
72
72
  break;
73
73
  }
74
74
 
75
+ # Internal-only URI for sending files with X-Accel-Redirect from within
76
+ # a release of the Rails app. See also corresponding proxy_set_header in
77
+ # @unicorn config below.
78
+ location /__send_file_accel {
79
+ internal;
80
+ alias <%= fetch(:deploy_to) %>/releases;
81
+ }
82
+
75
83
  include /etc/nginx/<%= application_basename%>-locations/*;
76
84
 
77
85
  # Prefer to serve static files directly from nginx to avoid unnecessary
@@ -94,6 +102,10 @@ upstream unicorn_<%= application_basename %> {
94
102
  # redirects, we set the Host: header above already.
95
103
  proxy_redirect off;
96
104
 
105
+ # send_file support
106
+ proxy_set_header X-Sendfile-Type X-Accel-Redirect;
107
+ proxy_set_header X-Accel-Mapping <%= fetch(:deploy_to) %>/releases/=/__send_file_accel/;
108
+
97
109
  # enable caching (honors cache-control headers sent by Rails)
98
110
  # lock and use_stale help prevent a cache stampede
99
111
  proxy_cache default;
@@ -1,5 +1,5 @@
1
1
  module Capistrano
2
2
  module MB
3
- VERSION = "0.24.0"
3
+ VERSION = "0.25.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-mb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.24.0
4
+ version: 0.25.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Brictson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-09-11 00:00:00.000000000 Z
11
+ date: 2015-10-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capistrano