diff options
author | Patrick J Cherry <patrick@bytemark.co.uk> | 2011-06-09 18:09:52 +0100 |
---|---|---|
committer | Patrick J Cherry <patrick@bytemark.co.uk> | 2011-06-09 18:09:52 +0100 |
commit | 495c44445642cfae8f23fadde299ad5307f5be58 (patch) | |
tree | 0104c9eef164235aa5ab05b126c8f63e52fb8624 /lib/mauve/http_server.rb | |
parent | 0c88fcc91db1b003cd5d5311f62700c7867b4099 (diff) |
Big commit
--HG--
rename : views/please_authenticate.haml => views/login.haml
Diffstat (limited to 'lib/mauve/http_server.rb')
-rw-r--r-- | lib/mauve/http_server.rb | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/mauve/http_server.rb b/lib/mauve/http_server.rb index 69b566b..4fd8b60 100644 --- a/lib/mauve/http_server.rb +++ b/lib/mauve/http_server.rb @@ -2,15 +2,15 @@ # # Bleuurrgggggh! Bleurrrrrgghh! # +require 'mauve/auth_bytemark' +require 'mauve/web_interface' +require 'mauve/mauve_thread' require 'digest/sha1' require 'log4r' require 'thin' require 'rack' require 'rack-flash' require 'rack/handler/webrick' -require 'mauve/auth_bytemark' -require 'mauve/web_interface' -require 'mauve/mauve_thread' ################################################################################ # @@ -87,19 +87,19 @@ module Mauve attr_accessor :session_secret # not used yet def initialize - @port = 32761 + @port = 1288 @ip = "127.0.0.1" - @document_root = "." - @session_secret = rand(2**100).to_s + @document_root = "/usr/share/mauvealert" + @session_secret = "%x" % rand(2**100) end def main_loop - @server = ::Thin::Server.new(@ip, @port, Rack::CommonLogger.new(Rack::Chunked.new(Rack::ContentLength.new(WebInterface.new)), RackErrorsProxy.new(logger)), :signals => false) + @server = ::Thin::Server.new(@ip, @port, Rack::Session::Cookie.new(WebInterface.new, {:key => "mauvealert", :secret => @session_secret, :expire_after => 691200}), :signals => false) @server.start end def stop - @server.stop + @server.stop if @server super end end |