sugoi-mail 0.0.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.
- data/README +35 -0
- data/Rakefile +10 -0
- data/app/apis/mailservice_api.rb +178 -0
- data/app/controllers/.sugoi_admin_controller.rb.swp +0 -0
- data/app/controllers/account_controller.rb +39 -0
- data/app/controllers/address_controller.rb +49 -0
- data/app/controllers/application.rb +4 -0
- data/app/controllers/commandline_controller.rb +15 -0
- data/app/controllers/domain_controller.rb +37 -0
- data/app/controllers/mailinglist_controller.rb +51 -0
- data/app/controllers/mailservice_controller.rb +497 -0
- data/app/controllers/sugoi_admin_controller.rb +93 -0
- data/app/helpers/account_helper.rb +2 -0
- data/app/helpers/address_helper.rb +2 -0
- data/app/helpers/application_helper.rb +3 -0
- data/app/helpers/domain_helper.rb +2 -0
- data/app/helpers/mailservice_helper.rb +2 -0
- data/app/helpers/sugoi_admin_helper.rb +2 -0
- data/app/models/address.rb +110 -0
- data/app/models/admin_message.rb +45 -0
- data/app/models/confirmationcode.rb +59 -0
- data/app/models/domain.rb +76 -0
- data/app/models/mailinglist.rb +336 -0
- data/app/models/mailinglist_class.rb +39 -0
- data/app/models/message.rb +293 -0
- data/app/models/proxy_link.rb +25 -0
- data/app/models/user.rb +150 -0
- data/app/views/account/login.rhtml +22 -0
- data/app/views/account/logout.rhtml +10 -0
- data/app/views/account/signup.rhtml +17 -0
- data/app/views/account/welcome.rhtml +13 -0
- data/app/views/address/_form.rhtml +7 -0
- data/app/views/address/edit.rhtml +10 -0
- data/app/views/address/list.rhtml +27 -0
- data/app/views/address/new.rhtml +8 -0
- data/app/views/address/show.rhtml +8 -0
- data/app/views/domain/login.rhtml +22 -0
- data/app/views/domain/logout.rhtml +10 -0
- data/app/views/domain/signup.rhtml +17 -0
- data/app/views/domain/welcome.rhtml +13 -0
- data/app/views/layouts/address.rhtml +13 -0
- data/app/views/layouts/scaffold.rhtml +13 -0
- data/app/views/mailinglist/_form.rhtml +28 -0
- data/app/views/mailinglist/edit.rhtml +10 -0
- data/app/views/mailinglist/list.rhtml +27 -0
- data/app/views/mailinglist/new.rhtml +8 -0
- data/app/views/mailinglist/show.rhtml +16 -0
- data/app/views/sugoi_admin/create_domain.rhtml +1 -0
- data/app/views/sugoi_admin/list_addresses.rhtml +1 -0
- data/app/views/sugoi_admin/list_domains.rhtml +2 -0
- data/app/views/sugoi_admin/list_mailinglists.rhtml +1 -0
- data/bin/mailc +32 -0
- data/bin/maild +133 -0
- data/bin/sugoi-admin +21 -0
- data/bin/sugoi-mail +20 -0
- data/config/boot.rb +44 -0
- data/config/environment.rb +54 -0
- data/config/environments/bench.rb +21 -0
- data/config/environments/coverage.rb +21 -0
- data/config/environments/development.rb +21 -0
- data/config/environments/production.rb +18 -0
- data/config/environments/test.rb +19 -0
- data/config/lighttpd.conf +46 -0
- data/config/routes.rb +29 -0
- data/db/migrate/001_mailproxy.rb +7 -0
- data/db/migrate/002_create_users.rb +13 -0
- data/db/migrate/003_create_mailinglists.rb +13 -0
- data/db/migrate/004_create_addresses.rb +12 -0
- data/db/migrate/005_create_addresses_mailinglists.rb +13 -0
- data/db/migrate/006_alter_mailinglists.rb +9 -0
- data/db/migrate/007_create_messages.rb +25 -0
- data/db/migrate/008_add_mailinglistid_to_users.rb +14 -0
- data/db/migrate/009_add_domainadmin_to_users.rb +9 -0
- data/db/migrate/010_add_domain_to_users.rb +16 -0
- data/db/migrate/011_add_active_to_addresses.rb +14 -0
- data/db/migrate/012_create_confirmationcodes.rb +14 -0
- data/db/migrate/013_add_description_to_mailinglists.rb +9 -0
- data/db/migrate/014_create_admin_messages.rb +69 -0
- data/db/migrate/015_add_messages_to_mailinglists.rb +26 -0
- data/db/migrate/016_add_mailinglist_admin_to_users.rb +9 -0
- data/db/migrate/017_add_mailinglist_types.rb +94 -0
- data/db/migrate/018_add_bounciness_to_addresses.rb +20 -0
- data/db/migrate/019_add_archived_to_mailinglist_classes.rb +25 -0
- data/db/migrate/020_add_envelope_data_to_messages.rb +11 -0
- data/db/migrate/021_add_addresses_users.rb +14 -0
- data/db/migrate/022_add_virtual_to_users.rb +14 -0
- data/db/migrate/023_drop_openposting_from_mailinglists.rb +9 -0
- data/db/migrate/024_add_proxy_links.rb +21 -0
- data/db/migrate/025_add_proxify_to_mailinglist_classes.rb +25 -0
- data/db/schema.mysql.sql +104 -0
- data/db/schema.postgresql.sql +104 -0
- data/db/schema.rb +85 -0
- data/db/schema.sqlite.sql +104 -0
- data/db/schema.sqlserver.sql +113 -0
- data/db/schema_version +1 -0
- data/doc/README_FOR_APP +179 -0
- data/doc/mailinglist_classes description.txt +28 -0
- data/installer/rails_installer_defaults.yml +5 -0
- data/lib/daemonize.rb +56 -0
- data/lib/domain_system.rb +87 -0
- data/lib/gurgitate-rules.rb +69 -0
- data/lib/limitedfork.rb +66 -0
- data/lib/login_system.rb +87 -0
- data/public/.htaccess +40 -0
- data/public/404.html +8 -0
- data/public/500.html +8 -0
- data/public/dispatch.cgi +10 -0
- data/public/dispatch.fcgi +24 -0
- data/public/dispatch.rb +10 -0
- data/public/favicon.ico +0 -0
- data/public/images/rails.png +0 -0
- data/public/javascripts/application.js +2 -0
- data/public/javascripts/controls.js +815 -0
- data/public/javascripts/dragdrop.js +913 -0
- data/public/javascripts/effects.js +958 -0
- data/public/javascripts/prototype.js +2006 -0
- data/public/robots.txt +1 -0
- data/public/stylesheets/scaffold.css +74 -0
- data/public/stylesheets/trestle.css +74 -0
- data/script/about +3 -0
- data/script/breakpointer +3 -0
- data/script/console +3 -0
- data/script/destroy +3 -0
- data/script/fakedeliver +19 -0
- data/script/generate +3 -0
- data/script/performance/benchmarker +3 -0
- data/script/performance/profiler +3 -0
- data/script/plugin +3 -0
- data/script/process/reaper +3 -0
- data/script/process/spawner +3 -0
- data/script/runner +3 -0
- data/script/server +3 -0
- data/sugoi-mail.gemspec +36 -0
- data/test/fixtures/addresses.yml +70 -0
- data/test/fixtures/addresses_mailinglists.yml +20 -0
- data/test/fixtures/admin_messages.yml +65 -0
- data/test/fixtures/confirmationcodes.yml +13 -0
- data/test/fixtures/domains.yml +9 -0
- data/test/fixtures/mailinglist_classes.yml +45 -0
- data/test/fixtures/mailinglists.yml +80 -0
- data/test/fixtures/messages.yml +154 -0
- data/test/fixtures/proxy_links.yml +5 -0
- data/test/fixtures/users.yml +50 -0
- data/test/functional/domain_controller_test.rb +74 -0
- data/test/functional/mailservice_controller_test.rb +546 -0
- data/test/integration/test_soap.rb +413 -0
- data/test/integration/test_xmlrpc.rb +198 -0
- data/test/mocks/test/net-smtp-stub.rb +24 -0
- data/test/test_helper.rb +28 -0
- data/test/unit/address_test.rb +44 -0
- data/test/unit/admin_message_test.rb +41 -0
- data/test/unit/confirmationcode_test.rb +64 -0
- data/test/unit/domain_test.rb +128 -0
- data/test/unit/mailinglist_class_test.rb +82 -0
- data/test/unit/mailinglist_test.rb +145 -0
- data/test/unit/message_test.rb +151 -0
- data/test/unit/user_test.rb +126 -0
- data/test/units.rb +4 -0
- data/vendor/plugins/active_command/init.rb +1 -0
- data/vendor/plugins/active_command/lib/active_command/request.rb +137 -0
- data/vendor/plugins/active_command/lib/active_command/response.rb +132 -0
- data/vendor/plugins/active_command/lib/active_command.rb +2 -0
- data/vendor/plugins/ar_fixtures/CHANGELOG +10 -0
- data/vendor/plugins/ar_fixtures/MIT-LICENSE +20 -0
- data/vendor/plugins/ar_fixtures/README +19 -0
- data/vendor/plugins/ar_fixtures/Rakefile +54 -0
- data/vendor/plugins/ar_fixtures/about.yml +7 -0
- data/vendor/plugins/ar_fixtures/init.rb +1 -0
- data/vendor/plugins/ar_fixtures/lib/ar_fixtures.rb +102 -0
- data/vendor/plugins/ar_fixtures/tasks/ar_fixtures.rake +39 -0
- data/vendor/plugins/ar_fixtures/test/ar_fixtures_test.rb +53 -0
- data/vendor/plugins/ar_fixtures/test/database.yml +18 -0
- data/vendor/plugins/ar_fixtures/test/fixtures/beer.rb +5 -0
- data/vendor/plugins/ar_fixtures/test/fixtures/beers.yml +9 -0
- data/vendor/plugins/ar_fixtures/test/fixtures/beers_drunkards.yml +8 -0
- data/vendor/plugins/ar_fixtures/test/fixtures/drunkard.rb +6 -0
- data/vendor/plugins/ar_fixtures/test/fixtures/drunkards.yml +8 -0
- data/vendor/plugins/ar_fixtures/test/fixtures/glass.rb +2 -0
- data/vendor/plugins/ar_fixtures/test/fixtures/glasses.yml +9 -0
- data/vendor/plugins/ar_fixtures/test/schema.rb +21 -0
- data/vendor/plugins/ar_fixtures/test/test_helper.rb +37 -0
- metadata +320 -0
@@ -0,0 +1,87 @@
|
|
1
|
+
require_dependency "domain"
|
2
|
+
|
3
|
+
module DomainSystem
|
4
|
+
|
5
|
+
protected
|
6
|
+
|
7
|
+
# overwrite this if you want to restrict access to only a few actions
|
8
|
+
# or if you want to check if the user has the correct rights
|
9
|
+
# example:
|
10
|
+
#
|
11
|
+
# # only allow nonbobs
|
12
|
+
# def authorize?(user)
|
13
|
+
# user.login != "bob"
|
14
|
+
# end
|
15
|
+
def authorize?(domain)
|
16
|
+
true
|
17
|
+
end
|
18
|
+
|
19
|
+
# overwrite this method if you only want to protect certain actions of the controller
|
20
|
+
# example:
|
21
|
+
#
|
22
|
+
# # don't protect the login and the about method
|
23
|
+
# def protect?(action)
|
24
|
+
# if ['action', 'about'].include?(action)
|
25
|
+
# return false
|
26
|
+
# else
|
27
|
+
# return true
|
28
|
+
# end
|
29
|
+
# end
|
30
|
+
def protect?(action)
|
31
|
+
true
|
32
|
+
end
|
33
|
+
|
34
|
+
# login_required filter. add
|
35
|
+
#
|
36
|
+
# before_filter :login_required
|
37
|
+
#
|
38
|
+
# if the controller should be under any rights management.
|
39
|
+
# for finer access control you can overwrite
|
40
|
+
#
|
41
|
+
# def authorize?(user)
|
42
|
+
#
|
43
|
+
def login_required
|
44
|
+
|
45
|
+
if not protect?(action_name)
|
46
|
+
return true
|
47
|
+
end
|
48
|
+
|
49
|
+
if @session[:user] and authorize?(@session[:user])
|
50
|
+
return true
|
51
|
+
end
|
52
|
+
|
53
|
+
# store current location so that we can
|
54
|
+
# come back after the user logged in
|
55
|
+
store_location
|
56
|
+
|
57
|
+
# call overwriteable reaction to unauthorized access
|
58
|
+
access_denied
|
59
|
+
return false
|
60
|
+
end
|
61
|
+
|
62
|
+
# overwrite if you want to have special behavior in case the user is not
|
63
|
+
# authorized to access the current operation.
|
64
|
+
# the default action is to redirect to the login screen
|
65
|
+
# example use :
|
66
|
+
# a popup window might just close itself for instance
|
67
|
+
def access_denied
|
68
|
+
redirect_to :controller=>"/account", :action =>"login"
|
69
|
+
end
|
70
|
+
|
71
|
+
# store current uri in the session.
|
72
|
+
# we can return to this location by calling return_location
|
73
|
+
def store_location
|
74
|
+
@session[:return_to] = @request.request_uri
|
75
|
+
end
|
76
|
+
|
77
|
+
# move to the last store_location call or to the passed default one
|
78
|
+
def redirect_back_or_default(default)
|
79
|
+
if @session[:return_to].nil?
|
80
|
+
redirect_to default
|
81
|
+
else
|
82
|
+
redirect_to_url @session[:return_to]
|
83
|
+
@session[:return_to] = nil
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
87
|
+
end
|
@@ -0,0 +1,69 @@
|
|
1
|
+
#------------------------------------------------------------------------
|
2
|
+
# Gurgitate rules for the mail proxy
|
3
|
+
#
|
4
|
+
# I (hopefully) get some ActiveRecord gubbins in as well as the Gurgitate
|
5
|
+
# stuff.
|
6
|
+
#------------------------------------------------------------------------
|
7
|
+
|
8
|
+
$logger.debug "in gurgitate-rules"
|
9
|
+
$logger.debug to_s
|
10
|
+
$logger.debug "From: #{from}"
|
11
|
+
$logger.debug "To: #{to.inspect}"
|
12
|
+
|
13
|
+
# ------------------------------------------------------------------------
|
14
|
+
# mail to mailing list
|
15
|
+
# ------------------------------------------------------------------------
|
16
|
+
to.each do |to_address|
|
17
|
+
$logger.debug "Looking up #{to_address}"
|
18
|
+
if mlinfo = Mailinglist.find_by_address(to_address)
|
19
|
+
$logger.debug "mlinfo is #{mlinfo.inspect}"
|
20
|
+
ml, command, *params = mlinfo
|
21
|
+
|
22
|
+
$logger.debug ml.inspect
|
23
|
+
$logger.debug command.inspect
|
24
|
+
|
25
|
+
case command
|
26
|
+
when :mail
|
27
|
+
mess=Message.from_message(self)
|
28
|
+
mess.mailinglist = ml
|
29
|
+
mess.save
|
30
|
+
|
31
|
+
if mess then
|
32
|
+
mess.deliver
|
33
|
+
|
34
|
+
if ml.archived?
|
35
|
+
mess.save
|
36
|
+
mailinglist.store_message mess
|
37
|
+
mailinglist.save
|
38
|
+
else
|
39
|
+
mess.destroy
|
40
|
+
end
|
41
|
+
end
|
42
|
+
when :request
|
43
|
+
ml.handle_request self
|
44
|
+
when :bounces
|
45
|
+
nil # yes, this needs to be handled
|
46
|
+
when :proxy
|
47
|
+
# later
|
48
|
+
end
|
49
|
+
return
|
50
|
+
else
|
51
|
+
matches = to_address.match(/(.*?)#(.*?)@(.*)/)
|
52
|
+
puts "hey, found a funky rewrite thingy"
|
53
|
+
|
54
|
+
if matches then
|
55
|
+
localpart, destdomain, domain = matches[1..3]
|
56
|
+
to_address = "#{localpart}@#{destdomain}"
|
57
|
+
p "from address is: #{from}"
|
58
|
+
proxy_address=Address.proxyaddress(from)
|
59
|
+
p "proxy address is: #{proxy_address.inspect}"
|
60
|
+
if proxy_address
|
61
|
+
# mailinglist = Mailinglist.find_by_address(proxy_address)[0]
|
62
|
+
mess=Message.from_message(self)
|
63
|
+
p mess
|
64
|
+
mess.proxy_deliver proxy_address, to_address
|
65
|
+
end
|
66
|
+
end
|
67
|
+
# bounce, or report to postmaster, or something
|
68
|
+
end
|
69
|
+
end
|
data/lib/limitedfork.rb
ADDED
@@ -0,0 +1,66 @@
|
|
1
|
+
require "singleton"
|
2
|
+
require "thread"
|
3
|
+
|
4
|
+
class LimitedFork
|
5
|
+
include Singleton
|
6
|
+
|
7
|
+
def initialize
|
8
|
+
@pids = 0
|
9
|
+
@max_processes = 10 # arbitrary default
|
10
|
+
@mutex=Mutex.new
|
11
|
+
|
12
|
+
trap("CHLD") do
|
13
|
+
begin
|
14
|
+
loop do
|
15
|
+
pid = Process.wait(0)
|
16
|
+
@mutex.synchronize do
|
17
|
+
# @pids -= [ pid ]
|
18
|
+
@pids -= 1
|
19
|
+
end
|
20
|
+
end
|
21
|
+
rescue Errno::ECHILD
|
22
|
+
@pids = 0
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
attr_accessor :pids, :pids, :max_processes, :mutex
|
28
|
+
|
29
|
+
def self.pids
|
30
|
+
instance.pids
|
31
|
+
end
|
32
|
+
|
33
|
+
def self.pids=(val)
|
34
|
+
instance.pids=val
|
35
|
+
end
|
36
|
+
|
37
|
+
def self.limit=(limit)
|
38
|
+
instance.max_processes=limit
|
39
|
+
end
|
40
|
+
|
41
|
+
def self.fork
|
42
|
+
if pids > instance.max_processes then
|
43
|
+
# block until it's okay to go
|
44
|
+
begin
|
45
|
+
pid = Process.waitpid
|
46
|
+
instance.mutex.synchronize do
|
47
|
+
# instance.pids -= [ pid ]
|
48
|
+
self.pids -= 1
|
49
|
+
end
|
50
|
+
rescue Errno::ECHILD
|
51
|
+
# Oops, look like someone already got there. Never
|
52
|
+
# mind then!
|
53
|
+
self.pids=0
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
pid = Process.fork { yield }
|
58
|
+
if pid
|
59
|
+
instance.mutex.synchronize do
|
60
|
+
instance.pids += 1
|
61
|
+
end
|
62
|
+
end
|
63
|
+
return pid
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
data/lib/login_system.rb
ADDED
@@ -0,0 +1,87 @@
|
|
1
|
+
require_dependency "user"
|
2
|
+
|
3
|
+
module LoginSystem
|
4
|
+
|
5
|
+
protected
|
6
|
+
|
7
|
+
# overwrite this if you want to restrict access to only a few actions
|
8
|
+
# or if you want to check if the user has the correct rights
|
9
|
+
# example:
|
10
|
+
#
|
11
|
+
# # only allow nonbobs
|
12
|
+
# def authorize?(user)
|
13
|
+
# user.login != "bob"
|
14
|
+
# end
|
15
|
+
def authorize?(user)
|
16
|
+
true
|
17
|
+
end
|
18
|
+
|
19
|
+
# overwrite this method if you only want to protect certain actions of the controller
|
20
|
+
# example:
|
21
|
+
#
|
22
|
+
# # don't protect the login and the about method
|
23
|
+
# def protect?(action)
|
24
|
+
# if ['action', 'about'].include?(action)
|
25
|
+
# return false
|
26
|
+
# else
|
27
|
+
# return true
|
28
|
+
# end
|
29
|
+
# end
|
30
|
+
def protect?(action)
|
31
|
+
true
|
32
|
+
end
|
33
|
+
|
34
|
+
# login_required filter. add
|
35
|
+
#
|
36
|
+
# before_filter :login_required
|
37
|
+
#
|
38
|
+
# if the controller should be under any rights management.
|
39
|
+
# for finer access control you can overwrite
|
40
|
+
#
|
41
|
+
# def authorize?(user)
|
42
|
+
#
|
43
|
+
def login_required
|
44
|
+
|
45
|
+
if not protect?(action_name)
|
46
|
+
return true
|
47
|
+
end
|
48
|
+
|
49
|
+
if @session[:user] and authorize?(@session[:user])
|
50
|
+
return true
|
51
|
+
end
|
52
|
+
|
53
|
+
# store current location so that we can
|
54
|
+
# come back after the user logged in
|
55
|
+
store_location
|
56
|
+
|
57
|
+
# call overwriteable reaction to unauthorized access
|
58
|
+
access_denied
|
59
|
+
return false
|
60
|
+
end
|
61
|
+
|
62
|
+
# overwrite if you want to have special behavior in case the user is not authorized
|
63
|
+
# to access the current operation.
|
64
|
+
# the default action is to redirect to the login screen
|
65
|
+
# example use :
|
66
|
+
# a popup window might just close itself for instance
|
67
|
+
def access_denied
|
68
|
+
redirect_to :controller=>"/account", :action =>"login"
|
69
|
+
end
|
70
|
+
|
71
|
+
# store current uri in the session.
|
72
|
+
# we can return to this location by calling return_location
|
73
|
+
def store_location
|
74
|
+
@session[:return_to] = @request.request_uri
|
75
|
+
end
|
76
|
+
|
77
|
+
# move to the last store_location call or to the passed default one
|
78
|
+
def redirect_back_or_default(default)
|
79
|
+
if @session[:return_to].nil?
|
80
|
+
redirect_to default
|
81
|
+
else
|
82
|
+
redirect_to_url @session[:return_to]
|
83
|
+
@session[:return_to] = nil
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
87
|
+
end
|
data/public/.htaccess
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
# General Apache options
|
2
|
+
AddHandler fastcgi-script .fcgi
|
3
|
+
AddHandler cgi-script .cgi
|
4
|
+
Options +FollowSymLinks +ExecCGI
|
5
|
+
|
6
|
+
# If you don't want Rails to look in certain directories,
|
7
|
+
# use the following rewrite rules so that Apache won't rewrite certain requests
|
8
|
+
#
|
9
|
+
# Example:
|
10
|
+
# RewriteCond %{REQUEST_URI} ^/notrails.*
|
11
|
+
# RewriteRule .* - [L]
|
12
|
+
|
13
|
+
# Redirect all requests not available on the filesystem to Rails
|
14
|
+
# By default the cgi dispatcher is used which is very slow
|
15
|
+
#
|
16
|
+
# For better performance replace the dispatcher with the fastcgi one
|
17
|
+
#
|
18
|
+
# Example:
|
19
|
+
# RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
|
20
|
+
RewriteEngine On
|
21
|
+
|
22
|
+
# If your Rails application is accessed via an Alias directive,
|
23
|
+
# then you MUST also set the RewriteBase in this htaccess file.
|
24
|
+
#
|
25
|
+
# Example:
|
26
|
+
# Alias /myrailsapp /path/to/myrailsapp/public
|
27
|
+
# RewriteBase /myrailsapp
|
28
|
+
|
29
|
+
RewriteRule ^$ index.html [QSA]
|
30
|
+
RewriteRule ^([^.]+)$ $1.html [QSA]
|
31
|
+
RewriteCond %{REQUEST_FILENAME} !-f
|
32
|
+
RewriteRule ^(.*)$ dispatch.cgi [QSA,L]
|
33
|
+
|
34
|
+
# In case Rails experiences terminal errors
|
35
|
+
# Instead of displaying this message you can supply a file here which will be rendered instead
|
36
|
+
#
|
37
|
+
# Example:
|
38
|
+
# ErrorDocument 500 /500.html
|
39
|
+
|
40
|
+
ErrorDocument 500 "<h2>Application error</h2>Rails application failed to start properly"
|
data/public/404.html
ADDED
data/public/500.html
ADDED
@@ -0,0 +1,8 @@
|
|
1
|
+
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
|
2
|
+
"http://www.w3.org/TR/html4/loose.dtd">
|
3
|
+
<html>
|
4
|
+
<body>
|
5
|
+
<h1>Application error</h1>
|
6
|
+
<p>Change this error message for exceptions thrown outside of an action (like in Dispatcher setups or broken Ruby code) in public/500.html</p>
|
7
|
+
</body>
|
8
|
+
</html>
|
data/public/dispatch.cgi
ADDED
@@ -0,0 +1,10 @@
|
|
1
|
+
#!/usr/bin/ruby1.8
|
2
|
+
|
3
|
+
require File.dirname(__FILE__) + "/../config/environment" unless defined?(RAILS_ROOT)
|
4
|
+
|
5
|
+
# If you're using RubyGems and mod_ruby, this require should be changed to an absolute path one, like:
|
6
|
+
# "/usr/local/lib/ruby/gems/1.8/gems/rails-0.8.0/lib/dispatcher" -- otherwise performance is severely impaired
|
7
|
+
require "dispatcher"
|
8
|
+
|
9
|
+
ADDITIONAL_LOAD_PATHS.reverse.each { |dir| $:.unshift(dir) if File.directory?(dir) } if defined?(Apache::RubyRun)
|
10
|
+
Dispatcher.dispatch
|
@@ -0,0 +1,24 @@
|
|
1
|
+
#!/usr/bin/ruby1.8
|
2
|
+
#
|
3
|
+
# You may specify the path to the FastCGI crash log (a log of unhandled
|
4
|
+
# exceptions which forced the FastCGI instance to exit, great for debugging)
|
5
|
+
# and the number of requests to process before running garbage collection.
|
6
|
+
#
|
7
|
+
# By default, the FastCGI crash log is RAILS_ROOT/log/fastcgi.crash.log
|
8
|
+
# and the GC period is nil (turned off). A reasonable number of requests
|
9
|
+
# could range from 10-100 depending on the memory footprint of your app.
|
10
|
+
#
|
11
|
+
# Example:
|
12
|
+
# # Default log path, normal GC behavior.
|
13
|
+
# RailsFCGIHandler.process!
|
14
|
+
#
|
15
|
+
# # Default log path, 50 requests between GC.
|
16
|
+
# RailsFCGIHandler.process! nil, 50
|
17
|
+
#
|
18
|
+
# # Custom log path, normal GC behavior.
|
19
|
+
# RailsFCGIHandler.process! '/var/log/myapp_fcgi_crash.log'
|
20
|
+
#
|
21
|
+
require File.dirname(__FILE__) + "/../config/environment"
|
22
|
+
require 'fcgi_handler'
|
23
|
+
|
24
|
+
RailsFCGIHandler.process!
|
data/public/dispatch.rb
ADDED
@@ -0,0 +1,10 @@
|
|
1
|
+
#!/usr/bin/ruby1.8
|
2
|
+
|
3
|
+
require File.dirname(__FILE__) + "/../config/environment" unless defined?(RAILS_ROOT)
|
4
|
+
|
5
|
+
# If you're using RubyGems and mod_ruby, this require should be changed to an absolute path one, like:
|
6
|
+
# "/usr/local/lib/ruby/gems/1.8/gems/rails-0.8.0/lib/dispatcher" -- otherwise performance is severely impaired
|
7
|
+
require "dispatcher"
|
8
|
+
|
9
|
+
ADDITIONAL_LOAD_PATHS.reverse.each { |dir| $:.unshift(dir) if File.directory?(dir) } if defined?(Apache::RubyRun)
|
10
|
+
Dispatcher.dispatch
|
data/public/favicon.ico
ADDED
File without changes
|
Binary file
|