aboutsummaryrefslogtreecommitdiff
path: root/lib/mauve/http_server.rb
diff options
context:
space:
mode:
authorPatrick J Cherry <patrick@bytemark.co.uk>2011-07-20 16:15:03 +0100
committerPatrick J Cherry <patrick@bytemark.co.uk>2011-07-20 16:15:03 +0100
commit645c47d975e3c34a092acddf4a5f9420010755bc (patch)
tree6c667f44b01425efe6e7e4e10813bfe0cc082632 /lib/mauve/http_server.rb
parent53f89ba450850990057883a92f89ed994563e4ab (diff)
* Added heartbeat to remote mauve
* Added URLs to messages * Added example configuration file * Added various docs * XMPP messages now XHTML and TXT * Handling of MUC reconnection a bit better.
Diffstat (limited to 'lib/mauve/http_server.rb')
-rw-r--r--lib/mauve/http_server.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/mauve/http_server.rb b/lib/mauve/http_server.rb
index 71261c8..7bd4467 100644
--- a/lib/mauve/http_server.rb
+++ b/lib/mauve/http_server.rb
@@ -87,7 +87,7 @@ module Mauve
include Singleton
- attr_accessor :port, :ip, :document_root
+ attr_accessor :port, :ip, :document_root, :base_url
attr_accessor :session_secret
def initialize
@@ -96,6 +96,7 @@ module Mauve
@ip = "127.0.0.1"
@document_root = "/usr/share/mauvealert"
@session_secret = "%x" % rand(2**100)
+ @server_name = nil
end
def main_loop
@@ -105,6 +106,10 @@ module Mauve
@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 base_url
+ @base_url ||= "http://"+Server.instance.hostname
+ end
def stop
@server.stop if @server