Permalink
Browse files

Add enterprisey aspects.

  • Loading branch information...
1 parent 3ca31b3 commit bb20616dc45356ab8bcec522d99c53195da3df7f @FooBarWidget FooBarWidget committed Apr 28, 2008
View
@@ -383,7 +383,8 @@ spec = Gem::Specification.new do |s|
'passenger-spawn-server',
'passenger-install-apache2-module',
'passenger-config',
- 'passenger-memory-stats'
+ 'passenger-memory-stats',
+ 'passenger-make-enterprisey'
]
s.has_rdoc = true
s.extra_rdoc_files = ['README']
@@ -0,0 +1,62 @@
+#!/usr/bin/env ruby
+# Phusion Passenger - http://www.modrails.com/
+# Copyright (C) 2008 Phusion
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+PASSENGER_ROOT = File.expand_path(File.dirname(__FILE__) << "/..")
+require 'digest/md5'
+
+##############################################################################
+#
+# Hidden license
+#
+# By reading the source code of this file, you're automatically agreeing
+# with the following conditions:
+#
+# 1. You will sell your soul to us for $0.
+# 2. You will watch the movie "Hot Fuzz".
+#
+# [ Allow ] or [ Deny ]
+#
+##############################################################################
+
+
+
+
+trap("INT") { exit 1 }
+if File.exist?("#{PASSENGER_ROOT}/enterprisey.txt")
+ puts "Congratulations, your Passenger Enterprise License has already been activated!"
+else
+ puts %{
+ Phusion Genuine Advantage
+ -------------------------
+ Welcome to the Phusion Genuine Advantage (PGA) program. This program will help
+ you with activating your Passenger Enterprise License.
+
+ Please enter your Enterprise License Key:
+ }.gsub(/^\t\t/, '').strip
+ done = false
+ while !done
+ key = STDIN.readline.strip
+ if key == Digest::MD5.hexdigest(%{Saying "Rails doesn't scale" is like saying "my car doesn’t go infinitely fast".})
+ done = true
+ else
+ STDERR.puts "Invalid key given. Please try again:"
+ end
+ end
+ system("touch", "#{PASSENGER_ROOT}/enterprisey.txt")
+ puts "Congratulations! Your Passenger Enterprise License has been activated!"
+ puts "Please restart Apache to take full advantage of your Enterprise License."
+end
@@ -97,12 +97,17 @@ class RequestHandler
DEFAULT = 'DEFAULT' # :nodoc:
CONTENT_LENGTH = 'CONTENT_LENGTH' # :nodoc:
HTTP_CONTENT_LENGTH = 'HTTP_CONTENT_LENGTH' # :nodoc:
+ X_POWERED_BY = 'X-Powered-By'
NINJA_PATCHING_LOCK = Mutex.new
@@ninja_patched_action_controller = false
File.read("#{File.dirname(__FILE__)}/../../Rakefile") =~ /^PACKAGE_VERSION = "(.*)"$/
PASSENGER_VERSION = $1
+ PASSENGER_HEADER = "Phusion Passenger (mod_rails) #{PASSENGER_VERSION}"
+ if File.exist?("#{File.dirname(__FILE__)}/../../enterprisey.txt")
+ PASSENGER_HEADER << ", Enterprise Edition"
+ end
# The name of the socket on which the request handler accepts
# new connections. This is either a Unix socket filename, or
@@ -136,7 +141,7 @@ def initialize(owner_pipe)
alias passenger_orig_perform_action perform_action
def perform_action(*whatever)
- headers["X-Powered-By"] = "Phusion Passenger (mod_rails) #{PASSENGER_VERSION}"
+ headers[X_POWERED_BY] = PASSENGER_HEADER
passenger_orig_perform_action(*whatever)
end
end
@@ -247,6 +247,7 @@ def cleaner_thread_main
end
def send_error_page(channel, template_name, options = {})
+ options["enterprisey"] = File.exist?("#{File.dirname(__FILE__)}/../../enterprisey.txt")
data = HTMLTemplate.new(template_name, options).result
channel.write('error_page')
channel.write_scalar(data)
@@ -14,7 +14,7 @@
<div id="site_container">
<div id="site_header">
- <ul class="corporate_identity">
+ <ul class="corporate_identity <% if @enterprisey %>enterprise_edition<% end %>">
<li class="logo"><a href="http://www.modrails.com"><span>Phusion Passenger</span></a></li>
</ul>
</div>
@@ -28,7 +28,7 @@
text. Thank you.
-->
<div class="container">
- Powered by <a href="http://www.modrails.com/">Phusion Passenger</a>,
+ Powered by <a href="http://www.modrails.com/">Phusion Passenger</a><% if @enterprisey %> (Enterprise Edition)<% end %>,
<tt>mod_rails</tt> for Apache.
</div>
</div>

1 comment on commit bb20616

myabc commented on bb20616 Apr 28, 2008

April 1 was 27 days ago!

Please sign in to comment.