Add rainbows config

This commit is contained in:
Kyle Drake 2013-06-02 23:16:38 -07:00
parent 5deb20e264
commit f621488b6a
3 changed files with 34 additions and 0 deletions

View file

@ -6,6 +6,7 @@ gem 'sequel'
gem 'slim'
gem 'bcrypt-ruby', require: 'bcrypt'
gem 'sinatra-flash', require: 'sinatra/flash'
gem 'sinatra-xsendfile', require: 'sinatra/xsendfile'
gem 'puma', require: nil
platform :mri do

View file

@ -64,6 +64,8 @@ GEM
tilt (~> 1.3, >= 1.3.4)
sinatra-flash (0.3.0)
sinatra (>= 1.0.0)
sinatra-xsendfile (0.4.0)
sinatra (>= 0.9.1)
slim (1.3.9)
temple (~> 0.6.3)
tilt (~> 1.3, >= 1.3.3)
@ -101,5 +103,6 @@ DEPENDENCIES
simplecov
sinatra
sinatra-flash
sinatra-xsendfile
slim
webmock

30
rainbows_config.rb Normal file
View file

@ -0,0 +1,30 @@
Rainbows! do
name = 'neocities'
use :ThreadPool
client_max_body_size 1*1024*1024 # 1 Megabyte
worker_processes 8
worker_connections 32
timeout 10
listen "unix:tmp/#{name}.sock", :backlog => 2048
pid "tmp/#{name}.pid"
stderr_path "tmp/#{name}.log"
stdout_path "tmp/#{name}.log"
preload_app true
before_fork do |server, worker|
old_pid = "tmp/#{name}.pid.oldbin"
if File.exists?(old_pid) && server.pid != old_pid
begin
Process.kill("QUIT", File.read(old_pid).to_i)
rescue Errno::ENOENT, Errno::ESRCH
# someone else did our job for us
end
end
end
end