passenger 4.0.44 → 4.0.45

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of passenger might be problematic. Click here for more details.

Files changed (110) hide show
  1. checksums.yaml +8 -8
  2. checksums.yaml.gz.asc +7 -7
  3. data.tar.gz.asc +7 -7
  4. data/.travis.yml +3 -0
  5. data/CHANGELOG +31 -0
  6. data/CONTRIBUTING.md +70 -10
  7. data/CONTRIBUTORS +4 -0
  8. data/README.md +1 -1
  9. data/Vagrantfile +50 -0
  10. data/bin/passenger-install-nginx-module +7 -2
  11. data/build/basics.rb +4 -1
  12. data/build/documentation.rb +6 -0
  13. data/build/node_tests.rb +7 -1
  14. data/build/packaging.rb +5 -0
  15. data/build/test_basics.rb +3 -3
  16. data/debian.template/copyright +1 -1
  17. data/debian.template/passenger.manpages +0 -1
  18. data/dev/rack.test/config.ru +5 -0
  19. data/dev/rack.test/public/asset.txt +1 -0
  20. data/dev/vagrant/apache_default_site.conf +35 -0
  21. data/dev/vagrant/apache_passenger.conf +5 -0
  22. data/dev/vagrant/apache_passenger.load +1 -0
  23. data/dev/vagrant/apache_ports.conf +24 -0
  24. data/dev/vagrant/apache_rack_test.conf +9 -0
  25. data/dev/vagrant/bashrc +21 -0
  26. data/dev/vagrant/nginx.conf +39 -0
  27. data/dev/vagrant/nginx_rakefile +34 -0
  28. data/dev/vagrant/nginx_start +32 -0
  29. data/dev/vagrant/provision.sh +115 -0
  30. data/dev/vagrant/sudoers.conf +5 -0
  31. data/doc/Design and Architecture.txt +515 -0
  32. data/doc/DeveloperQuickstart.md +70 -0
  33. data/doc/Users guide Apache.idmap.txt +24 -18
  34. data/doc/Users guide Apache.txt +200 -62
  35. data/doc/Users guide Nginx.idmap.txt +53 -45
  36. data/doc/Users guide Nginx.txt +501 -360
  37. data/doc/Users guide Standalone.txt +8 -0
  38. data/doc/images/direct_spawning.png +0 -0
  39. data/doc/images/direct_spawning.svg +16 -13
  40. data/doc/images/helper_agent_core_architecture.png +0 -0
  41. data/doc/images/passenger_architecture_overview.png +0 -0
  42. data/doc/images/smart_spawning.png +0 -0
  43. data/doc/images/{smart.svg → smart_spawning.svg} +23 -20
  44. data/doc/images/spawning_preparation_work.png +0 -0
  45. data/doc/images/startup_sequence.png +0 -0
  46. data/doc/users_guide_snippets/appendix_c_spawning_methods.txt +82 -121
  47. data/doc/users_guide_snippets/environment_variables.txt +1 -1
  48. data/doc/users_guide_snippets/support_information.txt +2 -0
  49. data/doc/users_guide_snippets/tips.txt +117 -9
  50. data/ext/apache2/Configuration.hpp +4 -2
  51. data/ext/apache2/ConfigurationCommands.cpp +14 -0
  52. data/ext/apache2/ConfigurationFields.hpp +4 -0
  53. data/ext/apache2/ConfigurationSetters.cpp +22 -0
  54. data/ext/apache2/CreateDirConfig.cpp +2 -0
  55. data/ext/apache2/Hooks.cpp +30 -14
  56. data/ext/apache2/MergeDirConfig.cpp +14 -0
  57. data/ext/apache2/SetHeaders.cpp +8 -0
  58. data/ext/common/ApplicationPool2/AppTypes.cpp +6 -1
  59. data/ext/common/ApplicationPool2/Implementation.cpp +1 -1
  60. data/ext/common/ApplicationPool2/Session.h +1 -1
  61. data/ext/common/Constants.h +9 -7
  62. data/ext/common/Utils/HttpHeaderBufferer.h +23 -4
  63. data/ext/common/Utils/StrIntUtils.h +35 -0
  64. data/ext/common/Utils/StringScanning.h +4 -10
  65. data/ext/common/agents/HelperAgent/RequestHandler.h +90 -49
  66. data/ext/nginx/CacheLocationConfig.c +40 -0
  67. data/ext/nginx/ConfigurationCommands.c +20 -0
  68. data/ext/nginx/ConfigurationFields.h +4 -0
  69. data/ext/nginx/ContentHandler.c +1 -1
  70. data/ext/nginx/CreateLocationConfig.c +9 -0
  71. data/ext/nginx/MergeLocationConfig.c +12 -0
  72. data/ext/nginx/config +2 -2
  73. data/ext/nginx/ngx_http_passenger_module.c +4 -4
  74. data/helper-scripts/node-loader.js +40 -27
  75. data/lib/phusion_passenger.rb +1 -1
  76. data/lib/phusion_passenger/apache2/config_options.rb +14 -2
  77. data/lib/phusion_passenger/constants.rb +7 -6
  78. data/lib/phusion_passenger/loader_shared_helpers.rb +11 -1
  79. data/lib/phusion_passenger/nginx/config_options.rb +8 -0
  80. data/lib/phusion_passenger/packaging.rb +8 -3
  81. data/lib/phusion_passenger/platform_info/apache.rb +3 -0
  82. data/lib/phusion_passenger/platform_info/ruby.rb +4 -1
  83. data/lib/phusion_passenger/standalone/command.rb +0 -1
  84. data/lib/phusion_passenger/standalone/package_runtime_command.rb +1 -0
  85. data/lib/phusion_passenger/standalone/start_command.rb +80 -62
  86. data/lib/phusion_passenger/standalone/status_command.rb +1 -0
  87. data/lib/phusion_passenger/standalone/stop_command.rb +1 -0
  88. data/man/passenger-config.1 +1 -1
  89. data/man/passenger-memory-stats.8 +1 -1
  90. data/man/passenger-status.8 +1 -1
  91. data/npm-shrinkwrap.json +229 -0
  92. data/package.json +28 -0
  93. data/resources/templates/standalone/config.erb +2 -0
  94. data/rpm/Vagrantfile +0 -3
  95. data/test/config.json.vagrant +30 -0
  96. data/test/cxx/HttpHeaderBuffererTest.cpp +64 -10
  97. data/test/cxx/RequestHandlerTest.cpp +35 -13
  98. data/test/integration_tests/apache2_tests.rb +1 -0
  99. data/test/stub/node/app.js +26 -18
  100. metadata +28 -13
  101. metadata.gz.asc +7 -7
  102. data/doc/Architectural overview.idmap.txt +0 -36
  103. data/doc/Architectural overview.txt +0 -410
  104. data/doc/images/smart.png +0 -0
  105. data/ext/common/ApplicationPool2/README.md +0 -56
  106. data/man/passenger-stress-test.1 +0 -43
  107. data/node_lib/phusion_passenger/httplib_emulation.js +0 -215
  108. data/node_lib/phusion_passenger/request_handler.js +0 -73
  109. data/node_lib/phusion_passenger/session_protocol_parser.js +0 -113
  110. data/test/node/httplib_emulation_spec.js +0 -623
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YjE0MmI0OTJkOTRiYTA1NDYyNmJmNjM2NzFlOTMxZTBmM2QxYzU3ZA==
4
+ OTQxZWYyOGY1YmIzMDg1MjllZTY3YzNkZmE0ZWIwZTE2NWI5MjdjZg==
5
5
  data.tar.gz: !binary |-
6
- YzUzNGUzNDNjMDQ4YmM5YWEyNDIxZmU0MGZhODA0MTI0YzA3M2I5MA==
6
+ ODI1MDFmYzg5YWQyMjU4MzQ4MmU3MmJjNzM4MTAzN2M4OTY0M2I0MQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NTExZDgyNzE2OGQxMDVhNWY4Yzc1NGQ0NjRhMTllOTRhYWQ0NjY4ZjIxMDI3
10
- ZjAyZDE0MzgwNmQzN2IwMDU5OTdkNzcwN2Y0ZDc2ZGFhZTM1YTkwOTBlZjZl
11
- NjFjMTIxM2U5MWMzMWM2Y2ViZjIyNDY3ODkwY2MzMTNjMGZmYTU=
9
+ MjM2MDgyNzQyNDg1Yjg2MmIyMjcwMWY4MDFkYzliM2VmMTgwMmY5MGJmYmI4
10
+ YjdjYjMwMDI4N2ZkMDk4ZDM1YzQ3ZTNjZmVjZWJjMTdkMjg2OWFhYmM1YzU4
11
+ NzllOWU2ZGQzMDhkNDM2N2EyZDc3MzQ0ZDQ3ZTNkOGFmMDcwNjk=
12
12
  data.tar.gz: !binary |-
13
- ZDE2NzdlOGQyZGY5NjE5ZmEyMGY0OTQ2OGRjZDllMDNlZjQ4MzMwMzEyY2Rh
14
- ODI4ODFlNTNhNDYzYzZkODI5Yjc1ZTdjNzA2MDAxZWYyMzE2ZGZkOTk1M2Y2
15
- OTFmZDQ0NzFmMzMzNWQwNjdkNWFhNjlkMjE3MTMyNWY3ODA1ZjU=
13
+ ZmJhNjExZTdmOTMwM2IyY2FjMjI5M2RkZWE5YjMxNmUxY2VjYWQ4MmY2ZDNj
14
+ ZTdlNjVhN2RhYTU1NGNhZmY2YjU0NTVhNTNiNzkzYTBmNzgxNTI1ZTcyMGZk
15
+ MjA1MzE0Mzk5NDQ3Y2EzMjE3N2I1ZDk3ZmU3ZDUwNGI2M2YxODY=
checksums.yaml.gz.asc CHANGED
@@ -2,11 +2,11 @@
2
2
  Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
3
3
  Comment: GPGTools - http://gpgtools.org
4
4
 
5
- iQEcBAABAgAGBQJThyRmAAoJECrHRaUKISqMHS4H/2z5ltAxui7WJ5E/13DDIR2T
6
- BLxFDixTzjGIgyA6WONunPQJQsR4JG7dIyUGm5cZAo0AlmJ8ptuClIVv3Q9JCP2g
7
- YQeaYR2bc0ahrjxzOnCdysA/PKHlkQMDAdmKvPGE+qN8CJBwk1/jTtW/CYrG0Zi5
8
- xDVvww0z1DnhQlKPRyu8a9R3r4ZTZdixZmbZneE0NGlRFcQbQPWlmp0Q0gh3TsYY
9
- rkvYEQxhQWsjUf0g7Id0tLxpnh7N/go6vWnC6EAXWVJe+T0V4U98vBk8sG/84A64
10
- O/4nbys5SiNGo2ampAgXn2Ol6r3jblJ9nhVXuU4YLMksKOGOif0WxOsMGEvlVAw=
11
- =+CYd
5
+ iQEcBAABAgAGBQJTmYzGAAoJECrHRaUKISqMhFYH/R98G3A4TabyzULioj4MnFL2
6
+ exwefHsSLPT5GkpqHn9JEGA0FkX9R+cQhYtaMiiy63Y3w6cCzC+GnCiMlhWwLd9k
7
+ jDUo2PdC+nuWP7DxUSrUtikHsBMY9Dw+xWAGTyjF/gahINKL72nRyMgVhLzxYXlj
8
+ M74M8SPFFfFW8Ajy+/WF/Q68kx/1oGGeOETgJGjwEi4gI+bE129oErsTe3Ia2TO5
9
+ yesWCGeR+AE2DnrLkUVoxAih7uZkL9bVT8exG5YytP70uo21CjwDkxJKv0P8cZn6
10
+ rXjmCEgxh4dAfvqLz5TBK1Fc3JMQcgnXXq4QOVNXgL7Mq0jlKtz+ubYxaZJo5/M=
11
+ =rQKT
12
12
  -----END PGP SIGNATURE-----
data.tar.gz.asc CHANGED
@@ -2,11 +2,11 @@
2
2
  Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
3
3
  Comment: GPGTools - http://gpgtools.org
4
4
 
5
- iQEcBAABAgAGBQJThyRmAAoJECrHRaUKISqM2Q0H/1T5KZVf5LIddFcIOCSRo6ww
6
- FmLU9oQ3zJVtWwn8BFItGOzF1UXd5e4Lnlrf0Jje6YovQagiTzkAeR8R3sALQEmC
7
- MZux3X80nW4IalyNiM6DBVEIebh0h/MGAbAsr0NrxfcKtBNqdW1oZpP3xQhpGdyd
8
- CFIPQOeU3RCSTjZqK2aeTXZDYzVoJ7eDuM47+nHQLItfsUGJxkVEcZsIv1wmvqk5
9
- FGpUQD03NY58QjpevoTVvM9DE0JS5SMp+iNup2FpjhLimBtG6hENY9dMmYHRCgBj
10
- R1R8ZpbdOvNeiqaHFR03K1xtIE9aAeDjWefFzDk1D7ySVAqCMD6mbL8BiIVTsUA=
11
- =SFYQ
5
+ iQEcBAABAgAGBQJTmYzGAAoJECrHRaUKISqMlvsH/3KowVMQS+UI3bAP2Os6mhKW
6
+ p3N73sotyHBtWmsYyWsgp2H9JnzEIf2Z7eNhh9VLVAXSrSBSLNEUVa5JmqHGI6eb
7
+ 5f2NrHE0DawKYznK4DEtRSqH2P6iUAsP+XCGnpwoZBP0LaJzCdOPFcfUrWqlHo0z
8
+ aOrJzsh/KS2Jr0694elf+uMmn3AKnqbPU4neGliOIeiSHM2LO36WSaBOZiagiWXK
9
+ Eti3XYSmClE8tFOUmjdVfHJAom0UrBCTFUI6UhBPFuyq1bdUcbNcnKT9hKClphjL
10
+ jYpx3G1iCuacbCMbF93LHxN3wh4U0f0hkW41Sirz/P7ItT4Ieet3hOg95OZkiv8=
11
+ =Y+ZE
12
12
  -----END PGP SIGNATURE-----
data/.travis.yml CHANGED
@@ -10,3 +10,6 @@ env:
10
10
  - TEST_SOURCE_PACKAGING=1 TEST_DEBIAN_PACKAGING=1
11
11
 
12
12
  script: ./dev/run_travis.sh
13
+
14
+ notifications:
15
+ slack: phusionnl:PH5p7JYXyv2XLDpICHh8Nj6F
data/CHANGELOG CHANGED
@@ -1,3 +1,34 @@
1
+ Release 4.0.45
2
+ --------------
3
+
4
+ * Major improvements in Node.js and Meteor compatibility. Older Phusion Passenger
5
+ versions implemented Node.js support by emulating Node.js' HTTP library.
6
+ This approach was found to be unsustainable, so we've abandoned that approach
7
+ and replaced it with a much simpler approach that does not involve emulating
8
+ the HTTP library.
9
+ * Introduced support for sticky sessions. Sticky sessions are useful -- or even
10
+ required -- for apps that store state inside process memory. Prominent examples
11
+ include SockJS, Socket.io, faye-websocket and Meteor. Sticky sessions are
12
+ required to make the aforementioned examples work in multi-process scenarios.
13
+ By introducing sticky sessions support, we've much improved WebSocket support
14
+ and support for the aforementioned libraries and frameworks.
15
+ * Due to user demand, GET requests with request bodies are once again supported.
16
+ Support for these kinds of requests was removed in 4.0.42 in an attempt to
17
+ increase the strictness and robustness of our request handling code. It has
18
+ been determined that GET requests with request bodies can be adequately
19
+ supported without degrading robustness in Phusion Passenger. However, GET
20
+ requests with both request bodies and WebSocket upgrade headers are
21
+ unsupported. Fixes issue #1092.
22
+ * [Enterprise] The [Flying Passenger](http://www.modrails.com/documentation/Users%20guide%20Apache.html#flying_passenger)
23
+ feature is now also available on Apache.
24
+ * Fixed some issues with RVM mixed mode support, issue #1121.
25
+ * Fixed Passenger Standalone complaining about not finding PassengerHelperAgent
26
+ during startup.
27
+ * Fixed various minor issues such as #1190 and #1197.
28
+ * The download timeout for passenger-install-nginx-module has been increased.
29
+ Patch by 亀田 義裕.
30
+
31
+
1
32
  Release 4.0.44
2
33
  --------------
3
34
 
data/CONTRIBUTING.md CHANGED
@@ -1,17 +1,35 @@
1
- # Contributing to Phusion Passenger
1
+ # Contributors Guide
2
+
3
+ **Table of contents**
4
+
5
+ * [Filing bug reports](#file_bugs)
6
+ * [Contributing documentation](#contrib_docs)
7
+ * [Contributing by bug triaging](#contrib_triag)
8
+ * [Contributing community support](#contrib_support)
9
+ * [Contributing code](#contrib_code)
10
+ * [Developer QuickStart](#dev_quickstart)
11
+ * [Design and Architecture](#design_and_architecture)
12
+ * [Compilation and build system](#build_system)
13
+ * [Running the unit tests](#unit_tests)
14
+ * [Directory structure](#dir_structure)
15
+ * [C++ coding style](#cxx_coding_style)
16
+ * [Ruby coding style](#ruby_coding_style)
17
+ * [Systems programming fundamentals](#systems_programming_fundamentals)
18
+ * [Further reading](#further_reading)
2
19
 
3
20
  Thank you for your interest in Phusion Passenger. Phusion Passenger is open source so your contributions are very welcome. Although we also provide a [commercial version](https://www.phusionpassenger.com/enterprise) and [commercial support](https://www.phusionpassenger.com/commercial_support), the core remains open source and we remain committed to keep it that way. This guide gives you an overview of the ways with which you can contribute, as well as contribution guidelines.
4
21
 
5
22
  You can contribute in one of the following areas:
6
23
 
7
- * Documentation (user documentation, developer documentation, contributor documentation).
24
+ * Filing bugs.
8
25
  * Bug triage.
26
+ * Documentation (user documentation, developer documentation, contributor documentation).
9
27
  * Community support.
10
28
  * Code.
11
29
 
12
30
  We require contributors to sign our [contributor agreement](http://www.phusion.nl/forms/contributor_agreement) before we can merge their patches.
13
31
 
14
- Please submit patches in the form of a Github pull request or as a patch on the [bug tracker](http://code.google.com/p/phusion-passenger/issues/list). Pull requests are preferred and generally get more attention because Github has better email notifications and better discussion capabilities.
32
+ Please submit patches in the form of a Github pull request or as a patch on the [bug tracker](https://github.com/phusion/passenger/issues). Pull requests are preferred and generally get more attention because Github has better email notifications and better discussion capabilities.
15
33
 
16
34
  You should also install required developer tools. The following command will install everything you need:
17
35
 
@@ -21,15 +39,27 @@ If your system requires gems to be installed with root privileges, run:
21
39
 
22
40
  rake test:install_deps SUDO=1
23
41
 
42
+ <a name="file_bugs"></a>
43
+ ## Filing bug reports
44
+
45
+ When filing a bug report, please ensure that you include the following information:
46
+
47
+ * What steps will reproduce the problem?
48
+ * What is the expected output? What do you see instead?
49
+ * What version of Phusion Passenger are you using?
50
+ * Which version of Ruby, Rails, Node.js or Meteor are you using? On what operating system?
51
+
52
+ <a name="contrib_docs"></a>
24
53
  ## Contributing documentation
25
54
 
26
55
  All good software should have good documentation, and we take this very seriously. However writing and maintaing quality documentation is not an easy task. If you are not skilled in C++ or programming, then writing documentation is the easiest way to contribute.
27
56
 
28
57
  Most documentation can be located in the `doc` directory, and are either written in Markdown or in Asciidoc format. They can be compiled to HTML with `rake doc`. You need [Mizuho](https://github.com/FooBarWidget/mizuho) to compile Asciidoc and [BlueCloth](http://deveiate.org/projects/BlueCloth) to compile Markdown. Both gems are automatically installed as part of the Phusion Passenger developer tools.
29
58
 
59
+ <a name="contrib_tiag"></a>
30
60
  ## Contributing by bug triaging
31
61
 
32
- Users [fill bug reports](http://code.google.com/p/phusion-passenger/issues/list) on a regular basis, but not all bug reports are legit, not all bug reports are equally important, etc. By helping with bug triaging you make the lives of the core developers a lot easier.
62
+ Users [file bug reports](https://github.com/phusion/passenger/issues) on a regular basis, but not all bug reports are legit,contain sufficient information, are equally important, etc. By helping with bug triaging you make the lives of the core developers a lot easier.
33
63
 
34
64
  To start contributing, please submit a comment on any bug report that needs triaging. This comment should contain triaging instructions, e.g. whether a report should be considered duplicate. If you contribute regularly we'll give you moderator access to the bug tracker so that you can apply triaging labels directly.
35
65
 
@@ -43,19 +73,31 @@ Here are some of the things that you should look for:
43
73
 
44
74
  **Always be polite to bug reporters.** Not all reporters are fluent in English, and not everybody may be tech-savvy. But we ask you for your patience and tolerance on this. We want to stimulate a positive and ejoyable environment.
45
75
 
76
+ <a name="contrib_support"></a>
46
77
  ## Contributing community support
47
78
 
48
79
  You can contribute by answering support questions on the [community discussion forum](http://groups.google.com/group/phusion-passenger) or on [Stack Overflow](http://stackoverflow.com/search?q=passenger).
49
80
 
81
+ <a name="contrib_code"></a>
50
82
  ## Contributing code
51
83
 
52
- Phusion Passenger is mostly written in C++, but the build system and various small helper scripts are in Ruby. The loaders for each supported language is written in the respective language.
84
+ Phusion Passenger is mostly written in C++, but the build system and various small helper scripts are in Ruby. The loaders for each supported language is written in the respective language. The source code is filled with inline comments, so look there if you want to understand how things work.
85
+
86
+ <a name="dev_quickstart"></a>
87
+ ### Developer QuickStart
88
+
89
+ <a href="https://vimeo.com/phusionnl/review/97427161/15cb4cc59a"><img src="http://blog.phusion.nl/wp-content/uploads/2014/06/passenger_developer_quickstart.png"></a>
53
90
 
54
- The source code is filled with inline comments, so look there if you want to understand how things work. We also have dedicated documents on some topics and for some subsystems. Some interesting documents are:
91
+ _Watch the Developer QuickStart screencast_
55
92
 
56
- * ext/common/ApplicationPool2/README.md - If you're interesting in the ApplicationPool and Spawner subsystems.
57
- * doc/DebuggingAndStressTesting.md
93
+ We provide an easy and convenient development environment that contributors can use. Learn more at the [Developer QuickStart](https://github.com/phusion/passenger/blob/master/doc/DeveloperQuickstart.md).
58
94
 
95
+ <a name="design_and_architecture"></a>
96
+ ### Design and Architecture
97
+
98
+ Phusion Passenger's design and architecture is documented in detail in the [Design & Architecture](https://www.phusionpassenger.com/documentation/Design%20and%20Architecture.html) document.
99
+
100
+ <a name="build_system"></a>
59
101
  ### Compilation and build system
60
102
 
61
103
  `passenger-install-apache2-module` and `passenger-install-nginx-module` are actually user-friendly wrappers around the build system. The build system is written in Rake, and most of it can be found in the `build/` directory.
@@ -67,6 +109,7 @@ Run the following command to compile everything:
67
109
 
68
110
  It is recommended that you install ccache and set the `USE_CCACHE=1` environment variable. The build system will then automatically wrap all compiler calls in ccache, significantly improving recompilation times.
69
111
 
112
+ <a name="unit_tests"></a>
70
113
  ### Running the unit tests
71
114
 
72
115
  The tests depend on the Phusion Passenger developer tools. Make sure they're installed:
@@ -109,6 +152,7 @@ Run just the integration tests:
109
152
 
110
153
  Note that some tests, such as the ones that test privilege lowering, require root privileges. Those will only be run if Rake is run as root.
111
154
 
155
+ <a name="dir_structure"></a>
112
156
  ### Directory structure
113
157
 
114
158
  The most important directories are:
@@ -160,6 +204,7 @@ Less important directories:
160
204
  * `build` <br>
161
205
  Source code of the build system.
162
206
 
207
+ <a name="cxx_coding_style"></a>
163
208
  ### C++ coding style
164
209
 
165
210
  * Use 4-space tabs for indentation.
@@ -273,6 +318,7 @@ Less important directories:
273
318
 
274
319
  Other than the aforementioned rules, function definitions follow the same rules as function declarations.
275
320
 
321
+ <a name="ruby_coding_style"></a>
276
322
  ### Ruby coding style
277
323
 
278
324
  The usual Ruby coding style applies, with some exceptions:
@@ -280,6 +326,20 @@ The usual Ruby coding style applies, with some exceptions:
280
326
  * Use 4-space tabs for indentation.
281
327
  * Return values explicitly with `return`.
282
328
 
283
- ## Further reading
329
+ <a name="systems_programming_fundamentals"></a>
330
+ ### Systems programming fundamentals
331
+
332
+ Large parts of Phusion Passenger are written in C++. You can find a free C++ tutorial at [cplusplus.com](http://www.cplusplus.com/doc/tutorial/).
333
+
334
+ Phusion Passenger heavily utilizes POSIX, the API that is in use by all Unix systems. The POSIX API is heavily used for:
335
+
336
+ * Filesystem operations.
337
+ * Process management.
338
+ * Sockets.
339
+
340
+ A good and comprehensive, but rather large source for learning POSIX is the [POSIX Programmer's Guide](ftp://92.42.8.18/pub/doc/books/OReilly_-_POSIX_Programmers_Guide.pdf) by Donald A. Lewine. You can find smaller but less comprehensive documents all over the Internet. In particular, you will want to familiarize yourself with [fork-exec](http://en.wikipedia.org/wiki/Fork-exec), the standard process creation pattern in Unix.
341
+
342
+ <a name="further_reading"></a>
343
+ ### Further reading
284
344
 
285
- Please read "doc/CodingTipsAndPitfalls.md".
345
+ * [Coding Tips and Pitfalls](https://github.com/phusion/passenger/blob/master/doc/CodingTipsAndPitfalls.md)
data/CONTRIBUTORS CHANGED
@@ -9,6 +9,7 @@ Andy Allan
9
9
  Benjamin Fleischer
10
10
  Bernd Ahlers
11
11
  Chad Fowler
12
+ Chris Walquist
12
13
  Christoffer Sawicki
13
14
  Damien Le Berrigaud
14
15
  Dan Peterson
@@ -21,6 +22,7 @@ Dmitry Galinsky
21
22
  Dylan Vaughn
22
23
  Erik Ogan
23
24
  Evan Phoenix
25
+ flygoast
24
26
  Gaspard Bucher
25
27
  Goffert van Gool (Phusion)
26
28
  Gokulnath Manakkattil
@@ -53,6 +55,7 @@ Neil Wilson
53
55
  Ninh Bui (Phusion)
54
56
  Pat Downey
55
57
  Paul Kmiec
58
+ Pepijn Looije
56
59
  Perry Smith
57
60
  Philip M. Gollucci
58
61
  Redmar Kerkhoff
@@ -68,3 +71,4 @@ Tim Carey-Smith
68
71
  Tinco Andringa (Phusion)
69
72
  W. Andrew Loe III
70
73
  Weyert de Boer
74
+ 亀田 義裕
data/README.md CHANGED
@@ -16,7 +16,7 @@ Please follow [the installation instructions on the website](https://www.phusion
16
16
 
17
17
  ### Installing the source directly from git
18
18
 
19
- If you mean to install the latest version of Passenger directly from this git repository, then you should run one of the following commands. Installing from the git repository is basically the same as the tarball installation method, as [described in the manual](http://modrails.com/documentation/Users%20guide.html#installation).
19
+ If you mean to install the latest version of Passenger directly from this git repository, then you should run one of the following commands. Installing from the git repository is basically the same as the tarball installation method, as [described in the manual](https://www.phusionpassenger.com/documentation/Users%20guide.html#installation).
20
20
 
21
21
  ./bin/passenger-install-apache2-module
22
22
 
data/Vagrantfile ADDED
@@ -0,0 +1,50 @@
1
+ # This Vagrantfile sets up an Ubuntu VM, for the purpose of developing Phusion Passenger.
2
+
3
+ # Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
4
+ VAGRANTFILE_API_VERSION = "2"
5
+
6
+ CPUS = ENV.fetch('CPUS', 2).to_i
7
+ MEMORY = ENV.fetch('MEMORY', 2048).to_i
8
+
9
+ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
10
+ config.vm.box = "phusion-open-ubuntu-14.04-amd64"
11
+ config.vm.box_url = "https://oss-binaries.phusionpassenger.com/vagrant/boxes/latest/ubuntu-14.04-amd64-vbox.box"
12
+ config.ssh.forward_agent = true
13
+
14
+ # Passenger Standalone and 'rails server'
15
+ config.vm.network :forwarded_port, :host => 3000, :guest => 3000
16
+ config.vm.network :forwarded_port, :host => 3001, :guest => 3001
17
+ config.vm.network :forwarded_port, :host => 3002, :guest => 3002
18
+ # Apache
19
+ config.vm.network :forwarded_port, :host => 8000, :guest => 8000
20
+ config.vm.network :forwarded_port, :host => 8001, :guest => 8001
21
+ config.vm.network :forwarded_port, :host => 8002, :guest => 8002
22
+ config.vm.network :forwarded_port, :host => 8003, :guest => 8003
23
+ config.vm.network :forwarded_port, :host => 8004, :guest => 8004
24
+ config.vm.network :forwarded_port, :host => 8005, :guest => 8005
25
+ config.vm.network :forwarded_port, :host => 8010, :guest => 8010
26
+ # Nginx
27
+ config.vm.network :forwarded_port, :host => 8100, :guest => 8100
28
+ config.vm.network :forwarded_port, :host => 8101, :guest => 8101
29
+ config.vm.network :forwarded_port, :host => 8102, :guest => 8102
30
+ config.vm.network :forwarded_port, :host => 8103, :guest => 8103
31
+ config.vm.network :forwarded_port, :host => 8104, :guest => 8104
32
+ config.vm.network :forwarded_port, :host => 8105, :guest => 8105
33
+ config.vm.network :forwarded_port, :host => 8110, :guest => 8110
34
+
35
+ config.vm.provider :virtualbox do |vb, override|
36
+ # VirtualBox shared folders are WAAAAY too slow
37
+ override.vm.network :private_network, :type => "dhcp"
38
+ override.vm.synced_folder ".", "/vagrant", :type => "nfs"
39
+ vb.cpus = CPUS
40
+ vb.memory = MEMORY
41
+ end
42
+
43
+ config.vm.provider :vmware_fusion do |vf, override|
44
+ override.vm.box_url = "https://oss-binaries.phusionpassenger.com/vagrant/boxes/latest/ubuntu-14.04-amd64-vmwarefusion.box"
45
+ vf.vmx["numvcpus"] = CPUS.to_s
46
+ vf.vmx["memsize"] = MEMORY.to_s
47
+ end
48
+
49
+ config.vm.provision :shell, :path => "dev/vagrant/provision.sh"
50
+ end
@@ -42,6 +42,11 @@ PhusionPassenger.require_passenger_lib 'abstract_installer'
42
42
  PhusionPassenger.require_passenger_lib 'utils/terminal_choice_menu'
43
43
  PhusionPassenger.require_passenger_lib 'utils/tmpio'
44
44
 
45
+ DOWNLOAD_OPTION = {
46
+ :connect_timeout => 30,
47
+ :idle_timeout => 30
48
+ }
49
+
45
50
  class Installer < PhusionPassenger::AbstractInstaller
46
51
  include PhusionPassenger
47
52
  TerminalChoiceMenu = PhusionPassenger::Utils::TerminalChoiceMenu
@@ -260,7 +265,7 @@ private
260
265
  dirname = "pcre-#{PREFERRED_PCRE_VERSION}"
261
266
  tarball = "#{@working_dir}/pcre.tar.gz"
262
267
 
263
- if download(url, tarball)
268
+ if download(url, tarball, DOWNLOAD_OPTION)
264
269
  Dir.chdir(@working_dir) do
265
270
  puts "<banner>Verifying PCRE checksum...</banner>"
266
271
  if Digest::SHA256.file(tarball) != PCRE_SHA256_CHECKSUM
@@ -298,7 +303,7 @@ private
298
303
  dirname = "nginx-#{PREFERRED_NGINX_VERSION}"
299
304
  tarball = "#{@working_dir}/nginx.tar.gz"
300
305
 
301
- if download(url, tarball)
306
+ if download(url, tarball, DOWNLOAD_OPTION)
302
307
  Dir.chdir(@working_dir) do
303
308
  puts "<banner>Verifying Nginx checksum...</banner>"
304
309
  if Digest::SHA256.file(tarball) != NGINX_SHA256_CHECKSUM
data/build/basics.rb CHANGED
@@ -97,7 +97,7 @@ def boolean_option(name, default_value = false)
97
97
  end
98
98
 
99
99
  def maybe_wrap_in_ccache(command)
100
- if boolean_option('USE_CCACHE', false)
100
+ if boolean_option('USE_CCACHE', false) && command !~ /^ccache /
101
101
  return "ccache #{command}"
102
102
  else
103
103
  return command
@@ -128,6 +128,9 @@ if boolean_option('CACHING', true) && !boolean_option('RELEASE')
128
128
  FileUtils.mkdir_p(PlatformInfo.cache_dir)
129
129
  end
130
130
 
131
+ # https://github.com/phusion/passenger/issues/672
132
+ ENV.delete('CDPATH')
133
+
131
134
  #################################################
132
135
 
133
136
  PACKAGE_NAME = PhusionPassenger::PACKAGE_NAME
@@ -91,3 +91,9 @@ def create_markdown_compilation_task(target)
91
91
  end
92
92
 
93
93
  create_markdown_compilation_task('doc/Packaging.html')
94
+
95
+ desc "Upload documentation to the Phusion web server"
96
+ task 'doc:rsync' => :doc do
97
+ sh "cd doc && rsync -rv --progress --partial-dir=.rsync-partial --human-readable . " +
98
+ "shell.phusion.nl:/home/phusion/websites/passenger_docs/"
99
+ end
data/build/node_tests.rb CHANGED
@@ -25,5 +25,11 @@
25
25
 
26
26
  desc "Run unit tests for the Node.js libraries"
27
27
  task 'test:node' do
28
- sh "cd test && env NODE_PATH=#{PhusionPassenger.node_libdir} ../node_modules/.bin/mocha -R spec node/*_spec.js"
28
+ require 'shellwords'
29
+ command = "cd test && env NODE_PATH=#{PhusionPassenger.node_libdir} " +
30
+ "../node_modules/.bin/mocha -R spec node/*_spec.js"
31
+ if grep = string_option('G')
32
+ command << " -g #{Shellwords.escape(grep)}"
33
+ end
34
+ sh(command)
29
35
  end
data/build/packaging.rb CHANGED
@@ -104,6 +104,11 @@ task :clobber => 'package:clean'
104
104
 
105
105
  task 'package:set_official' do
106
106
  ENV['OFFICIAL_RELEASE'] = '1'
107
+ # These environment variables interfere with 'brew install'
108
+ # and maybe other stuff, so unset them.
109
+ ENV.delete('CC')
110
+ ENV.delete('CXX')
111
+ ENV.delete('USE_CCACHE')
107
112
  end
108
113
 
109
114
  desc "Build, sign & upload gem & tarball"
data/build/test_basics.rb CHANGED
@@ -51,7 +51,8 @@ task 'test:install_deps' do
51
51
  if boolean_option('BASE_DEPS', default)
52
52
  sh "#{gem_install} rails -v 2.3.15"
53
53
  sh "#{gem_install} mime-types -v 1.25"
54
- sh "#{gem_install} bundler rspec daemon_controller json rack"
54
+ sh "#{gem_install} rspec -v 2.14.1"
55
+ sh "#{gem_install} bundler daemon_controller json rack"
55
56
  end
56
57
  if boolean_option('DOCTOOLS', default)
57
58
  begin
@@ -77,7 +78,6 @@ task 'test:install_deps' do
77
78
  end
78
79
  end
79
80
  if boolean_option('NODE_MODULES', default)
80
- sh "npm install mocha should sinon"
81
- sh "npm install express@3.4.8"
81
+ sh "npm install"
82
82
  end
83
83
  end