mirror of
https://github.com/mistergibson/gxg-server.git
synced 2026-08-15 02:15:59 -07:00
Dep bug fix for mimemagic
This commit is contained in:
parent
69ec7a480b
commit
b7533c6c9d
3 changed files with 26 additions and 21 deletions
|
|
@ -1801,7 +1801,7 @@ core_service.on(:at_start, {:description => "System Service Layer Startup", :usa
|
||||||
::GxG::Engine::determine_loads()
|
::GxG::Engine::determine_loads()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
core_service.on(:at_stop, {:description => "System Service Layer Shutdown", :usage => "{ :at_stop => (service-object) }", :public => false}) do |service|
|
core_service.on(:at_stop, {:description => "System Service Layer Shutdown", :usage => "{ :at_stop => (service-object) }", :public => false}) do |service, credential|
|
||||||
# ### Stop Services
|
# ### Stop Services
|
||||||
::GxG::Services::stop_order().each do |the_service_moniker|
|
::GxG::Services::stop_order().each do |the_service_moniker|
|
||||||
unless the_service_moniker == :core
|
unless the_service_moniker == :core
|
||||||
|
|
@ -1838,16 +1838,6 @@ core_service.on(:at_stop, {:description => "System Service Layer Shutdown", :usa
|
||||||
end
|
end
|
||||||
#
|
#
|
||||||
end
|
end
|
||||||
# ### Startup Scripts
|
|
||||||
Dir.entries("#{::GxG::SYSTEM_PATHS[:system]}/Startup").each do |entry|
|
|
||||||
if File.extname(entry) == ".rb"
|
|
||||||
begin
|
|
||||||
require "#{::GxG::SYSTEM_PATHS[:system]}/Startup/#{entry}"
|
|
||||||
rescue Exception => the_error
|
|
||||||
log_error({:error => the_error})
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
#
|
#
|
||||||
end
|
end
|
||||||
# ### Provide Universal Resouce Access
|
# ### Provide Universal Resouce Access
|
||||||
|
|
@ -1890,6 +1880,17 @@ Signal.trap("HUP") do
|
||||||
exit(0)
|
exit(0)
|
||||||
end
|
end
|
||||||
#
|
#
|
||||||
|
# ### Startup Scripts
|
||||||
|
Dir.entries("#{::GxG::SYSTEM_PATHS[:system]}/Startup").each do |entry|
|
||||||
|
if File.extname(entry) == ".rb"
|
||||||
|
begin
|
||||||
|
require "#{::GxG::SYSTEM_PATHS[:system]}/Startup/#{entry}"
|
||||||
|
rescue Exception => the_error
|
||||||
|
log_error({:error => the_error})
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
#
|
||||||
unless ($0 == "irb" || $0 == "jirb" || Module.constants.include?(:IRB))
|
unless ($0 == "irb" || $0 == "jirb" || Module.constants.include?(:IRB))
|
||||||
# ### Place-holder loop for running in the background
|
# ### Place-holder loop for running in the background
|
||||||
while true do
|
while true do
|
||||||
|
|
|
||||||
|
|
@ -20,24 +20,26 @@ federation_service.on(:resume, {:description => "Federation Service Resume", :us
|
||||||
end
|
end
|
||||||
# ### Define Internal Service Control Events:
|
# ### Define Internal Service Control Events:
|
||||||
federation_service.on(:at_start, {:description => "Federation Startup", :usage => "{ :at_start => (service-object) }"}) do |service, credential|
|
federation_service.on(:at_start, {:description => "Federation Startup", :usage => "{ :at_start => (service-object) }"}) do |service, credential|
|
||||||
# ::GxG::GXG_FEDERATION = {:title => "Untitled", :uuid => nil, :available => {}, :connections => {}}
|
# GXG_FEDERATION = {:title => "Untitled", :uuid => nil, :access_url => nil, :available => {}, :connections => {}}
|
||||||
::GxG::GXG_FEDERATION_SAFETY.synchronize {
|
::GxG::GXG_FEDERATION_SAFETY.synchronize {
|
||||||
::GxG::GXG_FEDERATION[:uuid] = federation_service.configuration[:uuid]
|
::GxG::GXG_FEDERATION[:uuid] = federation_service.configuration[:uuid]
|
||||||
::GxG::GXG_FEDERATION[:title] = federation_service.configuration[:title]
|
::GxG::GXG_FEDERATION[:title] = federation_service.configuration[:title]
|
||||||
|
# ::GxG::SERVICES[:www].configuration[:relative_url]
|
||||||
|
::GxG::GXG_FEDERATION[:access_url] = federation_service.configuration[:access_url]
|
||||||
}
|
}
|
||||||
#
|
#
|
||||||
{:result => true}
|
{:result => true}
|
||||||
end
|
end
|
||||||
#
|
#
|
||||||
federation_service.on(:at_stop, {:description => "Federation Stop", :usage => "{ :at_stop => (service-object) }", :public => false}) do |service|
|
federation_service.on(:at_stop, {:description => "Federation Stop", :usage => "{ :at_stop => (service-object) }", :public => false}) do |service,credential|
|
||||||
#
|
#
|
||||||
|
|
||||||
#
|
#
|
||||||
{:result => true}
|
{:result => true}
|
||||||
end
|
end
|
||||||
#
|
#
|
||||||
federation_service.on(:connect, {:description => "Federation Connect", :usage => "{ :connect => (uuid) }", :public => false}) do |data|
|
federation_service.on(:connect, {:description => "Federation Connect", :usage => "{ :connect => {:uuid => (uuid), :username => String, :password => String} }", :public => false}) do |data, credential|
|
||||||
#
|
# {:uuid => localuuid, :title => localtitle, :access_url => localaccess, :bridge_challenge => @bridge_challenge}
|
||||||
if ::GxG::valid_uuid?(data.to_s.to_sym)
|
if ::GxG::valid_uuid?(data.to_s.to_sym)
|
||||||
::GxG::CHANNELS.create_channel(data.to_s.to_sym)
|
::GxG::CHANNELS.create_channel(data.to_s.to_sym)
|
||||||
::GxG::GXG_FEDERATION_SAFETY.synchronize { {:result => {:uuid => ::GxG::GXG_FEDERATION[:uuid], :title => ::GxG::GXG_FEDERATION[:title]}} }
|
::GxG::GXG_FEDERATION_SAFETY.synchronize { {:result => {:uuid => ::GxG::GXG_FEDERATION[:uuid], :title => ::GxG::GXG_FEDERATION[:title]}} }
|
||||||
|
|
@ -47,7 +49,7 @@ federation_service.on(:connect, {:description => "Federation Connect", :usage =>
|
||||||
#
|
#
|
||||||
end
|
end
|
||||||
#
|
#
|
||||||
federation_service.on(:disconnect, {:description => "Federation Disconnect", :usage => "{ :disconnect => (uuid) }", :public => false}) do |data|
|
federation_service.on(:disconnect, {:description => "Federation Disconnect", :usage => "{ :disconnect => (uuid) }", :public => false}) do |data,credential|
|
||||||
#
|
#
|
||||||
if ::GxG::valid_uuid?(data.to_s.to_sym)
|
if ::GxG::valid_uuid?(data.to_s.to_sym)
|
||||||
::GxG::CHANNELS.destroy_channel(data.to_s.to_sym)
|
::GxG::CHANNELS.destroy_channel(data.to_s.to_sym)
|
||||||
|
|
@ -58,7 +60,7 @@ federation_service.on(:disconnect, {:description => "Federation Disconnect", :us
|
||||||
#
|
#
|
||||||
end
|
end
|
||||||
#
|
#
|
||||||
federation_service.on(:operation, {:description => "Perform Operation(s)", :usage => "{ :operation => (Hash/Array) }", :public => false}) do |data|
|
federation_service.on(:operation, {:description => "Perform Operation(s)", :usage => "{ :operation => (Hash/Array) }", :public => false}) do |data,credential|
|
||||||
# operation(data)
|
# operation(data)
|
||||||
result = {:result => false}
|
result = {:result => false}
|
||||||
if data.is_any?(::Array, ::Hash)
|
if data.is_any?(::Array, ::Hash)
|
||||||
|
|
@ -103,7 +105,7 @@ federation_service.on(:operation, {:description => "Perform Operation(s)", :usag
|
||||||
result
|
result
|
||||||
end
|
end
|
||||||
#
|
#
|
||||||
federation_service.on(:channel_exist, {:description => "Does a channel exist?", :usage => "{ :channel_exist => (uuid) }", :public => false}) do |data|
|
federation_service.on(:channel_exist, {:description => "Does a channel exist?", :usage => "{ :channel_exist => (uuid) }", :public => false}) do |data,credential|
|
||||||
# channel_exist(the_uuid)
|
# channel_exist(the_uuid)
|
||||||
if ::GxG::valid_uuid?(data.to_s.to_sym)
|
if ::GxG::valid_uuid?(data.to_s.to_sym)
|
||||||
the_channel = ::GxG::CHANNELS.fetch_channel(data.to_s.to_sym)
|
the_channel = ::GxG::CHANNELS.fetch_channel(data.to_s.to_sym)
|
||||||
|
|
@ -119,7 +121,7 @@ federation_service.on(:channel_exist, {:description => "Does a channel exist?",
|
||||||
end
|
end
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
federation_service.on(:next_message, {:description => "Get a message", :usage => "{ :next_message => (uuid) }", :public => false}) do |data|
|
federation_service.on(:next_message, {:description => "Get a message", :usage => "{ :next_message => (uuid) }", :public => false}) do |data,credential|
|
||||||
# next_message(the_uuid)
|
# next_message(the_uuid)
|
||||||
if ::GxG::valid_uuid?(data.to_s.to_sym)
|
if ::GxG::valid_uuid?(data.to_s.to_sym)
|
||||||
{:result => ::GxG::CHANNELS.next_message(data.to_s.to_sym)}
|
{:result => ::GxG::CHANNELS.next_message(data.to_s.to_sym)}
|
||||||
|
|
@ -129,7 +131,7 @@ federation_service.on(:next_message, {:description => "Get a message", :usage =>
|
||||||
#
|
#
|
||||||
end
|
end
|
||||||
#
|
#
|
||||||
federation_service.on(:send_message, {:description => "Send a message", :usage => "{ :send_message => {:uuid => (uuid), :message => (message)} }", :public => false}) do |data|
|
federation_service.on(:send_message, {:description => "Send a message", :usage => "{ :send_message => {:uuid => (uuid), :message => (message)} }", :public => false}) do |data,credential|
|
||||||
# send_message(the_uuid, the_message)
|
# send_message(the_uuid, the_message)
|
||||||
if ::GxG::valid_uuid?(data[:uuid].to_s.to_sym)
|
if ::GxG::valid_uuid?(data[:uuid].to_s.to_sym)
|
||||||
{:result => ::GxG::CHANNELS.send_message(data[:uuid].to_s.to_sym, data[:message])}
|
{:result => ::GxG::CHANNELS.send_message(data[:uuid].to_s.to_sym, data[:message])}
|
||||||
|
|
@ -144,6 +146,8 @@ unless ::GxG::Services::service_available?(:federation)
|
||||||
# Set Configuration Defaults
|
# Set Configuration Defaults
|
||||||
federation_service.configuration[:title] = "Untitled"
|
federation_service.configuration[:title] = "Untitled"
|
||||||
federation_service.configuration[:uuid] = ::GxG::uuid_generate.to_s
|
federation_service.configuration[:uuid] = ::GxG::uuid_generate.to_s
|
||||||
|
federation_service.configuration[:access_url] = nil
|
||||||
|
# ::GxG::SERVICES[:www].configuration[:relative_url]
|
||||||
federation_service.save_configuration
|
federation_service.save_configuration
|
||||||
::GxG::Services::install_service(:federation)
|
::GxG::Services::install_service(:federation)
|
||||||
::GxG::Services::enable_service(:federation)
|
::GxG::Services::enable_service(:federation)
|
||||||
|
|
|
||||||
Binary file not shown.
Loading…
Reference in a new issue